Loading [MathJax]/extensions/tex2jax.js
libSBML C++ API  5.20.4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ASTNode.cpp File Reference

Abstract Syntax Tree (AST) for representing formula trees. More...

Include dependency graph for ASTNode.cpp:

Macros

#define ASTNodeType_isAvogadro(t)    (t == AST_NAME_AVOGADRO)
 ASTNodeType predicate.
 
#define ASTNodeType_isConstant(t)    (((t >= AST_CONSTANT_E) && (t <= AST_CONSTANT_TRUE)) || t == AST_NAME_AVOGADRO)
 ASTNodeType predicate.
 
#define ASTNodeType_isConstantNumber(t)    (t == AST_CONSTANT_E || t == AST_CONSTANT_PI || t == AST_NAME_AVOGADRO)
 ASTNodeType predicate.
 
#define ASTNodeType_isFunction(t)    (((t >= AST_FUNCTION) && (t <= AST_FUNCTION_TANH)) || t == AST_CSYMBOL_FUNCTION)
 ASTNodeType predicate.
 
#define ASTNodeType_isInteger(t)    (t == AST_INTEGER)
 ASTNodeType predicate.
 
#define ASTNodeType_isLambda(t)    (t == AST_LAMBDA)
 ASTNodeType predicate.
 
#define ASTNodeType_isLogical(t)    (((t >= AST_LOGICAL_AND) && (t <= AST_LOGICAL_XOR)))
 ASTNodeType predicate.
 
#define ASTNodeType_isName(t)    ((t >= AST_NAME) && (t <= AST_NAME_TIME))
 ASTNodeType predicate.
 
#define ASTNodeType_isNumber(t)    (ASTNodeType_isInteger(t) || ASTNodeType_isReal(t))
 ASTNodeType predicate.
 
#define ASTNodeType_isOperator(t)
 ASTNodeType predicate.
 
#define ASTNodeType_isRational(t)    (t == AST_RATIONAL)
 ASTNodeType predicate.
 
#define ASTNodeType_isReal(t)    ((t >= AST_REAL) && (t <= AST_RATIONAL))
 ASTNodeType predicate.
 
#define ASTNodeType_isRelational(t)    ((t >= AST_RELATIONAL_EQ) && (t <= AST_RELATIONAL_NEQ))
 ASTNodeType predicate.
 
#define ASTNodeType_isUnknown(t)    (t == AST_UNKNOWN)
 ASTNodeType predicate.
 

Functions

static void copyNode (const ASTNode *source, ASTNode *dest)
 

Variables

static const char * AST_CONSTANT_STRINGS []
 
static const char * AST_FUNCTION_STRINGS []
 
static const char * AST_LAMBDA_STRING = "lambda"
 String Constants.
 
static const char * AST_LOGICAL_STRINGS []
 
static const char * AST_OPERATOR_STRINGS []
 
static const char * AST_RELATIONAL_STRINGS []
 

Detailed Description

Abstract Syntax Tree (AST) for representing formula trees.

Author
Ben Bornstein

Macro Definition Documentation

◆ ASTNodeType_isAvogadro

#define ASTNodeType_isAvogadro (   t)     (t == AST_NAME_AVOGADRO)

ASTNodeType predicate.

◆ ASTNodeType_isConstant

#define ASTNodeType_isConstant (   t)     (((t >= AST_CONSTANT_E) && (t <= AST_CONSTANT_TRUE)) || t == AST_NAME_AVOGADRO)

ASTNodeType predicate.

◆ ASTNodeType_isConstantNumber

#define ASTNodeType_isConstantNumber (   t)     (t == AST_CONSTANT_E || t == AST_CONSTANT_PI || t == AST_NAME_AVOGADRO)

ASTNodeType predicate.

◆ ASTNodeType_isFunction

#define ASTNodeType_isFunction (   t)     (((t >= AST_FUNCTION) && (t <= AST_FUNCTION_TANH)) || t == AST_CSYMBOL_FUNCTION)

ASTNodeType predicate.

◆ ASTNodeType_isInteger

#define ASTNodeType_isInteger (   t)     (t == AST_INTEGER)

ASTNodeType predicate.

◆ ASTNodeType_isLambda

#define ASTNodeType_isLambda (   t)     (t == AST_LAMBDA)

ASTNodeType predicate.

◆ ASTNodeType_isLogical

#define ASTNodeType_isLogical (   t)     (((t >= AST_LOGICAL_AND) && (t <= AST_LOGICAL_XOR)))

ASTNodeType predicate.

◆ ASTNodeType_isName

#define ASTNodeType_isName (   t)     ((t >= AST_NAME) && (t <= AST_NAME_TIME))

ASTNodeType predicate.

◆ ASTNodeType_isNumber

#define ASTNodeType_isNumber (   t)     (ASTNodeType_isInteger(t) || ASTNodeType_isReal(t))

ASTNodeType predicate.

◆ ASTNodeType_isOperator

#define ASTNodeType_isOperator (   t)
Value:
( ( t == AST_PLUS ) || \
( t == AST_MINUS ) || \
( t == AST_TIMES ) || \
( t == AST_DIVIDE ) || \
( t == AST_POWER ) )
@ AST_MINUS
Definition ASTNodeType.h:85
@ AST_DIVIDE
Definition ASTNodeType.h:87
@ AST_TIMES
Definition ASTNodeType.h:86
@ AST_POWER
Definition ASTNodeType.h:88
@ AST_PLUS
Definition ASTNodeType.h:84

ASTNodeType predicate.

◆ ASTNodeType_isRational

#define ASTNodeType_isRational (   t)     (t == AST_RATIONAL)

ASTNodeType predicate.

◆ ASTNodeType_isReal

#define ASTNodeType_isReal (   t)     ((t >= AST_REAL) && (t <= AST_RATIONAL))

ASTNodeType predicate.

◆ ASTNodeType_isRelational

#define ASTNodeType_isRelational (   t)     ((t >= AST_RELATIONAL_EQ) && (t <= AST_RELATIONAL_NEQ))

ASTNodeType predicate.

◆ ASTNodeType_isUnknown

#define ASTNodeType_isUnknown (   t)     (t == AST_UNKNOWN)

ASTNodeType predicate.

Function Documentation

◆ copyNode()

static void copyNode ( const ASTNode source,
ASTNode dest 
)
static

Variable Documentation

◆ AST_CONSTANT_STRINGS

const char* AST_CONSTANT_STRINGS[]
static
Initial value:
=
{
"exponentiale"
, "false"
, "pi"
, "true"
, "avogadro"
}

◆ AST_FUNCTION_STRINGS

const char* AST_FUNCTION_STRINGS[]
static

◆ AST_LAMBDA_STRING

const char* AST_LAMBDA_STRING = "lambda"
static

String Constants.

◆ AST_LOGICAL_STRINGS

const char* AST_LOGICAL_STRINGS[]
static
Initial value:
=
{
"and"
, "not"
, "or"
, "xor"
}

◆ AST_OPERATOR_STRINGS

const char* AST_OPERATOR_STRINGS[]
static
Initial value:
=
{
"divide"
, "minus"
, "plus"
, "times"
, "power"
}

◆ AST_RELATIONAL_STRINGS

const char* AST_RELATIONAL_STRINGS[]
static
Initial value:
=
{
"eq"
, "geq"
, "gt"
, "leq"
, "lt"
, "neq"
}