TypeC Type
TypeC declares the available data types of variables in MiniC. There are atomic types Cbool, Cnat and Cint, and composite types Carr and Cfun:
- Cbool are booleans, i.e., true and false, which are the machine words 1...1 and 0...0, i.e., -1 and 0 (interpreted as Cint).
- Cnat are unsigned integers bounded by the machine width
- Cint are signed integers bounded by the machine width
- Ctup(tyA) is a tuple type consisting of the types in array tyA.
- Carr(dim,ty) is an array of dimension dim of type ty. For the definition of functions, it is allowed to use arrays with an unspecified dimension which makes their use more flexible.
- Cfun(tyA,rty) is a function type mapping arguments of types in array tyA to a potential value of return type rty (None means void).
Union cases
Union case | Description |
|
|
Full Usage:
Cbool
|
|
Full Usage:
Cint
|
|
Full Usage:
Cnat
|
|
|
|
Instance members
Instance member | Description |
Full Usage:
this.IsCarr
Returns: bool
|
|
Full Usage:
this.IsCbool
Returns: bool
|
|
Full Usage:
this.IsCfun
Returns: bool
|
|
Full Usage:
this.IsCint
Returns: bool
|
|
Full Usage:
this.IsCnat
Returns: bool
|
|
Full Usage:
this.IsCtup
Returns: bool
|
|