#include <exprTree.h>
Public Types | |
enum | NodeKind { LITERAL_NODE, ATTRREF_NODE, OP_NODE, FN_CALL_NODE, CLASSAD_NODE, EXPR_LIST_NODE, LITERAL_NODE, ATTRREF_NODE, OP_NODE, FN_CALL_NODE, CLASSAD_NODE, EXPR_LIST_NODE } |
The kinds of nodes in expression trees. More... | |
enum | NodeKind { LITERAL_NODE, ATTRREF_NODE, OP_NODE, FN_CALL_NODE, CLASSAD_NODE, EXPR_LIST_NODE, LITERAL_NODE, ATTRREF_NODE, OP_NODE, FN_CALL_NODE, CLASSAD_NODE, EXPR_LIST_NODE } |
The kinds of nodes in expression trees. More... | |
Public Member Functions | |
virtual | ~ExprTree () |
Virtual destructor. | |
void | SetParentScope (const ClassAd *p) |
const ClassAd * | GetParentScope () const |
virtual ExprTree * | Copy () const =0 |
NodeKind | GetKind (void) const |
void | Puke () const |
A debugging method; send expression to stdout. | |
bool | Evaluate (EvalState &state, Value &val) const |
bool | Evaluate (Value &v) const |
virtual bool | SameAs (const ExprTree *tree) const =0 |
virtual | ~ExprTree () |
Virtual destructor. | |
void | SetParentScope (const ClassAd *p) |
const ClassAd * | GetParentScope () const |
virtual ExprTree * | Copy () const =0 |
NodeKind | GetKind (void) const |
void | Puke () const |
A debugging method; send expression to stdout. | |
bool | Evaluate (EvalState &state, Value &val) const |
bool | Evaluate (Value &v) const |
virtual bool | SameAs (const ExprTree *tree) const =0 |
Protected Types | |
enum | { EVAL_FAIL, EVAL_OK, EVAL_UNDEF, PROP_UNDEF, EVAL_ERROR, PROP_ERROR } |
enum | { EVAL_FAIL, EVAL_OK, EVAL_UNDEF, PROP_UNDEF, EVAL_ERROR, PROP_ERROR } |
Protected Member Functions | |
void | CopyFrom (const ExprTree &literal) |
bool | Evaluate (Value &v, ExprTree *&t) const |
bool | Flatten (Value &val, ExprTree *&tree) const |
bool | Flatten (EvalState &, Value &, ExprTree *&, int *=NULL) const |
bool | Evaluate (EvalState &, Value &, ExprTree *&) const |
void | CopyFrom (const ExprTree &literal) |
bool | Evaluate (Value &v, ExprTree *&t) const |
bool | Flatten (Value &val, ExprTree *&tree) const |
bool | Flatten (EvalState &, Value &, ExprTree *&, int *=NULL) const |
bool | Evaluate (EvalState &, Value &, ExprTree *&) const |
Protected Attributes | |
const ClassAd * | parentScope |
NodeKind | nodeKind |
Friends | |
class | Operation |
class | AttributeReference |
class | FunctionCall |
class | FunctionTable |
class | ExprList |
class | ExprListIterator |
class | ClassAd |
bool | operator== (const ExprTree &tree1, const ExprTree &tree2) |
bool | operator== (const ExprTree &tree1, const ExprTree &tree2) |
A node of the expression tree, which may be a literal, attribute reference, function call, classad, expression list, or an operator applied to other ExprTree operands.
enum ExprTree::NodeKind |
The kinds of nodes in expression trees.
LITERAL_NODE |
Literal node (string, integer, real, boolean, undefined, error). |
ATTRREF_NODE |
Attribute reference node (attr, .attr, expr.attr). |
OP_NODE |
Expression operation node (unary, binary, ternary)/. |
FN_CALL_NODE |
Function call node. |
CLASSAD_NODE |
ClassAd node. |
EXPR_LIST_NODE |
Expression list node. |
LITERAL_NODE |
Literal node (string, integer, real, boolean, undefined, error). |
ATTRREF_NODE |
Attribute reference node (attr, .attr, expr.attr). |
OP_NODE |
Expression operation node (unary, binary, ternary)/. |
FN_CALL_NODE |
Function call node. |
CLASSAD_NODE |
ClassAd node. |
EXPR_LIST_NODE |
Expression list node. |
enum ExprTree::NodeKind |
The kinds of nodes in expression trees.
LITERAL_NODE |
Literal node (string, integer, real, boolean, undefined, error). |
ATTRREF_NODE |
Attribute reference node (attr, .attr, expr.attr). |
OP_NODE |
Expression operation node (unary, binary, ternary)/. |
FN_CALL_NODE |
Function call node. |
CLASSAD_NODE |
ClassAd node. |
EXPR_LIST_NODE |
Expression list node. |
LITERAL_NODE |
Literal node (string, integer, real, boolean, undefined, error). |
ATTRREF_NODE |
Attribute reference node (attr, .attr, expr.attr). |
OP_NODE |
Expression operation node (unary, binary, ternary)/. |
FN_CALL_NODE |
Function call node. |
CLASSAD_NODE |
ClassAd node. |
EXPR_LIST_NODE |
Expression list node. |
virtual ExprTree* ExprTree::Copy | ( | ) | const [pure virtual] |
Makes a deep copy of the expression tree
Implemented in AttributeReference, ClassAd, ExprList, FunctionCall, Literal, Operation, AttributeReference, ClassAd, ExprList, FunctionCall, Literal, and Operation.
virtual ExprTree* ExprTree::Copy | ( | ) | const [pure virtual] |
Makes a deep copy of the expression tree
Implemented in AttributeReference, ClassAd, ExprList, FunctionCall, Literal, Operation, AttributeReference, ClassAd, ExprList, FunctionCall, Literal, and Operation.
void ExprTree::CopyFrom | ( | const ExprTree & | literal | ) | [protected] |
void ExprTree::CopyFrom | ( | const ExprTree & | literal | ) | [protected] |
Evaluate this tree
state | The current state | |
val | The result of the evaluation |
bool ExprTree::Evaluate | ( | Value & | v | ) | const |
Evaluate this tree. This only works if the expression is currently part of a ClassAd.
val | The result of the evaluation |
Evaluate this tree
state | The current state | |
val | The result of the evaluation |
bool ExprTree::Evaluate | ( | Value & | v | ) | const |
Evaluate this tree. This only works if the expression is currently part of a ClassAd.
val | The result of the evaluation |
NodeKind ExprTree::GetKind | ( | void | ) | const [inline] |
NodeKind ExprTree::GetKind | ( | void | ) | const [inline] |
const ClassAd* ExprTree::GetParentScope | ( | ) | const [inline] |
Gets the parent scope of the expression.
const ClassAd* ExprTree::GetParentScope | ( | ) | const [inline] |
Gets the parent scope of the expression.
virtual bool ExprTree::SameAs | ( | const ExprTree * | tree | ) | const [pure virtual] |
Is this ExprTree the same as the tree?
Implemented in AttributeReference, ClassAd, ExprList, FunctionCall, Literal, Operation, AttributeReference, ClassAd, ExprList, FunctionCall, Literal, and Operation.
virtual bool ExprTree::SameAs | ( | const ExprTree * | tree | ) | const [pure virtual] |
Is this ExprTree the same as the tree?
Implemented in AttributeReference, ClassAd, ExprList, FunctionCall, Literal, Operation, AttributeReference, ClassAd, ExprList, FunctionCall, Literal, and Operation.
void ExprTree::SetParentScope | ( | const ClassAd * | p | ) |
Sets the lexical parent scope of the expression, which is used to determine the lexical scoping structure for resolving attribute references. (However, the semantic parent may be different from the lexical parent if a super
attribute is specified.) This method is automatically called when expressions are inserted into ClassAds, and should thus be called explicitly only when evaluating expressions which haven't been inserted into a ClassAd.
p | The parent ClassAd. |
void ExprTree::SetParentScope | ( | const ClassAd * | p | ) |
Sets the lexical parent scope of the expression, which is used to determine the lexical scoping structure for resolving attribute references. (However, the semantic parent may be different from the lexical parent if a super
attribute is specified.) This method is automatically called when expressions are inserted into ClassAds, and should thus be called explicitly only when evaluating expressions which haven't been inserted into a ClassAd.
p | The parent ClassAd. |