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