Represents an expression in the context of its engine. More...
#include <elamexpression.h>
Public Types | |
enum | Type { Literal =Token::Literal, Variable =Token::Variable, Constant =Token::Constant, Function =Token::Function, Parentheses =Token::Parentheses, UnaryOp =Token::UnaryOp, BinaryOp =Token::BinaryOp, PipeOp =Token::PipeOp, AssignmentOp =Token::AssignmentOp, Exception =Token::IgnoredTokenMask } |
Public Member Functions | |
Expression () | |
creates and invalid expression, that always evaluates to an exception More... | |
Expression (Engine *parent, const QList< Token > &tokens) | |
creates an expression by its context engine and its tokens More... | |
QVariant | evaluate () |
evaluates the expression and returns the result of the evaluation More... | |
Position | position () const |
returns the position of the main element of this expression More... | |
Friends | |
QDebug & | operator<< (QDebug, const Expression &) |
makes expressions accessable to qDebug() More... | |
Represents an expression in the context of its engine.
An expression always has an engine as context and stores a hierarchy of operations (also expressions) to perform when called to evaluate. Expressions may become invalid if constants, functions, or operators change between the time they are created and the time they are evaluated.
ELAM::Expression::Expression | ( | ) |
creates and invalid expression, that always evaluates to an exception
creates an expression by its context engine and its tokens
QVariant ELAM::Expression::evaluate | ( | ) |
evaluates the expression and returns the result of the evaluation
Position ELAM::Expression::position | ( | ) | const |
returns the position of the main element of this expression
|
friend |
makes expressions accessable to qDebug()