Public Types | Public Member Functions | Friends

ELAM::Expression Class Reference

Represents an expression in the context of its engine. More...

#include <elamexpression.h>

List of all members.

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, AssignmentOp = Token::AssignmentOp,
  Exception = Token::IgnoredTokenMask
}

Public Member Functions

 Expression ()
 creates and invalid expression, that always evaluates to an exception
 Expression (Engine *parent, const QList< Token > &tokens)
 creates an expression by its context engine and its tokens
QVariant evaluate ()
 evaluates the expression and returns the result of the evaluation
Position position () const
 returns the position of the main element of this expression

Friends

QDebug & operator<< (QDebug, const Expression &)
 makes expressions accessable to qDebug()

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 
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:
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Friends