#include <symbols.h>
Public Member Functions | |
type_t () | |
Default constructor. | |
type_t (const type_t &) | |
Copy constructor. | |
~type_t () | |
Destructor. | |
const type_t & | operator= (const type_t &) |
Assignment operator. | |
bool | operator== (const type_t &) const |
Equality operator. | |
bool | operator!= (const type_t &) const |
Inequality operator. | |
type_t | getBase () const |
Returns the base type of this frame. | |
frame_t | getRecordFields () const |
Returns the fields of a record type. | |
frame_t | getParameters () const |
Returns the parameters of a function or template type. | |
frame_t | getFrame () const |
Polymorphic version of getRecordFields() and getParameters(). | |
type_t | getSub () |
Returns the sub-type of this type. | |
type_t | getReturnType () |
Returns the return-type of a function. | |
bool | hasPrefix (prefix::prefix_t) const |
Returns the true if this type has the given prefix. | |
type_t | setPrefix (bool set, prefix::prefix_t) const |
Sets or clears a prefix. | |
type_t | getArraySize () const |
Returns the size of an array. | |
std::pair< expression_t, expression_t > | getRange () const |
Returns the range of an integer type. | |
std::string | toString () |
Print type to the given output stream. | |
bool | isInteger () const |
Returns true if this is an integer. | |
bool | isValue () const |
Returns true if this is a boolean or integer. | |
bool | isScalar () const |
Returns true if this is a scalar or integer. | |
bool | isClock () const |
Returns true if this is a clock. | |
bool | isRecord () const |
Returns true if this is a record. | |
bool | isDiff () const |
Returns true if this is a clock difference. | |
bool | isVoid () const |
Returns true if this is a void. | |
bool | isInvariant () const |
bool | isGuard () const |
bool | isConstraint () const |
bool | isArray () const |
Static Public Member Functions | |
static type_t | createInteger (expression_t, expression_t) |
Creates and returns a new integer type with the given range. | |
static type_t | createScalarSet (expression_t, expression_t) |
Create and returns a new scalar set type of the given size. | |
static type_t | createRecord (frame_t) |
Creates and returns a new record type. | |
static type_t | createFunction (frame_t, type_t) |
Creates and returns a new function type. | |
static type_t | createArray (type_t, type_t) |
Creates and returns a new array type. | |
static type_t | createTypeName (type_t) |
Creates and returns a new named type. | |
static type_t | createTemplate (frame_t) |
Creates and returns a new template type. | |
static type_t | createProcess (frame_t) |
Creates and returns a new process type. | |
static type_t | createBase () |
Create a new primitive type. | |
Static Public Attributes | |
static type_t | UNKNOWN |
static type_t | VOID_TYPE |
static type_t | CLOCK |
static type_t | INT |
static type_t | BOOL |
static type_t | SCALAR |
static type_t | LOCATION |
static type_t | CHANNEL |
static type_t | TEMPLATE |
static type_t | INSTANCE |
static type_t | FUNCTION |
static type_t | ARRAY |
static type_t | RECORD |
static type_t | PROCESS |
static type_t | NTYPE |
static type_t | INVARIANT |
static type_t | INVARIANT_WR |
static type_t | GUARD |
static type_t | DIFF |
static type_t | CONSTRAINT |
static type_t | COST |
static type_t | RATE |
Types are represented as type objects. Type objects cannot be access directly. You need to use an instance of type_t to access a type object. Internally, type objects are reference counted and do not need to be deallocated manually.
Types are either primitive such as clocks or channels, or contructed types such as structs and array. Primitive types are allocated statically and can be accessed via the static member fields of the type_t class. Constructed types are created using one of the static factory methods in the type_t class.
All types have a base type. For primitive types, the base type is the type itself. For constructed types, the base type indicates the type constructor (i.e. if this is an array, record, etc.). In addition, all types can have a number of prefixes, such as URGENT, COMMITTED, CONSTANT, BROADCAST, and REFERENCE.
Constructed types can have other fields: Integers have a range, arrays have a size and a sub-type, records have fields, functions have parameters and a return type (the sub-type), templates have parameters, and named types have a sub-type.
|
Default constructor.
|
|
Copy constructor.
|
|
Destructor.
|
|
Creates and returns a new array type.
|
|
Create a new primitive type.
|
|
Creates and returns a new function type.
|
|
Creates and returns a new integer type with the given range.
|
|
Creates and returns a new process type.
|
|
Creates and returns a new record type.
|
|
Create and returns a new scalar set type of the given size.
|
|
Creates and returns a new template type.
|
|
Creates and returns a new named type.
|
|
Returns the size of an array.
|
|
Returns the base type of this frame.
|
|
Polymorphic version of getRecordFields() and getParameters().
|
|
Returns the parameters of a function or template type.
|
|
Returns the range of an integer type.
|
|
Returns the fields of a record type.
|
|
Returns the return-type of a function.
|
|
Returns the sub-type of this type.
|
|
Returns the true if this type has the given prefix.
|
|
|
|
Returns true if this is a clock.
|
|
|
|
Returns true if this is a clock difference.
|
|
|
|
Returns true if this is an integer.
|
|
|
|
Returns true if this is a record.
|
|
Returns true if this is a scalar or integer.
|
|
Returns true if this is a boolean or integer.
|
|
Returns true if this is a void.
|
|
Inequality operator.
|
|
Assignment operator.
|
|
Equality operator.
|
|
Sets or clears a prefix.
|
|
Print type to the given output stream.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|