libutap
|
A reference to a symbol. More...
#include <symbols.h>
Public Member Functions | |
symbol_t () | |
Default constructor. More... | |
symbol_t (const symbol_t &) | |
Copy constructor. More... | |
~symbol_t () | |
Destructor. More... | |
const symbol_t & | operator= (const symbol_t &) |
Assignment operator. More... | |
bool | operator== (const symbol_t &) const |
Equality operator. More... | |
bool | operator!= (const symbol_t &) const |
Inequality operator. More... | |
bool | operator< (const symbol_t &) const |
Less-than operator. More... | |
frame_t | getFrame () |
Get frame this symbol belongs to. More... | |
type_t | getType () const |
Returns the type of this symbol. More... | |
void | setType (type_t) |
Alters the type of this symbol. More... | |
void * | getData () |
Returns the user data of this symbol. More... | |
const void * | getData () const |
Return the user data of this symbol. More... | |
std::string | getName () const |
Returns the name (identifier) of this symbol. More... | |
void | setName (std::string) |
Alters the name of this symbol. More... | |
void | setData (void *) |
Sets the user data of this symbol. More... | |
Protected Member Functions | |
symbol_t (void *frame, type_t type, std::string name, void *user) | |
Friends | |
class | frame_t |
A reference to a symbol.
Symbols can only be accessed via instances of symbol_t. Internally, symbols are reference counted and do not need to be deallocated manually. Each symbol has a name (which might be NULL) a type and an uninterpreted optional void pointer.
Symbols are members of a frame (see also frame_t). It is possible to access the frame of a symbol via the symbol (see getFrame()). However, a symbol does not contain a counted reference to its frame so you must maintain at least one reference to the frame to avoid to be deallocated.
Notice that it is possible to add the same symbol to several frames. In this case, the symbol will only "point back" to the first frame it was added to.
|
protected |
|
inline |
Default constructor.
symbol_t::symbol_t | ( | const symbol_t & | symbol | ) |
Copy constructor.
symbol_t::~symbol_t | ( | ) |
Destructor.
void * symbol_t::getData | ( | ) |
Returns the user data of this symbol.
Referenced by UTAP::template_t::addEdge(), UTAP::template_t::addMessage(), UTAP::template_t::addUpdate(), UTAP::StatementBuilder::collectDependencies(), collectDependencies(), UTAP::expression_t::collectPossibleReads(), UTAP::expression_t::collectPossibleWrites(), UTAP::ExpressionBuilder::exprDot(), UTAP::XMLWriter::init(), UTAP::SystemBuilder::instanceName(), UTAP::SystemBuilder::process(), UTAP::TypeChecker::visitBlockStatement(), and UTAP::SignalFlow::visitExpression().
const void * symbol_t::getData | ( | ) | const |
Return the user data of this symbol.
frame_t symbol_t::getFrame | ( | ) |
Get frame this symbol belongs to.
References frame_t.
Referenced by UTAP::SignalFlow::visitExpression().
string symbol_t::getName | ( | ) | const |
Returns the name (identifier) of this symbol.
Referenced by UTAP::frame_t::add(), UTAP::TimedAutomataSystem::addProcess(), UTAP::frame_t::addSymbol(), UTAP::SignalFlow::addVar(), UTAP::SignalFlow::checkParams(), UTAP::ExpressionBuilder::exprDot(), UTAP::XMLWriter::location(), UTAP::XMLWriter::name(), operator<<(), UTAP::SystemBuilder::process(), UTAP::XMLWriter::taTempl(), UTAP::IterationStatement::toString(), UTAP::XMLWriter::transition(), UTAP::ExpressionBuilder::typeName(), UTAP::ExpressionBuilder::typeScalar(), UTAP::SignalFlow::visitExpression(), and UTAP::SignalFlow::visitProcess().
type_t symbol_t::getType | ( | ) | const |
Returns the type of this symbol.
Referenced by UTAP::template_t::addEdge(), UTAP::TimedAutomataSystem::addProcess(), UTAP::expression_t::collectPossibleReads(), UTAP::expression_t::collectPossibleWrites(), UTAP::expression_t::createIdentifier(), UTAP::StatementBuilder::declFuncEnd(), UTAP::SystemBuilder::instanceName(), UTAP::ExpressionBuilder::isType(), UTAP::XMLWriter::location(), operator<<(), UTAP::SystemBuilder::procEdgeBegin(), UTAP::SystemBuilder::process(), UTAP::SystemBuilder::procLscUpdate(), UTAP::SystemBuilder::procMessage(), UTAP::SystemBuilder::procStateCommit(), UTAP::SystemBuilder::procStateInit(), UTAP::SystemBuilder::procStateUrgent(), UTAP::StatementBuilder::returnStatement(), UTAP::IterationStatement::toString(), UTAP::ExpressionBuilder::typeName(), UTAP::TypeChecker::visitBlockStatement(), UTAP::SignalFlow::visitExpression(), UTAP::TypeChecker::visitFunction(), UTAP::TypeChecker::visitInstance(), UTAP::TypeChecker::visitIterationStatement(), UTAP::TypeChecker::visitProcess(), UTAP::CompileTimeComputableValues::visitVariable(), and UTAP::TypeChecker::visitVariable().
bool symbol_t::operator!= | ( | const symbol_t & | symbol | ) | const |
Inequality operator.
bool symbol_t::operator< | ( | const symbol_t & | symbol | ) | const |
Less-than operator.
bool symbol_t::operator== | ( | const symbol_t & | symbol | ) | const |
Equality operator.
void symbol_t::setData | ( | void * | value | ) |
Sets the user data of this symbol.
void symbol_t::setName | ( | std::string | ) |
Alters the name of this symbol.
void symbol_t::setType | ( | type_t | type | ) |
Alters the type of this symbol.
Referenced by UTAP::SystemBuilder::procStateCommit(), and UTAP::SystemBuilder::procStateUrgent().
|
friend |
Referenced by getFrame().