98 std::shared_ptr<type_data> data;
144 const type_t get(uint32_t)
const;
147 const std::string &
getLabel(uint32_t)
const;
191 std::pair<expression_t, expression_t>
getRange()
const;
275 bool isProbability()
const;
340 type_t rename(
const std::string& from,
const std::string& to)
const;
385 const std::vector<std::string> &,
390 const std::vector<type_t> &,
391 const std::vector<std::string> &,
bool isPrefix() const
Returns false for non-prefix types and true otherwise.
bool isRange() const
Shortcut for is(RANGE).
bool isClock() const
Shortcut for is(CLOCK).
bool isProcessSet() const
Shortcut for is(PROCESSSET).
const type_t & operator=(const type_t &)
Assignment operator.
bool unknown() const
Returns true if this is null-type or of kind UNKNOWN.
bool isVoid() const
Shortcut for is(VOID_TYPE).
bool isIntegral() const
Returns true if this is a boolean or integer.
bool isInvariant() const
Returns true if this is an invariant, boolean or integer.
bool isInteger() const
Shortcut for is(INT).
bool operator==(const type_t &) const
Equality operator.
static type_t createRange(type_t, expression_t, expression_t, position_t=position_t())
static type_t createInstance(frame_t, position_t=position_t())
Creates a new instance type.
type_t createPrefix(Constants::kind_t kind, position_t=position_t()) const
Creates a new type by adding a prefix to it.
std::string toDeclarationString() const
static type_t createPrimitive(Constants::kind_t, position_t=position_t())
Create a primitive type.
static type_t createLscInstance(frame_t, position_t=position_t())
Creates a new lsc instance type.
bool isArray() const
Shortcut for is(ARRAY).
std::string toString() const
Generates string representation of the type.
std::pair< expression_t, expression_t > getRange() const
Returns the range of a RANGE type.
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.
position_t getPosition() const
Returns the position of the type in the input file.
const std::string & getLabel(uint32_t) const
Returns the i'th label.
std::ostream & operator<<(std::ostream &os, const SignalFlow::strs_t &s)
bool operator<(const type_t &) const
Less-than operator.
bool isFormula() const
Returns true if this is a formula, constraint, guard, invariant, boolean or integer.
type_t strip() const
Removes any leading prefixes, RANGE, REF and LABEL types and returns the result.
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.
bool isConstant() const
Returns true if and only if all elements of the type are constant.
bool isConstraint() const
Returns true if this is a constraint, guard, invariant, boolean or integer.
bool isCost() const
Shortcut for is(COST).
type_t stripArray() const
Removes any leading prefixes, RANGE, REF, LABEL and ARRAY types and returns the result.
type_t getSub() const
Returns the element type of an array.
static string symbol(const char *str)
Extracts the alpha-numerical symbol used for variable/type identifiers.
bool isBranchpoint() const
Shortcut for is(BRANCHPOINT).
bool isFunction() const
Shortcut for is(FUNCTION).
bool isDiff() const
Shortcut for is(DIFF).
expression_t getExpression() const
Returns the expression associated with the type.
bool isNonConstant() const
Returns true if and only if all elements of the type are not constant.
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...
static type_t createTypeDef(const std::string &, type_t, position_t=position_t())
Creates a new type definition.
static type_t createProcessSet(type_t instance, position_t=position_t())
Creates a new processset type.
const type_t operator[](uint32_t) const
Returns the i'th child.
bool isGuard() const
Returns true if this is a guard, invariant, boolean or integer.
bool isBoolean() const
Shortcut for is(BOOL).
type_t()
Default constructor.
size_t size() const
Returns the number of children.
int32_t findIndexOf(const std::string &) const
Returns the index of the record or process field with the given label.
std::string getRecordLabel(size_t i) const
Returns the label of the 'th field of a record.
type_t createLabel(const std::string &, position_t=position_t()) const
Creates a LABEL.
static type_t createRecord(const std::vector< type_t > &, const std::vector< std::string > &, position_t=position_t())
Creates a new record type.
bool operator!=(const type_t &) const
Inequality operator.
A reference to an expression.
type_t getArraySize() const
Returns the size of an array (this is itself a type).
type_t createPosition(position_t=position_t()) const
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()...
bool isLocation() const
Shortcut for is(LOCATION).
bool isScalar() const
Shortcut for is(SCALAR).
static type_t createArray(type_t sub, type_t size, position_t=position_t())
Creates an array type.
bool isDouble() const
Shortcut for is(DOUBLE).
bool isInstanceLine() const
Shortcut for is(INSTANCELINE).
static type_t createProcess(frame_t, position_t=position_t())
Creates a new process type.
bool isRecord() const
Shortcut for is(RECORD).
Constants::kind_t getKind() const
Returns the kind of type object.
bool isChannel() const
Shortcut for is(CHANNEL).
bool isProcess() const
Shortcut for is(PROCESS).
size_t getRecordSize() const
Returns the number of fields of a record.