src/Pure/Isar/outer_syntax.ML
author wenzelm
Sat Apr 23 19:50:51 2005 +0200 (2005-04-23)
changeset 15830 74d8412b1a27
parent 15570 8d8c70b41bab
child 15973 5fd94d84470f
permissions -rw-r--r--
added structure Isar (from isar.ML);
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@15830
    10
  structure Isar:
wenzelm@15830
    11
    sig
wenzelm@15830
    12
      val main: unit -> unit
wenzelm@15830
    13
      val loop: unit -> unit
wenzelm@15830
    14
      val sync_main: unit -> unit
wenzelm@15830
    15
      val sync_loop: unit -> unit
wenzelm@15830
    16
    end;
wenzelm@5829
    17
end;
wenzelm@5829
    18
wenzelm@5829
    19
signature OUTER_SYNTAX =
wenzelm@5829
    20
sig
wenzelm@5829
    21
  include BASIC_OUTER_SYNTAX
wenzelm@6722
    22
  structure Keyword:
wenzelm@6722
    23
    sig
wenzelm@6722
    24
      val control: string
wenzelm@6722
    25
      val diag: string
wenzelm@6722
    26
      val thy_begin: string
wenzelm@7104
    27
      val thy_switch: string
wenzelm@6722
    28
      val thy_end: string
wenzelm@6722
    29
      val thy_heading: string
wenzelm@6722
    30
      val thy_decl: string
wenzelm@9588
    31
      val thy_script: string
wenzelm@6722
    32
      val thy_goal: string
wenzelm@6722
    33
      val qed: string
wenzelm@6733
    34
      val qed_block: string
wenzelm@8209
    35
      val qed_global: string
wenzelm@9552
    36
      val prf_heading: string
wenzelm@6722
    37
      val prf_goal: string
wenzelm@6722
    38
      val prf_block: string
wenzelm@9056
    39
      val prf_open: string
wenzelm@9056
    40
      val prf_close: string
wenzelm@6722
    41
      val prf_chain: string
wenzelm@6722
    42
      val prf_decl: string
wenzelm@6868
    43
      val prf_asm: string
wenzelm@7676
    44
      val prf_asm_goal: string
wenzelm@6722
    45
      val prf_script: string
wenzelm@6722
    46
      val kinds: string list
wenzelm@6722
    47
    end
wenzelm@5829
    48
  type token
wenzelm@5829
    49
  type parser
wenzelm@6722
    50
  val command: string -> string -> string ->
wenzelm@6373
    51
    (token list -> (Toplevel.transition -> Toplevel.transition) * token list) -> parser
wenzelm@9132
    52
  val markup_command: IsarOutput.markup -> string -> string -> string ->
wenzelm@7789
    53
    (token list -> (Toplevel.transition -> Toplevel.transition) * token list) -> parser
wenzelm@6722
    54
  val improper_command: string -> string -> string ->
wenzelm@6373
    55
    (token list -> (Toplevel.transition -> Toplevel.transition) * token list) -> parser
wenzelm@14687
    56
  val is_keyword: string -> bool
wenzelm@7026
    57
  val dest_keywords: unit -> string list
wenzelm@7026
    58
  val dest_parsers: unit -> (string * string * string * bool) list
wenzelm@5883
    59
  val print_outer_syntax: unit -> unit
wenzelm@9223
    60
  val print_commands: Toplevel.transition -> Toplevel.transition
wenzelm@5829
    61
  val add_keywords: string list -> unit
wenzelm@5829
    62
  val add_parsers: parser list -> unit
wenzelm@12943
    63
  val check_text: string * Position.T -> bool -> Toplevel.state -> unit
wenzelm@7940
    64
  val deps_thy: string -> bool -> Path.T -> string list * Path.T list
wenzelm@6199
    65
  val load_thy: string -> bool -> bool -> Path.T -> unit
nipkow@14091
    66
  val isar: bool -> bool -> unit Toplevel.isar
aspinall@15224
    67
  val scan: string -> OuterLex.token list  
aspinall@15144
    68
  val read: OuterLex.token list -> 
aspinall@15144
    69
		(string * OuterLex.token list * Toplevel.transition) list
wenzelm@5829
    70
end;
wenzelm@5829
    71
