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