SeExpr
|
Node that compute a local variable assignment. More...
#include <ExprNode.h>
Public Member Functions | |
ExprAssignNode (const Expression *expr, const char *name, ExprNode *e) | |
virtual ExprType | prep (bool wantScalar, ExprVarEnvBuilder &envBuilder) |
virtual int | buildInterpreter (Interpreter *interpreter) const |
builds an interpreter. Returns the location index for the evaluated data More... | |
virtual LLVM_VALUE | codegen (LLVM_BUILDER) LLVM_BODY |
const std::string & | name () const |
const ExprType & | assignedType () const |
const ExprLocalVar * | localVar () const |
Public Member Functions inherited from SeExpr2::ExprNode | |
ExprNode (const Expression *expr) | |
ExprNode (const Expression *expr, const ExprType &type) | |
virtual | ~ExprNode () |
bool | isVec () const |
True if node has a vector result. More... | |
const Expression * | expr () const |
Access expression. More... | |
std::string | toString () const |
Access to original string representation of current expression. More... | |
const ExprType & | type () const |
The type of the node. More... | |
void | addError (const std::string &error) const |
Register error. This will allow users and sophisticated editors to highlight where in code problem was. More... | |
ExprNode (const Expression *expr, ExprNode *a) | |
ExprNode (const Expression *expr, ExprNode *a, const ExprType &type) | |
ExprNode (const Expression *expr, ExprNode *a, ExprNode *b) | |
ExprNode (const Expression *expr, ExprNode *a, ExprNode *b, const ExprType &type) | |
ExprNode (const Expression *expr, ExprNode *a, ExprNode *b, ExprNode *c) | |
ExprNode (const Expression *expr, ExprNode *a, ExprNode *b, ExprNode *c, const ExprType &type) | |
const ExprNode * | parent () const |
Access parent node - root node has no parent. More... | |
int | numChildren () const |
Number of children. More... | |
const ExprNode * | child (size_t i) const |
Get 0 indexed child. More... | |
ExprNode * | child (size_t i) |
Get 0 indexed child. More... | |
void | swapChildren (size_t i, size_t j) |
Swap children, do not use unless you know what you are doing. More... | |
void | removeLastChild () |
Remove last child and delete the entry. More... | |
void | addChild (ExprNode *child) |
Add a child to the child list (for parser use only) More... | |
void | addChildren (ExprNode *surrogate) |
Transfer children from surrogate parent (for parser use only) More... | |
void | setPosition (const short int startPos, const short int endPos) |
Remember the line and column position in the input string. More... | |
short int | startPos () const |
Access start position in input string. More... | |
short int | endPos () const |
Access end position in input string. More... | |
short int | length () const |
Access length of input string. More... | |
bool | checkCondition (bool check, const std::string &message, bool &error) |
Checks the boolean value and records an error string with node if it is false. More... | |
bool | checkIsValue (const ExprType &type, bool &error) |
Checks if the type is a value (i.e. string or float[d]) More... | |
bool | checkIsFP (const ExprType &type, bool &error) |
Checks if the type is a float[d] for any d. More... | |
bool | checkIsFP (int d, const ExprType &type, bool &error) |
Checks if the type is a float[d] for a specific d. More... | |
bool | checkTypesCompatible (const ExprType &first, const ExprType &second, bool &error) |
types match (true if they do) More... | |
Private Attributes | |
std::string | _name |
ExprLocalVar * | _localVar |
ExprType | _assignedType |
Additional Inherited Members | |
Protected Member Functions inherited from SeExpr2::ExprNode | |
void | setType (const ExprType &t) |
Set type of parameter. More... | |
void | setTypeWithChildLife (const ExprType &t) |
Set's the type to the argument but uses the children to determine lifetime. More... | |
Protected Attributes inherited from SeExpr2::ExprNode | |
const Expression * | _expr |
Owning expression (node can't modify) More... | |
ExprNode * | _parent |
Parent node (null if this the the root) More... | |
std::vector< ExprNode * > | _children |
List of children. More... | |
bool | _isVec |
True if node has a vector result. More... | |
ExprType | _type |
int | _maxChildDim |
unsigned short int | _startPos |
Position line and collumn. More... | |
unsigned short int | _endPos |
Node that compute a local variable assignment.
Definition at line 354 of file ExprNode.h.
|
inline |
Definition at line 356 of file ExprNode.h.
|
inline |
Definition at line 367 of file ExprNode.h.
|
virtual |
builds an interpreter. Returns the location index for the evaluated data
Reimplemented from SeExpr2::ExprNode.
Definition at line 647 of file Interpreter.cpp.
References _localVar, SeExpr2::Interpreter::addOp(), SeExpr2::Interpreter::addOperand(), SeExpr2::ExprLocalVar::buildInterpreter(), SeExpr2::ExprNode::buildInterpreter(), SeExpr2::ExprNode::child(), SeExpr2::ExprType::dim(), SeExpr2::Interpreter::endOp(), f(), SeExpr2::ExprType::isFP(), SeExpr2::ExprType::isString(), and SeExpr2::ExprNode::type().
|
virtual |
Reimplemented from SeExpr2::ExprNode.
|
inline |
Definition at line 370 of file ExprNode.h.
Referenced by prep().
|
inline |
Definition at line 364 of file ExprNode.h.
Referenced by SeExpr2::ExprCurveAssignSpec< T >::ExprCurveAssignSpec(), SeExpr2::ExprScalarAssignSpec::ExprScalarAssignSpec(), and SeExpr2::ExprVectorAssignSpec::ExprVectorAssignSpec().
|
virtual |
Prepare the node (for parser use only). See the discussion at the start of SeExprNode.cpp for more info.
Default is to call prep on children (giving AnyType as desired type). If all children return valid types, returns NoneType. Otherwise, returns ErrorType. Note: Ignores wanted type.
Reimplemented from SeExpr2::ExprNode.
Definition at line 305 of file ExprNode.cpp.
References _assignedType, _localVar, _name, SeExpr2::ExprNode::_type, SeExpr2::ExprVarEnv::add(), SeExpr2::ExprNode::checkCondition(), SeExpr2::ExprNode::child(), SeExpr2::ExprVarEnvBuilder::current(), SeExpr2::ExprType::isValid(), localVar(), SeExpr2::ExprNode::prep(), SeExpr2::ExprNode::setType(), SeExpr2::ExprNode::setTypeWithChildLife(), SeExpr2::ExprType::toString(), and SeExpr2::ExprNode::type().
|
private |
Definition at line 375 of file ExprNode.h.
Referenced by prep().
|
private |
Definition at line 374 of file ExprNode.h.
Referenced by buildInterpreter(), and prep().
|
private |
Definition at line 373 of file ExprNode.h.
Referenced by prep().