aspinall@15224
    72
structure OuterSyntax : OUTER_SYNTAX  =
wenzelm@5829
    73
struct
wenzelm@5829
    74
wenzelm@7750
    75
structure T = OuterLex;
wenzelm@6860
    76
structure P = OuterParse;
wenzelm@6860
    77
wenzelm@5829
    78
wenzelm@5829
    79
(** outer syntax **)
wenzelm@5829
    80
wenzelm@6722
    81
(* command keyword classification *)
wenzelm@6722
    82
wenzelm@6722
    83
structure Keyword =
wenzelm@6722
    84
struct
wenzelm@6722
    85
  val control = "control";
wenzelm@6722
    86
  val diag = "diag";
wenzelm@6722
    87
  val thy_begin = "theory-begin";
wenzelm@7104
    88
  val thy_switch = "theory-switch";
wenzelm@6722
    89
  val thy_end = "theory-end";
wenzelm@6722
    90
  val thy_heading = "theory-heading";
wenzelm@6722
    91
  val thy_decl = "theory-decl";
wenzelm@9588
    92
  val thy_script = "theory-script";
wenzelm@6722
    93
  val thy_goal = "theory-goal";
wenzelm@6722
    94
  val qed = "qed";
wenzelm@6733
    95
  val qed_block = "qed-block";
wenzelm@8209
    96
  val qed_global = "qed-global";
wenzelm@9552
    97
  val prf_heading = "proof-heading";
wenzelm@6722
    98
  val prf_goal = "proof-goal";
wenzelm@6722
    99
  val prf_block = "proof-block";
wenzelm@9056
   100
  val prf_open = "proof-open";
wenzelm@9056
   101
  val prf_close = "proof-close";
wenzelm@6722
   102
  val prf_chain = "proof-chain";
wenzelm@6722
   103
  val prf_decl = "proof-decl";
wenzelm@6868
   104
  val prf_asm = "proof-asm";
wenzelm@7676
   105
  val prf_asm_goal = "proof-asm-goal";
wenzelm@6722
   106
  val prf_script = "proof-script";
wenzelm@6722
   107
wenzelm@9588
   108
  val kinds = [control, diag, thy_begin, thy_switch, thy_end, thy_heading, thy_decl, thy_script,
wenzelm@9588
   109
    thy_goal, qed, qed_block, qed_global, prf_heading, prf_goal, prf_block, prf_open, prf_close,
wenzelm@9588
   110
    prf_chain, prf_decl, prf_asm, prf_asm_goal, prf_script];
wenzelm@6722
   111
end;
wenzelm@6722
   112
wenzelm@6722
   113
wenzelm@5829
   114
(* parsers *)
wenzelm@5829
   115
wenzelm@7750
   116
type token = T.token;
wenzelm@5829
   117
type parser_fn = token list -> (Toplevel.transition -> Toplevel.transition) * token list;
wenzelm@5829
   118
wenzelm@5829
   119
datatype parser =
wenzelm@9132
   120
  Parser of string * (string * string * IsarOutput.markup option) * bool * parser_fn;
wenzelm@5829
   121
wenzelm@7750
   122
fun parser int_only markup name comment kind parse =
wenzelm@7750
   123
  Parser (name, (comment, kind, markup), int_only, parse);
wenzelm@5829
   124
wenzelm@5829
   125
wenzelm@5829
   126
(* parse command *)
wenzelm@5829
   127
wenzelm@6860
   128
local
wenzelm@6199
   129
wenzelm@14925
   130
fun terminate false = Scan.succeed ()
wenzelm@14925
   131
  | terminate true = P.group "end of input" (Scan.option P.sync -- P.semicolon >> K ());
wenzelm@14925
   132
wenzelm@14925
   133
fun trace false parse = parse
wenzelm@14925
   134
  | trace true parse = Scan.trace parse >> (fn (f, toks) => f o Toplevel.source toks);
wenzelm@14925
   135
wenzelm@14925
   136
fun body cmd trc (name, _) =
wenzelm@7026
   137
  (case cmd name of
skalberg@15531
   138
    SOME (int_only, parse) =>
wenzelm@14925
   139
      P.!!! (Scan.prompt (name ^ "# ") (trace trc parse >> pair int_only))
skalberg@15531
   140
  | NONE => sys_error ("no parser for outer syntax command " ^ quote name));
