- datatype vtype = Int | Typedef of ident | Pointer of vtype | Array of vtype | TNull
- fun typeeq (Int, Int) = true
- | typeeq (Typedef a, Typedef b) = (Symbol.name a) = (Symbol.name b)
- | typeeq (Pointer a, Pointer b) = typeeq (a, b)
- | typeeq (Array a, Array b) = typeeq (a, b)
- | typeeq (TNull, TNull) = true
- | typeeq _ = false
- fun castable (Pointer _, TNull) = true
- | castable (Array _, TNull) = true
- | castable (a, b) = typeeq (a, b)
- type variable = ident * vtype
- datatype typedef = Struct of variable list
- | MarkedTypedef of typedef Mark.marked
-