Averest


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).
Note that MiniC is viewed, as C, as a macro language for assembler programs, so that all atomic data types are mapped to machine words. Cint uses 2-complement for interpreting machine words as integers, while Cnat simply interprets them as binary numbers.

Union cases

Union case Description

Carr int option * TypeC

Full Usage: Carr int option * TypeC

Parameters:
    Item : int option * TypeC

Item : int option * TypeC

Cbool

Full Usage: Cbool

Cfun TypeC[] * TypeC option

Full Usage: Cfun TypeC[] * TypeC option

Parameters:

Item : TypeC[] * TypeC option

Cint

Full Usage: Cint

Cnat

Full Usage: Cnat

Ctup TypeC[]

Full Usage: Ctup TypeC[]

Parameters:

Item : TypeC[]