Abstract Syntax Tree (AST)

This module provides the Abstract Syntax Tree (AST) for Formulate.

class formulate.AST.AST

Bases: object

abstract property named_constants: OrderedSet[str]
abstractmethod to_numexpr() str
abstractmethod to_python() str
abstractmethod to_root() str
abstract property unnamed_constants: OrderedSet[str]
abstract property variables: OrderedSet[str]
class formulate.AST.BinaryOperator(operator: 'str', left: 'AST', right: 'AST')

Bases: AST

left: AST
property named_constants: OrderedSet[str]
operator: str
right: AST
to_numexpr() str
to_python() str
to_root() str
property unnamed_constants: OrderedSet[str]
property variables: OrderedSet[str]
class formulate.AST.Call(function: 'str', arguments: 'list[AST]')

Bases: AST

arguments: list[AST]
function: str
property named_constants: OrderedSet[str]
to_numexpr() str
to_python() str
to_root() str
property unnamed_constants: OrderedSet[str]
property variables: OrderedSet[str]
class formulate.AST.Literal(value: 'int | float')

Bases: AST

property named_constants: OrderedSet[str]
to_numexpr() str
to_python() str
to_root() str
property unnamed_constants: OrderedSet[str]
value: int | float
property variables: OrderedSet[str]
class formulate.AST.Matrix(var: 'Symbol', indices: 'list[AST]')

Bases: AST

indices: list[AST]
property named_constants: OrderedSet[str]
to_numexpr() str
to_python() str
to_root() str
property unnamed_constants: OrderedSet[str]
var: Symbol
property variables: OrderedSet[str]
class formulate.AST.Symbol(name: 'str')

Bases: AST

name: str
property named_constants: OrderedSet[str]
to_numexpr() str
to_python() str
to_root() str
property unnamed_constants: OrderedSet[str]
property variables: OrderedSet[str]
class formulate.AST.UnaryOperator(operator: 'str', operand: 'AST')

Bases: AST

property named_constants: OrderedSet[str]
operand: AST
operator: str
to_numexpr() str
to_python() str
to_root() str
property unnamed_constants: OrderedSet[str]
property variables: OrderedSet[str]