src/Pure/Isar/outer_syntax.ML
author wenzelm
Sun Oct 03 15:52:53 1999 +0200 (1999-10-03)
changeset 7683 e74f43f1d8a3
parent 7676 811022c3837e
child 7735 3e5ff3806831
permissions -rw-r--r--
export token_source;
improved Present.theory_source;
wenzelm@5829
     1
(*  Title:      Pure/Isar/outer_syntax.ML
wenzelm@5829
     2
    ID:         $Id$
wenzelm@5829
     3
    Author:     Markus Wenzel, TU Muenchen
wenzelm@5829
     4
wenzelm@5829
     5
The global Isabelle/Isar outer syntax.
wenzelm@5829
     6
*)
wenzelm@5829
     7
wenzelm@5829
     8
signature BASIC_OUTER_SYNTAX =
wenzelm@5829
     9
sig
wenzelm@5829
    10
  val main: unit -> unit
wenzelm@5883
    11
  val loop: unit -> unit
wenzelm@6860
    12
  val sync_main: unit -> unit
wenzelm@6860
    13
  val sync_loop: unit -> unit
wenzelm@5829
    14
  val help: unit -> unit
wenzelm@5829
    15
end;
wenzelm@5829
    16
wenzelm@5829
    17
signature OUTER_SYNTAX =
wenzelm@5829
    18
sig
wenzelm@5829
    19
  include BASIC_OUTER_SYNTAX
wenzelm@6722
    20
  structure Keyword:
wenzelm@6722
    21
    sig
wenzelm@6722
    22
      val control: string
wenzelm@6722
    23
      val diag: string
wenzelm@6722
    24
      val thy_begin: string
wenzelm@7104
    25
      val thy_switch: string
wenzelm@6722
    26
      val thy_end: string
wenzelm@6722
    27
      val thy_heading: string
wenzelm@6722
    28
      val thy_decl: string
wenzelm@6722
    29
      val thy_goal: string
wenzelm@6722
    30
      val qed: string
wenzelm@6733
    31
      val qed_block: string
wenzelm@6722
    32
      val prf_goal: string
wenzelm@6722
    33
      val prf_block: string
wenzelm@6722
    34
      val prf_chain: string
wenzelm@6722
    35
      val prf_decl: string
wenzelm@6868
    36
      val prf_asm: string
wenzelm@7676
    37
      val prf_asm_goal: string
wenzelm@6722
    38
      val prf_script: string
wenzelm@6722
    39
      val kinds: string list
wenzelm@6722
    40
    end
wenzelm@5829
    41
  type token
wenzelm@5829
    42
  type parser
wenzelm@6722
    43
  val command: string -> string -> string ->
wenzelm@6373
    44
    (token list -> (Toplevel.transition -> Toplevel.transition) * token list) -> parser
wenzelm@6722
    45
  val improper_command: string -> string -> string ->
wenzelm@6373
    46
    (token list -> (Toplevel.transition -> Toplevel.transition) * token list) -> parser
wenzelm@7026
    47
  val dest_keywords: unit -> string list
wenzelm@7026
    48
  val dest_parsers: unit -> (string * string * string * bool) list
wenzelm@5883
    49
  val print_outer_syntax: unit -> unit
wenzelm@7367
    50
  val print_help: Toplevel.transition -> Toplevel.transition
wenzelm@5829
    51
  val add_keywords: string list -> unit
wenzelm@5829
    52
  val add_parsers: parser list -> unit
