libSBML Perl API
libSBML 5.8.0 Perl API
|
Abstract Syntax Tree (AST) for representing formula trees.
Classes | |
class | ASTNode |
Abstract Syntax Tree (AST) representation of a mathematical expression. More... | |
Typedefs | |
typedef int(* | ASTNodePredicate )(const ASTNode_t *node) |
A pointer to a function that takes an ASTNode and returns true (non-zero) or false (0). More... | |
typedef int(* ASTNodePredicate)(const ASTNode_t *node) |
A pointer to a function that takes an ASTNode and returns true
(non-zero) or false
(0).
enum ASTNodeType_t |
ASTNodeType_t is the enumeration of possible ASTNode types.
Each ASTNode has a type whose value is one of the elements of this enumeration. The types have the following meanings:
If the node is basic mathematical operator (e.g., "+"
), then the node's type will be AST_PLUS, AST_MINUS, AST_TIMES, AST_DIVIDE, or AST_POWER, as appropriate.
If the node is a predefined function or operator from SBML Level 1 (in the string-based formula syntax used in Level 1) or SBML Level 2 and 3 (in the subset of MathML used in SBML Levels 2 and 3), then the node's type will be either AST_FUNCTION_
X, AST_LOGICAL_
X, or AST_RELATIONAL_
X, as appropriate. (Examples: AST_FUNCTION_LOG, AST_RELATIONAL_LEQ.)
If the node refers to a user-defined function, the node's type will be AST_FUNCTION (because it holds the name of the function).
If the node is a lambda expression, its type will be AST_LAMBDA.
If the node is a predefined constant ("ExponentialE"
, "Pi"
, "True"
or "False"
), then the node's type will be AST_CONSTANT_E, AST_CONSTANT_PI, AST_CONSTANT_TRUE, or AST_CONSTANT_FALSE.
(Levels 2 and 3 only) If the node is the special MathML csymbol time
, the value of the node will be AST_NAME_TIME. (Note, however, that the MathML csymbol delay
is translated into a node of type AST_FUNCTION_DELAY. The difference is due to the fact that time
is a single variable, whereas delay
is actually a function taking arguments.)
(Level 3 only) If the node is the special MathML csymbol avogadro
, the value of the node will be AST_NAME_AVOGADRO
.