#include <statementbuilder.h>
Inheritance diagram for UTAP::StatementBuilder:
Public Member Functions | |
StatementBuilder (TimedAutomataSystem *) | |
virtual void | typeArrayOfSize (size_t) |
Called to create an array type. | |
virtual void | typeArrayOfType (size_t) |
Called to create an array type. | |
virtual void | typeStruct (PREFIX, uint32_t fields) |
Used to construct a new struct type, which is then pushed onto the type stack. | |
virtual void | structField (const char *name) |
Used to declare the fields of a structure. | |
virtual void | declTypeDef (const char *name) |
A type definition. | |
virtual void | declVar (const char *name, bool init) |
Declare a new variable of the given name. | |
virtual void | declInitialiserList (uint32_t num) |
virtual void | declFieldInit (const char *name) |
virtual void | declParameter (const char *name, bool) |
virtual void | declFuncBegin (const char *name) |
virtual void | declFuncEnd () |
virtual void | blockBegin () |
virtual void | blockEnd () |
virtual void | emptyStatement () |
virtual void | forBegin () |
virtual void | forEnd () |
virtual void | iterationBegin (const char *name) |
virtual void | iterationEnd (const char *name) |
virtual void | whileBegin () |
virtual void | whileEnd () |
virtual void | doWhileBegin () |
virtual void | doWhileEnd () |
virtual void | ifBegin () |
virtual void | ifElse () |
virtual void | ifEnd (bool) |
virtual void | exprStatement () |
virtual void | returnStatement (bool) |
virtual void | assertStatement () |
virtual void | exprCallBegin () |
Protected Member Functions | |
virtual variable_t * | addVariable (type_t type, const char *name, expression_t init)=0 |
virtual bool | addFunction (type_t type, const char *name)=0 |
Static Protected Member Functions | |
static void | collectDependencies (std::set< symbol_t > &, expression_t) |
static void | collectDependencies (std::set< symbol_t > &, type_t) |
Protected Attributes | |
frame_t | params |
The params frame is used temporarily during parameter parsing. | |
function_t * | currentFun |
The function currently being parsed. | |
std::vector< BlockStatement * > | blocks |
Stack of nested statement blocks. | |
std::vector< type_t > | fields |
The types of a struct. | |
std::vector< std::string > | labels |
The labels of a struct. |
StatementBuilder::StatementBuilder | ( | TimedAutomataSystem * | ) |
virtual bool UTAP::StatementBuilder::addFunction | ( | type_t | type, | |
const char * | name | |||
) | [protected, pure virtual] |
Implemented in UTAP::SystemBuilder.
virtual variable_t* UTAP::StatementBuilder::addVariable | ( | type_t | type, | |
const char * | name, | |||
expression_t | init | |||
) | [protected, pure virtual] |
Implemented in UTAP::SystemBuilder.
void StatementBuilder::assertStatement | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::blockBegin | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::blockEnd | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::collectDependencies | ( | std::set< symbol_t > & | , | |
expression_t | ||||
) | [static, protected] |
void StatementBuilder::declFieldInit | ( | const char * | name | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::declFuncBegin | ( | const char * | name | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::declFuncEnd | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::declInitialiserList | ( | uint32_t | num | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::declParameter | ( | const char * | name, | |
bool | ||||
) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::declTypeDef | ( | const char * | name | ) | [virtual] |
A type definition.
Assign the name to the given type on the type fragment stack. In case of array types, dim constant expressions are expected on and popped from the expression stack.
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::declVar | ( | const char * | name, | |
bool | hasInit | |||
) | [virtual] |
Declare a new variable of the given name.
The type is expected to be on the type stack. If the variable has an initialiser (the init parameter is true), then a constant expression is expected at the top of the expression stack. The expressions will be popped of the stack (the type is left untouched).
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::doWhileBegin | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::doWhileEnd | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::emptyStatement | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::exprCallBegin | ( | ) | [virtual] |
Reimplemented from UTAP::ExpressionBuilder.
void StatementBuilder::exprStatement | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::forBegin | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::forEnd | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::ifBegin | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::ifElse | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::ifEnd | ( | bool | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::iterationBegin | ( | const char * | name | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::iterationEnd | ( | const char * | name | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::returnStatement | ( | bool | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::structField | ( | const char * | name | ) | [virtual] |
Used to declare the fields of a structure.
The type of the field is expected to be on the type fragment stack.
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::typeArrayOfSize | ( | size_t | ) | [virtual] |
Called to create an array type.
The size of the array was previously pushed as an expression.
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::typeArrayOfType | ( | size_t | ) | [virtual] |
Called to create an array type.
The size of the array was previously pushed as a type.
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::typeStruct | ( | PREFIX | prefix, | |
uint32_t | n | |||
) | [virtual] |
Used to construct a new struct type, which is then pushed onto the type stack.
The type is based on n fields, which are expected to be on and will be popped off the type stack.
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::whileBegin | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
void StatementBuilder::whileEnd | ( | ) | [virtual] |
Reimplemented from UTAP::AbstractBuilder.
std::vector<BlockStatement*> UTAP::StatementBuilder::blocks [protected] |
Stack of nested statement blocks.
function_t* UTAP::StatementBuilder::currentFun [protected] |
The function currently being parsed.
std::vector<type_t> UTAP::StatementBuilder::fields [protected] |
The types of a struct.
std::vector<std::string> UTAP::StatementBuilder::labels [protected] |
The labels of a struct.
frame_t UTAP::StatementBuilder::params [protected] |
The params frame is used temporarily during parameter parsing.