Commit | Line | Data |
---|---|---|
7f918cf1 CE |
1 | diff --git a/README.mlton b/README.mlton |
2 | new file mode 100644 | |
3 | index 0000000..f1b9b15 | |
4 | --- /dev/null | |
5 | +++ b/README.mlton | |
6 | @@ -0,0 +1,8 @@ | |
7 | +The following changes were made to the ckit Library, in addition to | |
8 | +deriving the `.mlb` file from the `.cm` file: | |
9 | + | |
10 | +* `ast/pp/pp-ast-adornment-sig.sml` (modified): Rewrote use of `signature` in `local`. | |
11 | +* `ast/pp/pp-ast-ext-sig.sml` (modified): Rewrote use of `signature` in `local`. | |
12 | +* `ast/type-util-sig.sml` (modified): Rewrote use of `signature` in `local`. | |
13 | +* `parser/parse-tree-sig.sml` (modified): Rewrote use of (sequential) `withtype` in signature. | |
14 | +* `parser/parse-tree.sml` (modified): Rewrote use of (sequential) `withtype`. | |
15 | diff --git a/ckit-lib.mlb b/ckit-lib.mlb | |
16 | new file mode 100644 | |
17 | index 0000000..abc601f | |
18 | --- /dev/null | |
19 | +++ b/ckit-lib.mlb | |
20 | @@ -0,0 +1 @@ | |
21 | +src/ckit-lib.mlb | |
22 | diff --git a/src/ast/pp/pp-ast-adornment-sig.sml b/src/ast/pp/pp-ast-adornment-sig.sml | |
23 | index a7b937b..ab6e0a9 100644 | |
24 | --- a/src/ast/pp/pp-ast-adornment-sig.sml | |
25 | +++ b/src/ast/pp/pp-ast-adornment-sig.sml | |
26 | @@ -1,14 +1,14 @@ | |
27 | (* Copyright (c) 1998 by Lucent Technologies *) | |
28 | ||
29 | -local | |
30 | +(* local *) | |
31 | type 'a pp = Tables.tidtab -> OldPrettyPrint.ppstream -> 'a -> unit | |
32 | ||
33 | type ('aidinfo,'a,'b) adornment_pp = ('aidinfo -> 'a) -> 'aidinfo -> 'b | |
34 | -in | |
35 | +(* in *) | |
36 | signature PPASTADORNMENT = sig | |
37 | type aidinfo | |
38 | val ppExpressionAdornment: (aidinfo,Ast.coreExpression pp,Ast.expression pp) adornment_pp | |
39 | val ppStatementAdornment : (aidinfo,Ast.coreStatement pp,Ast.statement pp) adornment_pp | |
40 | val ppExternalDeclAdornment: (aidinfo,Ast.coreExternalDecl pp,Ast.externalDecl pp) adornment_pp | |
41 | end | |
42 | -end | |
43 | +(* end *) | |
44 | diff --git a/src/ast/pp/pp-ast-ext-sig.sml b/src/ast/pp/pp-ast-ext-sig.sml | |
45 | index 4169fc7..c7291ab 100644 | |
46 | --- a/src/ast/pp/pp-ast-ext-sig.sml | |
47 | +++ b/src/ast/pp/pp-ast-ext-sig.sml | |
48 | @@ -1,13 +1,13 @@ | |
49 | (* Copyright (c) 1998 by Lucent Technologies *) | |
50 | ||
51 | -local | |
52 | +(* local *) | |
53 | type 'a pp = Tables.tidtab -> OldPrettyPrint.ppstream -> 'a -> unit | |
54 | type ('a, 'aidinfo) ppExt = | |
55 | (('aidinfo -> Ast.expression pp) * ('aidinfo -> Ast.statement pp) * | |
56 | ('aidinfo -> Ast.binop pp) * ('aidinfo -> Ast.unop pp)) | |
57 | -> 'aidinfo | |
58 | -> Tables.tidtab -> OldPrettyPrint.ppstream -> 'a -> unit | |
59 | -in | |
60 | +(* in *) | |
61 | ||
62 | signature PPASTEXT = sig | |
63 | type aidinfo | |
64 | @@ -24,4 +24,4 @@ signature PPASTEXT = sig | |
65 | aidinfo) ppExt | |
66 | end | |
67 | ||
68 | -end | |
69 | +(* end *) | |
70 | diff --git a/src/ast/type-util-sig.sml b/src/ast/type-util-sig.sml | |
71 | index b03260b..a262146 100644 | |
72 | --- a/src/ast/type-util-sig.sml | |
73 | +++ b/src/ast/type-util-sig.sml | |
74 | @@ -1,10 +1,10 @@ | |
75 | (* Copyright (c) 1998 by Lucent Technologies *) | |
76 | ||
77 | -local | |
78 | +(* local *) | |
79 | type 'a type_util = Tables.tidtab -> Ast.ctype -> 'a | |
80 | type 'a type_mem_util = Tables.tidtab -> Ast.ctype * Ast.member -> 'a | |
81 | type 'a type_type_util = Tables.tidtab -> Ast.ctype * Ast.ctype -> 'a | |
82 | -in | |
83 | +(* in *) | |
84 | ||
85 | signature TYPE_UTIL = | |
86 | sig | |
87 | @@ -145,4 +145,4 @@ sig | |
88 | ||
89 | end (* signature TYPE_UTIL *) | |
90 | ||
91 | -end (* local *) | |
92 | +(* end (* local *) *) | |
93 | diff --git a/src/ckit-lib.mlb b/src/ckit-lib.mlb | |
94 | new file mode 100644 | |
95 | index 0000000..04c7479 | |
96 | --- /dev/null | |
97 | +++ b/src/ckit-lib.mlb | |
98 | @@ -0,0 +1,890 @@ | |
99 | + | |
100 | +ann | |
101 | + "nonexhaustiveBind warn" "nonexhaustiveMatch warn" | |
102 | + "redundantBind warn" "redundantMatch warn" | |
103 | + "sequenceNonUnit ignore" | |
104 | + "warnUnused false" "forceUsed" | |
105 | + "allowOrPats true" "allowSigWithtype true" "allowVectorExpsAndPats true" | |
106 | +in | |
107 | + | |
108 | +local | |
109 | + basis l4 = | |
110 | + bas | |
111 | + (* $/basis.cm ====> *) $(SML_LIB)/basis/basis.mlb $(SML_LIB)/basis/unsafe.mlb | |
112 | + end | |
113 | + basis l24 = | |
114 | + bas | |
115 | + (* $/smlnj-lib.cm ====> *) $(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb | |
116 | + end | |
117 | + basis l71 = | |
118 | + bas | |
119 | + (* $/pp-lib.cm ====> *) $(SML_LIB)/smlnj-lib/PP/pp-lib.mlb | |
120 | + end | |
121 | + basis l96 = | |
122 | + bas | |
123 | + (* $/ml-yacc-lib.cm ====> *) $(SML_LIB)/mlyacc-lib/mlyacc-lib.mlb | |
124 | + end | |
125 | +in | |
126 | +local | |
127 | + $(SML_LIB)/basis/pervasive.mlb | |
128 | + local | |
129 | + open l4 | |
130 | + in | |
131 | + structure gs_0 = TextIO | |
132 | + end | |
133 | + local | |
134 | + variants/type-check-control-sig.sml | |
135 | + in | |
136 | + signature gs_1 = TYPECHECKCONTROL | |
137 | + end | |
138 | + local | |
139 | + variants/parse-control-sig.sml | |
140 | + in | |
141 | + signature gs_2 = PARSECONTROL | |
142 | + end | |
143 | + local | |
144 | + signature PARSECONTROL = gs_2 | |
145 | + signature TYPECHECKCONTROL = gs_1 | |
146 | + variants/config-sig.sml | |
147 | + in | |
148 | + signature gs_3 = CONFIG | |
149 | + end | |
150 | + local | |
151 | + signature CONFIG = gs_3 | |
152 | + signature PARSECONTROL = gs_2 | |
153 | + signature TYPECHECKCONTROL = gs_1 | |
154 | + structure TextIO = gs_0 | |
155 | + variants/ansic/config.sml | |
156 | + in | |
157 | + structure gs_4 = Config | |
158 | + end | |
159 | + local | |
160 | + open l24 | |
161 | + in | |
162 | + functor gs_5 = HashTableFn | |
163 | + end | |
164 | + local | |
165 | + ast/uidtabimp-sig.sml | |
166 | + in | |
167 | + signature gs_6 = UIDTABIMP | |
168 | + end | |
169 | + local | |
170 | + open l4 | |
171 | + in | |
172 | + structure gs_7 = Word | |
173 | + end | |
174 | + local | |
175 | + structure Word = gs_7 | |
176 | + ast/uid-sig.sml | |
177 | + in | |
178 | + signature gs_8 = UID | |
179 | + end | |
180 | + local | |
181 | + functor HashTableFn = gs_5 | |
182 | + signature UID = gs_8 | |
183 | + signature UIDTABIMP = gs_6 | |
184 | + ast/uidtabimp-fn.sml | |
185 | + in | |
186 | + functor gs_9 = UidtabImpFn | |
187 | + end | |
188 | + local | |
189 | + open l4 | |
190 | + in | |
191 | + structure gs_10 = Int | |
192 | + end | |
193 | + local | |
194 | + structure Int = gs_10 | |
195 | + signature UID = gs_8 | |
196 | + structure Word = gs_7 | |
197 | + ast/uid-fn.sml | |
198 | + in | |
199 | + functor gs_11 = UidFn | |
200 | + end | |
201 | + local | |
202 | + signature UID = gs_8 | |
203 | + functor UidFn = gs_11 | |
204 | + ast/aid.sml | |
205 | + in | |
206 | + structure gs_12 = Aid | |
207 | + end | |
208 | + local | |
209 | + structure Aid = gs_12 | |
210 | + functor UidtabImpFn = gs_9 | |
211 | + ast/aidtab.sml | |
212 | + in | |
213 | + structure gs_13 = Aidtab | |
214 | + end | |
215 | + local | |
216 | + open l24 | |
217 | + in | |
218 | + structure gs_14 = Format | |
219 | + end | |
220 | + local | |
221 | + open l4 | |
222 | + in | |
223 | + structure gs_15 = String | |
224 | + end | |
225 | + local | |
226 | + parser/util/sourcemap-sig.sml | |
227 | + in | |
228 | + signature gs_16 = SOURCE_MAP | |
229 | + end | |
230 | + local | |
231 | + structure Config = gs_4 | |
232 | + structure Format = gs_14 | |
233 | + structure Int = gs_10 | |
234 | + signature SOURCE_MAP = gs_16 | |
235 | + structure String = gs_15 | |
236 | + parser/util/sourcemap.sml | |
237 | + in | |
238 | + structure gs_17 = SourceMap | |
239 | + end | |
240 | + local | |
241 | + open l71 | |
242 | + in | |
243 | + functor gs_18 = PPStreamFn | |
244 | + end | |
245 | + local | |
246 | + open l71 | |
247 | + in | |
248 | + structure gs_19 = StringToken | |
249 | + end | |
250 | + local | |
251 | + open l4 | |
252 | + in | |
253 | + structure gs_20 = StringCvt | |
254 | + end | |
255 | + local | |
256 | + open l4 | |
257 | + in | |
258 | + structure gs_21 = List | |
259 | + end | |
260 | + local | |
261 | + structure List = gs_21 | |
262 | + functor PPStreamFn = gs_18 | |
263 | + structure String = gs_15 | |
264 | + structure StringCvt = gs_20 | |
265 | + structure StringToken = gs_19 | |
266 | + parser/util/old-pp.sml | |
267 | + in | |
268 | + signature gs_22 = OLD_PRETTYPRINT | |
269 | + structure gs_23 = OldPrettyPrint | |
270 | + end | |
271 | + local | |
272 | + structure Format = gs_14 | |
273 | + signature OLD_PRETTYPRINT = gs_22 | |
274 | + structure OldPrettyPrint = gs_23 | |
275 | + structure SourceMap = gs_17 | |
276 | + structure TextIO = gs_0 | |
277 | + parser/util/error-sig.sml | |
278 | + in | |
279 | + signature gs_24 = ERROR | |
280 | + end | |
281 | + local | |
282 | + signature ERROR = gs_24 | |
283 | + structure Format = gs_14 | |
284 | + signature OLD_PRETTYPRINT = gs_22 | |
285 | + structure OldPrettyPrint = gs_23 | |
286 | + structure SourceMap = gs_17 | |
287 | + structure TextIO = gs_0 | |
288 | + parser/util/error.sml | |
289 | + in | |
290 | + structure gs_25 = Error | |
291 | + end | |
292 | + local | |
293 | + open l96 | |
294 | + in | |
295 | + functor gs_26 = Join | |
296 | + functor gs_27 = JoinWithArg | |
297 | + end | |
298 | + local | |
299 | + open l96 | |
300 | + in | |
301 | + structure gs_28 = LrParser | |
302 | + end | |
303 | + local | |
304 | + open l4 | |
305 | + in | |
306 | + structure gs_29 = LargeInt | |
307 | + end | |
308 | + local | |
309 | + parser/extensions/c/parse-tree-ext.sml | |
310 | + in | |
311 | + structure gs_30 = ParseTreeExt | |
312 | + end | |
313 | + local | |
314 | + structure LargeInt = gs_29 | |
315 | + structure ParseTreeExt = gs_30 | |
316 | + structure SourceMap = gs_17 | |
317 | + parser/parse-tree-sig.sml | |
318 | + in | |
319 | + signature gs_31 = PARSETREE | |
320 | + end | |
321 | + local | |
322 | + structure LargeInt = gs_29 | |
323 | + signature PARSETREE = gs_31 | |
324 | + structure ParseTreeExt = gs_30 | |
325 | + structure SourceMap = gs_17 | |
326 | + parser/parse-tree.sml | |
327 | + in | |
328 | + structure gs_32 = ParseTree | |
329 | + end | |
330 | + local | |
331 | + structure Error = gs_25 | |
332 | + structure ParseTree = gs_32 | |
333 | + parser/parser-sig.sml | |
334 | + in | |
335 | + signature gs_33 = PARSER | |
336 | + end | |
337 | + local | |
338 | + open l4 | |
339 | + in | |
340 | + structure gs_34 = Unsafe | |
341 | + end | |
342 | + local | |
343 | + open l4 | |
344 | + in | |
345 | + structure gs_35 = IntInf | |
346 | + end | |
347 | + local | |
348 | + open l4 | |
349 | + in | |
350 | + structure gs_36 = CharVector | |
351 | + end | |
352 | + local | |
353 | + open l4 | |
354 | + in | |
355 | + structure gs_37 = Vector | |
356 | + end | |
357 | + local | |
358 | + open l4 | |
359 | + in | |
360 | + structure gs_38 = Real | |
361 | + end | |
362 | + local | |
363 | + open l4 | |
364 | + in | |
365 | + structure gs_39 = Char | |
366 | + end | |
367 | + local | |
368 | + open l24 | |
369 | + in | |
370 | + structure gs_40 = AtomTable | |
371 | + end | |
372 | + local | |
373 | + open l24 | |
374 | + in | |
375 | + structure gs_41 = Atom | |
376 | + end | |
377 | + local | |
378 | + structure Atom = gs_41 | |
379 | + structure AtomTable = gs_40 | |
380 | + structure Config = gs_4 | |
381 | + parser/grammar/tdefs.sml | |
382 | + in | |
383 | + signature gs_42 = TYPEDEFS | |
384 | + structure gs_43 = TypeDefs | |
385 | + end | |
386 | + local | |
387 | + open l96 | |
388 | + in | |
389 | + signature gs_44 = ARG_LEXER | |
390 | + signature gs_45 = ARG_PARSER | |
391 | + signature gs_46 = LEXER | |
392 | + signature gs_47 = LR_PARSER | |
393 | + signature gs_48 = LR_TABLE | |
394 | + signature gs_49 = PARSER | |
395 | + signature gs_50 = PARSER_DATA | |
396 | + signature gs_51 = STREAM | |
397 | + signature gs_52 = TOKEN | |
398 | + end | |
399 | + local | |
400 | + signature ARG_LEXER = gs_44 | |
401 | + signature ARG_PARSER = gs_45 | |
402 | + signature LEXER = gs_46 | |
403 | + signature LR_PARSER = gs_47 | |
404 | + signature LR_TABLE = gs_48 | |
405 | + structure LargeInt = gs_29 | |
406 | + signature PARSER = gs_49 | |
407 | + signature PARSER_DATA = gs_50 | |
408 | + signature STREAM = gs_51 | |
409 | + signature TOKEN = gs_52 | |
410 | + parser/grammar/c.grm.sig | |
411 | + in | |
412 | + signature gs_53 = C_LRVALS | |
413 | + signature gs_54 = C_TOKENS | |
414 | + end | |
415 | + local | |
416 | + structure Atom = gs_41 | |
417 | + structure AtomTable = gs_40 | |
418 | + signature C_LRVALS = gs_53 | |
419 | + signature C_TOKENS = gs_54 | |
420 | + structure Config = gs_4 | |
421 | + signature TYPEDEFS = gs_42 | |
422 | + structure TypeDefs = gs_43 | |
423 | + parser/grammar/tokentable.sml | |
424 | + in | |
425 | + signature gs_55 = TOKENTABLE | |
426 | + functor gs_56 = TokenTable | |
427 | + end | |
428 | + local | |
429 | + signature C_LRVALS = gs_53 | |
430 | + signature C_TOKENS = gs_54 | |
431 | + structure Char = gs_39 | |
432 | + structure CharVector = gs_36 | |
433 | + structure Int = gs_10 | |
434 | + structure IntInf = gs_35 | |
435 | + structure LargeInt = gs_29 | |
436 | + structure List = gs_21 | |
437 | + structure Real = gs_38 | |
438 | + structure SourceMap = gs_17 | |
439 | + structure String = gs_15 | |
440 | + structure StringCvt = gs_20 | |
441 | + signature TOKENTABLE = gs_55 | |
442 | + functor TokenTable = gs_56 | |
443 | + structure Unsafe = gs_34 | |
444 | + structure Vector = gs_37 | |
445 | + parser/grammar/c.lex.sml | |
446 | + in | |
447 | + functor gs_57 = CLexFun | |
448 | + end | |
449 | + local | |
450 | + open l4 | |
451 | + in | |
452 | + structure gs_58 = Array | |
453 | + end | |
454 | + local | |
455 | + open l4 | |
456 | + in | |
457 | + structure gs_59 = General | |
458 | + end | |
459 | + local | |
460 | + signature ARG_LEXER = gs_44 | |
461 | + signature ARG_PARSER = gs_45 | |
462 | + structure Array = gs_58 | |
463 | + signature C_LRVALS = gs_53 | |
464 | + signature C_TOKENS = gs_54 | |
465 | + structure Char = gs_39 | |
466 | + structure Error = gs_25 | |
467 | + structure General = gs_59 | |
468 | + signature LEXER = gs_46 | |
469 | + signature LR_PARSER = gs_47 | |
470 | + signature LR_TABLE = gs_48 | |
471 | + structure LargeInt = gs_29 | |
472 | + structure List = gs_21 | |
473 | + signature PARSER = gs_49 | |
474 | + signature PARSER_DATA = gs_50 | |
475 | + structure ParseTree = gs_32 | |
476 | + signature STREAM = gs_51 | |
477 | + structure SourceMap = gs_17 | |
478 | + structure String = gs_15 | |
479 | + signature TOKEN = gs_52 | |
480 | + signature TYPEDEFS = gs_42 | |
481 | + structure TypeDefs = gs_43 | |
482 | + parser/grammar/c.grm.sml | |
483 | + in | |
484 | + functor gs_60 = LrValsFun | |
485 | + end | |
486 | + local | |
487 | + functor CLexFun = gs_57 | |
488 | + structure Error = gs_25 | |
489 | + functor Join = gs_26 | |
490 | + functor JoinWithArg = gs_27 | |
491 | + structure LrParser = gs_28 | |
492 | + functor LrValsFun = gs_60 | |
493 | + signature PARSER = gs_33 | |
494 | + structure SourceMap = gs_17 | |
495 | + signature TOKENTABLE = gs_55 | |
496 | + signature TYPEDEFS = gs_42 | |
497 | + structure TextIO = gs_0 | |
498 | + functor TokenTable = gs_56 | |
499 | + structure TypeDefs = gs_43 | |
500 | + parser/parser.sml | |
501 | + in | |
502 | + structure gs_61 = Parser | |
503 | + end | |
504 | + local | |
505 | + open l24 | |
506 | + in | |
507 | + structure gs_62 = HashString | |
508 | + end | |
509 | + local | |
510 | + signature UID = gs_8 | |
511 | + functor UidFn = gs_11 | |
512 | + ast/tid.sml | |
513 | + in | |
514 | + structure gs_63 = Tid | |
515 | + end | |
516 | + local | |
517 | + structure Tid = gs_63 | |
518 | + ast/symbol-sig.sml | |
519 | + in | |
520 | + signature gs_64 = SYMBOL | |
521 | + end | |
522 | + local | |
523 | + structure HashString = gs_62 | |
524 | + structure Int = gs_10 | |
525 | + signature SYMBOL = gs_64 | |
526 | + structure String = gs_15 | |
527 | + structure Tid = gs_63 | |
528 | + structure Word = gs_7 | |
529 | + ast/symbol.sml | |
530 | + in | |
531 | + structure gs_65 = Symbol | |
532 | + end | |
533 | + local | |
534 | + signature UID = gs_8 | |
535 | + functor UidFn = gs_11 | |
536 | + ast/pid.sml | |
537 | + in | |
538 | + structure gs_66 = Pid | |
539 | + end | |
540 | + local | |
541 | + ast/extensions/c/ast-ext.sml | |
542 | + in | |
543 | + structure gs_67 = AstExt | |
544 | + end | |
545 | + local | |
546 | + structure Aid = gs_12 | |
547 | + structure AstExt = gs_67 | |
548 | + structure LargeInt = gs_29 | |
549 | + structure Pid = gs_66 | |
550 | + structure SourceMap = gs_17 | |
551 | + structure Symbol = gs_65 | |
552 | + structure Tid = gs_63 | |
553 | + ast/ast-sig.sml | |
554 | + in | |
555 | + signature gs_68 = AST | |
556 | + end | |
557 | + local | |
558 | + signature AST = gs_68 | |
559 | + structure Aid = gs_12 | |
560 | + structure AstExt = gs_67 | |
561 | + structure LargeInt = gs_29 | |
562 | + structure Pid = gs_66 | |
563 | + structure SourceMap = gs_17 | |
564 | + structure Symbol = gs_65 | |
565 | + structure Tid = gs_63 | |
566 | + ast/ast.sml | |
567 | + in | |
568 | + structure gs_69 = Ast | |
569 | + end | |
570 | + local | |
571 | + structure Ast = gs_69 | |
572 | + structure LargeInt = gs_29 | |
573 | + structure Pid = gs_66 | |
574 | + structure SourceMap = gs_17 | |
575 | + structure Symbol = gs_65 | |
576 | + structure Tid = gs_63 | |
577 | + ast/bindings.sml | |
578 | + in | |
579 | + structure gs_70 = Bindings | |
580 | + end | |
581 | + local | |
582 | + open l24 | |
583 | + in | |
584 | + functor gs_71 = BinaryMapFn | |
585 | + end | |
586 | + local | |
587 | + open l24 | |
588 | + in | |
589 | + signature gs_72 = ORD_MAP | |
590 | + end | |
591 | + local | |
592 | + structure Tid = gs_63 | |
593 | + functor UidtabImpFn = gs_9 | |
594 | + ast/tidtab.sml | |
595 | + in | |
596 | + structure gs_73 = Tidtab | |
597 | + end | |
598 | + local | |
599 | + structure Aidtab = gs_13 | |
600 | + structure Ast = gs_69 | |
601 | + structure Bindings = gs_70 | |
602 | + structure Tidtab = gs_73 | |
603 | + ast/tables.sml | |
604 | + in | |
605 | + structure gs_74 = Tables | |
606 | + end | |
607 | + local | |
608 | + structure Aid = gs_12 | |
609 | + structure Ast = gs_69 | |
610 | + structure Bindings = gs_70 | |
611 | + structure Error = gs_25 | |
612 | + structure LargeInt = gs_29 | |
613 | + signature ORD_MAP = gs_72 | |
614 | + structure SourceMap = gs_17 | |
615 | + structure Symbol = gs_65 | |
616 | + structure Tables = gs_74 | |
617 | + structure Tid = gs_63 | |
618 | + ast/state-sig.sml | |
619 | + in | |
620 | + signature gs_75 = STATE | |
621 | + end | |
622 | + local | |
623 | + structure Aid = gs_12 | |
624 | + structure Aidtab = gs_13 | |
625 | + structure Ast = gs_69 | |
626 | + functor BinaryMapFn = gs_71 | |
627 | + structure Bindings = gs_70 | |
628 | + structure Error = gs_25 | |
629 | + structure LargeInt = gs_29 | |
630 | + structure List = gs_21 | |
631 | + structure Pid = gs_66 | |
632 | + signature STATE = gs_75 | |
633 | + structure SourceMap = gs_17 | |
634 | + structure Symbol = gs_65 | |
635 | + structure Tables = gs_74 | |
636 | + structure Tid = gs_63 | |
637 | + structure Tidtab = gs_73 | |
638 | + ast/state.sml | |
639 | + in | |
640 | + structure gs_76 = State | |
641 | + end | |
642 | + local | |
643 | + ast/sizes-sig.sml | |
644 | + in | |
645 | + signature gs_77 = SIZES | |
646 | + end | |
647 | + local | |
648 | + signature SIZES = gs_77 | |
649 | + ast/sizes.sml | |
650 | + in | |
651 | + structure gs_78 = Sizes | |
652 | + end | |
653 | + local | |
654 | + structure Ast = gs_69 | |
655 | + structure Bindings = gs_70 | |
656 | + structure Sizes = gs_78 | |
657 | + structure State = gs_76 | |
658 | + structure Tables = gs_74 | |
659 | + structure TextIO = gs_0 | |
660 | + structure Tidtab = gs_73 | |
661 | + ast/parse-to-ast-sig.sml | |
662 | + in | |
663 | + signature gs_79 = PARSE_TO_AST | |
664 | + end | |
665 | + local | |
666 | + open l4 | |
667 | + in | |
668 | + structure gs_80 = ListPair | |
669 | + end | |
670 | + local | |
671 | + open l4 | |
672 | + in | |
673 | + structure gs_81 = Option | |
674 | + end | |
675 | + local | |
676 | + structure Ast = gs_69 | |
677 | + structure Bindings = gs_70 | |
678 | + structure Error = gs_25 | |
679 | + structure ParseTree = gs_32 | |
680 | + structure Sizes = gs_78 | |
681 | + structure State = gs_76 | |
682 | + structure Tables = gs_74 | |
683 | + structure Tidtab = gs_73 | |
684 | + ast/build-ast-sig.sml | |
685 | + in | |
686 | + signature gs_82 = BUILD_AST | |
687 | + end | |
688 | + local | |
689 | + structure Ast = gs_69 | |
690 | + structure ParseTree = gs_32 | |
691 | + structure ParseTreeExt = gs_30 | |
692 | + structure State = gs_76 | |
693 | + ast/cnv-ext-sig.sml | |
694 | + in | |
695 | + signature gs_83 = CNVEXT | |
696 | + end | |
697 | + local | |
698 | + structure Ast = gs_69 | |
699 | + signature CNVEXT = gs_83 | |
700 | + structure ParseTree = gs_32 | |
701 | + structure ParseTreeExt = gs_30 | |
702 | + structure State = gs_76 | |
703 | + ast/extensions/c/cnv-ext.sml | |
704 | + in | |
705 | + structure gs_84 = CnvExt | |
706 | + end | |
707 | + local | |
708 | + structure Ast = gs_69 | |
709 | + structure Bindings = gs_70 | |
710 | + structure Pid = gs_66 | |
711 | + structure Symbol = gs_65 | |
712 | + ast/simplify-assign-ops.sml | |
713 | + in | |
714 | + structure gs_85 = SimplifyAssignOps | |
715 | + end | |
716 | + local | |
717 | + structure Ast = gs_69 | |
718 | + structure Bindings = gs_70 | |
719 | + signature OLD_PRETTYPRINT = gs_22 | |
720 | + structure OldPrettyPrint = gs_23 | |
721 | + structure Tables = gs_74 | |
722 | + structure Tid = gs_63 | |
723 | + ast/pp/pp-ast-sig.sml | |
724 | + in | |
725 | + signature gs_86 = PP_AST | |
726 | + end | |
727 | + local | |
728 | + open l4 | |
729 | + in | |
730 | + structure gs_87 = Int32 | |
731 | + end | |
732 | + local | |
733 | + structure Ast = gs_69 | |
734 | + structure Int = gs_10 | |
735 | + structure Int32 = gs_87 | |
736 | + structure LargeInt = gs_29 | |
737 | + signature OLD_PRETTYPRINT = gs_22 | |
738 | + structure OldPrettyPrint = gs_23 | |
739 | + structure Pid = gs_66 | |
740 | + structure Real = gs_38 | |
741 | + structure String = gs_15 | |
742 | + structure Symbol = gs_65 | |
743 | + structure Tables = gs_74 | |
744 | + structure TextIO = gs_0 | |
745 | + structure Tid = gs_63 | |
746 | + structure Tidtab = gs_73 | |
747 | + ast/pp/pp-lib.sml | |
748 | + in | |
749 | + structure gs_88 = PPLib | |
750 | + end | |
751 | + local | |
752 | + structure Ast = gs_69 | |
753 | + structure AstExt = gs_67 | |
754 | + signature OLD_PRETTYPRINT = gs_22 | |
755 | + structure OldPrettyPrint = gs_23 | |
756 | + structure Tables = gs_74 | |
757 | + ast/pp/pp-ast-ext-sig.sml | |
758 | + in | |
759 | + signature gs_89 = PPASTEXT | |
760 | + end | |
761 | + local | |
762 | + signature PPASTEXT = gs_89 | |
763 | + ast/extensions/c/pp-ast-ext-fn.sml | |
764 | + in | |
765 | + functor gs_90 = PPAstExtFn | |
766 | + end | |
767 | + local | |
768 | + structure Ast = gs_69 | |
769 | + signature OLD_PRETTYPRINT = gs_22 | |
770 | + structure OldPrettyPrint = gs_23 | |
771 | + structure Tables = gs_74 | |
772 | + ast/pp/pp-ast-adornment-sig.sml | |
773 | + in | |
774 | + signature gs_91 = PPASTADORNMENT | |
775 | + end | |
776 | + local | |
777 | + structure Ast = gs_69 | |
778 | + structure Bindings = gs_70 | |
779 | + structure Int = gs_10 | |
780 | + structure LargeInt = gs_29 | |
781 | + structure List = gs_21 | |
782 | + signature OLD_PRETTYPRINT = gs_22 | |
783 | + structure OldPrettyPrint = gs_23 | |
784 | + structure Option = gs_81 | |
785 | + signature PPASTADORNMENT = gs_91 | |
786 | + functor PPAstExtFn = gs_90 | |
787 | + structure PPLib = gs_88 | |
788 | + signature PP_AST = gs_86 | |
789 | + structure Pid = gs_66 | |
790 | + structure SourceMap = gs_17 | |
791 | + structure Tid = gs_63 | |
792 | + structure Tidtab = gs_73 | |
793 | + ast/pp/pp-ast-fn.sml | |
794 | + in | |
795 | + functor gs_92 = PPAstFn | |
796 | + end | |
797 | + local | |
798 | + structure Ast = gs_69 | |
799 | + signature PPASTADORNMENT = gs_91 | |
800 | + functor PPAstFn = gs_92 | |
801 | + ast/pp/pp-ast.sml | |
802 | + in | |
803 | + structure gs_93 = PPAst | |
804 | + end | |
805 | + local | |
806 | + structure Ast = gs_69 | |
807 | + ast/ctype-eq.sml | |
808 | + in | |
809 | + structure gs_94 = CTypeEq | |
810 | + end | |
811 | + local | |
812 | + structure Ast = gs_69 | |
813 | + structure Sizes = gs_78 | |
814 | + structure Tables = gs_74 | |
815 | + ast/sizeof-sig.sml | |
816 | + in | |
817 | + signature gs_95 = SIZEOF | |
818 | + end | |
819 | + local | |
820 | + structure Ast = gs_69 | |
821 | + structure LargeInt = gs_29 | |
822 | + structure Tables = gs_74 | |
823 | + ast/type-util-sig.sml | |
824 | + in | |
825 | + signature gs_96 = TYPE_UTIL | |
826 | + end | |
827 | + local | |
828 | + structure Ast = gs_69 | |
829 | + structure Bindings = gs_70 | |
830 | + structure Config = gs_4 | |
831 | + structure Int = gs_10 | |
832 | + structure List = gs_21 | |
833 | + structure PPAst = gs_93 | |
834 | + structure PPLib = gs_88 | |
835 | + structure Pid = gs_66 | |
836 | + structure Symbol = gs_65 | |
837 | + signature TYPE_UTIL = gs_96 | |
838 | + structure Tables = gs_74 | |
839 | + structure Tid = gs_63 | |
840 | + structure Tidtab = gs_73 | |
841 | + ast/type-util.sml | |
842 | + in | |
843 | + structure gs_97 = TypeUtil | |
844 | + end | |
845 | + local | |
846 | + structure Ast = gs_69 | |
847 | + functor BinaryMapFn = gs_71 | |
848 | + structure Bindings = gs_70 | |
849 | + structure Config = gs_4 | |
850 | + structure Int = gs_10 | |
851 | + structure LargeInt = gs_29 | |
852 | + structure List = gs_21 | |
853 | + structure Pid = gs_66 | |
854 | + signature SIZEOF = gs_95 | |
855 | + structure Sizes = gs_78 | |
856 | + structure Tables = gs_74 | |
857 | + structure TextIO = gs_0 | |
858 | + structure Tid = gs_63 | |
859 | + structure Tidtab = gs_73 | |
860 | + structure TypeUtil = gs_97 | |
861 | + ast/sizeof.sml | |
862 | + in | |
863 | + structure gs_98 = Sizeof | |
864 | + end | |
865 | + local | |
866 | + structure ParseTree = gs_32 | |
867 | + structure Real = gs_38 | |
868 | + structure Tid = gs_63 | |
869 | + ast/anonymous-structs.sml | |
870 | + in | |
871 | + structure gs_99 = AnonymousStructs | |
872 | + structure gs_100 = TyEq | |
873 | + end | |
874 | + local | |
875 | + structure Aid = gs_12 | |
876 | + structure Ast = gs_69 | |
877 | + structure Bindings = gs_70 | |
878 | + structure Tid = gs_63 | |
879 | + ast/initializer-normalizer-sig.sml | |
880 | + in | |
881 | + signature gs_101 = INITIALIZER_NORMALIZER | |
882 | + end | |
883 | + local | |
884 | + structure Aid = gs_12 | |
885 | + structure Ast = gs_69 | |
886 | + structure Bindings = gs_70 | |
887 | + signature INITIALIZER_NORMALIZER = gs_101 | |
888 | + structure LargeInt = gs_29 | |
889 | + structure SourceMap = gs_17 | |
890 | + structure String = gs_15 | |
891 | + structure Tid = gs_63 | |
892 | + ast/initializer-normalizer.sml | |
893 | + in | |
894 | + structure gs_102 = InitializerNormalizer | |
895 | + end | |
896 | + local | |
897 | + structure Aid = gs_12 | |
898 | + structure Aidtab = gs_13 | |
899 | + structure AnonymousStructs = gs_99 | |
900 | + structure Ast = gs_69 | |
901 | + signature BUILD_AST = gs_82 | |
902 | + functor BinaryMapFn = gs_71 | |
903 | + structure Bindings = gs_70 | |
904 | + structure CTypeEq = gs_94 | |
905 | + structure CnvExt = gs_84 | |
906 | + structure Config = gs_4 | |
907 | + structure Error = gs_25 | |
908 | + structure InitializerNormalizer = gs_102 | |
909 | + structure Int = gs_10 | |
910 | + structure LargeInt = gs_29 | |
911 | + structure List = gs_21 | |
912 | + structure ListPair = gs_80 | |
913 | + structure Option = gs_81 | |
914 | + structure PPAst = gs_93 | |
915 | + structure PPLib = gs_88 | |
916 | + structure ParseTree = gs_32 | |
917 | + structure ParseTreeExt = gs_30 | |
918 | + structure Pid = gs_66 | |
919 | + structure SimplifyAssignOps = gs_85 | |
920 | + structure Sizeof = gs_98 | |
921 | + structure Sizes = gs_78 | |
922 | + structure SourceMap = gs_17 | |
923 | + structure State = gs_76 | |
924 | + structure String = gs_15 | |
925 | + structure Symbol = gs_65 | |
926 | + structure Tables = gs_74 | |
927 | + structure TextIO = gs_0 | |
928 | + structure Tid = gs_63 | |
929 | + structure Tidtab = gs_73 | |
930 | + structure TyEq = gs_100 | |
931 | + structure TypeUtil = gs_97 | |
932 | + structure Word = gs_7 | |
933 | + ast/build-ast.sml | |
934 | + in | |
935 | + structure gs_103 = BuildAst | |
936 | + end | |
937 | + local | |
938 | + structure Ast = gs_69 | |
939 | + structure Bindings = gs_70 | |
940 | + structure BuildAst = gs_103 | |
941 | + structure Error = gs_25 | |
942 | + signature PARSE_TO_AST = gs_79 | |
943 | + structure PPAst = gs_93 | |
944 | + structure PPLib = gs_88 | |
945 | + structure Parser = gs_61 | |
946 | + structure Sizes = gs_78 | |
947 | + structure State = gs_76 | |
948 | + structure Tables = gs_74 | |
949 | + structure TextIO = gs_0 | |
950 | + structure Tidtab = gs_73 | |
951 | + ast/parse-to-ast.sml | |
952 | + in | |
953 | + structure gs_104 = ParseToAst | |
954 | + end | |
955 | +in | |
956 | + signature AST = gs_68 | |
957 | + structure Aidtab = gs_13 | |
958 | + structure Ast = gs_69 | |
959 | + structure Bindings = gs_70 | |
960 | + signature CONFIG = gs_3 | |
961 | + structure Config = gs_4 | |
962 | + signature PARSECONTROL = gs_2 | |
963 | + signature PARSER = gs_33 | |
964 | + signature PARSETREE = gs_31 | |
965 | + signature PARSE_TO_AST = gs_79 | |
966 | + structure PPAst = gs_93 | |
967 | + signature PP_AST = gs_86 | |
968 | + structure ParseToAst = gs_104 | |
969 | + structure ParseTree = gs_32 | |
970 | + structure Parser = gs_61 | |
971 | + structure Pid = gs_66 | |
972 | + signature SOURCE_MAP = gs_16 | |
973 | + structure Sizeof = gs_98 | |
974 | + structure Sizes = gs_78 | |
975 | + structure SourceMap = gs_17 | |
976 | + structure State = gs_76 | |
977 | + structure Symbol = gs_65 | |
978 | + signature TYPECHECKCONTROL = gs_1 | |
979 | + structure Tables = gs_74 | |
980 | + structure Tid = gs_63 | |
981 | + structure Tidtab = gs_73 | |
982 | + structure TypeUtil = gs_97 | |
983 | + signature UID = gs_8 | |
984 | + signature UIDTABIMP = gs_6 | |
985 | +end | |
986 | +end | |
987 | + | |
988 | +end | |
989 | diff --git a/src/parser/grammar/c.grm.sml b/src/parser/grammar/c.grm.sml | |
990 | index 175f5c4..1404fd2 100644 | |
991 | --- a/src/parser/grammar/c.grm.sml | |
992 | +++ b/src/parser/grammar/c.grm.sml | |
993 | @@ -1658,7 +1658,7 @@ local | |
994 | fun f i = | |
995 | if i=numstates then g i | |
996 | else (Array.update(memo,i,SHIFT (STATE i)); f (i+1)) | |
997 | - in f 0 handle Subscript => () | |
998 | + in f 0 handle General.Subscript => () | |
999 | end | |
1000 | in | |
1001 | val entry_to_action = fn 0 => ACCEPT | 1 => ERROR | j => Array.sub(memo,(j-2)) | |
1002 | @@ -1668,7 +1668,7 @@ val actionRows=string_to_table(string_to_pairlist_default(T,entry_to_action),act | |
1003 | val actionRowNumbers = string_to_list actionRowNumbers | |
1004 | val actionT = let val actionRowLookUp= | |
1005 | let val a=Array.fromList(actionRows) in fn i=>Array.sub(a,i) end | |
1006 | -in Array.fromList(map actionRowLookUp actionRowNumbers) | |
1007 | +in Array.fromList(List.map actionRowLookUp actionRowNumbers) | |
1008 | end | |
1009 | in LrTable.mkLrTable {actions=actionT,gotos=gotoT,numRules=numrules, | |
1010 | numStates=numstates,initialState=STATE 0} | |
1011 | diff --git a/src/parser/parse-tree-sig.sml b/src/parser/parse-tree-sig.sml | |
1012 | index 4ac8151..a50f78c 100644 | |
1013 | --- a/src/parser/parse-tree-sig.sml | |
1014 | +++ b/src/parser/parse-tree-sig.sml | |
1015 | @@ -27,8 +27,10 @@ sig | |
1016 | | ModAssign | XorAssign | OrAssign | AndAssign | |
1017 | | LshiftAssign | RshiftAssign | |
1018 | | Uplus | |
1019 | - | SizeofType of ctype | |
1020 | - | OperatorExt of operatorExt | |
1021 | + | SizeofType of | |
1022 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list} | |
1023 | + | OperatorExt of | |
1024 | + ParseTreeExt.operatorExt | |
1025 | ||
1026 | and expression | |
1027 | = EmptyExpr | |
1028 | @@ -40,10 +42,17 @@ sig | |
1029 | | Binop of operator * expression * expression | |
1030 | | QuestionColon of expression * expression * expression | |
1031 | | Call of expression * expression list | |
1032 | - | Cast of ctype * expression | |
1033 | + | Cast of | |
1034 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list} * | |
1035 | + expression | |
1036 | | InitList of expression list | |
1037 | | MARKexpression of (SourceMap.location * expression) | |
1038 | - | ExprExt of expressionExt | |
1039 | + | ExprExt of | |
1040 | + (specifier, declarator, | |
1041 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list}, | |
1042 | + (* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list}, | |
1043 | + operator, expression, statement) | |
1044 | + ParseTreeExt.expressionExt | |
1045 | ||
1046 | and specifier | |
1047 | = Void | |
1048 | @@ -60,11 +69,15 @@ sig | |
1049 | | Wholenum | |
1050 | | Saturate | |
1051 | | Nonsaturate | |
1052 | - | Array of expression * ctype | |
1053 | - | Pointer of ctype | |
1054 | + | Array of | |
1055 | + expression * | |
1056 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list} | |
1057 | + | Pointer of | |
1058 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list} | |
1059 | | Function of | |
1060 | - {retType : ctype, | |
1061 | - params : (decltype * declarator) list} | |
1062 | + {retType : (* ctype *) {qualifiers : qualifier list, specifiers : specifier list}, | |
1063 | + params : ((* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list} * | |
1064 | + declarator) list} | |
1065 | | Enum of | |
1066 | {tagOpt : string option, | |
1067 | enumerators : (string * expression) list, | |
1068 | @@ -72,13 +85,19 @@ sig | |
1069 | | Struct of | |
1070 | {isStruct : bool, (* struct or union; true => struct *) | |
1071 | tagOpt : string option, (* optional tag *) | |
1072 | - members: (ctype * (declarator * expression) list) list} (* member specs *) | |
1073 | + members: ((* ctype *) {qualifiers : qualifier list, specifiers : specifier list} * | |
1074 | + (declarator * expression) list) list} (* member specs *) | |
1075 | | TypedefName of string | |
1076 | | StructTag of | |
1077 | {isStruct : bool, (* ??? *) | |
1078 | name : string} | |
1079 | | EnumTag of string | |
1080 | - | SpecExt of specifierExt | |
1081 | + | SpecExt of | |
1082 | + (specifier, declarator, | |
1083 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list}, | |
1084 | + (* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list}, | |
1085 | + operator, expression, statement) | |
1086 | + ParseTreeExt.specifierExt | |
1087 | ||
1088 | and declarator (* constructor suffix: "Decr" *) | |
1089 | = EmptyDecr | |
1090 | @@ -87,9 +106,17 @@ sig | |
1091 | | ArrayDecr of declarator * expression | |
1092 | | PointerDecr of declarator | |
1093 | | QualDecr of qualifier * declarator | |
1094 | - | FuncDecr of declarator * (decltype * declarator) list | |
1095 | + | FuncDecr of | |
1096 | + declarator * | |
1097 | + ((* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list} * | |
1098 | + declarator) list | |
1099 | | MARKdeclarator of (SourceMap.location * declarator) | |
1100 | - | DecrExt of declaratorExt | |
1101 | + | DecrExt of | |
1102 | + (specifier, declarator, | |
1103 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list}, | |
1104 | + (* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list}, | |
1105 | + operator, expression, statement) | |
1106 | + ParseTreeExt.declaratorExt | |
1107 | ||
1108 | (* supports extensions of C in which expressions contain statements *) | |
1109 | and statement | |
1110 | @@ -110,25 +137,42 @@ sig | |
1111 | | IfThenElse of expression * statement * statement | |
1112 | | Switch of expression * statement | |
1113 | | MARKstatement of (SourceMap.location * statement) | |
1114 | - | StatExt of statementExt | |
1115 | + | StatExt of | |
1116 | + (specifier, declarator, | |
1117 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list}, | |
1118 | + (* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list}, | |
1119 | + operator, expression, statement) | |
1120 | + ParseTreeExt.statementExt | |
1121 | ||
1122 | and declaration | |
1123 | - = Declaration of decltype * (declarator * expression) list | |
1124 | + = Declaration of | |
1125 | + (* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list} * | |
1126 | + (declarator * expression) list | |
1127 | | MARKdeclaration of (SourceMap.location * declaration) | |
1128 | - | DeclarationExt of declarationExt | |
1129 | + | DeclarationExt of | |
1130 | + (specifier, declarator, | |
1131 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list}, | |
1132 | + (* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list}, | |
1133 | + operator, expression, statement) | |
1134 | + ParseTreeExt.declarationExt | |
1135 | ||
1136 | (* the top-level constructs in a translation unit (i.e. source file) *) | |
1137 | and externalDecl | |
1138 | = ExternalDecl of declaration | |
1139 | | FunctionDef of | |
1140 | - {retType : decltype, (* return type *) | |
1141 | + {retType : (* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list}, (* return type *) | |
1142 | funDecr : declarator, (* function name declarator *) | |
1143 | krParams : declaration list, (* K&R-style parameter declarations *) | |
1144 | body : statement} (* function body *) | |
1145 | | MARKexternalDecl of (SourceMap.location * externalDecl) | |
1146 | - | ExternalDeclExt of externalDeclExt | |
1147 | + | ExternalDeclExt of | |
1148 | + (specifier, declarator, | |
1149 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list}, | |
1150 | + (* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list}, | |
1151 | + operator, expression, statement) | |
1152 | + ParseTreeExt.externalDeclExt | |
1153 | ||
1154 | - withtype ctype = | |
1155 | + type ctype = | |
1156 | {qualifiers : qualifier list, | |
1157 | specifiers : specifier list} | |
1158 | and decltype = | |
1159 | @@ -137,7 +181,7 @@ sig | |
1160 | storage : storage list} | |
1161 | ||
1162 | (* extension types for basic constructs *) | |
1163 | - and externalDeclExt = | |
1164 | + type externalDeclExt = | |
1165 | (specifier, declarator, ctype, decltype, operator, expression, statement) | |
1166 | ParseTreeExt.externalDeclExt | |
1167 | and declarationExt = | |
1168 | diff --git a/src/parser/parse-tree.sml b/src/parser/parse-tree.sml | |
1169 | index 160eb5e..b62b955 100644 | |
1170 | --- a/src/parser/parse-tree.sml | |
1171 | +++ b/src/parser/parse-tree.sml | |
1172 | @@ -23,8 +23,10 @@ struct | |
1173 | | ModAssign | XorAssign | OrAssign | AndAssign | |
1174 | | LshiftAssign | RshiftAssign | |
1175 | | Uplus | |
1176 | - | SizeofType of ctype | |
1177 | - | OperatorExt of operatorExt | |
1178 | + | SizeofType of | |
1179 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list} | |
1180 | + | OperatorExt of | |
1181 | + ParseTreeExt.operatorExt | |
1182 | ||
1183 | and expression | |
1184 | = EmptyExpr | |
1185 | @@ -36,10 +38,17 @@ struct | |
1186 | | Binop of operator * expression * expression | |
1187 | | QuestionColon of expression * expression * expression | |
1188 | | Call of expression * expression list | |
1189 | - | Cast of ctype * expression | |
1190 | + | Cast of | |
1191 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list} * | |
1192 | + expression | |
1193 | | InitList of expression list | |
1194 | | MARKexpression of (SourceMap.location * expression) | |
1195 | - | ExprExt of expressionExt | |
1196 | + | ExprExt of | |
1197 | + (specifier, declarator, | |
1198 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list}, | |
1199 | + (* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list}, | |
1200 | + operator, expression, statement) | |
1201 | + ParseTreeExt.expressionExt | |
1202 | ||
1203 | and specifier | |
1204 | = Void | |
1205 | @@ -56,11 +65,15 @@ struct | |
1206 | | Wholenum | |
1207 | | Saturate | |
1208 | | Nonsaturate | |
1209 | - | Array of expression * ctype | |
1210 | - | Pointer of ctype | |
1211 | + | Array of | |
1212 | + expression * | |
1213 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list} | |
1214 | + | Pointer of | |
1215 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list} | |
1216 | | Function of | |
1217 | - {retType : ctype, | |
1218 | - params : (decltype * declarator) list} | |
1219 | + {retType : (* ctype *) {qualifiers : qualifier list, specifiers : specifier list}, | |
1220 | + params : ((* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list} * | |
1221 | + declarator) list} | |
1222 | | Enum of | |
1223 | {tagOpt : string option, | |
1224 | enumerators : (string * expression) list, | |
1225 | @@ -68,13 +81,19 @@ struct | |
1226 | | Struct of | |
1227 | {isStruct : bool, (* struct or union; true => struct *) | |
1228 | tagOpt : string option, (* optional tag *) | |
1229 | - members: (ctype * (declarator * expression) list) list} (* member specs *) | |
1230 | + members: ((* ctype *) {qualifiers : qualifier list, specifiers : specifier list} * | |
1231 | + (declarator * expression) list) list} (* member specs *) | |
1232 | | TypedefName of string | |
1233 | | StructTag of | |
1234 | {isStruct : bool, (* ??? *) | |
1235 | name : string} | |
1236 | | EnumTag of string | |
1237 | - | SpecExt of specifierExt | |
1238 | + | SpecExt of | |
1239 | + (specifier, declarator, | |
1240 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list}, | |
1241 | + (* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list}, | |
1242 | + operator, expression, statement) | |
1243 | + ParseTreeExt.specifierExt | |
1244 | ||
1245 | and declarator (* constructor suffix: "Decr" *) | |
1246 | = EmptyDecr | |
1247 | @@ -83,9 +102,17 @@ struct | |
1248 | | ArrayDecr of declarator * expression | |
1249 | | PointerDecr of declarator | |
1250 | | QualDecr of qualifier * declarator | |
1251 | - | FuncDecr of declarator * (decltype * declarator) list | |
1252 | + | FuncDecr of | |
1253 | + declarator * | |
1254 | + ((* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list} * | |
1255 | + declarator) list | |
1256 | | MARKdeclarator of (SourceMap.location * declarator) | |
1257 | - | DecrExt of declaratorExt | |
1258 | + | DecrExt of | |
1259 | + (specifier, declarator, | |
1260 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list}, | |
1261 | + (* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list}, | |
1262 | + operator, expression, statement) | |
1263 | + ParseTreeExt.declaratorExt | |
1264 | ||
1265 | (* supports extensions of C in which expressions contain statements *) | |
1266 | and statement | |
1267 | @@ -106,24 +133,41 @@ struct | |
1268 | | IfThenElse of expression * statement * statement | |
1269 | | Switch of expression * statement | |
1270 | | MARKstatement of (SourceMap.location * statement) | |
1271 | - | StatExt of statementExt | |
1272 | + | StatExt of | |
1273 | + (specifier, declarator, | |
1274 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list}, | |
1275 | + (* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list}, | |
1276 | + operator, expression, statement) | |
1277 | + ParseTreeExt.statementExt | |
1278 | ||
1279 | and declaration | |
1280 | - = Declaration of decltype * (declarator * expression) list | |
1281 | + = Declaration of | |
1282 | + (* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list} * | |
1283 | + (declarator * expression) list | |
1284 | | MARKdeclaration of (SourceMap.location * declaration) | |
1285 | - | DeclarationExt of declarationExt | |
1286 | + | DeclarationExt of | |
1287 | + (specifier, declarator, | |
1288 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list}, | |
1289 | + (* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list}, | |
1290 | + operator, expression, statement) | |
1291 | + ParseTreeExt.declarationExt | |
1292 | ||
1293 | and externalDecl | |
1294 | = ExternalDecl of declaration | |
1295 | | FunctionDef of (* record? *) | |
1296 | - {retType : decltype, (* return type *) | |
1297 | + {retType : (* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list}, (* return type *) | |
1298 | funDecr : declarator, (* function name declarator *) | |
1299 | krParams : declaration list, (* K&R-style parameter declarations *) | |
1300 | body : statement} (* function body *) | |
1301 | | MARKexternalDecl of (SourceMap.location * externalDecl) | |
1302 | - | ExternalDeclExt of externalDeclExt | |
1303 | + | ExternalDeclExt of | |
1304 | + (specifier, declarator, | |
1305 | + (* ctype *) {qualifiers : qualifier list, specifiers : specifier list}, | |
1306 | + (* decltype *) {qualifiers : qualifier list, specifiers : specifier list, storage : storage list}, | |
1307 | + operator, expression, statement) | |
1308 | + ParseTreeExt.externalDeclExt | |
1309 | ||
1310 | - withtype ctype = | |
1311 | + type ctype = | |
1312 | {qualifiers : qualifier list, | |
1313 | specifiers : specifier list} | |
1314 | and decltype = | |
1315 | @@ -131,7 +175,7 @@ struct | |
1316 | specifiers : specifier list, | |
1317 | storage : storage list} | |
1318 | ||
1319 | - and externalDeclExt = | |
1320 | + type externalDeclExt = | |
1321 | (specifier, declarator, ctype, decltype, operator, expression, statement) | |
1322 | ParseTreeExt.externalDeclExt | |
1323 | and declarationExt = |