DiaDes
0.1
DIAgnosisofDiscrete-EventSystem
|
#include <Expression.hh>
Public Types | |
typedef ExprVector::size_type | AlternativeIndex |
Public Types inherited from Diades::Altarica::Expression | |
enum | Category { IfThenElse =0, Case =1, Or =2, And =3, Eq =4, Neq =5, Imply =6, Lt =7, Gt =8, Leq =9, Geq =10, Add =11, Sub =12, Mul =13, Div =14, Mod =15, Neg =16, Not =17, Paren =18, StructMember =19, ArrayMember =20, Var =21, Id =22, Min =23, Max =24, True =25, False =26, Integer =27, ForAll =28, Exist =29, FunctionCall =30, Struct =31, Array =32 } |
typedef reference_wrapper< Expression const > | ConstReference |
typedef reference_wrapper< Expression > | Reference |
typedef std::vector< ConstReference > | ExprVector |
typedef Utils::Exception< Expression > | Exception |
typedef std::vector< VariableDecl::ConstReference >::const_iterator | VariableIterator |
typedef std::vector< VariableDecl::ConstReference >::size_type | SizeType |
typedef std::vector< VariableDecl::ConstReference > | Support |
Public Member Functions | |
CaseExpression (const NodeDecl &owner, unsigned id, const ExprVector &choices, const ExprVector &expressions) | |
AlternativeIndex | first () const |
AlternativeIndex | last () const |
const Expression & | getAlternative (AlternativeIndex index) const |
const Expression & | getAlternativeExpression (AlternativeIndex index) const |
const Expression & | defaultCase () const |
virtual bool | valid () const |
Category | category () const |
virtual const Type & | valueType () const |
virtual bool | isConstant () const |
virtual | ~CaseExpression () |
Public Member Functions inherited from Diades::Altarica::Expression | |
virtual | ~Expression () |
const AltaricaModel & | model () const |
const NodeDecl & | owner () const |
bool | operator== (const Expression &e) const |
Expression (const NodeDecl &owner, unsigned id) | |
unsigned | id () const |
VariableIterator | variableBegin () const |
VariableIterator | variableEnd () const |
SizeType | supportSize () const |
const Support & | support () const |
Private Attributes | |
ExprVector | _choices |
ExprVector | _expressions |
Friends | |
ostream & | operator<< (ostream &os, const Expression &expression) |
Additional Inherited Members | |
Static Public Member Functions inherited from Diades::Altarica::Expression | |
static string | typeName () |
Protected Attributes inherited from Diades::Altarica::Expression | |
Support | _varSupport |
const NodeDecl & | _owner |
VariableDecls that are supporting the Expression. More... | |
unsigned | _id |
The class represents a case expression. Each alternative is implemented as an Expression in vector _choices and each alternative resulting expression is implemented as an Expression in a vector _expressions. The default case is the last Expression in _expressions which means that _choices.size() = _expressions.size()-1
Definition at line 283 of file Expression.hh.
typedef ExprVector::size_type Diades::Altarica::CaseExpression::AlternativeIndex |
Definition at line 289 of file Expression.hh.
Diades::Altarica::CaseExpression::CaseExpression | ( | const NodeDecl & | owner, |
unsigned | id, | ||
const ExprVector & | choices, | ||
const ExprVector & | expressions | ||
) |
|
inlinevirtual |
Definition at line 347 of file Expression.hh.
References Diades::Altarica::Expression::operator<<.
|
inlinevirtual |
Expression evaluation: this operation evaluates the expression with the current value associated to the variables that support the Expression. The evaluation is failing if there is a variable of the support that is still free (that is an unassigned variable).
value | the Value resulting from the evaluation of the current Expression. |
Implements Diades::Altarica::Expression.
Definition at line 326 of file Expression.hh.
References Diades::Altarica::Expression::Case.
|
inline |
Definition at line 310 of file Expression.hh.
|
inline |
Definition at line 293 of file Expression.hh.
|
inline |
Definition at line 301 of file Expression.hh.
|
inline |
Definition at line 305 of file Expression.hh.
|
inlinevirtual |
Implements Diades::Altarica::Expression.
Definition at line 335 of file Expression.hh.
|
inline |
Definition at line 297 of file Expression.hh.
|
inlinevirtual |
Validity of an Expression
Implements Diades::Altarica::Expression.
Definition at line 311 of file Expression.hh.
|
inlinevirtual |
Type of the Value returned by the Expression (lazy computation)
Implements Diades::Altarica::Expression.
Definition at line 328 of file Expression.hh.
|
friend |
|
private |
Definition at line 286 of file Expression.hh.
|
private |
Definition at line 287 of file Expression.hh.