#include <expression.h>
Public Types | |
Type Definitions | |
typedef void *(* | CreationMethod )() |
A creation method for predicates. | |
Public Member Functions | |
Constructors and Destructor | |
Expression () throw () | |
Default Constructor. | |
Expression (const Expression &expression) throw () | |
Copy Constructor. | |
Expression (const String &expression_string) throw (Exception::ParseError) | |
Construct an Expression with a string. | |
virtual | ~Expression () throw () |
Destructor. | |
Predicates | |
bool | hasPredicate (const String &name) const throw () |
bool | operator== (const Expression &expression) const throw () |
Equality operator. | |
Accessors | |
virtual bool | operator() (const Atom &atom) const throw () |
Evaluate the expression of atom . | |
ExpressionPredicate * | getPredicate (const String &name, const String &args="") const throw () |
Create a new predicate according to the name. | |
void | registerPredicate (const String &name, CreationMethod creation_method) throw () |
Register a new predicate class. | |
void | setExpression (const String &expression) throw (Exception::ParseError) |
Set the expression and build a tree for it. | |
const String & | getExpressionString () const throw () |
Get the expression string. | |
const ExpressionTree * | getExpressionTree () const throw () |
Get the expression tree. | |
const StringHashMap< CreationMethod > & | getCreationMethods () const throw () |
Get the creation methods. | |
Assignment | |
Expression & | operator= (const Expression &expression) throw () |
Assignment operator. | |
virtual void | clear () throw () |
Clear method. | |
Protected Member Functions | |
ExpressionTree * | constructExpressionTree_ (const ExpressionParser::SyntaxTree &tree) throw (Exception::ParseError) |
void | registerStandardPredicates_ () throw () |
Protected Attributes | |
StringHashMap< CreationMethod > | create_methods_ |
ExpressionTree * | expression_tree_ |
String | expression_string_ |
This class provides a frontend to ExpressionTree.
operator () (const Atom& atom) const
.
|
A creation method for predicates.
|
|
Default Constructor.
|
|
Copy Constructor.
|
|
Destructor.
|
|
Get the creation methods.
|
|
Get the expression string.
|
|
Get the expression tree.
|
|
Create a new predicate according to the name. If the predicate is not known, return 0.
|
|
Evaluate the expression of
|
|
Register a new predicate class.
|
|
Set the expression and build a tree for it.
|