#include <ExpressionParser.h>
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< ParseNode > | rootnode |
| Enclosed smart ptr so that the parse tree is not cloned when ParseTree instances are copied. | |
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.
| 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.
| 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.
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.
1.5.2