This class is used to parse a string boolean expression into an internal tree represenation and to evaluate or reduce the expression for a given user
![]() | Expression () Constructor |
![]() | Expression (const string& expression) Constructs this Expression given expression |
![]() | ~Expression () Destroys this object |
![]() | isNull () |
![]() | toString () const Returns a string representation of this Expression |
![]() | toLogString () const For logging purpose |
![]() | evaluate (ExpressionEvaluator& evaluator) const Use this method when it is possible for the evaluator to evaluate all non-boolean expressions |
![]() | reduce (ExpressionEvaluator& evaluator, Expression& expr) const Use this method when it may not be possible for the evaluator to evaluate all non-boolean expressions |
![]() | visit (ExpressionVisitor& visitor) const Use this method to visit all the non-boolean expressions |
This class is used to parse a string boolean expression into an internal tree represenation and to evaluate or reduce the expression for a given user.Grammar: EXPR -> AEXPR { OR AEXPR } AEXPR -> NEXPER { AND NEXPR } NEXPER -> { NOT NEXPR } | PEXPER PEXPER -> LEXPER AOP REXPER | ( EXPER ) LEXPER -> one non-empty string REXPER -> one or more non-empty strings AOP -> = | != | < | <= | > | >= NOT -> ! AND -> && | & OR -> || | | Precedence: Following is the list of operators we support. They are listed from highest to lowest precedence. { =, != , <, <= , >, >= }, !, { &&, &}, { ||, | }. Parenthesis are of course optional. And as usual they can be used for groupings. Blank spaces have no meaning unless they are used to delimit the right hand side of an equality/or inequality operator. This is really where we differ from the C expression parser. The following two partial expressions have the same meaning: CN = Denis The Menace CN=Denis The Menace
Expression(const string& expression)
~Expression()
bool isNull()
string toString() const
string toLogString() const
bool evaluate(ExpressionEvaluator& evaluator) const
int reduce(ExpressionEvaluator& evaluator, Expression& expr) const
void visit(ExpressionVisitor& visitor) const
alphabetic index hierarchy of classes
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de