libutap
|
A reference to a type. More...
#include <type.h>
Public Member Functions | |
type_t () | |
Default constructor. More... | |
type_t (const type_t &) | |
Copy constructor. More... | |
~type_t () | |
Destructor. More... | |
const type_t & | operator= (const type_t &) |
Assignment operator. More... | |
bool | operator== (const type_t &) const |
Equality operator. More... | |
bool | operator!= (const type_t &) const |
Inequality operator. More... | |
Constants::kind_t | getKind () const |
Returns the kind of type object. More... | |
position_t | getPosition () const |
Returns the position of the type in the input file. More... | |
size_t | size () const |
Returns the number of children. More... | |
bool | operator< (const type_t &) const |
Less-than operator. More... | |
const type_t | operator[] (uint32_t) const |
Returns the i'th child. More... | |
const type_t | get (uint32_t) const |
Returns the i'th child. More... | |
const std::string & | getLabel (uint32_t) const |
Returns the i'th label. More... | |
expression_t | getExpression () const |
Returns the expression associated with the type. More... | |
type_t | getArraySize () const |
Returns the size of an array (this is itself a type). More... | |
type_t | getSub () const |
Returns the element type of an array. More... | |
type_t | getSub (size_t) const |
Returns the 'th field of a record or process. More... | |
size_t | getRecordSize () const |
Returns the number of fields of a record. More... | |
std::string | getRecordLabel (size_t i) const |
Returns the label of the 'th field of a record. More... | |
int32_t | findIndexOf (std::string) const |
Returns the index of the record or process field with the given label. More... | |
std::pair< expression_t, expression_t > | getRange () const |
Returns the range of a RANGE type. More... | |
std::string | toString () const |
Generates string representation of the type. More... | |
std::string | toDeclarationString () const |
bool | isRange () const |
Shortcut for is(RANGE). More... | |
bool | isInteger () const |
Shortcut for is(INT). More... | |
bool | isBoolean () const |
Shortcut for is(BOOL). More... | |
bool | isFunction () const |
Shortcut for is(FUNCTION). More... | |
bool | isProcess () const |
Shortcut for is(PROCESS). More... | |
bool | isProcessSet () const |
Shortcut for is(PROCESSSET). More... | |
bool | isLocation () const |
Shortcut for is(LOCATION). More... | |
bool | isInstanceLine () const |
Shortcut for is(INSTANCELINE). More... | |
bool | isBranchpoint () const |
Shortcut for is(BRANCHPOINT). More... | |
bool | isChannel () const |
Shortcut for is(CHANNEL). More... | |
bool | isArray () const |
Shortcut for is(ARRAY). More... | |
bool | isScalar () const |
Shortcut for is(SCALAR). More... | |
bool | isClock () const |
Shortcut for is(CLOCK). More... | |
bool | isRecord () const |
Shortcut for is(RECORD). More... | |
bool | isDiff () const |
Shortcut for is(DIFF). More... | |
bool | isVoid () const |
Shortcut for is(VOID_TYPE). More... | |
bool | isCost () const |
Shortcut for is(COST). More... | |
bool | isDouble () const |
Shortcut for is(DOUBLE). More... | |
bool | isIntegral () const |
Returns true if this is a boolean or integer. More... | |
bool | isInvariant () const |
Returns true if this is an invariant, boolean or integer. More... | |
bool | isGuard () const |
Returns true if this is a guard, invariant, boolean or integer. More... | |
bool | isConstraint () const |
Returns true if this is a constraint, guard, invariant, boolean or integer. More... | |
bool | isFormula () const |
Returns true if this is a formula, constraint, guard, invariant, boolean or integer. More... | |
type_t | strip () const |
Removes any leading prefixes, RANGE, REF and LABEL types and returns the result. More... | |
type_t | stripArray () const |
Removes any leading prefixes, RANGE, REF, LABEL and ARRAY types and returns the result. More... | |
bool | isPrefix () const |
Returns false for non-prefix types and true otherwise. More... | |
bool | isConstant () const |
Returns true if and only if all elements of the type are constant. More... | |
bool | isNonConstant () const |
Returns true if and only if all elements of the type are not constant. More... | |
bool | is (Constants::kind_t kind) const |
Returns true if the type has kind kind or if type is a prefix, RANGE or REF type and the getChild().is(kind) returns true. More... | |
bool | unknown () const |
Returns true if this is null-type or of kind UNKNOWN. More... | |
type_t | rename (std::string from, std::string to) const |
Replaces any LABEL labeled from occuring in the type with a LABEL to. More... | |
type_t | subst (symbol_t symbol, expression_t expr) const |
Substitutes any occurence of symbol in any expression in the type (expressions that occur as ranges either on array sizes, scalars or integers) with expr. More... | |
type_t | createPrefix (Constants::kind_t kind, position_t=position_t()) const |
Creates a new type by adding a prefix to it. More... | |
type_t | createLabel (std::string, position_t=position_t()) const |
Creates a LABEL. More... | |
type_t | createPosition (position_t=position_t()) const |
Static Public Member Functions | |
static type_t | createRange (type_t, expression_t, expression_t, position_t=position_t()) |
static type_t | createPrimitive (Constants::kind_t, position_t=position_t()) |
Create a primitive type. More... | |
static type_t | createArray (type_t sub, type_t size, position_t=position_t()) |
Creates an array type. More... | |
static type_t | createTypeDef (std::string, type_t, position_t=position_t()) |
Creates a new type definition. More... | |
static type_t | createProcess (frame_t, position_t=position_t()) |
Creates a new process type. More... | |
static type_t | createProcessSet (type_t instance, position_t=position_t()) |
Creates a new processset type. More... | |
static type_t | createRecord (const std::vector< type_t > &, const std::vector< std::string > &, position_t=position_t()) |
Creates a new record type. More... | |
static type_t | createFunction (type_t, const std::vector< type_t > &, const std::vector< std::string > &, position_t=position_t()) |
Creates a new function type. More... | |
static type_t | createInstance (frame_t, position_t=position_t()) |
Creates a new instance type. More... | |
static type_t | createLscInstance (frame_t, position_t=position_t()) |
Creates a new lsc instance type. More... | |
A reference to a type.
Types are represented as trees of types. The type cannot be access directly. You need to use an instance of type_t to access a type. Internally, types are reference counted and do not need to be deallocated manually. Types are immutable.
Types are either primitive such as clocks or channels, or contructed types such as structs and array. Constructed types are created using one of the factory methods in the type_t class. Primitive types are leaves in the tree, constructed types are inner nodes.
All types have a kind - a type for the type. The kind is a value of kind_t. In anticipation of a future homogeneous AST, this kind is defined in the same enumerable as the kind of expressions.
Some constructed types are considered prefixes for other types: URGENT, COMMITTED, BROADCAST, CONSTANT and BROADCAST.
LABEL types are references to named types. These are introduced by references to types defined with a typedef or by scalar set declarations. They have one child: The type which has been named.
Constructed types are:
type_t::type_t | ( | ) |
Default constructor.
This creates a null-type.
type_t::type_t | ( | const type_t & | type | ) |
Copy constructor.
type_t::~type_t | ( | ) |
Destructor.
|
static |
Creates an array type.
References UTAP::Constants::ARRAY.
Referenced by UTAP::ExpressionBuilder::exprCallEnd(), and UTAP::StatementBuilder::typeArrayOfType().
|
static |
Creates a new function type.
References UTAP::Constants::FUNCTION.
Referenced by UTAP::StatementBuilder::declFuncBegin().
|
static |
Creates a new instance type.
References UTAP::frame_t::getSize(), and UTAP::Constants::INSTANCE.
Referenced by UTAP::TimedAutomataSystem::addDynamicTemplate(), UTAP::TimedAutomataSystem::addInstance(), and UTAP::TimedAutomataSystem::addTemplate().
type_t type_t::createLabel | ( | std::string | , |
position_t | = position_t() |
||
) | const |
Creates a LABEL.
References UTAP::Constants::LABEL.
Referenced by UTAP::ExpressionBuilder::typeName(), and UTAP::ExpressionBuilder::typeScalar().
|
static |
Creates a new lsc instance type.
References UTAP::frame_t::getSize(), and UTAP::Constants::LSCINSTANCE.
Referenced by UTAP::TimedAutomataSystem::addLscInstance(), and UTAP::TimedAutomataSystem::addTemplate().
type_t UTAP::type_t::createPosition | ( | position_t | = position_t() | ) | const |
type_t type_t::createPrefix | ( | Constants::kind_t | kind, |
position_t | pos = position_t() |
||
) | const |
Creates a new type by adding a prefix to it.
The prefix could be anything and it is the responsibility of the caller to make sure that the given kind is a valid prefix.
Referenced by UTAP::SystemBuilder::addSelectSymbolToFrame(), UTAP::ExpressionBuilder::applyPrefix(), UTAP::StatementBuilder::declParameter(), UTAP::ExpressionBuilder::exprForAllBegin(), UTAP::StatementBuilder::iterationBegin(), UTAP::SystemBuilder::procStateCommit(), and UTAP::SystemBuilder::procStateUrgent().
|
static |
Create a primitive type.
Referenced by UTAP::template_t::addBranchpoint(), UTAP::template_t::addLocation(), UTAP::TypeChecker::checkExpression(), UTAP::expression_t::createConstant(), UTAP::expression_t::createDeadlock(), UTAP::expression_t::createDouble(), UTAP::expression_t::createExit(), UTAP::ExpressionBuilder::exprDot(), UTAP::ExpressionBuilder::exprDouble(), UTAP::ExpressionBuilder::exprExistsDynamicBegin(), UTAP::ExpressionBuilder::exprExistsDynamicEnd(), UTAP::ExpressionBuilder::exprFalse(), UTAP::ExpressionBuilder::exprForAllDynamicBegin(), UTAP::ExpressionBuilder::exprForAllDynamicEnd(), UTAP::ExpressionBuilder::exprForeachDynamicBegin(), UTAP::ExpressionBuilder::exprForeachDynamicEnd(), UTAP::ExpressionBuilder::exprNumOf(), UTAP::ExpressionBuilder::exprProbaQuantitative(), UTAP::ExpressionBuilder::exprScenario(), UTAP::ExpressionBuilder::exprSumDynamicBegin(), UTAP::ExpressionBuilder::exprTrue(), UTAP::SystemBuilder::instanceName(), UTAP::TimedAutomataSystem::TimedAutomataSystem(), UTAP::ExpressionBuilder::typeBool(), UTAP::ExpressionBuilder::typeBoundedInt(), UTAP::ExpressionBuilder::typeChannel(), UTAP::ExpressionBuilder::typeClock(), UTAP::ExpressionBuilder::typeDouble(), UTAP::ExpressionBuilder::typeInt(), UTAP::ExpressionBuilder::typeName(), UTAP::ExpressionBuilder::typeScalar(), and UTAP::ExpressionBuilder::typeVoid().
|
static |
Creates a new process type.
References UTAP::frame_t::getSize(), and UTAP::Constants::PROCESS.
Referenced by UTAP::TimedAutomataSystem::addProcess(), and UTAP::ExpressionBuilder::exprCallEnd().
|
static |
Creates a new processset type.
References getLabel(), UTAP::Constants::PROCESSSET, and size().
Referenced by UTAP::TimedAutomataSystem::addProcess().
|
static |
References UTAP::Constants::RANGE, and UTAP::Constants::UNKNOWN.
Referenced by UTAP::ExpressionBuilder::typeBoundedInt(), UTAP::ExpressionBuilder::typeInt(), and UTAP::ExpressionBuilder::typeScalar().
|
static |
Creates a new record type.
References UTAP::Constants::RECORD.
Referenced by UTAP::StatementBuilder::declInitialiserList(), and UTAP::StatementBuilder::typeStruct().
|
static |
Creates a new type definition.
References UTAP::Constants::TYPEDEF.
Referenced by UTAP::StatementBuilder::declTypeDef().
int32_t type_t::findIndexOf | ( | std::string | label | ) | const |
Returns the index of the record or process field with the given label.
Returns -1 if such a field does not exist.
References getLabel(), and size().
Referenced by UTAP::ExpressionBuilder::exprDot(), and UTAP::ExpressionBuilder::exprScenario().
const type_t type_t::get | ( | uint32_t | i | ) | const |
Returns the i'th child.
Referenced by stripArray().
type_t type_t::getArraySize | ( | ) | const |
Returns the size of an array (this is itself a type).
References UTAP::Constants::ARRAY, UTAP::Constants::LABEL, and UTAP::Constants::REF.
Referenced by UTAP::TypeChecker::checkExpression(), and initRec().
expression_t type_t::getExpression | ( | ) | const |
Returns the expression associated with the type.
kind_t type_t::getKind | ( | ) | const |
Returns the kind of type object.
References UTAP::Constants::UNKNOWN.
Referenced by UTAP::StatementBuilder::collectDependencies(), initRec(), UTAP::SystemBuilder::instanceName(), isAssignable(), isSameScalarType(), UTAP::ExpressionBuilder::isType(), mustInitialise(), UTAP::SystemBuilder::process(), stripArray(), UTAP::ExpressionBuilder::typeName(), validReturnType(), visit(), and UTAP::SignalFlow::visitExpression().
const std::string & type_t::getLabel | ( | uint32_t | i | ) | const |
Returns the i'th label.
Referenced by createProcessSet(), UTAP::StatementBuilder::declInitialiserList(), findIndexOf(), isSameScalarType(), and UTAP::IterationStatement::toString().
position_t type_t::getPosition | ( | ) | const |
Returns the position of the type in the input file.
This exposes the fact that the type is actually part of the AST.
std::pair< expression_t, expression_t > type_t::getRange | ( | ) | const |
Returns the range of a RANGE type.
References UTAP::Constants::RANGE.
Referenced by UTAP::StatementBuilder::collectDependencies(), and isSameScalarType().
string type_t::getRecordLabel | ( | size_t | i | ) | const |
Returns the label of the 'th field of a record.
References UTAP::Constants::LABEL, UTAP::Constants::PROCESS, UTAP::Constants::RECORD, and UTAP::Constants::REF.
size_t type_t::getRecordSize | ( | ) | const |
Returns the number of fields of a record.
References UTAP::Constants::LABEL, UTAP::Constants::RECORD, and UTAP::Constants::REF.
type_t type_t::getSub | ( | ) | const |
Returns the element type of an array.
Preserves any prefixes.
References UTAP::Constants::LABEL, and UTAP::Constants::REF.
Referenced by UTAP::TypeChecker::checkExpression(), UTAP::ExpressionBuilder::exprArray(), UTAP::ExpressionBuilder::exprCallEnd(), UTAP::ExpressionBuilder::exprDot(), initRec(), UTAP::TypeChecker::visitIODecl(), and UTAP::TypeChecker::visitSystemAfter().
type_t type_t::getSub | ( | size_t | i | ) | const |
Returns the 'th field of a record or process.
Preserves any prefixes.
References UTAP::Constants::LABEL, and UTAP::Constants::REF.
bool type_t::is | ( | Constants::kind_t | kind | ) | const |
Returns true if the type has kind kind or if type is a prefix, RANGE or REF type and the getChild().is(kind) returns true.
References UTAP::Constants::DOUBLEINVGUARD, UTAP::Constants::LABEL, UTAP::Constants::PROCESSVAR, UTAP::Constants::RANGE, and UTAP::Constants::REF.
Referenced by UTAP::TimedAutomataSystem::accept(), UTAP::SystemBuilder::addSelectSymbolToFrame(), channelCapability(), UTAP::ExpressionBuilder::exprDot(), UTAP::ExpressionBuilder::exprForAllBegin(), isArray(), isBoolean(), isBranchpoint(), isChannel(), isClock(), isCost(), isCost(), isDiff(), isDouble(), isFunction(), isInstanceLine(), isInteger(), isInvariantWR(), isLocation(), isProcess(), isProcessID(), isProcessSet(), isRange(), isRecord(), isScalar(), isVoid(), UTAP::StatementBuilder::iterationBegin(), UTAP::XMLWriter::location(), UTAP::SystemBuilder::procStateCommit(), UTAP::SystemBuilder::procStateUrgent(), UTAP::StatementBuilder::structField(), UTAP::StatementBuilder::typeArrayOfType(), visit(), UTAP::TypeChecker::visitEdge(), UTAP::SignalFlow::visitExpression(), UTAP::CompileTimeComputableValues::visitInstance(), UTAP::TypeChecker::visitInstance(), UTAP::TypeChecker::visitIterationStatement(), UTAP::TypeChecker::visitProcess(), and UTAP::TypeChecker::visitProperty().
|
inline |
Shortcut for is(ARRAY).
References UTAP::Constants::ARRAY, and is().
Referenced by UTAP::TypeChecker::checkExpression(), UTAP::ExpressionBuilder::exprArray(), UTAP::TypeChecker::visitIODecl(), and UTAP::TypeChecker::visitSystemAfter().
|
inline |
Shortcut for is(BOOL).
References UTAP::Constants::BOOL, and is().
|
inline |
Shortcut for is(BRANCHPOINT).
References UTAP::Constants::BRANCHPOINT, and is().
Referenced by UTAP::SystemBuilder::procEdgeBegin().
|
inline |
Shortcut for is(CHANNEL).
References UTAP::Constants::CHANNEL, and is().
Referenced by channelCapability(), UTAP::TypeChecker::visitEdge(), UTAP::TypeChecker::visitIODecl(), UTAP::TypeChecker::visitMessage(), and UTAP::TypeChecker::visitSystemAfter().
|
inline |
Shortcut for is(CLOCK).
References UTAP::Constants::CLOCK, and is().
bool type_t::isConstant | ( | ) | const |
Returns true if and only if all elements of the type are constant.
References UTAP::Constants::CONSTANT, UTAP::Constants::FUNCTION, UTAP::Constants::INSTANCE, UTAP::Constants::LSCINSTANCE, UTAP::Constants::PROCESS, and UTAP::Constants::RECORD.
Referenced by UTAP::expression_t::collectPossibleWrites(), UTAP::CompileTimeComputableValues::visitInstance(), UTAP::TypeChecker::visitInstance(), and UTAP::CompileTimeComputableValues::visitVariable().
bool type_t::isConstraint | ( | ) | const |
Returns true if this is a constraint, guard, invariant, boolean or integer.
Shortcut for is(CONSTRAINT) || isGuard().
References UTAP::Constants::CONSTRAINT, and isGuard().
Referenced by isConstraint().
|
inline |
Shortcut for is(COST).
References UTAP::Constants::COST, and is().
|
inline |
|
inline |
Shortcut for is(DOUBLE).
References UTAP::Constants::DOUBLE, and is().
Referenced by initRec(), isBound(), isDouble(), UTAP::CompileTimeComputableValues::visitInstance(), and UTAP::TypeChecker::visitState().
bool type_t::isFormula | ( | ) | const |
Returns true if this is a formula, constraint, guard, invariant, boolean or integer.
Shortcut for is(FORMULA) || isConstraint().
References UTAP::Constants::FORMULA, and isConstraint().
Referenced by isFormula().
|
inline |
Shortcut for is(FUNCTION).
References UTAP::Constants::FUNCTION, and is().
Referenced by UTAP::expression_t::collectPossibleReads(), and UTAP::expression_t::collectPossibleWrites().
bool type_t::isGuard | ( | ) | const |
Returns true if this is a guard, invariant, boolean or integer.
Shortcut for is(GUARD) || isInvariant().
References UTAP::Constants::GUARD, and isInvariant().
Referenced by isGuard().
|
inline |
Shortcut for is(INSTANCELINE).
References UTAP::Constants::INSTANCELINE, and is().
Referenced by UTAP::SystemBuilder::procLscUpdate(), and UTAP::SystemBuilder::procMessage().
|
inline |
Shortcut for is(INT).
References UTAP::Constants::INT, and is().
Referenced by UTAP::SystemBuilder::addSelectSymbolToFrame(), UTAP::TypeChecker::checkExpression(), UTAP::ExpressionBuilder::exprForAllBegin(), isBound(), isInteger(), UTAP::StatementBuilder::typeArrayOfType(), and UTAP::TypeChecker::visitIterationStatement().
bool type_t::isIntegral | ( | ) | const |
Returns true if this is a boolean or integer.
Shortcut for isInt() || isBoolean().
References UTAP::Constants::BOOL, UTAP::Constants::INT, and UTAP::Constants::PROCESSVAR.
Referenced by UTAP::TypeChecker::checkExpression(), initRec(), isIntegral(), and UTAP::StatementBuilder::structField().
bool type_t::isInvariant | ( | ) | const |
Returns true if this is an invariant, boolean or integer.
Shortcut for isIntegral() || is(INVARIANT).
References UTAP::Constants::INVARIANT, and isIntegral().
Referenced by isInvariant().
|
inline |
Shortcut for is(LOCATION).
References is(), and UTAP::Constants::LOCATION.
Referenced by UTAP::template_t::addEdge(), UTAP::ExpressionBuilder::exprDot(), UTAP::SystemBuilder::procEdgeBegin(), UTAP::SystemBuilder::procStateCommit(), UTAP::SystemBuilder::procStateInit(), and UTAP::SystemBuilder::procStateUrgent().
bool type_t::isNonConstant | ( | ) | const |
Returns true if and only if all elements of the type are not constant.
References UTAP::Constants::CONSTANT, UTAP::Constants::FUNCTION, UTAP::Constants::INSTANCE, UTAP::Constants::LSCINSTANCE, UTAP::Constants::PROCESS, and UTAP::Constants::RECORD.
bool type_t::isPrefix | ( | ) | const |
Returns false for non-prefix types and true otherwise.
Non-prefix types are PRIMITIVE, ARRAY, RECORD, PROCESS, TEMPLATE, FUNCTION, INSTANCE, LSCINSTANCE, RANGE, REF, TYPEDEF.
References UTAP::Constants::ARRAY, UTAP::Constants::BOOL, UTAP::Constants::BRANCHPOINT, UTAP::Constants::CHANNEL, UTAP::Constants::CLOCK, UTAP::Constants::CONDITION, UTAP::Constants::CONSTRAINT, UTAP::Constants::COST, UTAP::Constants::DIFF, UTAP::Constants::DOUBLE, UTAP::Constants::FORMULA, UTAP::Constants::FRACTION, UTAP::Constants::FUNCTION, UTAP::Constants::GUARD, UTAP::Constants::INSTANCE, UTAP::Constants::INSTANCELINE, UTAP::Constants::INT, UTAP::Constants::INVARIANT, UTAP::Constants::INVARIANT_WR, UTAP::Constants::LABEL, UTAP::Constants::LOCATION, UTAP::Constants::LSCINSTANCE, UTAP::Constants::MESSAGE, UTAP::Constants::PROCESS, UTAP::Constants::PROCESSSET, UTAP::Constants::RANGE, UTAP::Constants::RATE, UTAP::Constants::RECORD, UTAP::Constants::REF, UTAP::Constants::SCALAR, UTAP::Constants::TIOGRAPH, UTAP::Constants::TYPEDEF, UTAP::Constants::UNKNOWN, UTAP::Constants::UPDATE, and UTAP::Constants::VOID_TYPE.
|
inline |
Shortcut for is(PROCESS).
References is(), and UTAP::Constants::PROCESS.
Referenced by UTAP::ExpressionBuilder::exprDot().
|
inline |
Shortcut for is(PROCESSSET).
References is(), and UTAP::Constants::PROCESSSET.
|
inline |
Shortcut for is(RANGE).
References is(), and UTAP::Constants::RANGE.
Referenced by UTAP::TypeChecker::visitProcess().
|
inline |
Shortcut for is(RECORD).
References is(), and UTAP::Constants::RECORD.
Referenced by UTAP::ExpressionBuilder::exprDot(), and UTAP::StatementBuilder::structField().
|
inline |
Shortcut for is(SCALAR).
References is(), and UTAP::Constants::SCALAR.
Referenced by UTAP::SystemBuilder::addSelectSymbolToFrame(), UTAP::TypeChecker::checkExpression(), UTAP::ExpressionBuilder::exprForAllBegin(), initRec(), UTAP::StatementBuilder::structField(), UTAP::StatementBuilder::typeArrayOfType(), UTAP::TypeChecker::visitIterationStatement(), and UTAP::TypeChecker::visitProcess().
|
inline |
Shortcut for is(VOID_TYPE).
References is(), and UTAP::Constants::VOID_TYPE.
Referenced by UTAP::StatementBuilder::declFuncEnd(), isVoid(), UTAP::StatementBuilder::returnStatement(), and UTAP::TypeChecker::visitFunction().
bool type_t::operator!= | ( | const type_t & | type | ) | const |
Inequality operator.
bool type_t::operator< | ( | const type_t & | type | ) | const |
Less-than operator.
bool type_t::operator== | ( | const type_t & | type | ) | const |
Equality operator.
const type_t type_t::operator[] | ( | uint32_t | i | ) | const |
Returns the i'th child.
type_t type_t::rename | ( | std::string | from, |
std::string | to | ||
) | const |
Replaces any LABEL labeled from occuring in the type with a LABEL to.
As always, a type is immutable, so a copy of the type will be created.
References UTAP::Constants::LABEL.
Referenced by UTAP::ExpressionBuilder::exprDot().
size_t type_t::size | ( | ) | const |
Returns the number of children.
Referenced by UTAP::TypeChecker::checkExpression(), UTAP::StatementBuilder::collectDependencies(), UTAP::expression_t::collectPossibleWrites(), createProcessSet(), findIndexOf(), initRec(), isAssignable(), mustInitialise(), UTAP::SystemBuilder::process(), validReturnType(), UTAP::TypeChecker::visitFunction(), and UTAP::TypeChecker::visitInstance().
type_t type_t::strip | ( | ) | const |
Removes any leading prefixes, RANGE, REF and LABEL types and returns the result.
References UTAP::Constants::LABEL, UTAP::Constants::RANGE, and UTAP::Constants::REF.
Referenced by initRec(), and stripArray().
type_t type_t::stripArray | ( | ) | const |
Removes any leading prefixes, RANGE, REF, LABEL and ARRAY types and returns the result.
References UTAP::Constants::ARRAY, get(), getKind(), and strip().
Referenced by UTAP::TimedAutomataSystem::accept(), UTAP::StatementBuilder::structField(), and visit().
type_t type_t::subst | ( | symbol_t | symbol, |
expression_t | expr | ||
) | const |
Substitutes any occurence of symbol in any expression in the type (expressions that occur as ranges either on array sizes, scalars or integers) with expr.
Referenced by UTAP::ExpressionBuilder::exprDot().
string type_t::toDeclarationString | ( | ) | const |
References UTAP::Constants::ARRAY, UTAP::Constants::BOOL, UTAP::Constants::BROADCAST, UTAP::Constants::CHANNEL, UTAP::Constants::CLOCK, UTAP::Constants::COMMITTED, UTAP::Constants::CONSTANT, UTAP::Constants::CONSTRAINT, UTAP::Constants::COST, UTAP::Constants::DIFF, UTAP::Constants::DOUBLE, UTAP::Constants::FORMULA, UTAP::Constants::FUNCTION, UTAP::Constants::GUARD, UTAP::Constants::INSTANCE, UTAP::Constants::INT, UTAP::Constants::INVARIANT, UTAP::Constants::LABEL, UTAP::Constants::PROCESS, UTAP::Constants::RANGE, UTAP::Constants::RATE, UTAP::Constants::RECORD, UTAP::Constants::REF, UTAP::Constants::SCALAR, UTAP::Constants::TYPEDEF, UTAP::Constants::UNKNOWN, UTAP::Constants::URGENT, and UTAP::Constants::VOID_TYPE.
string type_t::toString | ( | ) | const |
Generates string representation of the type.
References UTAP::Constants::ARRAY, UTAP::Constants::BOOL, UTAP::Constants::BRANCHPOINT, UTAP::Constants::BROADCAST, UTAP::Constants::CHANNEL, UTAP::Constants::CLOCK, UTAP::Constants::COMMITTED, UTAP::Constants::CONDITION, UTAP::Constants::CONSTANT, UTAP::Constants::CONSTRAINT, UTAP::Constants::COST, UTAP::Constants::DIFF, UTAP::Constants::DOUBLE, UTAP::Constants::FORMULA, UTAP::Constants::FRACTION, UTAP::Constants::FUNCTION, UTAP::Constants::GUARD, UTAP::Constants::INSTANCE, UTAP::Constants::INSTANCELINE, UTAP::Constants::INT, UTAP::Constants::INVARIANT, UTAP::Constants::LABEL, UTAP::Constants::LOCATION, UTAP::Constants::LSCINSTANCE, UTAP::Constants::MESSAGE, UTAP::Constants::PROCESS, UTAP::Constants::PROCESSVAR, UTAP::Constants::RANGE, UTAP::Constants::RATE, UTAP::Constants::RECORD, UTAP::Constants::REF, UTAP::Constants::SCALAR, UTAP::Constants::TIOGRAPH, UTAP::Constants::TYPEDEF, UTAP::Constants::UNKNOWN, UTAP::Constants::UPDATE, UTAP::Constants::URGENT, and UTAP::Constants::VOID_TYPE.
Referenced by operator<<(), UTAP::TypeChecker::visitCondition(), UTAP::TypeChecker::visitEdge(), and UTAP::TypeChecker::visitState().
bool type_t::unknown | ( | ) | const |
Returns true if this is null-type or of kind UNKNOWN.
References UTAP::Constants::UNKNOWN.
Referenced by UTAP::TypeChecker::checkExpression().