@@ -28,12 +28,6 @@ module Types :
2828 (** FIXME: I wonder why this goes here? *)
2929
3030 (** - Types *)
31- (* datatype Type = TYPE of ClassInf.State * Var list *)
32- (** The `Type' datatype stores information about the type of an *)
33- (** instantiated variable. The only information that is kept is the *)
34- (** class inference state, and the subcomponents. *)
35-
36- (** - Basic types and arrays *)
3731 datatype Type = T_INTEGER
3832 | T_REAL
3933 | T_STRING
@@ -49,8 +43,6 @@ module Types :
4943
5044 type FuncArg = Ident * Type
5145
52- (* datatype Component = COMP of Ident * Type *)
53-
5446 (** To generate the correct set of equations, the translator has to *)
5547 (** differentiate between the primitive types `Real', `Integer', *)
5648 (** `String', `Boolean' and types directly derived from then from *)
@@ -62,7 +54,6 @@ module Types :
6254 (** type, and whether a variable is of one of these types. *)
6355
6456 (** - Exported relations *)
65- (* relation simplify_type : Type => Type *)
6657 relation basic_type : Type => bool
6758 relation same_type : (Type, Type) => bool
6859 relation lookup_component : (Type, Ident) => Var
@@ -90,6 +81,8 @@ relation basic_type : Type => bool =
9081end
9182
9283(** relation: same_type
84+ **
85+ ** FIXME: An half-hearted type equivalence relation.
9386 **)
9487
9588relation same_type : (Type, Type) => bool =
@@ -160,7 +153,10 @@ relation pick : (Var list, Ident)
160153
161154end
162155
163- (** relation: lookup_component *)
156+ (** relation: lookup_component
157+ **
158+ ** This relation finds a subcomponent by name.
159+ **)
164160
165161relation lookup_component : (Type, Ident) => Var =
166162
@@ -194,7 +190,15 @@ relation lookup_component2 : (Var list , Ident) => Var =
194190
195191end
196192
197- (** relation: known_type *)
193+ (** relation: known_type
194+ **
195+ ** When a class is instantiated, the restriction state machin will
196+ ** have reached its final state. Such a state is here used to
197+ ** construct a `Types.Type' object. If the state indicates that the
198+ ** instantiated class was one of the primitive types, the
199+ ** corresponding type constructor is used. Otherwise, one of the
200+ ** constructors `T_ARRAY' and `T_COMPLEX' is used.
201+ **)
198202
199203relation known_type : (ClassInf.State, Absyn.ArrayDim) => Type =
200204
@@ -224,7 +228,7 @@ relation mk_arraydim : Absyn.ArrayDim => ArrayDim =
224228 axiom mk_arraydim [] => NODIM
225229
226230 rule mk_arraydim ds => ds'
227- (* FIXME: calculate d *)
231+ (** FIXME: calculate d *)
228232 ---------------------
229233 mk_arraydim d::ds => DIM(NONE,ds')
230234
259263 **
260264 ** This relation prints a textual description of a Modelica type. If
261265 ** the type is not one of the primitive types, it simply prints
262- ** `complex' .
266+ ** `composite'. The actual code is expluded from the report .
263267 **)
264268
269+ (*!ignorecode*)
270+
265271relation print_type : Type => () =
266272
267273 rule print "Integer"
@@ -331,8 +337,10 @@ relation print_params : FuncArg list => () =
331337 print_params [(n,t)]
332338
333339 rule print n & print " :: " & print_type t &
334- print " � " & print_params params
340+ print " * " & print_params params
335341 ---------------------------------
336342 print_params ((n,t)::params)
337343
338344end
345+
346+ (*!includecode*)
0 commit comments