Skip to content

Commit 5e6653d

Browse files
author
x97davka
committed
Doc fix.
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@332 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 4ee727d commit 5e6653d

File tree

2 files changed

+30
-15
lines changed

2 files changed

+30
-15
lines changed

modeq/main.rml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,18 @@ with "explode.rml"
1313
with "dae.rml"
1414
with "inst.rml"
1515

16+
(** relation: main
17+
**
18+
** The only relation in this module is the `main' relation, which is
19+
** the starting point in all RML specifications. It is invoked with
20+
** a list containing the command-line arguments.
21+
**)
22+
1623
relation main =
1724

1825
rule (* print "\n = Parsing\n\n" & *)
1926
Parser.parse f => p &
20-
Dump.dump p &
27+
(* Dump.dump p & *)
2128

2229
(* print "\n = Exploding\n\n" & *)
2330
SCode.elaborate(p) => p' &

modeq/types.rml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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 =
9081
end
9182

9283
(** relation: same_type
84+
**
85+
** FIXME: An half-hearted type equivalence relation.
9386
**)
9487

9588
relation same_type : (Type, Type) => bool =
@@ -160,7 +153,10 @@ relation pick : (Var list, Ident)
160153

161154
end
162155

163-
(** relation: lookup_component *)
156+
(** relation: lookup_component
157+
**
158+
** This relation finds a subcomponent by name.
159+
**)
164160

165161
relation lookup_component : (Type, Ident) => Var =
166162

@@ -194,7 +190,15 @@ relation lookup_component2 : (Var list , Ident) => Var =
194190

195191
end
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

199203
relation 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

@@ -259,9 +263,11 @@ end
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+
265271
relation 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

338344
end
345+
346+
(*!includecode*)

0 commit comments

Comments
 (0)