Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends

ExprTree Class Reference

#include <exprTree.h>

Inheritance diagram for ExprTree:
AttributeReference AttributeReference ClassAd ClassAd ExprList ExprList FunctionCall FunctionCall Literal Literal Operation Operation

List of all members.

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 ClassAdGetParentScope () const
virtual ExprTreeCopy () 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 ClassAdGetParentScope () const
virtual ExprTreeCopy () 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 ClassAdparentScope
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)

Detailed Description

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.

See also:
NodeKind

Member Enumeration Documentation

The kinds of nodes in expression trees.

Enumerator:
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.

The kinds of nodes in expression trees.

Enumerator:
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.


Member Function Documentation

virtual ExprTree* ExprTree::Copy (  )  const [pure virtual]

Makes a deep copy of the expression tree

Returns:
A deep copy of the expression, or NULL on failure.

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

Returns:
A deep copy of the expression, or NULL on failure.

Implemented in AttributeReference, ClassAd, ExprList, FunctionCall, Literal, Operation, AttributeReference, ClassAd, ExprList, FunctionCall, Literal, and Operation.

void ExprTree::CopyFrom ( const ExprTree literal  )  [protected]

Fill in this ExprTree with the contents of the other ExprTree.

Returns:
true if the copy succeeded, false otherwise.
void ExprTree::CopyFrom ( const ExprTree literal  )  [protected]

Fill in this ExprTree with the contents of the other ExprTree.

Returns:
true if the copy succeeded, false otherwise.
bool ExprTree::Evaluate ( EvalState state,
Value val 
) const

Evaluate this tree

Parameters:
state The current state
val The result of the evaluation
Returns:
true on success, false on failure
bool ExprTree::Evaluate ( Value v  )  const

Evaluate this tree. This only works if the expression is currently part of a ClassAd.

Parameters:
val The result of the evaluation
Returns:
true on success, false on failure
bool ExprTree::Evaluate ( EvalState state,
Value val 
) const

Evaluate this tree

Parameters:
state The current state
val The result of the evaluation
Returns:
true on success, false on failure
bool ExprTree::Evaluate ( Value v  )  const

Evaluate this tree. This only works if the expression is currently part of a ClassAd.

Parameters:
val The result of the evaluation
Returns:
true on success, false on failure
NodeKind ExprTree::GetKind ( void   )  const [inline]

Gets the node kind of this expression node.

Returns:
The node kind.
See also:
NodeKind
NodeKind ExprTree::GetKind ( void   )  const [inline]

Gets the node kind of this expression node.

Returns:
The node kind.
See also:
NodeKind
const ClassAd* ExprTree::GetParentScope (  )  const [inline]

Gets the parent scope of the expression.

Returns:
The parent scope of the expression.
const ClassAd* ExprTree::GetParentScope (  )  const [inline]

Gets the parent scope of the expression.

Returns:
The parent scope of the expression.
virtual bool ExprTree::SameAs ( const ExprTree tree  )  const [pure virtual]

Is this ExprTree the same as the tree?

Returns:
true if it is the same, false otherwise

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?

Returns:
true if it is the same, false otherwise

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.

Parameters:
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.

Parameters:
p The parent ClassAd.

The documentation for this class was generated from the following files:
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends