#include <expressionbuilder.h>
Inheritance diagram for UTAP::ExpressionBuilder:
Public Member Functions | |
ExpressionBuilder (TimedAutomataSystem *) | |
ExpressionFragments & | getExpressions () |
virtual void | addPosition (uint32_t position, uint32_t offset, uint32_t line, std::string path) |
Add mapping from an absolute position to a relative XML element. | |
virtual void | handleError (std::string) |
virtual void | handleWarning (std::string) |
virtual void | typeDuplicate () |
Duplicate type at the top of the type stack. | |
virtual void | typePop () |
Pop type at the topof the type stack. | |
virtual void | typeBool (PREFIX) |
virtual void | typeInt (PREFIX) |
virtual void | typeBoundedInt (PREFIX) |
virtual void | typeChannel (PREFIX) |
virtual void | typeClock () |
Called whenever a clock type is parsed. | |
virtual void | typeVoid () |
Called whenever a void type is parsed. | |
virtual void | typeScalar (PREFIX) |
virtual void | typeName (PREFIX, const char *name) |
virtual bool | isType (const char *) |
Must return true if and only if name is registered in the symbol table as a named type, for instance, "int" or "bool" or a user defined type. | |
virtual void | exprTrue () |
virtual void | exprFalse () |
virtual void | exprId (const char *varName) |
virtual void | exprNat (int32_t) |
virtual void | exprCallBegin () |
virtual void | exprCallEnd (uint32_t n) |
virtual void | exprArray () |
virtual void | exprPostIncrement () |
virtual void | exprPreIncrement () |
virtual void | exprPostDecrement () |
virtual void | exprPreDecrement () |
virtual void | exprAssignment (Constants::kind_t op) |
virtual void | exprUnary (Constants::kind_t unaryop) |
virtual void | exprBinary (Constants::kind_t binaryop) |
virtual void | exprTernary (Constants::kind_t ternaryop, bool firstMissing) |
virtual void | exprInlineIf () |
virtual void | exprComma () |
virtual void | exprDot (const char *) |
virtual void | exprDeadlock () |
virtual void | exprForAllBegin (const char *name) |
virtual void | exprForAllEnd (const char *name) |
virtual void | exprExistsBegin (const char *name) |
virtual void | exprExistsEnd (const char *name) |
Protected Member Functions | |
void | pushFrame (frame_t) |
Push a new frame. | |
void | popFrame () |
Pop the topmost frame. | |
bool | resolve (std::string, symbol_t &) |
expression_t | makeConstant (int value) |
type_t | applyPrefix (PREFIX, type_t type) |
Given a prefix and a type, this method creates a new type by applying the prefix. | |
virtual bool | allowProcessReferences () |
If this method returns true, it is allowed to access the private identifiers of a process by prefixing the identifier with the process name. | |
Protected Attributes | |
ExpressionFragments | fragments |
Expression stack. | |
TypeFragments | typeFragments |
Type stack. | |
std::stack< frame_t > | frames |
Frame stack. | |
TimedAutomataSystem * | system |
Pointer to the system under construction. | |
template_t * | currentTemplate |
The template currently being parsed. | |
int32_t | scalar_count |
Counter for creating unique scalarset names. | |
Classes | |
class | ExpressionFragments |
class | TypeFragments |
In order to support quantifier expressions, this class also handles the type related methods.
This class does not implement any declaration related methods.
Internally, three stacks are maintained: One for expressions, one for types and for frames (scopes).
ExpressionBuilder::ExpressionBuilder | ( | TimedAutomataSystem * | ) |
void ExpressionBuilder::addPosition | ( | uint32_t | position, | |
uint32_t | offset, | |||
uint32_t | line, | |||
std::string | path | |||
) | [virtual] |
virtual bool UTAP::ExpressionBuilder::allowProcessReferences | ( | ) | [inline, protected, virtual] |
If this method returns true, it is allowed to access the private identifiers of a process by prefixing the identifier with the process name.
This is only interesting when parsing properties. In this case the method should be overridden by a sub class.
Given a prefix and a type, this method creates a new type by applying the prefix.
TypeExceptions might be thrown if the combination of the prefix and the type is illegal.
void ExpressionBuilder::exprArray | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
virtual void UTAP::ExpressionBuilder::exprAssignment | ( | Constants::kind_t | op | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
virtual void UTAP::ExpressionBuilder::exprBinary | ( | Constants::kind_t | binaryop | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::exprCallBegin | ( | ) | [virtual] |
void ExpressionBuilder::exprCallEnd | ( | uint32_t | n | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::exprComma | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::exprDeadlock | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::exprDot | ( | const char * | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::exprExistsBegin | ( | const char * | name | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::exprExistsEnd | ( | const char * | name | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::exprFalse | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::exprForAllBegin | ( | const char * | name | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::exprForAllEnd | ( | const char * | name | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::exprId | ( | const char * | varName | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::exprInlineIf | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::exprNat | ( | int32_t | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::exprPostDecrement | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::exprPostIncrement | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::exprPreDecrement | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::exprPreIncrement | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
virtual void UTAP::ExpressionBuilder::exprTernary | ( | Constants::kind_t | ternaryop, | |
bool | firstMissing | |||
) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::exprTrue | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
virtual void UTAP::ExpressionBuilder::exprUnary | ( | Constants::kind_t | unaryop | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
ExpressionBuilder::ExpressionFragments & ExpressionBuilder::getExpressions | ( | ) |
virtual void UTAP::ExpressionBuilder::handleError | ( | std::string | ) | [virtual] |
Implements UTAP::ParserBuilder.
virtual void UTAP::ExpressionBuilder::handleWarning | ( | std::string | ) | [virtual] |
Implements UTAP::ParserBuilder.
bool ExpressionBuilder::isType | ( | const char * | ) | [virtual] |
Must return true if and only if name is registered in the symbol table as a named type, for instance, "int" or "bool" or a user defined type.
Reimplemented from UTAP::AbstractBuilder.
expression_t ExpressionBuilder::makeConstant | ( | int | value | ) | [protected] |
void ExpressionBuilder::popFrame | ( | ) | [protected] |
Pop the topmost frame.
void ExpressionBuilder::pushFrame | ( | frame_t | ) | [protected] |
Push a new frame.
bool ExpressionBuilder::resolve | ( | std::string | , | |
symbol_t & | ||||
) | [protected] |
void ExpressionBuilder::typeBool | ( | PREFIX | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::typeBoundedInt | ( | PREFIX | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::typeChannel | ( | PREFIX | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::typeClock | ( | ) | [virtual] |
void ExpressionBuilder::typeDuplicate | ( | ) | [virtual] |
void ExpressionBuilder::typeInt | ( | PREFIX | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::typeName | ( | PREFIX | , | |
const char * | name | |||
) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::typePop | ( | ) | [virtual] |
void ExpressionBuilder::typeScalar | ( | PREFIX | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void ExpressionBuilder::typeVoid | ( | ) | [virtual] |
template_t* UTAP::ExpressionBuilder::currentTemplate [protected] |
The template currently being parsed.
Expression stack.
std::stack<frame_t> UTAP::ExpressionBuilder::frames [protected] |
Frame stack.
int32_t UTAP::ExpressionBuilder::scalar_count [protected] |
Counter for creating unique scalarset names.
TimedAutomataSystem* UTAP::ExpressionBuilder::system [protected] |
Pointer to the system under construction.
TypeFragments UTAP::ExpressionBuilder::typeFragments [protected] |
Type stack.