SeExprNode Class Reference

Expression node base class. Always constructed by parser in SeExprParser.y. More...

#include <SeExprNode.h>

Inheritance diagram for SeExprNode:
SeExprAddNode SeExprAndNode SeExprAssignNode SeExprBlockNode SeExprCompareEqNode SeExprCompareNode SeExprCondNode SeExprDivNode SeExprExpNode SeExprFuncNode SeExprIfThenElseNode SeExprInvertNode SeExprModNode SeExprMulNode SeExprNegNode SeExprNotNode SeExprNumNode SeExprOrNode SeExprStrNode SeExprSubNode SeExprSubscriptNode SeExprVarNode SeExprVecNode

List of all members.

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 SeExpressionexpr () const
 Access expression.
const SeExprNodeparent () const
 Access parent node - root node has no parent.
int numChildren () const
 Access children.
const SeExprNodechild (int i) const
SeExprNodechild (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

Detailed Description

Expression node base class. Always constructed by parser in SeExprParser.y.

Definition at line 26 of file SeExprNode.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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]
SeExprNode* SeExprNode::child ( int  i  )  [inline]

Definition at line 49 of file SeExprNode.h.

References _children.

const SeExprNode* SeExprNode::child ( int  i  )  const [inline]
void SeExprNode::eval ( SeVec3d v  )  const [virtual]
const SeExpression* SeExprNode::expr (  )  const [inline]

Access expression.

Definition at line 42 of file SeExprNode.h.

References _expr.

bool SeExprNode::isVec (  )  const [inline]
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]
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.

References _endPos, and _startPos.


Member Data Documentation

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]

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().


The documentation for this class was generated from the following files:

Generated on 25 Jul 2013 for SeExpr by  doxygen 1.6.1