stx::Grammar::PNBinaryComparisonExpr Class Reference

Parse tree node representing a binary comparison operator: ==, =, !=, <, >, >=, <=, =>, =<. More...

Inheritance diagram for stx::Grammar::PNBinaryComparisonExpr:

stx::ParseNode List of all members.

Public Member Functions

 PNBinaryComparisonExpr (const ParseNode *_left, const ParseNode *_right, std::string _op)
 Constructor from the parser: both operand subnodes and the operator id.
virtual ~PNBinaryComparisonExpr ()
 Recursively delete parse tree.
virtual AnyScalar evaluate (const class SymbolTable &st) const
 Applies the operator to the two recursive calculated values.
virtual bool evaluate_const (AnyScalar *dest) const
 Returns false because this node isn't always constant.
virtual std::string toString () const
 String (operandA op operandB).

Private Types

enum  {
  EQUAL, NOTEQUAL, LESS, GREATER,
  LESSEQUAL, GREATEREQUAL
}
 Comparison operation to perform: left op right. More...

Private Attributes

const ParseNodeleft
 Pointers to the left of the two child parse trees.
const ParseNoderight
 Pointers to the right of the two child parse trees.
enum stx::Grammar::PNBinaryComparisonExpr:: { ... }  op
 Comparison operation to perform: left op right.
std::string opstr
 String saved for toString().

Detailed Description

Parse tree node representing a binary comparison operator: ==, =, !=, <, >, >=, <=, =>, =<.

This node has two children.

Definition at line 682 of file ExpressionParser.cc.


Member Enumeration Documentation

anonymous enum [private]

Comparison operation to perform: left op right.

Enumerator:
EQUAL 
NOTEQUAL 
LESS 
GREATER 
LESSEQUAL 
GREATEREQUAL 

Definition at line 692 of file ExpressionParser.cc.


Member Function Documentation

virtual AnyScalar stx::Grammar::PNBinaryComparisonExpr::evaluate ( const class SymbolTable st  )  const [inline, virtual]

Applies the operator to the two recursive calculated values.

The actual switching between types is handled by AnyScalar's operators. This result type of this processing node is always bool.

Implements stx::ParseNode.

Definition at line 731 of file ExpressionParser.cc.

References stx::AnyScalar::ATTRTYPE_BOOL, EQUAL, stx::AnyScalar::equal_to(), stx::ParseNode::evaluate(), stx::AnyScalar::greater(), GREATER, stx::AnyScalar::greater_equal(), GREATEREQUAL, left, stx::AnyScalar::less(), LESS, stx::AnyScalar::less_equal(), LESSEQUAL, stx::AnyScalar::not_equal_to(), NOTEQUAL, op, and right.


The documentation for this class was generated from the following file:
Generated on Tue Jul 17 16:51:58 2007 for STX Expression Parser by  doxygen 1.5.2