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