Public Methods | |
SmvTypeDecl (SmvTrans smvTrans, TransSystem sys) | |
void | caseArray (Array type, Object o) |
void | caseBool (Bool type, Object o) |
void | caseCollection (Collection type, Object o) |
void | caseEnumerated (Enumerated type, Object o) |
void | caseField (Field type, Object o) |
void | caseLock (Lock type, Object o) |
void | caseRange (Range type, Object o) |
void | caseRecord (Record type, Object o) |
void | caseRef (Ref type, Object o) |
void | defaultCase (Object obj) |
int | getMaxCollectionSize () |
Private Methods | |
String | initValue (Type type, Object context) |
String | varName (Object context) |
Private Attributes | |
SmvTrans | smvTrans |
TransSystem | system |
StateVar | source |
SmvVar | container |
boolean | constrained |
SmvVar | deadFlag |
String | refIndexType |
String | instNumType |
int | maxSize |
An instance of this class is created by SmvTrans to help it declare all the components of a BIR variable (composite types have multiple components). Variables are declared by callbacks to the SmvTrans object on declareVar().
The SmvTypeDecl is applied to each variable by its type, with the variable itself being passed to the caseXXX() method as the second parameter (the Object context).
If the type is composite, then we recursively apply the type switch to the components of the composite type, but the context parameter is then a string denoting the prefix of the SMV variable name for the components of that variable.
Note that the varName() method must be called at the top of each caseXXX() method to record the variable source and other parameters for the subsequent recursive calls (which will not get the StateVar as a param).
Definition at line 63 of file SmvTypeDecl.java.
|
Declare array variable. An array variable is an aggregate with the following components:
Definition at line 106 of file SmvTypeDecl.java. |
|
Declare boolean variable. Definition at line 125 of file SmvTypeDecl.java. |
|
Declare collection variable. A collection variable is an aggregate with the following components:
Definition at line 143 of file SmvTypeDecl.java. |
|
Declare enumerated variable. Since we used named integer constants for each enumerated value, this is really just a range type. Definition at line 168 of file SmvTypeDecl.java. |
|
Declare field variable. Definition at line 181 of file SmvTypeDecl.java. |
|
Declare lock variable. A lock variable is an aggregate with the following components:
Definition at line 199 of file SmvTypeDecl.java. |
|
Declare range variable. Definition at line 218 of file SmvTypeDecl.java. |
|
Declare record variable. An record variable is an aggregate with one or more variables for each field (created via recursive calls). Definition at line 234 of file SmvTypeDecl.java. |
|
Declare reference variable. A reference is an aggregate with the following components:
Definition at line 268 of file SmvTypeDecl.java. |
|
Get initial value of variable. If the context is a String, the variable is a component, so just use the default value of the type. Otherwise (context is StateVar), get the initial value of that variable and translate it. Definition at line 296 of file SmvTypeDecl.java. |
|
Return the name of the variable indicated by the context. The context is either a StateVar (for a top-level call) or a String denoting a prefix of a name (for a nested call to declare the components of a composite type). This must be called at the top of each caseXXX() method to set the source, container, and constrained fields. Definition at line 315 of file SmvTypeDecl.java. |