wenzelm@6860
   141
wenzelm@6860
   142
in
wenzelm@5829
   143
wenzelm@14925
   144
fun command do_terminate do_trace cmd =
skalberg@15531
   145
  P.semicolon >> K NONE ||
skalberg@15531
   146
  P.sync >> K NONE ||
wenzelm@14925
   147
  (P.position P.command :-- body cmd do_trace) --| terminate do_terminate
wenzelm@6860
   148
    >> (fn ((name, pos), (int_only, f)) =>
skalberg@15531
   149
      SOME (Toplevel.empty |> Toplevel.name name |> Toplevel.position pos |>
wenzelm@6860
   150
        Toplevel.interactive int_only |> f));
wenzelm@5829
   151
wenzelm@6199
   152
end;
wenzelm@6199
   153
wenzelm@5829
   154
wenzelm@5829
   155
wenzelm@9132
   156
(** global outer syntax **)
wenzelm@5829
   157
wenzelm@7026
   158
local
wenzelm@7026
   159
wenzelm@7026
   160
val global_lexicons = ref (Scan.empty_lexicon, Scan.empty_lexicon);
wenzelm@7750
   161
val global_parsers =
wenzelm@9132
   162
  ref (Symtab.empty: (((string * string) * (bool * parser_fn)) * IsarOutput.markup option)
wenzelm@9132
   163
    Symtab.table);
wenzelm@9132
   164
val global_markups = ref ([]: (string * IsarOutput.markup) list);
wenzelm@5952
   165
wenzelm@7026
   166
fun change_lexicons f =
wenzelm@7026
   167
  let val lexs = f (! global_lexicons) in
wenzelm@7026
   168
    (case (op inter_string) (pairself Scan.dest_lexicon lexs) of
wenzelm@7026
   169
      [] => global_lexicons := lexs
wenzelm@7026
   170
    | bads => error ("Clash of outer syntax commands and keywords: " ^ commas_quote bads))
wenzelm@7026
   171
  end;
wenzelm@5829
   172
skalberg@15531
   173
fun get_markup (ms, (name, (_, SOME m))) = (name, m) :: ms
wenzelm@7789
   174
  | get_markup (ms, _) = ms;
wenzelm@7750
   175
wenzelm@7750
   176
fun make_markups () = global_markups := Symtab.foldl get_markup ([], ! global_parsers);
wenzelm@9132
   177
fun change_parsers f = (Library.change global_parsers f; make_markups ());
wenzelm@6722
   178
wenzelm@7026
   179
in
wenzelm@7026
   180
wenzelm@7750
   181
wenzelm@9132
   182
(* access current syntax *)
wenzelm@7026
   183
wenzelm@7026
   184
(*Note: the syntax for files is statically determined at the very
wenzelm@7026
   185
  beginning; for interactive processing it may change dynamically.*)
wenzelm@7026
   186
wenzelm@7026
   187
fun get_lexicons () = ! global_lexicons;
wenzelm@7026
   188
fun get_parsers () = ! global_parsers;
skalberg@15570
   189
