11.1.10.3.1. Ast

This module implements Abstract Syntactic Tree for Spice expressions.

class PySpice.Spice.Expression.Ast.Addition(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.BinaryOperator

OPERATOR = '+'
PRECEDENCE = 4
class PySpice.Spice.Expression.Ast.And(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.BinaryOperator

OPERATOR = '&&'
PRECEDENCE = 6
class PySpice.Spice.Expression.Ast.Assignation(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.BinaryExpression

property value
property variable
class PySpice.Spice.Expression.Ast.BinaryExpression(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.Expression

NUMBER_OF_OPERANDS = 2
class PySpice.Spice.Expression.Ast.BinaryOperator(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.BinaryExpression, PySpice.Spice.Expression.Ast.OperatorMixin

class PySpice.Spice.Expression.Ast.Constant(value)[source]

Bases: object

class PySpice.Spice.Expression.Ast.Division(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.BinaryOperator

OPERATOR = '/'
PRECEDENCE = 3
class PySpice.Spice.Expression.Ast.Equal(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.BinaryOperator

OPERATOR = '=='
PRECEDENCE = 5
class PySpice.Spice.Expression.Ast.Expression(*args, **kwargs)[source]

Bases: object

NUMBER_OF_OPERANDS = None
iter_on_operands()[source]
property operand
property operand1
property operand2
property operand3
class PySpice.Spice.Expression.Ast.FloatConstant(value)[source]

Bases: PySpice.Spice.Expression.Ast.Constant

class PySpice.Spice.Expression.Ast.Function(name, *args)[source]

Bases: PySpice.Spice.Expression.Ast.Expression

property name
class PySpice.Spice.Expression.Ast.Greater(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.BinaryOperator

OPERATOR = '>'
PRECEDENCE = 5
class PySpice.Spice.Expression.Ast.GreaterEqual(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.BinaryOperator

OPERATOR = '>='
PRECEDENCE = 5
class PySpice.Spice.Expression.Ast.If(condition, then_expression, else_expression)[source]

Bases: object

PRECEDENCE = 8
property condition
property else_expression
property then_expression
class PySpice.Spice.Expression.Ast.IntConstant(value)[source]

Bases: PySpice.Spice.Expression.Ast.Constant

class PySpice.Spice.Expression.Ast.IntegerDivision(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.BinaryOperator

OPERATOR = '\\'
PRECEDENCE = 3
class PySpice.Spice.Expression.Ast.Less(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.BinaryOperator

OPERATOR = '<'
PRECEDENCE = 5
class PySpice.Spice.Expression.Ast.LessEqual(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.BinaryOperator

OPERATOR = '<='
class PySpice.Spice.Expression.Ast.Modulo(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.BinaryOperator

OPERATOR = '%'
PRECEDENCE = 3
class PySpice.Spice.Expression.Ast.Multiplication(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.BinaryOperator

OPERATOR = '*'
PRECEDENCE = 3
class PySpice.Spice.Expression.Ast.Negation(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.UnaryOperator

OPERATOR = '-'
PRECEDENCE = 1
class PySpice.Spice.Expression.Ast.Not(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.UnaryOperator

OPERATOR = '!'
PRECEDENCE = 1
class PySpice.Spice.Expression.Ast.NotEqual(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.BinaryOperator

OPERATOR = '!='
PRECEDENCE = 5
class PySpice.Spice.Expression.Ast.OperatorMetaclass(class_name, base_classes, attributes)[source]

Bases: type

Metaclass to register operators

classmethod get_binary(operator)[source]
classmethod get_unary(operator)[source]
classmethod operator_iter()[source]
classmethod register_prefix(cls)[source]
class PySpice.Spice.Expression.Ast.OperatorMixin[source]

Bases: object

OPERATOR = None
class PySpice.Spice.Expression.Ast.Or(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.BinaryOperator

OPERATOR = '||'
PRECEDENCE = 7
class PySpice.Spice.Expression.Ast.Program(*statements)[source]

Bases: PySpice.Spice.Expression.Ast.StatementList

class PySpice.Spice.Expression.Ast.StatementList(*statements)[source]

Bases: object

add(statement)[source]
class PySpice.Spice.Expression.Ast.Subtraction(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.BinaryOperator

OPERATOR = '-'
PRECEDENCE = 4
class PySpice.Spice.Expression.Ast.TernaryExpression(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.Expression

NUMBER_OF_OPERANDS = 3
class PySpice.Spice.Expression.Ast.UnaryExpression(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.Expression

NUMBER_OF_OPERANDS = 1
class PySpice.Spice.Expression.Ast.UnaryOperator(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.UnaryExpression, PySpice.Spice.Expression.Ast.OperatorMixin

class PySpice.Spice.Expression.Ast.Variable(name)[source]

Bases: object

property name
class PySpice.Spice.Expression.Ast.power(*args, **kwargs)[source]

Bases: PySpice.Spice.Expression.Ast.BinaryOperator

OPERATOR = '**'
PRECEDENCE = 2