libutap  0.93
Uppaal Timed Automata Parser
UTAP::type_t Class Reference

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_toperator= (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 (const std::string &) const
 Returns the index of the record or process field with the given label. More...
 
std::pair< expression_t, expression_tgetRange () 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 (const std::string &from, const 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 (const 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 (const 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...
 

Detailed Description

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:

  • ARRAY; the first child is the element type, the second type is the array size (another type; either integer or scalarset).
  • RECORD; the children are the fields of the record.
  • FUNCTION; the first child is the return type. Remaining children are parameters.
  • INSTANCE; the parameters of an instance are the children.
  • PROCESS; the local variables of a process are the children.
  • PROCESSSET; process with unbound parameters. The unbound parameters are the children.
  • TYPEDEF; a type definition - it has one child.
  • RANGE; ranges have three children: the first is the type on which a range has been applied, the second is the lower bound and the third is the upper bound (the second and third children are really expression objects wrapped in a dummy type).
  • REF; a reference - the first child is the type from which the reference type is formed.

Definition at line 93 of file type.h.

Constructor & Destructor Documentation

◆ type_t() [1/2]

UTAP::type_t::type_t ( )
inline

Default constructor.

This creates a null-type.

Definition at line 106 of file type.h.

◆ type_t() [2/2]

type_t::type_t ( const type_t type)

Copy constructor.

Definition at line 55 of file type.cpp.

◆ ~type_t()

UTAP::type_t::~type_t ( )
inline

Member Function Documentation

◆ createArray()

type_t type_t::createArray ( type_t  sub,
type_t  size,
position_t  pos = position_t() 
)
static

Creates an array type.

Definition at line 467 of file type.cpp.

References UTAP::Constants::ARRAY.

Referenced by UTAP::ExpressionBuilder::exprCallEnd(), isDouble(), and UTAP::StatementBuilder::typeArrayOfType().

Here is the caller graph for this function:

◆ createFunction()

type_t type_t::createFunction ( type_t  ret,
const std::vector< type_t > &  parameters,
const std::vector< std::string > &  labels,
position_t  pos = position_t() 
)
static

Creates a new function type.

Definition at line 451 of file type.cpp.

References UTAP::Constants::FUNCTION.

Referenced by UTAP::StatementBuilder::declFuncBegin(), and isDouble().

Here is the caller graph for this function:

◆ createInstance()

type_t type_t::createInstance ( frame_t  parameters,
position_t  pos = position_t() 
)
static

Creates a new instance type.

Definition at line 483 of file type.cpp.

References UTAP::frame_t::getSize(), and UTAP::Constants::INSTANCE.

Referenced by UTAP::TimedAutomataSystem::addDynamicTemplate(), UTAP::TimedAutomataSystem::addInstance(), UTAP::TimedAutomataSystem::addTemplate(), and isDouble().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createLabel()

type_t type_t::createLabel ( const std::string &  ,
position_t  = position_t() 
) const

Creates a LABEL.

Definition at line 539 of file type.cpp.

References UTAP::Constants::LABEL.

Referenced by isDouble(), UTAP::ExpressionBuilder::typeName(), and UTAP::ExpressionBuilder::typeScalar().

Here is the caller graph for this function:

◆ createLscInstance()

type_t type_t::createLscInstance ( frame_t  parameters,
position_t  pos = position_t() 
)
static

Creates a new lsc instance type.

Definition at line 494 of file type.cpp.

References UTAP::frame_t::getSize(), and UTAP::Constants::LSCINSTANCE.

Referenced by UTAP::TimedAutomataSystem::addLscInstance(), UTAP::TimedAutomataSystem::addTemplate(), and isDouble().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createPosition()

type_t UTAP::type_t::createPosition ( position_t  = position_t()) const

Referenced by isDouble().

Here is the caller graph for this function:

◆ createPrefix()

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.

Definition at line 532 of file type.cpp.

Referenced by UTAP::SystemBuilder::addSelectSymbolToFrame(), UTAP::ExpressionBuilder::applyPrefix(), UTAP::StatementBuilder::declParameter(), UTAP::ExpressionBuilder::exprForAllBegin(), isDouble(), UTAP::StatementBuilder::iterationBegin(), UTAP::SystemBuilder::procStateCommit(), and UTAP::SystemBuilder::procStateUrgent().

Here is the caller graph for this function:

◆ createPrimitive()

type_t type_t::createPrimitive ( Constants::kind_t  kind,
position_t  pos = position_t() 
)
static

◆ createProcess()

type_t type_t::createProcess ( frame_t  frame,
position_t  pos = position_t() 
)
static

Creates a new process type.

Definition at line 505 of file type.cpp.

References UTAP::frame_t::getSize(), and UTAP::Constants::PROCESS.

Referenced by UTAP::TimedAutomataSystem::addProcess(), UTAP::ExpressionBuilder::exprCallEnd(), and isDouble().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createProcessSet()

type_t type_t::createProcessSet ( type_t  instance,
position_t  pos = position_t() 
)
static

Creates a new processset type.

Definition at line 516 of file type.cpp.

References getLabel(), UTAP::Constants::PROCESSSET, and size().

Referenced by UTAP::TimedAutomataSystem::addProcess(), and isDouble().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createRange()

type_t type_t::createRange ( type_t  type,
expression_t  lower,
expression_t  upper,
position_t  pos = position_t() 
)
static

Definition at line 425 of file type.cpp.

References UTAP::Constants::RANGE, and UTAP::Constants::UNKNOWN.

Referenced by isDouble(), UTAP::ExpressionBuilder::typeBoundedInt(), UTAP::ExpressionBuilder::typeInt(), and UTAP::ExpressionBuilder::typeScalar().

Here is the caller graph for this function:

◆ createRecord()

type_t type_t::createRecord ( const std::vector< type_t > &  ,
const std::vector< std::string > &  ,
position_t  = position_t() 
)
static

Creates a new record type.

Definition at line 437 of file type.cpp.

References UTAP::Constants::RECORD.

Referenced by UTAP::StatementBuilder::declInitialiserList(), isDouble(), and UTAP::StatementBuilder::typeStruct().

Here is the caller graph for this function:

◆ createTypeDef()

type_t type_t::createTypeDef ( const std::string &  label,
type_t  type,
position_t  pos = position_t() 
)
static

Creates a new type definition.

Definition at line 475 of file type.cpp.

References UTAP::Constants::TYPEDEF.

Referenced by UTAP::StatementBuilder::declTypeDef(), and isDouble().

Here is the caller graph for this function:

◆ findIndexOf()

int32_t type_t::findIndexOf ( const 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.

Precondition
isRecord() or isProcess().

Definition at line 105 of file type.cpp.

References getLabel(), and size().

Referenced by UTAP::ExpressionBuilder::exprDot(), UTAP::ExpressionBuilder::exprScenario(), isSameScalarType(), and ~type_t().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get()

const type_t type_t::get ( uint32_t  i) const

Returns the i'th child.

Definition at line 93 of file type.cpp.

Referenced by stripArray().

Here is the caller graph for this function:

◆ getArraySize()

type_t type_t::getArraySize ( ) const

Returns the size of an array (this is itself a type).

Precondition
isArray().

Definition at line 227 of file type.cpp.

References UTAP::Constants::ARRAY, UTAP::Constants::LABEL, and UTAP::Constants::REF.

Referenced by UTAP::TypeChecker::checkExpression(), initRec(), isSameScalarType(), UTAP::TypeChecker::TypeChecker(), and ~type_t().

Here is the caller graph for this function:

◆ getExpression()

expression_t type_t::getExpression ( ) const

Returns the expression associated with the type.

Definition at line 279 of file type.cpp.

Referenced by ~type_t().

Here is the caller graph for this function:

◆ getKind()

◆ getLabel()

const std::string & type_t::getLabel ( uint32_t  i) const

Returns the i'th label.

Definition at line 99 of file type.cpp.

Referenced by createProcessSet(), UTAP::StatementBuilder::declInitialiserList(), findIndexOf(), isSameScalarType(), and ~type_t().

Here is the caller graph for this function:

◆ getPosition()

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.

Definition at line 338 of file type.cpp.

Referenced by ~type_t().

Here is the caller graph for this function:

◆ getRange()

std::pair< expression_t, expression_t > type_t::getRange ( ) const

Returns the range of a RANGE type.

Precondition
isRange().

Definition at line 266 of file type.cpp.

References UTAP::Constants::RANGE.

Referenced by UTAP::StatementBuilder::collectDependencies(), isSameScalarType(), UTAP::TypeChecker::TypeChecker(), and ~type_t().

Here is the caller graph for this function:

◆ getRecordLabel()

string type_t::getRecordLabel ( size_t  i) const

Returns the label of the 'th field of a record.

Precondition
isRecord().

Definition at line 253 of file type.cpp.

References UTAP::Constants::LABEL, UTAP::Constants::PROCESS, UTAP::Constants::RECORD, and UTAP::Constants::REF.

Referenced by getBuiltinFunName(), isSameScalarType(), and ~type_t().

Here is the caller graph for this function:

◆ getRecordSize()

size_t type_t::getRecordSize ( ) const

Returns the number of fields of a record.

Precondition
isRecord().

Definition at line 240 of file type.cpp.

References UTAP::Constants::LABEL, UTAP::Constants::RECORD, and UTAP::Constants::REF.

Referenced by isSameScalarType(), and ~type_t().

Here is the caller graph for this function:

◆ getSub() [1/2]

type_t type_t::getSub ( ) const

◆ getSub() [2/2]

type_t type_t::getSub ( size_t  i) const

Returns the 'th field of a record or process.

Preserves any prefixes.

Precondition
isRecord() or isProcess().

Definition at line 210 of file type.cpp.

References UTAP::Constants::LABEL, and UTAP::Constants::REF.

◆ is()

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.

Definition at line 176 of file type.cpp.

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(), append(), channelCapability(), UTAP::TypeChecker::checkDynamicExpressions(), UTAP::CompileTimeComputableValues::contains(), 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(), isSameScalarType(), isScalar(), isVoid(), UTAP::StatementBuilder::iterationBegin(), UTAP::XMLWriter::location(), UTAP::SystemBuilder::procStateCommit(), UTAP::SystemBuilder::procStateUrgent(), UTAP::StatementBuilder::structField(), UTAP::StatementBuilder::typeArrayOfType(), UTAP::TypeChecker::TypeChecker(), visit(), UTAP::TypeChecker::visitEdge(), UTAP::SignalFlow::visitExpression(), UTAP::CompileTimeComputableValues::visitInstance(), UTAP::TypeChecker::visitInstance(), UTAP::TypeChecker::visitIterationStatement(), UTAP::TypeChecker::visitProcess(), and UTAP::TypeChecker::visitProperty().

Here is the caller graph for this function:

◆ isArray()

bool UTAP::type_t::isArray ( ) const
inline

Shortcut for is(ARRAY).

Definition at line 229 of file type.h.

References UTAP::Constants::ARRAY, and is().

Referenced by UTAP::TypeChecker::checkExpression(), UTAP::ExpressionBuilder::exprArray(), isSameScalarType(), UTAP::TypeChecker::TypeChecker(), UTAP::TypeChecker::visitIODecl(), and UTAP::TypeChecker::visitSystemAfter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isBoolean()

bool UTAP::type_t::isBoolean ( ) const
inline

Shortcut for is(BOOL).

Definition at line 205 of file type.h.

References UTAP::Constants::BOOL, and is().

Referenced by isSameScalarType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isBranchpoint()

bool UTAP::type_t::isBranchpoint ( ) const
inline

Shortcut for is(BRANCHPOINT).

Definition at line 223 of file type.h.

References UTAP::Constants::BRANCHPOINT, and is().

Referenced by UTAP::SystemBuilder::procEdgeBegin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isChannel()

bool UTAP::type_t::isChannel ( ) const
inline

Shortcut for is(CHANNEL).

Definition at line 226 of file type.h.

References UTAP::Constants::CHANNEL, and is().

Referenced by channelCapability(), isSameScalarType(), UTAP::TypeChecker::TypeChecker(), UTAP::TypeChecker::visitEdge(), UTAP::TypeChecker::visitIODecl(), UTAP::TypeChecker::visitMessage(), and UTAP::TypeChecker::visitSystemAfter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isClock()

bool UTAP::type_t::isClock ( ) const
inline

Shortcut for is(CLOCK).

Definition at line 235 of file type.h.

References UTAP::Constants::CLOCK, and is().

Referenced by initRec(), isClock(), isSameScalarType(), and UTAP::TypeChecker::TypeChecker().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isConstant()

◆ isConstraint()

bool type_t::isConstraint ( ) const

Returns true if this is a constraint, guard, invariant, boolean or integer.

Shortcut for is(CONSTRAINT) || isGuard().

Definition at line 365 of file type.cpp.

References UTAP::Constants::CONSTRAINT, and isGuard().

Referenced by isConstraint(), and isDouble().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isCost()

bool UTAP::type_t::isCost ( ) const
inline

Shortcut for is(COST).

Definition at line 247 of file type.h.

References UTAP::Constants::COST, and is().

Here is the call graph for this function:

◆ isDiff()

bool UTAP::type_t::isDiff ( ) const
inline

Shortcut for is(DIFF).

Definition at line 241 of file type.h.

References UTAP::Constants::DIFF, and is().

Referenced by isDiff().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isDouble()

◆ isFormula()

bool type_t::isFormula ( ) const

Returns true if this is a formula, constraint, guard, invariant, boolean or integer.

Shortcut for is(FORMULA) || isConstraint().

Definition at line 370 of file type.cpp.

References UTAP::Constants::FORMULA, and isConstraint().

Referenced by isDouble(), and isFormula().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isFunction()

bool UTAP::type_t::isFunction ( ) const
inline

Shortcut for is(FUNCTION).

Definition at line 208 of file type.h.

References UTAP::Constants::FUNCTION, and is().

Referenced by UTAP::expression_t::collectPossibleReads(), and UTAP::expression_t::collectPossibleWrites().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isGuard()

bool type_t::isGuard ( ) const

Returns true if this is a guard, invariant, boolean or integer.

Shortcut for is(GUARD) || isInvariant().

Definition at line 353 of file type.cpp.

References UTAP::Constants::GUARD, isInteger(), isInvariant(), and UTAP::Constants::PROBABILITY.

Referenced by isDouble(), and isGuard().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isInstanceLine()

bool UTAP::type_t::isInstanceLine ( ) const
inline

Shortcut for is(INSTANCELINE).

Definition at line 220 of file type.h.

References UTAP::Constants::INSTANCELINE, and is().

Referenced by UTAP::SystemBuilder::procLscUpdate(), and UTAP::SystemBuilder::procMessage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isInteger()

bool UTAP::type_t::isInteger ( ) const
inline

◆ isIntegral()

bool type_t::isIntegral ( ) const

Returns true if this is a boolean or integer.

Shortcut for isInt() || isBoolean().

Definition at line 343 of file type.cpp.

References UTAP::Constants::BOOL, UTAP::Constants::INT, and UTAP::Constants::PROCESSVAR.

Referenced by UTAP::TypeChecker::checkExpression(), initRec(), isDouble(), isIntegral(), isSameScalarType(), UTAP::StatementBuilder::structField(), and UTAP::TypeChecker::TypeChecker().

Here is the caller graph for this function:

◆ isInvariant()

bool type_t::isInvariant ( ) const

Returns true if this is an invariant, boolean or integer.

Shortcut for isIntegral() || is(INVARIANT).

Definition at line 348 of file type.cpp.

References UTAP::Constants::INVARIANT, and isIntegral().

Referenced by isDouble(), and isInvariant().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isLocation()

bool UTAP::type_t::isLocation ( ) const
inline

Shortcut for is(LOCATION).

Definition at line 217 of file type.h.

References is(), and UTAP::Constants::LOCATION.

Referenced by UTAP::template_t::addEdge(), UTAP::ExpressionBuilder::exprDot(), UTAP::SystemBuilder::procEdgeBegin(), UTAP::SystemBuilder::procStateCommit(), UTAP::SystemBuilder::procStateInit(), UTAP::SystemBuilder::procStateUrgent(), and UTAP::TypeChecker::TypeChecker().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isNonConstant()

bool type_t::isNonConstant ( ) const

Returns true if and only if all elements of the type are not constant.

Definition at line 400 of file type.cpp.

References UTAP::Constants::CONSTANT, UTAP::Constants::FUNCTION, UTAP::Constants::INSTANCE, UTAP::Constants::LSCINSTANCE, UTAP::Constants::PROCESS, and UTAP::Constants::RECORD.

Referenced by UTAP::TypeChecker::checkExpression(), and isDouble().

Here is the caller graph for this function:

◆ isPrefix()

◆ isProcess()

bool UTAP::type_t::isProcess ( ) const
inline

Shortcut for is(PROCESS).

Definition at line 211 of file type.h.

References is(), and UTAP::Constants::PROCESS.

Referenced by UTAP::ExpressionBuilder::exprDot(), and getBuiltinFunName().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isProcessSet()

bool UTAP::type_t::isProcessSet ( ) const
inline

Shortcut for is(PROCESSSET).

Definition at line 214 of file type.h.

References is(), and UTAP::Constants::PROCESSSET.

Here is the call graph for this function:

◆ isRange()

bool UTAP::type_t::isRange ( ) const
inline

Shortcut for is(RANGE).

Definition at line 199 of file type.h.

References is(), and UTAP::Constants::RANGE.

Referenced by UTAP::TypeChecker::visitProcess().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isRecord()

bool UTAP::type_t::isRecord ( ) const
inline

Shortcut for is(RECORD).

Definition at line 238 of file type.h.

References is(), and UTAP::Constants::RECORD.

Referenced by UTAP::ExpressionBuilder::exprDot(), getBuiltinFunName(), isSameScalarType(), UTAP::StatementBuilder::structField(), and UTAP::TypeChecker::TypeChecker().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isScalar()

◆ isVoid()

bool UTAP::type_t::isVoid ( ) const
inline

Shortcut for is(VOID_TYPE).

Definition at line 244 of file type.h.

References is(), and UTAP::Constants::VOID_TYPE.

Referenced by UTAP::StatementBuilder::declFuncEnd(), isVoid(), UTAP::StatementBuilder::returnStatement(), and UTAP::TypeChecker::visitFunction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!=()

bool type_t::operator!= ( const type_t type) const

Inequality operator.

Definition at line 71 of file type.cpp.

Referenced by ~type_t().

Here is the caller graph for this function:

◆ operator<()

bool type_t::operator< ( const type_t type) const

Less-than operator.

Definition at line 76 of file type.cpp.

Referenced by ~type_t().

Here is the caller graph for this function:

◆ operator=()

const type_t & type_t::operator= ( const type_t type)

Assignment operator.

Definition at line 60 of file type.cpp.

Referenced by ~type_t().

Here is the caller graph for this function:

◆ operator==()

bool type_t::operator== ( const type_t type) const

Equality operator.

Definition at line 66 of file type.cpp.

Referenced by ~type_t().

Here is the caller graph for this function:

◆ operator[]()

const type_t type_t::operator[] ( uint32_t  i) const

Returns the i'th child.

Definition at line 87 of file type.cpp.

Referenced by ~type_t().

Here is the caller graph for this function:

◆ rename()

type_t type_t::rename ( const std::string &  from,
const 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.

Definition at line 307 of file type.cpp.

References UTAP::Constants::LABEL.

Referenced by UTAP::ExpressionBuilder::exprDot(), and isDouble().

Here is the caller graph for this function:

◆ size()

◆ strip()

type_t type_t::strip ( ) const

Removes any leading prefixes, RANGE, REF and LABEL types and returns the result.

Definition at line 285 of file type.cpp.

References UTAP::Constants::LABEL, UTAP::Constants::RANGE, and UTAP::Constants::REF.

Referenced by initRec(), isDouble(), and stripArray().

Here is the caller graph for this function:

◆ stripArray()

type_t type_t::stripArray ( ) const

Removes any leading prefixes, RANGE, REF, LABEL and ARRAY types and returns the result.

Definition at line 297 of file type.cpp.

References UTAP::Constants::ARRAY, get(), getKind(), and strip().

Referenced by UTAP::TimedAutomataSystem::accept(), isDouble(), UTAP::StatementBuilder::structField(), UTAP::TypeChecker::TypeChecker(), and visit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ subst()

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.

Definition at line 323 of file type.cpp.

Referenced by UTAP::ExpressionBuilder::exprDot(), and isDouble().

Here is the caller graph for this function:

◆ toDeclarationString()

◆ toString()

◆ unknown()

bool type_t::unknown ( ) const

Returns true if this is null-type or of kind UNKNOWN.

Definition at line 171 of file type.cpp.

References UTAP::Constants::UNKNOWN.

Referenced by UTAP::TypeChecker::checkExpression(), and isDouble().

Here is the caller graph for this function:

The documentation for this class was generated from the following files: