nts.interf.base
Interface IType
- All Superinterfaces:
- IVisitable
public interface IType
- extends IVisitable
Interface for a type. Besides the basic (scalar) types INT,REAL,BOOL, there are also composite array types. Different
kinds of arrays are distinguished:
- array of basic-type elements -- declared as e.g. a1[N], a2[10,2*M]
- pure reference to an array -- declared as e.g. b1[], b2[][][]
- array of references to arrays -- declared as e.g. c1[5][], c2[K][][]
These kinds are represented by
- the basic type
- the dimension dRef of arrays they can reference -- e.g. 0 for a1 and a2,
1 for b1 and c1, 2 for c2, 3 for b2
- its own dimension dOwn -- e.g. 0 for b1 and b2, 1 for
a1, c1, and c2, 2 for a2
- the total dimension dTotal = dRef + dOwn
Note that for scalar types, dTotal = dRef = dOwn = 0.
basicType
EBasicType basicType()
- Returns:
- the basic type -- e.g. INT for variables in declaration x,a1[5],a2[K][],a3[] : int
isScalar
boolean isScalar()
- Returns:
- true iff dTot == 0
isArray
boolean isArray()
- Returns:
- true iff dTot != 0
dimRef
int dimRef()
- Returns:
- the dimension dRef described above
dimOwn
int dimOwn()
- Returns:
- the dimension dOwn described above
dimTotal
int dimTotal()
- Returns:
- the dimension dTot described above
isArrayOfBasic
boolean isArrayOfBasic()
- Returns:
- true iff dOwn != 0 and dRef == 0
isRefToArray
boolean isRefToArray()
- Returns:
- true iff dOwn == 0 and dRef != 0
isArrayOfRef
boolean isArrayOfRef()
- Returns:
- true iff dOwn != 0 and dRef != 0