ELAM
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Friends | List of all members
ELAM::Expression Class Reference

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...
 

Detailed Description

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.

Member Enumeration Documentation

Enumerator
Literal 
Variable 
Constant 
Function 
Parentheses 
UnaryOp 
BinaryOp 
PipeOp 
AssignmentOp 
Exception 

Constructor & Destructor Documentation

ELAM::Expression::Expression ( )

creates and invalid expression, that always evaluates to an exception

ELAM::Expression::Expression ( Engine parent,
const QList< Token > &  tokens 
)

creates an expression by its context engine and its tokens

Member Function Documentation

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

Friends And Related Function Documentation

QDebug& operator<< ( QDebug  ,
const Expression  
)
friend

makes expressions accessable to qDebug()


The documentation for this class was generated from the following file: