stx::ParseTree Class Reference

ParseTree contains the root node of a parse tree. More...

#include <ExpressionParser.h>

List of all members.

Public Member Functions

 ParseTree ()
 Create NULL parse tree object from the root ParseNode.
 ParseTree (ParseNode *pt)
 Create parse tree object from the root ParseNode.
bool isEmpty () const
 Returns true if this object does not contain a parse tree.
AnyScalar evaluate (const class SymbolTable &st=BasicSymbolTable()) const
 Function to recursively evaluate the contained parse tree and retrieve the calculated scalar value based on the given symbol table.
std::string toString () const
 Return the parsed expression as a string, which can be parsed again.

Protected Attributes

boost::shared_ptr< ParseNoderootnode
 Enclosed smart ptr so that the parse tree is not cloned when ParseTree instances are copied.


Detailed Description

ParseTree contains the root node of a parse tree.

It correctly allocates and deletes parse node, because they themselves are not copy-constructable or assignable. Pimpl class pattern with exposed inner class.

Definition at line 305 of file ExpressionParser.h.


Constructor & Destructor Documentation

stx::ParseTree::ParseTree (  )  [inline]

Create NULL parse tree object from the root ParseNode.

All functions will assert() or segfault unless the tree is assigned.

Definition at line 315 of file ExpressionParser.h.


Member Function Documentation

AnyScalar stx::ParseTree::evaluate ( const class SymbolTable st = BasicSymbolTable()  )  const [inline]

Function to recursively evaluate the contained parse tree and retrieve the calculated scalar value based on the given symbol table.

Definition at line 334 of file ExpressionParser.h.


Member Data Documentation

boost::shared_ptr<ParseNode> stx::ParseTree::rootnode [protected]

Enclosed smart ptr so that the parse tree is not cloned when ParseTree instances are copied.

Definition at line 310 of file ExpressionParser.h.


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