#include <symbols.hh>
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. | |
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. | |
expression_t | getArraySize () const |
Returns the size of an array. | |
std::pair< expression_t, expression_t > | getRange () const |
Returns the range of an integer type. | |
Static Public Member Functions | |
type_t | createInteger (expression_t, expression_t) |
Creates and returns a new integer type with the given range. | |
type_t | createRecord (frame_t) |
Creates and returns a new record type. | |
type_t | createFunction (frame_t, type_t) |
Creates and returns a new function type. | |
type_t | createArray (expression_t, type_t) |
Creates and returns a new array type. | |
type_t | createTypeName (type_t) |
Creates and returns a new named type. | |
type_t | createTemplate (frame_t) |
Creates and returns a new template type. | |
type_t | createProcess (frame_t) |
Creates and returns a new process type. | |
type_t | createBase () |
Create a new primitive type. | |
Static Public Attributes | |
type_t | UNKNOWN = type_t::createBase() |
type_t | VOID_TYPE = type_t::createBase() |
type_t | CLOCK = type_t::createBase() |
type_t | INT = type_t::createBase() |
type_t | LOCATION = type_t::createBase() |
type_t | CHANNEL = type_t::createBase() |
type_t | TEMPLATE = type_t::createBase() |
type_t | INSTANCE = type_t::createBase() |
type_t | FUNCTION = type_t::createBase() |
type_t | ARRAY = type_t::createBase() |
type_t | RECORD = type_t::createBase() |
type_t | PROCESS = type_t::createBase() |
type_t | NTYPE = type_t::createBase() |
type_t | INVARIANT = type_t::createBase() |
type_t | GUARD = type_t::createBase() |
type_t | DIFF = type_t::createBase() |
type_t | CONSTRAINT = type_t::createBase() |
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. This creates the equivalent of a NULL pointer. |
|
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.
|
|
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(). The frame returned must not be modified (since type objects are supposed to be immutable). |
|
Returns the parameters of a function or template type. See also getFrame(). |
|
Returns the range of an integer type.
|
|
Returns the fields of a record type. See also getFrame(). |
|
Returns the sub-type of this type. For functions, this is the return value. For arrays, this is type type of the array elements. |
|
Returns the true if this type has the given prefix.
|
|
Inequality operator.
|
|
Assignment operator.
|
|
Equality operator.
|
|
Sets or clears a prefix. The type itself is not altered, but a new type corresponding to the change is returned. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|