fun get_parser () = Option.map (#2 o #1) o curry Symtab.lookup (! global_parsers);
wenzelm@7789
   190
wenzelm@9132
   191
fun is_markup kind name =
skalberg@15531
   192
  (case assoc (! global_markups, name) of SOME k => k = kind | NONE => false);
wenzelm@9132
   193
fun markup kind = Scan.one (T.is_kind T.Command andf is_markup kind o T.val_of);
wenzelm@5829
   194
wenzelm@5829
   195
wenzelm@5829
   196
(* augment syntax *)
wenzelm@5829
   197
wenzelm@7026
   198
fun add_keywords keywords = change_lexicons (apfst (fn lex =>
wenzelm@7026
   199
  (Scan.extend_lexicon lex (map Symbol.explode keywords))));
wenzelm@5829
   200
wenzelm@7750
   201
fun add_parser (tab, Parser (name, (comment, kind, markup), int_only, parse)) =
wenzelm@5829
   202
 (if is_none (Symtab.lookup (tab, name)) then ()
wenzelm@5829
   203
  else warning ("Redefined outer syntax command " ^ quote name);
wenzelm@7750
   204
  Symtab.update ((name, (((comment, kind), (int_only, parse)), markup)), tab));
wenzelm@5829
   205
wenzelm@5829
   206
fun add_parsers parsers =
skalberg@15570
   207
  (change_parsers (fn tab => Library.foldl add_parser (tab, parsers));
wenzelm@7026
   208
    change_lexicons (apsnd (fn lex => Scan.extend_lexicon lex
wenzelm@7026
   209
      (map (fn Parser (name, _, _, _) => Symbol.explode name) parsers))));
wenzelm@7026
   210
wenzelm@7026
   211
end;
wenzelm@5829
   212
wenzelm@5829
   213
wenzelm@7026
   214
(* print syntax *)
wenzelm@7026
   215
wenzelm@14687
   216
fun is_keyword s = Scan.is_literal (#1 (get_lexicons ())) (Symbol.explode s);
wenzelm@7026
   217
fun dest_keywords () = Scan.dest_lexicon (#1 (get_lexicons ()));
wenzelm@7026
   218
wenzelm@7026
   219
fun dest_parsers () =
wenzelm@7750
   220
  map (fn (name, (((cmt, kind), (int_only, _)), _)) => (name, cmt, kind, int_only))
wenzelm@7026
   221
    (Symtab.dest (get_parsers ()));
wenzelm@5829
   222
wenzelm@9223
   223
fun print_outer_syntax () =
wenzelm@7026
   224
  let
wenzelm@7026
   225
    fun pretty_cmd (name, comment, _, _) =
wenzelm@7026
   226
      Pretty.block [Pretty.str (name ^ ":"), Pretty.brk 2, Pretty.str comment];
skalberg@15570
   227
    val (int_cmds, cmds) = List.partition #4 (dest_parsers ());
wenzelm@7026
   228
  in
wenzelm@8720
   229
    [Pretty.strs ("syntax keywords:" :: map quote (dest_keywords ())),
wenzelm@8720
   230
      Pretty.big_list "proper commands:" (map pretty_cmd cmds),
wenzelm@8720
   231
      Pretty.big_list "improper commands (interactive-only):" (map pretty_cmd int_cmds)]
wenzelm@9223
   232
    |> Pretty.chunks |> Pretty.writeln
wenzelm@7026
   233
  end;
wenzelm@5829
   234
wenzelm@9223
   235
val print_commands = Toplevel.imperative print_outer_syntax;
wenzelm@7367
   236
wenzelm@5829
   237
wenzelm@5829
   238
wenzelm@9132
   239
(** toplevel parsing **)
wenzelm@5829
   240
wenzelm@9132
   241
(* basic sources *)
wenzelm@6860
   242
wenzelm@14925
   243
fun toplevel_source term trc do_recover cmd src =
wenzelm@9132
   244
  let
wenzelm@9132
   245
    val no_terminator =
wenzelm@9132
   246
      Scan.unless P.semicolon (Scan.one (T.not_sync andf T.not_eof));
skalberg@15531
   247
    fun recover x = (Scan.prompt "recover# " (Scan.repeat no_terminator) >> K [NONE]) x;
wenzelm@9132
   248
  in
wenzelm@9132
   249
    src
wenzelm@12876
   250
    |> T.source_proper
wenzelm@9132
   251
    |> Source.source T.stopper
skalberg@15531
   252
      (Scan.bulk (P.$$$ "--" -- P.!!! P.text >> K NONE || P.not_eof >> SOME))
skalberg@15531
   253
      (if do_recover then SOME recover else NONE)
wenzelm@12876
   254
    |> Source.mapfilter I
wenzelm@14925
   255
    |> Source.source T.stopper (Scan.bulk (fn xs => P.!!! (command term trc (cmd ())) xs))
skalberg@15531
   256
      (if do_recover then SOME recover else NONE)
wenzelm@9132
   257
    |> Source.mapfilter I
wenzelm@9132
   258
  end;
wenzelm@5829
   259
wenzelm@7746
   260
wenzelm@9132
   261
(* interactive source of toplevel transformers *)
wenzelm@5829
   262
wenzelm@9132
   263
fun isar term no_pos =
wenzelm@9132
   264
  Source.tty
wenzelm@9132
   265
  |> Symbol.source true
wenzelm@9132
   266
  |> T.source true get_lexicons
wenzelm@9132
   267
    (if no_pos then Position.none else Position.line_name 1 "stdin")
wenzelm@14925
   268
  |> toplevel_source term false true get_parser;
wenzelm@6199
   269
wenzelm@6199
   270
aspinall@15144
   271
(* scan text,  read tokens with trace (for Proof General) *)
wenzelm@14925
   272
aspinall@15144
   273
fun scan str =
aspinall@15144
   274
 Source.of_string str
aspinall@15144
   275
 |> Symbol.source false
aspinall@15224
   276
 |> T.source true get_lexicons Position.none
aspinall@15144
   277
 |> Source.exhaust
wenzelm@14925
   278
aspinall@15144
   279
fun read toks =
aspinall@15144
   280
  Source.of_list toks
wenzelm@14925
   281
  |> toplevel_source false true true get_parser
wenzelm@14925
   282
  |> Source.exhaust
skalberg@15570
   283
  |> map (fn tr => (Toplevel.name_of tr, valOf (Toplevel.source_of tr), tr));
nipkow@14091
   284
nipkow@14091
   285
wenzelm@9132
   286
(** read theory **)
wenzelm@6247
   287
wenzelm@12943
   288
(* check_text *)
wenzelm@12943
   289
wenzelm@12943
   290
fun check_text s true state = (IsarOutput.eval_antiquote (#1 (get_lexicons ())) state s; ())
wenzelm@12943
   291
  | check_text _ false _ = ();
wenzelm@12943
   292
wenzelm@12943
   293
wenzelm@9132
   294
(* deps_thy *)
wenzelm@6199
   295
wenzelm@7940
   296
fun deps_thy name ml path =
wenzelm@6199
   297
  let
wenzelm@7735
   298
    val src = Source.of_string (File.read path);
wenzelm@7735
   299
    val pos = Path.position path;
wenzelm@9132
   300
    val (name', parents, files) = ThyHeader.scan (src, pos);
wenzelm@6199
   301
    val ml_path = ThyLoad.ml_path name;
skalberg@15570
   302
    val ml_file = if ml andalso isSome (ThyLoad.check_file NONE ml_path) then [ml_path] else [];
wenzelm@6199
   303
  in
wenzelm@6199
   304
    if name <> name' then
wenzelm@7940
   305
      error ("Filename " ^ quote (Path.pack path) ^
wenzelm@8078
   306
        " does not agree with theory name " ^ quote name')
wenzelm@6247
   307
    else (parents, map (Path.unpack o #1) files @ ml_file)
wenzelm@6199
   308
  end;
wenzelm@6199
   309
wenzelm@7746
   310
wenzelm@9132
   311
(* load_thy *)
wenzelm@6199
   312
wenzelm@7746
   313
local
wenzelm@7746
   314
wenzelm@7940
   315
fun try_ml_file name time =
wenzelm@6199
   316
  let
wenzelm@6199
   317
    val path = ThyLoad.ml_path name;
wenzelm@7940
   318
    val tr = Toplevel.imperative (fn () => ThyInfo.load_file time path);
wenzelm@6247
   319
    val tr_name = if time then "time_use" else "use";
wenzelm@6199
   320
  in
skalberg@15531
   321
    if is_none (ThyLoad.check_file NONE path) then ()
wenzelm@9132
   322
    else Toplevel.excursion [Toplevel.empty |> Toplevel.name tr_name |> tr]
wenzelm@6199
   323
  end;
wenzelm@6199
   324
wenzelm@9132
   325
fun parse_thy src =
wenzelm@9132
   326
  src
wenzelm@14925
   327
  |> toplevel_source false false false (K (get_parser ()))
wenzelm@7746
   328
  |> Source.exhaust;
wenzelm@5829
   329
wenzelm@6247
   330
fun run_thy name path =
wenzelm@7683
   331
  let
wenzelm@7735
   332
    val pos = Path.position path;
wenzelm@9132
   333
    val text = Library.untabify (explode (File.read path));
wenzelm@9132
   334
    val text_src = Source.of_list text;
wenzelm@9132
   335
    fun present_text () = Source.exhaust (Symbol.source false text_src);
wenzelm@7683
   336
  in
wenzelm@7735
   337
    Present.init_theory name;
wenzelm@9132
   338
    Present.verbatim_source name present_text;
wenzelm@9132
   339
    if ThyHeader.is_old (text_src, pos) then (ThySyn.load_thy name text;
wenzelm@9132
   340
      Present.old_symbol_source name present_text)   (*note: text presented twice*)
wenzelm@9132
   341
    else
wenzelm@9132
   342
      let
wenzelm@12876
   343
        val tok_src = text_src
wenzelm@12876
   344
          |> Symbol.source false
wenzelm@12876
   345
          |> T.source false (K (get_lexicons ())) pos
wenzelm@12876
   346
          |> Source.exhausted;
wenzelm@9132
   347
        val out = Toplevel.excursion_result
wenzelm@9132
   348
          (IsarOutput.parse_thy markup (#1 (get_lexicons ()))
wenzelm@9132
   349
            (parse_thy tok_src) tok_src);
wenzelm@9132
   350
      in Present.theory_output name (Buffer.content out) end
wenzelm@6247
   351
  end;
wenzelm@6199
   352
wenzelm@7746
   353
in
wenzelm@7746
   354
wenzelm@6199
   355
fun load_thy name ml time path =
wenzelm@6247
   356
 (if time then
wenzelm@6247
   357
    timeit (fn () =>
wenzelm@6247
   358
     (writeln ("\n**** Starting theory " ^ quote name ^ " ****");
wenzelm@9036
   359
      run_thy name path;
wenzelm@6247
   360
      writeln ("**** Finished theory " ^ quote name ^ " ****\n")))
wenzelm@6247
   361
  else run_thy name path;
wenzelm@6247
   362
  Context.context (ThyInfo.get_theory name);
wenzelm@7940
   363
  if ml then try_ml_file name time else ());
wenzelm@5829
   364
wenzelm@7746
   365
end;
wenzelm@7746
   366
wenzelm@5829
   367
wenzelm@5829
   368
wenzelm@5829
   369
(** the read-eval-print loop **)
wenzelm@5829
   370
wenzelm@5923
   371
(* main loop *)
wenzelm@5923
   372
wenzelm@7333
   373
fun gen_loop term no_pos =
wenzelm@7333
   374
 (Context.reset_context ();
wenzelm@7333
   375
  Toplevel.loop (isar term no_pos));
wenzelm@5829
   376
wenzelm@7333
   377
fun gen_main term no_pos =
wenzelm@5829
   378
 (Toplevel.set_state Toplevel.toplevel;
wenzelm@6199
   379
  writeln (Session.welcome ());
wenzelm@7333
   380
  gen_loop term no_pos);
wenzelm@6860
   381
wenzelm@15830
   382
structure Isar =
wenzelm@15830
   383
struct
wenzelm@15830
   384
  fun main () = gen_main false false;
wenzelm@15830
   385
  fun loop () = gen_loop false false;
wenzelm@15830
   386
  fun sync_main () = gen_main true true;
wenzelm@15830
   387
  fun sync_loop () = gen_loop true true;
wenzelm@15830
   388
end;
wenzelm@5829
   389
wenzelm@5829
   390
wenzelm@6373
   391
(*final declarations of this structure!*)
skalberg@15531
   392
val command = parser false NONE;
skalberg@15531
   393
val markup_command = parser false o SOME;
skalberg@15531
   394
val improper_command = parser true NONE;
wenzelm@6685
   395
wenzelm@5829
   396
end;
wenzelm@5829
   397
wenzelm@6199
   398
(*setup theory syntax dependent operations*)
wenzelm@6199
   399
ThyLoad.deps_thy_fn := OuterSyntax.deps_thy;
wenzelm@6199
   400
ThyLoad.load_thy_fn := OuterSyntax.load_thy;
wenzelm@6199
   401
structure ThyLoad: THY_LOAD = ThyLoad;
wenzelm@6199
   402
wenzelm@5829
   403
structure BasicOuterSyntax: BASIC_OUTER_SYNTAX = OuterSyntax;
wenzelm@5829
   404
open BasicOuterSyntax;
wenzelm@15830
   405
open Isar;