equal
deleted
inserted
replaced
6 *) |
6 *) |
7 |
7 |
8 infix |-> <-| <->; |
8 infix |-> <-| <->; |
9 |
9 |
10 signature BASIC_SYNTAX = |
10 signature BASIC_SYNTAX = |
11 sig |
11 sig |
12 include AST0 |
12 include AST0 |
13 include SYN_TRANS0 |
13 include SYN_TRANS0 |
14 include MIXFIX0 |
14 include MIXFIX0 |
15 include PRINTER0 |
15 include PRINTER0 |
16 datatype 'a trrule = |
16 datatype 'a trrule = |
17 op |-> of 'a * 'a | |
17 op |-> of 'a * 'a | |
18 op <-| of 'a * 'a | |
18 op <-| of 'a * 'a | |
19 op <-> of 'a * 'a |
19 op <-> of 'a * 'a |
20 end; |
20 end; |
21 |
21 |
22 signature SYNTAX = |
22 signature SYNTAX = |
23 sig |
23 sig |
24 include AST1 |
24 include AST1 |
25 include LEXICON0 |
25 include LEXICON0 |
26 include SYN_EXT0 |
26 include SYN_EXT0 |
27 include TYPE_EXT0 |
27 include TYPE_EXT0 |
28 include SYN_TRANS1 |
28 include SYN_TRANS1 |
29 include MIXFIX1 |
29 include MIXFIX1 |
30 include PRINTER0 |
30 include PRINTER0 |
31 sharing type ast = Parser.SynExt.Ast.ast |
|
32 datatype 'a trrule = |
31 datatype 'a trrule = |
33 op |-> of 'a * 'a | |
32 op |-> of 'a * 'a | |
34 op <-| of 'a * 'a | |
33 op <-| of 'a * 'a | |
35 op <-> of 'a * 'a |
34 op <-> of 'a * 'a |
36 type syntax |
35 type syntax |
60 val string_of_term: bool -> syntax -> term -> string |
59 val string_of_term: bool -> syntax -> term -> string |
61 val string_of_typ: syntax -> typ -> string |
60 val string_of_typ: syntax -> typ -> string |
62 val simple_string_of_typ: typ -> string |
61 val simple_string_of_typ: typ -> string |
63 val simple_pprint_typ: typ -> pprint_args -> unit |
62 val simple_pprint_typ: typ -> pprint_args -> unit |
64 val ambiguity_level: int ref |
63 val ambiguity_level: int ref |
65 end; |
64 end; |
66 |
65 |
67 functor SyntaxFun(structure Symtab: SYMTAB and TypeExt: TYPE_EXT |
66 structure Syntax : SYNTAX = |
68 and SynTrans: SYN_TRANS and Mixfix: MIXFIX and Printer: PRINTER |
|
69 sharing Mixfix.SynExt = SynTrans.Parser.SynExt = TypeExt.SynExt = Printer.SynExt) |
|
70 : SYNTAX = |
|
71 struct |
67 struct |
72 |
68 |
73 structure SynExt = TypeExt.SynExt; |
69 open Lexicon SynExt Ast Parser TypeExt SynTrans Mixfix Printer; |
74 structure Parser = SynTrans.Parser; |
|
75 structure Lexicon = Parser.Lexicon; |
|
76 open Lexicon SynExt SynExt.Ast Parser TypeExt SynTrans Mixfix Printer; |
|
77 |
70 |
78 |
71 |
79 (** tables of translation functions **) |
72 (** tables of translation functions **) |
80 |
73 |
81 (*the ref serves as unique id*) |
74 (*the ref serves as unique id*) |