143 const type_t get(uint32_t)
const;
146 const std::string &
getLabel(uint32_t)
const;
190 std::pair<expression_t, expression_t>
getRange()
const;
274 bool isProbability()
const;
383 const std::vector<std::string> &,
388 const std::vector<type_t> &,
389 const std::vector<std::string> &,
size_t size() const
Returns the number of children.
Definition: type.cpp:119
const type_t & operator=(const type_t &)
Assignment operator.
Definition: type.cpp:85
bool isDiff() const
Shortcut for is(DIFF).
Definition: type.h:240
A reference to a symbol.
Definition: symbols.h:107
bool isDouble() const
Shortcut for is(DOUBLE).
Definition: type.h:249
bool isScalar() const
Shortcut for is(SCALAR).
Definition: type.h:231
bool isRange() const
Shortcut for is(RANGE).
Definition: type.h:198
static type_t createLscInstance(frame_t, position_t=position_t())
Creates a new lsc instance type.
Definition: type.cpp:532
bool isInteger() const
Shortcut for is(INT).
Definition: type.h:201
std::pair< expression_t, expression_t > getRange() const
Returns the range of a RANGE type.
Definition: type.cpp:304
bool operator!=(const type_t &) const
Inequality operator.
Definition: type.cpp:109
expression_t getExpression() const
Returns the expression associated with the type.
Definition: type.cpp:317
type_t getArraySize() const
Returns the size of an array (this is itself a type).
Definition: type.cpp:265
bool isArray() const
Shortcut for is(ARRAY).
Definition: type.h:228
bool isFormula() const
Returns true if this is a formula, constraint, guard, invariant, boolean or integer.
Definition: type.cpp:408
std::string toString() const
Generates string representation of the type.
Definition: type.cpp:585
position_t getPosition() const
Returns the position of the type in the input file.
Definition: type.cpp:376
type_t()
Default constructor.
Definition: type.cpp:48
static type_t createPrimitive(Constants::kind_t, position_t=position_t())
Create a primitive type.
Definition: type.cpp:565
bool isGuard() const
Returns true if this is a guard, invariant, boolean or integer.
Definition: type.cpp:391
bool isRecord() const
Shortcut for is(RECORD).
Definition: type.h:237
type_t createPrefix(Constants::kind_t kind, position_t=position_t()) const
Creates a new type by adding a prefix to it.
Definition: type.cpp:570
bool isCost() const
Shortcut for is(COST).
Definition: type.h:246
kind_t
Definition: common.h:37
static string symbol(const char *str)
Extracts the alpha-numerical symbol used for variable/type identifiers.
Definition: xmlreader.cpp:107
std::string getRecordLabel(size_t i) const
Returns the label of the 'th field of a record.
Definition: type.cpp:291
A reference to a frame.
Definition: symbols.h:183
bool isVoid() const
Shortcut for is(VOID_TYPE).
Definition: type.h:243
bool isBranchpoint() const
Shortcut for is(BRANCHPOINT).
Definition: type.h:222
type_t createLabel(std::string, position_t=position_t()) const
Creates a LABEL.
Definition: type.cpp:577
bool isInvariant() const
Returns true if this is an invariant, boolean or integer.
Definition: type.cpp:386
static type_t createProcessSet(type_t instance, position_t=position_t())
Creates a new processset type.
Definition: type.cpp:554
bool isPrefix() const
Returns false for non-prefix types and true otherwise.
Definition: type.cpp:163
A reference to an expression.
Definition: expression.h:68
bool isChannel() const
Shortcut for is(CHANNEL).
Definition: type.h:225
size_t getRecordSize() const
Returns the number of fields of a record.
Definition: type.cpp:278
bool operator<(const type_t &) const
Less-than operator.
Definition: type.cpp:114
static type_t createRecord(const std::vector< type_t > &, const std::vector< std::string > &, position_t=position_t())
Creates a new record type.
Definition: type.cpp:475
bool operator==(const type_t &) const
Equality operator.
Definition: type.cpp:104
Definition: position.h:42
std::ostream & operator<<(std::ostream &o, UTAP::type_t t)
Definition: type.cpp:962
static type_t createInstance(frame_t, position_t=position_t())
Creates a new instance type.
Definition: type.cpp:521
bool isBoolean() const
Shortcut for is(BOOL).
Definition: type.h:204
const type_t operator[](uint32_t) const
Returns the i'th child.
Definition: type.cpp:125
type_t strip() const
Removes any leading prefixes, RANGE, REF and LABEL types and returns the result.
Definition: type.cpp:323
type_t getSub() const
Returns the element type of an array.
Definition: type.cpp:231
std::string toDeclarationString() const
Definition: type.cpp:772
A reference to a type.
Definition: type.h:92
static type_t createTypeDef(std::string, type_t, position_t=position_t())
Creates a new type definition.
Definition: type.cpp:513
static type_t createArray(type_t sub, type_t size, position_t=position_t())
Creates an array type.
Definition: type.cpp:505
const std::string & getLabel(uint32_t) const
Returns the i'th label.
Definition: type.cpp:137
bool isIntegral() const
Returns true if this is a boolean or integer.
Definition: type.cpp:381
bool isNonConstant() const
Returns true if and only if all elements of the type are not constant.
Definition: type.cpp:438
bool isLocation() const
Shortcut for is(LOCATION).
Definition: type.h:216
type_t createPosition(position_t=position_t()) const
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.
Definition: type.cpp:489
bool isClock() const
Shortcut for is(CLOCK).
Definition: type.h:234
static type_t createProcess(frame_t, position_t=position_t())
Creates a new process type.
Definition: type.cpp:543
bool isConstraint() const
Returns true if this is a constraint, guard, invariant, boolean or integer.
Definition: type.cpp:403
bool isInstanceLine() const
Shortcut for is(INSTANCELINE).
Definition: type.h:219
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 e...
Definition: type.cpp:361
~type_t()
Destructor.
Definition: type.cpp:72
Constants::kind_t getKind() const
Returns the kind of type object.
Definition: type.cpp:158
bool unknown() const
Returns true if this is null-type or of kind UNKNOWN.
Definition: type.cpp:209
type_t rename(std::string from, std::string to) const
Replaces any LABEL labeled from occuring in the type with a LABEL to.
Definition: type.cpp:345
type_t stripArray() const
Removes any leading prefixes, RANGE, REF, LABEL and ARRAY types and returns the result.
Definition: type.cpp:335
bool isFunction() const
Shortcut for is(FUNCTION).
Definition: type.h:207
bool isProcessSet() const
Shortcut for is(PROCESSSET).
Definition: type.h:213
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()...
Definition: type.cpp:214
bool isProcess() const
Shortcut for is(PROCESS).
Definition: type.h:210
bool isConstant() const
Returns true if and only if all elements of the type are constant.
Definition: type.cpp:413
static type_t createRange(type_t, expression_t, expression_t, position_t=position_t())
Definition: type.cpp:463
int32_t findIndexOf(std::string) const
Returns the index of the record or process field with the given label.
Definition: type.cpp:143