wenzelm@7683
    53
  val token_source: (string, 'a) Source.source * Position.T -> (OuterLex.token,
wenzelm@7683
    54
    Position.T * (Symbol.symbol, (string, 'a) Source.source) Source.source) Source.source
wenzelm@6247
    55
  val theory_header: token list -> (string * string list * (string * bool) list) * token list
wenzelm@7192
    56
  val deps_thy: string -> Path.T -> string list * Path.T list
wenzelm@6199
    57
  val load_thy: string -> bool -> bool -> Path.T -> unit
wenzelm@7333
    58
  val isar: bool -> bool -> Toplevel.isar
wenzelm@5829
    59
end;
wenzelm@5829
    60
wenzelm@5829
    61
structure OuterSyntax: OUTER_SYNTAX =
wenzelm@5829
    62
struct
wenzelm@5829
    63
wenzelm@6860
    64
structure P = OuterParse;
wenzelm@6860
    65
wenzelm@5829
    66
wenzelm@5829
    67
(** outer syntax **)
wenzelm@5829
    68
wenzelm@6722
    69
(* command keyword classification *)
wenzelm@6722
    70
wenzelm@6722
    71
structure Keyword =
wenzelm@6722
    72
struct
wenzelm@6722
    73
  val control = "control";
wenzelm@6722
    74
  val diag = "diag";
wenzelm@6722
    75
  val thy_begin = "theory-begin";
wenzelm@7104
    76
  val thy_switch = "theory-switch";
wenzelm@6722
    77
  val thy_end = "theory-end";
wenzelm@6722
    78
  val thy_heading = "theory-heading";
wenzelm@6722
    79
  val thy_decl = "theory-decl";
wenzelm@6722
    80
  val thy_goal = "theory-goal";
wenzelm@6722
    81
  val qed = "qed";
wenzelm@6733
    82
  val qed_block = "qed-block";
wenzelm@6722
    83
  val prf_goal = "proof-goal";
wenzelm@6722
    84
  val prf_block = "proof-block";
wenzelm@6722
    85
  val prf_chain = "proof-chain";
wenzelm@6722
    86
  val prf_decl = "proof-decl";
wenzelm@6868
    87
  val prf_asm = "proof-asm";
wenzelm@7676
    88
  val prf_asm_goal = "proof-asm-goal";
wenzelm@6722
    89
  val prf_script = "proof-script";
wenzelm@6722
    90
wenzelm@7104
    91
  val kinds = [control, diag, thy_begin, thy_switch, thy_end, thy_heading, thy_decl, thy_goal,
wenzelm@7676
    92
    qed, qed_block, prf_goal, prf_block, prf_chain, prf_decl, prf_asm, prf_asm_goal, prf_script];
wenzelm@6722
    93
end;
wenzelm@6722
    94
wenzelm@6722
    95
wenzelm@5829
    96
(* parsers *)
wenzelm@5829
    97
wenzelm@5829
    98
type token = OuterLex.token;
wenzelm@5829
    99
type parser_fn = token list -> (Toplevel.transition -> Toplevel.transition) * token list;
wenzelm@5829
   100
wenzelm@5829
   101
datatype parser =
wenzelm@6722
   102
  Parser of string * (string * string) * bool * parser_fn;
wenzelm@5829
   103
wenzelm@6722
   104
fun parser int_only name comment kind parse = Parser (name, (comment, kind), int_only, parse);
wenzelm@5829
   105
wenzelm@5829
   106
wenzelm@5829
   107
(* parse command *)
wenzelm@5829
   108
wenzelm@6860
   109
local
wenzelm@6199
   110
wenzelm@5829
   111
fun command_body cmd (name, _) =
wenzelm@7026
   112
  (case cmd name of
wenzelm@7026
   113
    Some (int_only, parse) => P.!!! (Scan.prompt (name ^ "# ") (parse >> pair int_only))
wenzelm@7026
   114
  | None => sys_error ("no parser for outer syntax command " ^ quote name));
wenzelm@6860
   115
wenzelm@6860
   116
fun terminator false = Scan.succeed ()
wenzelm@6860
   117
  | terminator true = P.group "terminator" (Scan.option P.sync -- P.$$$ ";" >> K ());
wenzelm@6860
   118
wenzelm@6860
   119
in
wenzelm@5829
   120
wenzelm@6860
   121
fun command term cmd =
wenzelm@6860
   122
  P.$$$ ";" >> K None ||
wenzelm@6860
   123
  P.sync >> K None ||
wenzelm@7026
   124
  (P.position P.command :-- command_body cmd) --| terminator term
wenzelm@6860
   125
    >> (fn ((name, pos), (int_only, f)) =>
wenzelm@6860
   126
      Some (Toplevel.empty |> Toplevel.name name |> Toplevel.position pos |>
wenzelm@6860
   127
        Toplevel.interactive int_only |> f));
wenzelm@5829
   128
wenzelm@6199
   129
end;
wenzelm@6199
   130
wenzelm@5829
   131
wenzelm@5829
   132
wenzelm@5829
   133
(** global syntax state **)
wenzelm@5829
   134
wenzelm@7026
   135
local
wenzelm@7026
   136
wenzelm@7026
   137
val global_lexicons = ref (Scan.empty_lexicon, Scan.empty_lexicon);
wenzelm@6722
   138
val global_parsers = ref (Symtab.empty: ((string * string) * (bool * parser_fn)) Symtab.table);
wenzelm@5952
   139
wenzelm@7026
   140
fun change_lexicons f =
wenzelm@7026
   141
  let val lexs = f (! global_lexicons) in
wenzelm@7026
   142
    (case (op inter_string) (pairself Scan.dest_lexicon lexs) of
wenzelm@7026
   143
      [] => global_lexicons := lexs
wenzelm@7026
   144
    | bads => error ("Clash of outer syntax commands and keywords: " ^ commas_quote bads))
wenzelm@7026
   145
  end;
wenzelm@5829
   146
wenzelm@7026
   147
fun change_parsers f = global_parsers := f (! global_parsers);
wenzelm@6722
   148
wenzelm@7026
   149
in
wenzelm@7026
   150
wenzelm@7026
   151
(* get current lexers / parsers *)
wenzelm@7026
   152
wenzelm@7026
   153
(*Note: the syntax for files is statically determined at the very
wenzelm@7026
   154
  beginning; for interactive processing it may change dynamically.*)
wenzelm@7026
   155
wenzelm@7026
   156
fun get_lexicons () = ! global_lexicons;
wenzelm@7026
   157
fun get_parsers () = ! global_parsers;
wenzelm@7026
   158
fun get_parser () = apsome snd o curry Symtab.lookup (! global_parsers);
wenzelm@5829
   159
wenzelm@5829
   160
wenzelm@5829
   161
(* augment syntax *)
wenzelm@5829
   162
wenzelm@7026
   163
fun add_keywords keywords = change_lexicons (apfst (fn lex =>
wenzelm@7026
   164
  (Scan.extend_lexicon lex (map Symbol.explode keywords))));
wenzelm@5829
   165
wenzelm@5829
   166
fun add_parser (tab, Parser (name, comment, int_only, parse)) =
wenzelm@5829
   167
 (if is_none (Symtab.lookup (tab, name)) then ()
wenzelm@5829
   168
  else warning ("Redefined outer syntax command " ^ quote name);
wenzelm@5829
   169
  Symtab.update ((name, (comment, (int_only, parse))), tab));
wenzelm@5829
   170
wenzelm@5829
   171
fun add_parsers parsers =
wenzelm@7026
   172
  (change_parsers (fn tab => foldl add_parser (tab, parsers));
wenzelm@7026
   173
    change_lexicons (apsnd (fn lex => Scan.extend_lexicon lex
wenzelm@7026
   174
      (map (fn Parser (name, _, _, _) => Symbol.explode name) parsers))));
wenzelm@7026
   175
wenzelm@7026
   176
end;
wenzelm@5829
   177
wenzelm@5829
   178
wenzelm@7026
   179
(* print syntax *)
wenzelm@7026
   180
wenzelm@7026
   181
fun dest_keywords () = Scan.dest_lexicon (#1 (get_lexicons ()));
wenzelm@7026
   182
wenzelm@7026
   183
fun dest_parsers () =
wenzelm@7026
   184
  map (fn (name, ((cmt, kind), (int_only, _))) => (name, cmt, kind, int_only))
wenzelm@7026
   185
    (Symtab.dest (get_parsers ()));
wenzelm@5829
   186
wenzelm@7026
   187
fun print_outer_syntax () =
wenzelm@7026
   188
  let
wenzelm@7026
   189
    fun pretty_cmd (name, comment, _, _) =
wenzelm@7026
   190
      Pretty.block [Pretty.str (name ^ ":"), Pretty.brk 2, Pretty.str comment];
wenzelm@7026
   191
    val (int_cmds, cmds) = partition #4 (dest_parsers ());
wenzelm@7026
   192
  in
wenzelm@7026
   193
    Pretty.writeln (Pretty.strs ("syntax keywords:" :: map quote (dest_keywords ())));
wenzelm@7026
   194
    Pretty.writeln (Pretty.big_list "proper commands:" (map pretty_cmd cmds));
wenzelm@7026
   195
    Pretty.writeln (Pretty.big_list "improper commands (interactive-only):"
wenzelm@7026
   196
      (map pretty_cmd int_cmds))
wenzelm@7026
   197
  end;
wenzelm@5829
   198
wenzelm@7367
   199
val print_help =
wenzelm@7367
   200
  Toplevel.keep (fn state =>
wenzelm@7613
   201
    let val opt_thy = try Toplevel.theory_of state in
wenzelm@7613
   202
      print_outer_syntax ();
wenzelm@7613
   203
      Method.help_methods opt_thy;
wenzelm@7613
   204
      Attrib.help_attributes opt_thy
wenzelm@7613
   205
    end);
wenzelm@7367
   206
wenzelm@5829
   207
wenzelm@5829
   208
wenzelm@5829
   209
(** read theory **)
wenzelm@5829
   210
wenzelm@6247
   211
(* theory keyword *)
wenzelm@6247
   212
wenzelm@6247
   213
val theoryN = "theory";
wenzelm@6247
   214
val theory_keyword = OuterParse.$$$ theoryN;
wenzelm@6247
   215
wenzelm@6247
   216
wenzelm@7683
   217
(* sources *)
wenzelm@5829
   218
wenzelm@6860
   219
local
wenzelm@5829
   220
wenzelm@6860
   221
val no_terminator =
wenzelm@6860
   222
  Scan.unless (P.$$$ ";") (Scan.one (OuterLex.not_sync andf OuterLex.not_eof));
wenzelm@6860
   223
wenzelm@6860
   224
val recover = Scan.prompt "recover# " (Scan.repeat no_terminator);
wenzelm@6860
   225
wenzelm@6860
   226
in
wenzelm@5829
   227
wenzelm@6860
   228
fun source term do_recover cmd src =
wenzelm@5829
   229
  src
wenzelm@6860
   230
  |> Source.source OuterLex.stopper
wenzelm@6860
   231
    (Scan.bulk (fn xs => OuterParse.!!! (command term (cmd ())) xs))
wenzelm@6860
   232
    (if do_recover then Some recover else None)
wenzelm@5829
   233
  |> Source.mapfilter I;
wenzelm@5829
   234
wenzelm@6860
   235
end;
wenzelm@6860
   236
wenzelm@7683
   237
fun token_source (src, pos) =
wenzelm@7683
   238
  src
wenzelm@7683
   239
  |> Symbol.source false
wenzelm@7683
   240
  |> OuterLex.source false (K (get_lexicons ())) pos;
wenzelm@7683
   241
wenzelm@7683
   242
fun filter_proper src =
wenzelm@7683
   243
  src
wenzelm@7683
   244
  |> Source.filter OuterLex.is_proper;
wenzelm@7683
   245
wenzelm@5829
   246
wenzelm@5829
   247
(* detect header *)
wenzelm@5829
   248
wenzelm@7026
   249
fun scan_header get_lex scan (src, pos) =
wenzelm@5829
   250
  src
wenzelm@5829
   251
  |> Symbol.source false
wenzelm@7026
   252
  |> OuterLex.source false (fn () => (get_lex (), Scan.empty_lexicon)) pos
wenzelm@7683
   253
  |> filter_proper
wenzelm@6199
   254
  |> Source.source OuterLex.stopper (Scan.single scan) None
wenzelm@5829
   255
  |> (fst o the o Source.get_single);
wenzelm@5829
   256
wenzelm@6247
   257
val check_header_lexicon = Scan.make_lexicon [Symbol.explode theoryN];
wenzelm@5829
   258
wenzelm@6199
   259
fun is_old_theory src =
wenzelm@6247
   260
  is_none (scan_header (K check_header_lexicon) (Scan.option theory_keyword) src);
wenzelm@6199
   261
wenzelm@6199
   262
wenzelm@6199
   263
(* deps_thy --- inspect theory header *)
wenzelm@6199
   264
wenzelm@6247
   265
val header_lexicon =
wenzelm@6247
   266
  Scan.make_lexicon (map Symbol.explode ["(", ")", "+", ":", "=", "files", theoryN]);
wenzelm@6199
   267
wenzelm@6860
   268
local
wenzelm@6199
   269
wenzelm@7026
   270
val file_name =
wenzelm@7026
   271
  (P.$$$ "(" |-- P.!!! (P.name --| P.$$$ ")")) >> rpair false || P.name >> rpair true;
wenzelm@6247
   272
wenzelm@6247
   273
val theory_head =
wenzelm@6860
   274
  (P.name -- (P.$$$ "=" |-- P.enum1 "+" P.name) --
wenzelm@6860
   275
    Scan.optional (P.$$$ "files" |-- P.!!! (Scan.repeat1 file_name)) [])
wenzelm@6247
   276
  >> (fn ((A, Bs), files) => (A, Bs, files));
wenzelm@6247
   277
wenzelm@6860
   278
in
wenzelm@6860
   279
wenzelm@6860
   280
val theory_header = theory_head --| (Scan.ahead P.eof || P.$$$ ":");
wenzelm@6860
   281
val only_header = theory_keyword |-- theory_head --| Scan.ahead P.eof;
wenzelm@6860
   282
val new_header = theory_keyword |-- P.!!! theory_header;
wenzelm@6199
   283
wenzelm@6199
   284
val old_header =
wenzelm@6860
   285
  P.name -- (P.$$$ "=" |-- P.name -- Scan.repeat (P.$$$ "+" |-- P.name))
wenzelm@6247
   286
  >> (fn (A, (B, Bs)) => (A, B :: Bs, []: (string * bool) list));
wenzelm@6199
   287
wenzelm@6199
   288
end;
wenzelm@5829
   289
wenzelm@7192
   290
fun deps_thy name path =
wenzelm@6199
   291
  let
wenzelm@6641
   292
    val src = File.source path;
wenzelm@6247
   293
    val (name', parents, files) =
wenzelm@6199
   294
      (*Note: old style headers dynamically depend on the current lexicon :-( *)
wenzelm@7212
   295
      if is_old_theory src then scan_header ThySyn.get_lexicon (Scan.error old_header) src
wenzelm@6247
   296
      else scan_header (K header_lexicon) (Scan.error new_header) src;
wenzelm@6199
   297
wenzelm@6199
   298
    val ml_path = ThyLoad.ml_path name;
wenzelm@7192
   299
    val ml_file = if is_none (ThyLoad.check_file ml_path) then [] else [ml_path];
wenzelm@6199
   300
  in
wenzelm@6199
   301
    if name <> name' then
wenzelm@6199
   302
      error ("Filename " ^ quote (Path.pack path) ^ " does not match theory name " ^ quote name)
wenzelm@6247
   303
    else (parents, map (Path.unpack o #1) files @ ml_file)
wenzelm@6199
   304
  end;
wenzelm@6199
   305
wenzelm@6199
   306
wenzelm@6199
   307
(* load_thy --- read text (including header) *)
wenzelm@6199
   308
wenzelm@6247
   309
fun try_ml_file name ml time =
wenzelm@6199
   310
  let
wenzelm@6199
   311
    val path = ThyLoad.ml_path name;
wenzelm@7243
   312
    val tr = Toplevel.imperative (fn () => ThyInfo.may_load_file ml time path);
wenzelm@6247
   313
    val tr_name = if time then "time_use" else "use";
wenzelm@6199
   314
  in
wenzelm@7243
   315
    if is_none (ThyLoad.check_file path) then ()
wenzelm@7062
   316
    else Toplevel.excursion_error [Toplevel.empty |> Toplevel.name tr_name |> tr]
wenzelm@6199
   317
  end;
wenzelm@6199
   318
wenzelm@7683
   319
fun parse_thy src_pos =
wenzelm@6247
   320
  let
wenzelm@7683
   321
    val lex_src = filter_proper (token_source src_pos);
wenzelm@6247
   322
    val only_head =
wenzelm@6247
   323
      lex_src
wenzelm@6247
   324
      |> Source.source OuterLex.stopper (Scan.single (Scan.option only_header)) None
wenzelm@6247
   325
      |> (fst o the o Source.get_single);
wenzelm@6247
   326
  in
wenzelm@6247
   327
    (case only_head of
wenzelm@6247
   328
      None =>
wenzelm@6247
   329
        lex_src
wenzelm@6860
   330
        |> source false false (K (get_parser ()))
wenzelm@6247
   331
        |> Source.exhaust
wenzelm@6247
   332
    | Some spec =>
wenzelm@6247
   333
        [Toplevel.empty |> Toplevel.name theoryN |> IsarThy.theory spec,
wenzelm@6247
   334
          Toplevel.empty |> Toplevel.name "end" |> Toplevel.exit])
wenzelm@6247
   335
  end;
wenzelm@5829
   336
wenzelm@6247
   337
fun run_thy name path =
wenzelm@7683
   338
  let
wenzelm@7683
   339
    val (src, pos) = File.source path;
wenzelm@7683
   340
    val is_old = is_old_theory (src, pos);
wenzelm@7683
   341
  in
wenzelm@7683
   342
    Present.theory_source is_old name (src, pos);
wenzelm@7683
   343
    if is_old then ThySyn.load_thy name (Source.exhaust src)
wenzelm@7062
   344
    else Toplevel.excursion_error (parse_thy (src, pos))
wenzelm@6247
   345
  end;
wenzelm@6199
   346
wenzelm@6199
   347
fun load_thy name ml time path =
wenzelm@6247
   348
 (if time then
wenzelm@6247
   349
    timeit (fn () =>
wenzelm@6247
   350
     (writeln ("\n**** Starting theory " ^ quote name ^ " ****");
wenzelm@6247
   351
      setmp Goals.proof_timing true (run_thy name) path;
wenzelm@6247
   352
      writeln ("**** Finished theory " ^ quote name ^ " ****\n")))
wenzelm@6247
   353
  else run_thy name path;
wenzelm@6247
   354
  Context.context (ThyInfo.get_theory name);
wenzelm@6247
   355
  try_ml_file name ml time);
wenzelm@5829
   356
wenzelm@5829
   357
wenzelm@5829
   358
(* interactive source of state transformers *)
wenzelm@5829
   359
wenzelm@7333
   360
fun isar term no_pos =
wenzelm@5829
   361
  Source.tty
wenzelm@5829
   362
  |> Symbol.source true
wenzelm@7604
   363
  |> OuterLex.source true get_lexicons
wenzelm@7604
   364
    (if no_pos then Position.none else Position.line_name 1 "stdin")
wenzelm@7683
   365
  |> filter_proper
wenzelm@6860
   366
  |> source term true get_parser;
wenzelm@5829
   367
wenzelm@5829
   368
wenzelm@5829
   369
wenzelm@5829
   370
(** the read-eval-print loop **)
wenzelm@5829
   371
wenzelm@5923
   372
(* main loop *)
wenzelm@5923
   373
wenzelm@7333
   374
fun gen_loop term no_pos =
wenzelm@7333
   375
 (Context.reset_context ();
wenzelm@7333
   376
  Toplevel.loop (isar term no_pos));
wenzelm@5829
   377
wenzelm@7333
   378
fun gen_main term no_pos =
wenzelm@5829
   379
 (Toplevel.set_state Toplevel.toplevel;
wenzelm@5829
   380
  ml_prompts "ML> " "ML# ";
wenzelm@6199
   381
  writeln (Session.welcome ());
wenzelm@7333
   382
  gen_loop term no_pos);
wenzelm@6860
   383
wenzelm@7333
   384
fun main () = gen_main false false;
wenzelm@7333
   385
fun loop () = gen_loop false false;
wenzelm@7333
   386
fun sync_main () = gen_main true true;
wenzelm@7333
   387
fun sync_loop () = gen_loop true true;
wenzelm@5829
   388
wenzelm@5829
   389
wenzelm@5829
   390
(* help *)
wenzelm@5829
   391
wenzelm@5829
   392
fun help () =
wenzelm@5829
   393
  writeln ("This is Isabelle's underlying ML system (" ^ ml_system ^ ");\n\
wenzelm@5883
   394
    \invoke 'loop();' to enter the Isar loop.");
wenzelm@5829
   395
wenzelm@5829
   396
wenzelm@6373
   397
(*final declarations of this structure!*)
wenzelm@6685
   398
val command = parser false;
wenzelm@6685
   399
val improper_command = parser true;
wenzelm@6685
   400
wenzelm@6373
   401
wenzelm@5829
   402
end;
wenzelm@5829
   403
wenzelm@6199
   404
(*setup theory syntax dependent operations*)
wenzelm@6199
   405
ThyLoad.deps_thy_fn := OuterSyntax.deps_thy;
wenzelm@6199
   406
ThyLoad.load_thy_fn := OuterSyntax.load_thy;
wenzelm@6199
   407
structure ThyLoad: THY_LOAD = ThyLoad;
wenzelm@6199
   408
wenzelm@5829
   409
structure BasicOuterSyntax: BASIC_OUTER_SYNTAX = OuterSyntax;
wenzelm@5829
   410
open BasicOuterSyntax;