#include <basic.h>
Public Member Functions | |
void | add (const string &s) |
Add type declaration. | |
bool | find (const string &var, size_t &pos) const |
Find whether a variable is typed. | |
const Type & | getType (size_t i) const |
Get variable type. | |
string | getVarList () const |
Get the list of typed variables. | |
const string & | getVarName (size_t i) const |
Get variable name. | |
bool | implies (const TypeDecl *d) const |
Return true if the type declaration implies a given one. | |
TypeDecl * | restrict (const string &varlist) const |
Return a new type declaration obtained by restricting to a list of variables. | |
void | setAllType (Type v) |
Set all variable to a given type. | |
void | setType (size_t i, Type v) |
Set variable type. | |
size_t | size () const |
Length of the type declaration. | |
string | to_string () const |
Get string representation. | |
TypeDecl (const string &s="") | |
Constructor. | |
Type::TypeSystem | typeSystem () const |
Return which type system is used. | |
Private Member Functions | |
void | add_single (const string &s) |
Private Attributes | |
vector< string > | varname |
Variable names. | |
vector< Type > | vartype |
Variable types. | |
Friends | |
ostream & | operator<< (ostream &os, const TypeDecl &decl) |
Stream output. |
Stored in almost normal form, i.e., there is no duplicate type for a single variable, but atd x:* may appear.
syn::TypeDecl::TypeDecl | ( | const string & | s = "" |
) | [inline] |
Constructor.
void syn::TypeDecl::add | ( | const string & | s | ) | [inline] |
Add type declaration.
void syn::TypeDecl::add_single | ( | const string & | s | ) | [inline, private] |
bool syn::TypeDecl::find | ( | const string & | var, | |
size_t & | pos | |||
) | const [inline] |
Find whether a variable is typed.
const Type& syn::TypeDecl::getType | ( | size_t | i | ) | const [inline] |
Get variable type.
string syn::TypeDecl::getVarList | ( | ) | const [inline] |
Get the list of typed variables.
const string& syn::TypeDecl::getVarName | ( | size_t | i | ) | const [inline] |
Get variable name.
bool syn::TypeDecl::implies | ( | const TypeDecl * | d | ) | const [inline] |
Return true if the type declaration implies a given one.
TypeDecl* syn::TypeDecl::restrict | ( | const string & | varlist | ) | const [inline] |
Return a new type declaration obtained by restricting to a list of variables.
void syn::TypeDecl::setAllType | ( | Type | v | ) | [inline] |
Set all variable to a given type.
void syn::TypeDecl::setType | ( | size_t | i, | |
Type | v | |||
) | [inline] |
Set variable type.
size_t syn::TypeDecl::size | ( | ) | const [inline] |
Length of the type declaration.
string syn::TypeDecl::to_string | ( | ) | const [inline] |
Get string representation.
Type::TypeSystem syn::TypeDecl::typeSystem | ( | ) | const [inline] |
Return which type system is used.
UP2BOX if variables are typed in {*,_,^,|} UP2DEF if variables are typed in {*,_,^,|,!} UP2BT if variables are typed in {*,_,^,|,!,|r} for some r > 0 UP2PT if parametric types
ostream& operator<< | ( | ostream & | os, | |
const TypeDecl & | decl | |||
) | [friend] |
Stream output.
vector<string> syn::TypeDecl::varname [private] |
Variable names.
vector<Type> syn::TypeDecl::vartype [private] |
Variable types.