Expression node base class. Always constructed by parser in SeExprParser.y. More...
#include <SeExprNode.h>
Public Member Functions | |
SeExprNode (const SeExpression *expr) | |
SeExprNode (const SeExpression *expr, SeExprNode *a) | |
These constructors supply one or more children. | |
SeExprNode (const SeExpression *expr, SeExprNode *a, SeExprNode *b) | |
SeExprNode (const SeExpression *expr, SeExprNode *a, SeExprNode *b, SeExprNode *c) | |
virtual | ~SeExprNode () |
bool | isVec () const |
True if node has a vector result. | |
virtual void | eval (SeVec3d &v) const |
Evaluation method. Note: v[1] and v[2] are undefined if !isVec. | |
const SeExpression * | expr () const |
Access expression. | |
const SeExprNode * | parent () const |
Access parent node - root node has no parent. | |
int | numChildren () const |
Access children. | |
const SeExprNode * | child (int i) const |
SeExprNode * | child (int i) |
void | addChild (SeExprNode *child) |
Add a child to the child list (for parser use only). | |
void | addChildren (SeExprNode *surrogate) |
Transfer children from surrogate parent (for parser use only). | |
virtual bool | prep (bool wantVec) |
void | setPosition (const short int startPos, const short int endPos) |
Remember the line and column position in the input string. | |
void | addError (const std::string &error) |
Register error. | |
Protected Attributes | |
const SeExpression * | _expr |
Owning expression (node can't modify). | |
SeExprNode * | _parent |
Parent node (null if this the the root). | |
std::vector< SeExprNode * > | _children |
List of children. | |
bool | _isVec |
True if node has a vector result. | |
unsigned short int | _startPos |
Position line and collumn. | |
unsigned short int | _endPos |
Expression node base class. Always constructed by parser in SeExprParser.y.
Definition at line 26 of file SeExprNode.h.
SeExprNode::SeExprNode | ( | const SeExpression * | expr | ) |
Definition at line 49 of file SeExprNode.cpp.
SeExprNode::SeExprNode | ( | const SeExpression * | expr, | |
SeExprNode * | a | |||
) |
These constructors supply one or more children.
Definition at line 55 of file SeExprNode.cpp.
References _children, and addChild().
SeExprNode::SeExprNode | ( | const SeExpression * | expr, | |
SeExprNode * | a, | |||
SeExprNode * | b | |||
) |
Definition at line 63 of file SeExprNode.cpp.
References _children, and addChild().
SeExprNode::SeExprNode | ( | const SeExpression * | expr, | |
SeExprNode * | a, | |||
SeExprNode * | b, | |||
SeExprNode * | c | |||
) |
Definition at line 72 of file SeExprNode.cpp.
References _children, and addChild().
SeExprNode::~SeExprNode | ( | ) | [virtual] |
Definition at line 83 of file SeExprNode.cpp.
References _children.
void SeExprNode::addChild | ( | SeExprNode * | child | ) |
Add a child to the child list (for parser use only).
Definition at line 93 of file SeExprNode.cpp.
References _children, and _parent.
Referenced by addChildren(), and SeExprNode().
void SeExprNode::addChildren | ( | SeExprNode * | surrogate | ) |
Transfer children from surrogate parent (for parser use only).
Definition at line 101 of file SeExprNode.cpp.
References _children, and addChild().
void SeExprNode::addError | ( | const std::string & | error | ) | [inline] |
Register error.
Definition at line 67 of file SeExprNode.h.
References _endPos, _expr, _startPos, and SeExpression::addError().
Referenced by SeExprStrNode::prep(), SeExprFuncNode::prep(), SeExprVarNode::prep(), SeExpr::PrintFuncX::prep(), SeExpr::CCurveFuncX::prep(), and SeExpr::CurveFuncX::prep().
SeExprNode* SeExprNode::child | ( | int | i | ) | [inline] |
Definition at line 49 of file SeExprNode.h.
References _children.
const SeExprNode* SeExprNode::child | ( | int | i | ) | const [inline] |
Definition at line 48 of file SeExprNode.h.
References _children.
Referenced by SeExprExpNode::eval(), SeExprModNode::eval(), SeExprDivNode::eval(), SeExprMulNode::eval(), SeExprSubNode::eval(), SeExprAddNode::eval(), SeExprGeNode::eval(), SeExprLeNode::eval(), SeExprGtNode::eval(), SeExprLtNode::eval(), SeExprNeNode::eval(), SeExprEqNode::eval(), SeExprNotNode::eval(), SeExprInvertNode::eval(), SeExprNegNode::eval(), SeExprSubscriptNode::eval(), SeExprOrNode::eval(), SeExprAndNode::eval(), SeExprCondNode::eval(), SeExprVecNode::eval(), SeExprAssignNode::eval(), SeExprIfThenElseNode::eval(), SeExprBlockNode::eval(), eval(), SeExpr::PrintFuncX::eval(), SeExpr::CCurveFuncX::eval(), SeExpr::CurveFuncX::eval(), SeExpr::CachedVoronoiFunc::eval(), SeExprFuncNode::evalArg(), SeExprFuncNode::evalArgs(), SeExprFuncNode::getStrArg(), SeExprFuncNode::isStrArg(), SeExprEdExpression::DummyFuncX::prep(), SeExprFuncNode::prep(), SeExprSubscriptNode::prep(), SeExprCondNode::prep(), SeExprAssignNode::prep(), SeExprIfThenElseNode::prep(), SeExprBlockNode::prep(), prep(), SeExpr::PrintFuncX::prep(), SeExpr::CCurveFuncX::prep(), and SeExpr::CurveFuncX::prep().
void SeExprNode::eval | ( | SeVec3d & | v | ) | const [virtual] |
Evaluation method. Note: v[1] and v[2] are undefined if !isVec.
Reimplemented in SeExprBlockNode, SeExprIfThenElseNode, SeExprAssignNode, SeExprVecNode, SeExprNegNode, SeExprInvertNode, SeExprNotNode, SeExprCondNode, SeExprAndNode, SeExprOrNode, SeExprSubscriptNode, SeExprEqNode, SeExprNeNode, SeExprLtNode, SeExprGtNode, SeExprLeNode, SeExprGeNode, SeExprAddNode, SeExprSubNode, SeExprMulNode, SeExprDivNode, SeExprModNode, SeExprExpNode, SeExprVarNode, SeExprNumNode, SeExprStrNode, and SeExprFuncNode.
Definition at line 133 of file SeExprNode.cpp.
References child(), eval(), and numChildren().
Referenced by SeExprExpNode::eval(), SeExprModNode::eval(), SeExprDivNode::eval(), SeExprMulNode::eval(), SeExprSubNode::eval(), SeExprAddNode::eval(), SeExprGeNode::eval(), SeExprLeNode::eval(), SeExprGtNode::eval(), SeExprLtNode::eval(), SeExprNeNode::eval(), SeExprEqNode::eval(), SeExprNotNode::eval(), SeExprInvertNode::eval(), SeExprNegNode::eval(), SeExprSubscriptNode::eval(), SeExprOrNode::eval(), SeExprAndNode::eval(), SeExprCondNode::eval(), SeExprVecNode::eval(), SeExprAssignNode::eval(), SeExprIfThenElseNode::eval(), SeExprBlockNode::eval(), eval(), SeExpr::PrintFuncX::eval(), SeExpr::CCurveFuncX::eval(), SeExpr::CurveFuncX::eval(), SeExpr::CachedVoronoiFunc::eval(), SeExprFuncNode::evalArg(), SeExprFuncNode::evalArgs(), SeExpression::evaluate(), SeExpr::CCurveFuncX::prep(), and SeExpr::CurveFuncX::prep().
const SeExpression* SeExprNode::expr | ( | ) | const [inline] |
bool SeExprNode::isVec | ( | ) | const [inline] |
True if node has a vector result.
Definition at line 36 of file SeExprNode.h.
References _isVec.
Referenced by SeExprExpNode::eval(), SeExprModNode::eval(), SeExprDivNode::eval(), SeExprMulNode::eval(), SeExprSubNode::eval(), SeExprAddNode::eval(), SeExprNeNode::eval(), SeExprEqNode::eval(), SeExprSubscriptNode::eval(), SeExprCondNode::eval(), SeExprAssignNode::eval(), SeExpr::CCurveFuncX::eval(), SeExpr::CurveFuncX::eval(), SeExprFuncNode::evalArg(), SeExprFuncNode::evalArgs(), SeExpression::isVec(), SeExprFuncNode::prep(), SeExprCondNode::prep(), SeExprAssignNode::prep(), SeExprBlockNode::prep(), prep(), and SeExpr::CCurveFuncX::prep().
int SeExprNode::numChildren | ( | ) | const [inline] |
Access children.
Definition at line 47 of file SeExprNode.h.
References _children.
Referenced by eval(), SeExpr::CachedVoronoiFunc::eval(), SeExprEdExpression::DummyFuncX::prep(), and SeExprFuncNode::prep().
const SeExprNode* SeExprNode::parent | ( | ) | const [inline] |
Access parent node - root node has no parent.
Definition at line 45 of file SeExprNode.h.
References _parent.
bool SeExprNode::prep | ( | bool | wantVec | ) | [virtual] |
Prepare the node (for parser use only). See the discussion at the start of SeExprNode.cpp for more info.
Reimplemented in SeExprBlockNode, SeExprIfThenElseNode, SeExprAssignNode, SeExprVecNode, SeExprCondNode, SeExprAndNode, SeExprOrNode, SeExprSubscriptNode, SeExprCompareEqNode, SeExprCompareNode, SeExprVarNode, SeExprStrNode, and SeExprFuncNode.
Definition at line 116 of file SeExprNode.cpp.
References _children, _isVec, child(), isVec(), and prep().
Referenced by SeExprEdExpression::DummyFuncX::prep(), SeExprFuncNode::prep(), SeExprCompareNode::prep(), SeExprCompareEqNode::prep(), SeExprOrNode::prep(), SeExprAndNode::prep(), SeExprVecNode::prep(), prep(), SeExpression::prep(), SeExpr::PrintFuncX::prep(), SeExpr::CCurveFuncX::prep(), and SeExpr::CurveFuncX::prep().
void SeExprNode::setPosition | ( | const short int | startPos, | |
const short int | endPos | |||
) | [inline] |
Remember the line and column position in the input string.
Definition at line 63 of file SeExprNode.h.
std::vector<SeExprNode*> SeExprNode::_children [protected] |
List of children.
Definition at line 78 of file SeExprNode.h.
Referenced by addChild(), addChildren(), child(), numChildren(), prep(), SeExprNode(), and ~SeExprNode().
unsigned short int SeExprNode::_endPos [protected] |
Definition at line 84 of file SeExprNode.h.
Referenced by addError(), and setPosition().
const SeExpression* SeExprNode::_expr [protected] |
Owning expression (node can't modify).
Definition at line 72 of file SeExprNode.h.
Referenced by addError(), expr(), SeExprFuncNode::prep(), SeExprVarNode::prep(), and SeExprAssignNode::prep().
bool SeExprNode::_isVec [protected] |
True if node has a vector result.
Definition at line 81 of file SeExprNode.h.
Referenced by SeExprFuncNode::eval(), SeExprExpNode::eval(), SeExprModNode::eval(), SeExprDivNode::eval(), SeExprMulNode::eval(), SeExprSubNode::eval(), SeExprAddNode::eval(), SeExprNotNode::eval(), SeExprInvertNode::eval(), SeExprNegNode::eval(), SeExprCondNode::eval(), SeExprVecNode::eval(), isVec(), SeExprFuncNode::prep(), SeExprVarNode::prep(), SeExprCompareNode::prep(), SeExprCompareEqNode::prep(), SeExprSubscriptNode::prep(), SeExprOrNode::prep(), SeExprAndNode::prep(), SeExprCondNode::prep(), SeExprVecNode::prep(), SeExprAssignNode::prep(), SeExprIfThenElseNode::prep(), SeExprBlockNode::prep(), prep(), and SeExprFuncNode::setIsVec().
SeExprNode* SeExprNode::_parent [protected] |
Parent node (null if this the the root).
Definition at line 75 of file SeExprNode.h.
Referenced by addChild(), and parent().
unsigned short int SeExprNode::_startPos [protected] |
Position line and collumn.
Definition at line 84 of file SeExprNode.h.
Referenced by addError(), and setPosition().