33 #include "lib/charbuf.h" 64 static char* ret = (
char*)
"-";
179 static char* ret = (
char*)
"|";
263 static char* ret = (
char*)
"!";
320 if (
right !=
nullptr)
386 else if (
right ==
nullptr)
399 else if (
right == node)
454 static char* ret = (
char*)
"+";
485 static char* ret = (
char*)
"-";
511 static char* ret = (
char*)
"*";
537 static char* ret = (
char*)
"/";
564 static char* ret = (
char*)
"^";
597 static char* ret = (
char*)
"=";
DivisionNode(ExpressionNode *left, ExpressionNode *right)
AbsoluteNode(ExpressionNode *expression)
ExpressionNode * expression
virtual Number * Absolute()=0
void Detach(SyntaxNode *node)
virtual Number * Factorial()=0
void Attach(SyntaxNode *node)
virtual Number * Mul(Number *other)=0
NumericOperator(ExpressionNode *left, ExpressionNode *right)
ReductionType GetReductionType()
Base class for all nodes in a syntax tree.
void Detach(SyntaxNode *node)
ExpressionNode * expression
virtual Number * Raise(Number *exponent)=0
PowerNode(ExpressionNode *left, ExpressionNode *right)
void Detach(SyntaxNode *node)
void Replace(SyntaxNode *n, SyntaxNode *x)
virtual char * GetNodeText()=0
MultiplicationNode(ExpressionNode *left, ExpressionNode *right)
void Append(const char *source)
void Replace(SyntaxNode *n, SyntaxNode *x)
virtual Number * Unary()=0
void Attach(SyntaxNode *node)
AssignmentNode(VariableNode *variable, ExpressionNode *expression)
void Attach(SyntaxNode *node)
void AssignValue(Number *value) const
AdditionNode(ExpressionNode *left, ExpressionNode *right)
void SetParent(SyntaxNode *node)
UnaryNode(ExpressionNode *expression)
virtual Number * Evaluate()=0
void Attach(SyntaxNode *node)
ReductionType GetReductionType()
virtual Number * Sub(Number *other)=0
ExpressionNode * expression
virtual int GetPrecedence()=0
virtual Number * Add(Number *other)=0
Use of a variable in a syntax tree.
int StrLen(const char *string)
Get the length of a null terminated string.
virtual char * GetText()=0
virtual Number * Div(Number *other)=0
void Detach(SyntaxNode *node)
ReductionType GetReductionType()
void Replace(SyntaxNode *n, SyntaxNode *x)
void Replace(SyntaxNode *n, SyntaxNode *x)
SubtractionNode(ExpressionNode *left, ExpressionNode *right)
ExpressionNode * expression
Base class for all nodes related to mathematical expressions.
FactorialNode(ExpressionNode *expression)
void EnsureSize(unsigned int size)
Ensure a memory block of specified size is allocated.