src/Pure/Isar/isar_syn.ML
author wenzelm
Sun Jun 25 23:49:55 2000 +0200 (2000-06-25 ago)
changeset 9129 effedd39a35e
parent 9056 8f78b2aea39e
child 9197 16d88c5547bd
permissions -rw-r--r--
use ThyHeader.args;
adapted OuterSyntax.markup_command;
wenzelm@5832
     1
(*  Title:      Pure/Isar/isar_syn.ML
wenzelm@5832
     2
    ID:         $Id$
wenzelm@5832
     3
    Author:     Markus Wenzel, TU Muenchen
wenzelm@8807
     4
    License:    GPL (GNU GENERAL PUBLIC LICENSE)
wenzelm@5832
     5
wenzelm@6353
     6
Isar/Pure outer syntax.
wenzelm@5832
     7
*)
wenzelm@5832
     8
wenzelm@5832
     9
signature ISAR_SYN =
wenzelm@5832
    10
sig
wenzelm@5832
    11
  val keywords: string list
wenzelm@5832
    12
  val parsers: OuterSyntax.parser list
wenzelm@5832
    13
end;
wenzelm@5832
    14
wenzelm@5832
    15
structure IsarSyn: ISAR_SYN =
wenzelm@5832
    16
struct
wenzelm@5832
    17
wenzelm@6723
    18
structure P = OuterParse and K = OuterSyntax.Keyword;
wenzelm@5832
    19
wenzelm@5832
    20
wenzelm@5832
    21
(** init and exit **)
wenzelm@5832
    22
wenzelm@5832
    23
val theoryP =
wenzelm@6723
    24
  OuterSyntax.command "theory" "begin theory" K.thy_begin
wenzelm@9129
    25
    (ThyHeader.args >> (Toplevel.print oo IsarThy.theory));
wenzelm@5832
    26
wenzelm@6687
    27
val end_excursionP =
wenzelm@6723
    28
  OuterSyntax.command "end" "end current excursion" K.thy_end
wenzelm@6687
    29
    (Scan.succeed (Toplevel.print o Toplevel.exit));
wenzelm@6687
    30
wenzelm@6245
    31
val contextP =
wenzelm@7102
    32
  OuterSyntax.improper_command "context" "switch theory context" K.thy_switch
wenzelm@6723
    33
    (P.name >> (Toplevel.print oo IsarThy.context));
wenzelm@6245
    34
wenzelm@5832
    35
wenzelm@5832
    36
wenzelm@7749
    37
(** markup commands **)
wenzelm@5832
    38
wenzelm@9129
    39
val headerP = OuterSyntax.markup_command IsarOutput.Markup "header" "theory header" K.diag
wenzelm@7733
    40
  (P.comment >> IsarThy.add_header);
wenzelm@6353
    41
wenzelm@9129
    42
val chapterP = OuterSyntax.markup_command IsarOutput.Markup "chapter" "chapter heading"
wenzelm@9129
    43
  K.thy_heading (P.comment >> (Toplevel.theory o IsarThy.add_chapter));
wenzelm@5958
    44
wenzelm@9129
    45
val sectionP = OuterSyntax.markup_command IsarOutput.Markup "section" "section heading"
wenzelm@9129
    46
  K.thy_heading (P.comment >> (Toplevel.theory o IsarThy.add_section));
wenzelm@5958
    47
wenzelm@9129
    48
val subsectionP = OuterSyntax.markup_command IsarOutput.Markup "subsection" "subsection heading"
wenzelm@9129
    49
  K.thy_heading (P.comment >> (Toplevel.theory o IsarThy.add_subsection));
wenzelm@5958
    50
wenzelm@7749
    51
val subsubsectionP =
wenzelm@9129
    52
  OuterSyntax.markup_command IsarOutput.Markup "subsubsection" "subsubsection heading"
wenzelm@9129
    53
  K.thy_heading (P.comment >> (Toplevel.theory o IsarThy.add_subsubsection));
wenzelm@5832
    54
wenzelm@9129
    55
val textP = OuterSyntax.markup_command IsarOutput.MarkupEnv "text" "formal comment (theory)"
wenzelm@9129
    56
  K.thy_decl (P.comment >> (Toplevel.theory o IsarThy.add_text));
wenzelm@7172
    57
wenzelm@9129
    58
val text_rawP = OuterSyntax.markup_command IsarOutput.Verbatim "text_raw"
wenzelm@9129
    59
  "raw document preparation text" K.thy_decl
wenzelm@9129
    60
  (P.comment >> (Toplevel.theory o IsarThy.add_text_raw));
wenzelm@7775
    61
wenzelm@7172
    62
wenzelm@9129
    63
val sectP = OuterSyntax.markup_command IsarOutput.Markup "sect" "formal comment (proof)" K.prf_decl
wenzelm@7172
    64
  (P.comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.add_sect)));
wenzelm@7172
    65
wenzelm@9129
    66
val subsectP = OuterSyntax.markup_command IsarOutput.Markup "subsect" "formal comment (proof)"
wenzelm@9129
    67
  K.prf_decl (P.comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.add_subsect)));
wenzelm@7172
    68
wenzelm@9129
    69
val subsubsectP = OuterSyntax.markup_command IsarOutput.Markup "subsubsect"
wenzelm@9129
    70
  "formal comment (proof)" K.prf_decl
wenzelm@7172
    71
  (P.comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.add_subsubsect)));
wenzelm@7172
    72
wenzelm@9129
    73
val txtP = OuterSyntax.markup_command IsarOutput.MarkupEnv "txt" "formal comment (proof)"
wenzelm@9129
    74
  K.prf_decl (P.comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.add_txt)));
wenzelm@7172
    75
wenzelm@9129
    76
val txt_rawP = OuterSyntax.markup_command IsarOutput.Verbatim "txt_raw"
wenzelm@9129
    77
  "raw document preparation text (proof)" K.prf_decl
wenzelm@9129
    78
  (P.comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.add_txt_raw)));
wenzelm@7775
    79
wenzelm@5832
    80
wenzelm@6886
    81
wenzelm@6886
    82
(** theory sections **)
wenzelm@6886
    83
wenzelm@5832
    84
(* classes and sorts *)
wenzelm@5832
    85
wenzelm@5832
    86
val classesP =
wenzelm@6723
    87
  OuterSyntax.command "classes" "declare type classes" K.thy_decl
wenzelm@6723
    88
    (Scan.repeat1 (P.name -- Scan.optional (P.$$$ "<" |-- P.!!! (P.list1 P.xname)) [])
wenzelm@6727
    89
      -- P.marg_comment >> (Toplevel.theory o IsarThy.add_classes));
wenzelm@5832
    90
wenzelm@5832
    91
val classrelP =
wenzelm@6723
    92
  OuterSyntax.command "classrel" "state inclusion of type classes (axiomatic!)" K.thy_decl
wenzelm@6727
    93
    (P.xname -- (P.$$$ "<" |-- P.!!! P.xname) -- P.marg_comment
wenzelm@6727
    94
      >> (Toplevel.theory o IsarThy.add_classrel));
wenzelm@5832
    95
wenzelm@5832
    96
val defaultsortP =
wenzelm@6723
    97
  OuterSyntax.command "defaultsort" "declare default sort" K.thy_decl
wenzelm@6727
    98
    (P.sort -- P.marg_comment >> (Toplevel.theory o IsarThy.add_defsort));
wenzelm@5832
    99
wenzelm@5832
   100
wenzelm@5832
   101
(* types *)
wenzelm@5832
   102
wenzelm@5832
   103
val typedeclP =
wenzelm@6723
   104
  OuterSyntax.command "typedecl" "Pure type declaration" K.thy_decl
wenzelm@6727
   105
    (P.type_args -- P.name -- P.opt_infix -- P.marg_comment >> (fn (((args, a), mx), cmt) =>
wenzelm@6727
   106
      Toplevel.theory (IsarThy.add_typedecl ((a, args, mx), cmt))));
wenzelm@5832
   107
wenzelm@5832
   108
val typeabbrP =
wenzelm@6723
   109
  OuterSyntax.command "types" "declare type abbreviations" K.thy_decl
wenzelm@6727
   110
    (Scan.repeat1
wenzelm@9037
   111
      (P.type_args -- P.name -- (P.$$$ "=" |-- P.!!! (P.typ -- P.opt_infix')) -- P.marg_comment)
wenzelm@6727
   112
      >> (Toplevel.theory o IsarThy.add_tyabbrs o
wenzelm@6727
   113
        map (fn (((args, a), (T, mx)), cmt) => ((a, args, T, mx), cmt))));
wenzelm@5832
   114
wenzelm@5832
   115
val nontermP =
wenzelm@6370
   116
  OuterSyntax.command "nonterminals" "declare types treated as grammar nonterminal symbols"
wenzelm@6727
   117
    K.thy_decl (Scan.repeat1 (P.name -- P.marg_comment)
wenzelm@6727
   118
      >> (Toplevel.theory o IsarThy.add_nonterminals));
wenzelm@5832
   119
wenzelm@5832
   120
val aritiesP =
wenzelm@6723
   121
  OuterSyntax.command "arities" "state type arities (axiomatic!)" K.thy_decl
wenzelm@6727
   122
    (Scan.repeat1 ((P.xname -- (P.$$$ "::" |-- P.!!! P.arity) >> P.triple2) -- P.marg_comment)
wenzelm@6727
   123
      >> (Toplevel.theory o IsarThy.add_arities));
wenzelm@5832
   124
wenzelm@5832
   125
wenzelm@5832
   126
(* consts and syntax *)
wenzelm@5832
   127
wenzelm@8227
   128
val judgmentP =
wenzelm@8227
   129
  OuterSyntax.command "judgment" "declare object-logic judgment" K.thy_decl
wenzelm@8227
   130
    (P.const -- P.marg_comment >> (Toplevel.theory o IsarThy.add_judgment));
wenzelm@8227
   131
wenzelm@5832
   132
val constsP =
wenzelm@6723
   133
  OuterSyntax.command "consts" "declare constants" K.thy_decl
wenzelm@6727
   134
    (Scan.repeat1 (P.const -- P.marg_comment) >> (Toplevel.theory o IsarThy.add_consts));
wenzelm@5832
   135
wenzelm@5832
   136
val opt_mode =
wenzelm@5832
   137
  Scan.optional
wenzelm@6723
   138
    (P.$$$ "(" |-- P.!!! (P.name -- Scan.optional (P.$$$ "output" >> K false) true --| P.$$$ ")"))
wenzelm@5832
   139
    ("", true);
wenzelm@5832
   140
wenzelm@5832
   141
val syntaxP =
wenzelm@6723
   142
  OuterSyntax.command "syntax" "declare syntactic constants" K.thy_decl
wenzelm@6727
   143
    (opt_mode -- Scan.repeat1 (P.const -- P.marg_comment)
wenzelm@6727
   144
      >> (Toplevel.theory o uncurry IsarThy.add_modesyntax));
wenzelm@5832
   145
wenzelm@5832
   146
wenzelm@5832
   147
(* translations *)
wenzelm@5832
   148
wenzelm@5832
   149
val trans_pat =
wenzelm@6723
   150
  Scan.optional (P.$$$ "(" |-- P.!!! (P.xname --| P.$$$ ")")) "logic" -- P.string;
wenzelm@5832
   151
wenzelm@5832
   152
fun trans_arrow toks =
wenzelm@6723
   153
  (P.$$$ "=>" >> K Syntax.ParseRule ||
wenzelm@6723
   154
    P.$$$ "<=" >> K Syntax.PrintRule ||
wenzelm@6723
   155
    P.$$$ "==" >> K Syntax.ParsePrintRule) toks;
wenzelm@5832
   156
wenzelm@5832
   157
val trans_line =
wenzelm@6723
   158
  trans_pat -- P.!!! (trans_arrow -- trans_pat)
wenzelm@5832
   159
    >> (fn (left, (arr, right)) => arr (left, right));
wenzelm@5832
   160
wenzelm@5832
   161
val translationsP =
wenzelm@6723
   162
  OuterSyntax.command "translations" "declare syntax translation rules" K.thy_decl
wenzelm@6727
   163
    (Scan.repeat1 (trans_line -- P.marg_comment) >> (Toplevel.theory o IsarThy.add_trrules));
wenzelm@5832
   164
wenzelm@5832
   165
wenzelm@5832
   166
(* axioms and definitions *)
wenzelm@5832
   167
wenzelm@5832
   168
val axiomsP =
wenzelm@6723
   169
  OuterSyntax.command "axioms" "state arbitrary propositions (axiomatic!)" K.thy_decl
wenzelm@6727
   170
    (Scan.repeat1 (P.spec_name -- P.marg_comment) >> (Toplevel.theory o IsarThy.add_axioms));
wenzelm@5832
   171
wenzelm@5832
   172
val defsP =
wenzelm@6723
   173
  OuterSyntax.command "defs" "define constants" K.thy_decl
wenzelm@7603
   174
    (Scan.repeat1 (P.spec_name -- P.marg_comment) >> (Toplevel.theory o IsarThy.add_defs));
wenzelm@6370
   175
wenzelm@6370
   176
val constdefsP =
wenzelm@6723
   177
  OuterSyntax.command "constdefs" "declare and define constants" K.thy_decl
wenzelm@6727
   178
    (Scan.repeat1 ((P.const -- P.marg_comment) -- (P.term -- P.marg_comment))
wenzelm@6727
   179
      >> (Toplevel.theory o IsarThy.add_constdefs));
wenzelm@5832
   180
wenzelm@5832
   181
wenzelm@5914
   182
(* theorems *)
wenzelm@5914
   183
wenzelm@6723
   184
val facts = P.opt_thm_name "=" -- P.xthms1;
wenzelm@5914
   185
wenzelm@5914
   186
val theoremsP =
wenzelm@6723
   187
  OuterSyntax.command "theorems" "define theorems" K.thy_decl
wenzelm@6727
   188
    (facts -- P.marg_comment >> (Toplevel.theory o IsarThy.have_theorems));
wenzelm@5914
   189
wenzelm@5914
   190
val lemmasP =
wenzelm@6723
   191
  OuterSyntax.command "lemmas" "define lemmas" K.thy_decl
wenzelm@6727
   192
    (facts -- P.marg_comment >> (Toplevel.theory o IsarThy.have_lemmas));
wenzelm@5914
   193
wenzelm@5914
   194
wenzelm@5832
   195
(* name space entry path *)
wenzelm@5832
   196
wenzelm@5832
   197
val globalP =
wenzelm@6723
   198
  OuterSyntax.command "global" "disable prefixing of theory name" K.thy_decl
wenzelm@8723
   199
    (P.marg_comment >> (Toplevel.theory o IsarThy.global_path));
wenzelm@5832
   200
wenzelm@5832
   201
val localP =
wenzelm@6723
   202
  OuterSyntax.command "local" "enable prefixing of theory name" K.thy_decl
wenzelm@8723
   203
    (P.marg_comment >> (Toplevel.theory o IsarThy.local_path));
wenzelm@8723
   204
wenzelm@8723
   205
val hideP =
wenzelm@8723
   206
  OuterSyntax.command "hide" "hide names from given name space" K.thy_decl
wenzelm@8723
   207
    (P.name -- Scan.repeat1 P.xname -- P.marg_comment >> (Toplevel.theory o IsarThy.hide_space));
wenzelm@5832
   208
wenzelm@5832
   209
wenzelm@5832
   210
(* use ML text *)
wenzelm@5832
   211
wenzelm@5832
   212
val useP =
wenzelm@6723
   213
  OuterSyntax.command "use" "eval ML text from file" K.diag
wenzelm@9010
   214
    (P.name >> (Toplevel.no_timing oo IsarCmd.use));
wenzelm@5832
   215
wenzelm@5832
   216
val mlP =
wenzelm@7616
   217
  OuterSyntax.command "ML" "eval ML text (diagnostic)" K.diag
wenzelm@7891
   218
    (P.text >> IsarCmd.use_mltext true);
wenzelm@7891
   219
wenzelm@7891
   220
val ml_commandP =
wenzelm@7891
   221
  OuterSyntax.command "ML_command" "eval ML text" K.diag
wenzelm@7891
   222
    (P.text >> IsarCmd.use_mltext false);
wenzelm@7616
   223
wenzelm@7616
   224
val ml_setupP =
wenzelm@7616
   225
  OuterSyntax.command "ML_setup" "eval ML text (may change theory)" K.thy_decl
wenzelm@7616
   226
    (P.text >> IsarCmd.use_mltext_theory);
wenzelm@5832
   227
wenzelm@5832
   228
val setupP =
wenzelm@7616
   229
  OuterSyntax.command "setup" "apply ML theory setup" K.thy_decl
wenzelm@8349
   230
    (P.text >> (Toplevel.theory o Context.use_setup));
wenzelm@5832
   231
wenzelm@5832
   232
wenzelm@5832
   233
(* translation functions *)
wenzelm@5832
   234
wenzelm@5832
   235
val parse_ast_translationP =
wenzelm@6723
   236
  OuterSyntax.command "parse_ast_translation" "install parse ast translation functions" K.thy_decl
wenzelm@6723
   237
    (P.text >> (Toplevel.theory o IsarThy.parse_ast_translation));
wenzelm@5832
   238
wenzelm@5832
   239
val parse_translationP =
wenzelm@6723
   240
  OuterSyntax.command "parse_translation" "install parse translation functions" K.thy_decl
wenzelm@6723
   241
    (P.text >> (Toplevel.theory o IsarThy.parse_translation));
wenzelm@5832
   242
wenzelm@5832
   243
val print_translationP =
wenzelm@6723
   244
  OuterSyntax.command "print_translation" "install print translation functions" K.thy_decl
wenzelm@6723
   245
    (P.text >> (Toplevel.theory o IsarThy.print_translation));
wenzelm@5832
   246
wenzelm@5832
   247
val typed_print_translationP =
wenzelm@6370
   248
  OuterSyntax.command "typed_print_translation" "install typed print translation functions"
wenzelm@6723
   249
    K.thy_decl (P.text >> (Toplevel.theory o IsarThy.typed_print_translation));
wenzelm@5832
   250
wenzelm@5832
   251
val print_ast_translationP =
wenzelm@6723
   252
  OuterSyntax.command "print_ast_translation" "install print ast translation functions" K.thy_decl
wenzelm@6723
   253
    (P.text >> (Toplevel.theory o IsarThy.print_ast_translation));
wenzelm@5832
   254
wenzelm@5832
   255
val token_translationP =
wenzelm@6723
   256
  OuterSyntax.command "token_translation" "install token translation functions" K.thy_decl
wenzelm@6723
   257
    (P.text >> (Toplevel.theory o IsarThy.token_translation));
wenzelm@5832
   258
wenzelm@5832
   259
wenzelm@5832
   260
(* oracles *)
wenzelm@5832
   261
wenzelm@5832
   262
val oracleP =
wenzelm@6723
   263
  OuterSyntax.command "oracle" "install oracle" K.thy_decl
wenzelm@7140
   264
    ((P.name --| P.$$$ "=") -- P.text -- P.marg_comment >> (Toplevel.theory o IsarThy.add_oracle));
wenzelm@5832
   265
wenzelm@5832
   266
wenzelm@5832
   267
wenzelm@5832
   268
(** proof commands **)
wenzelm@5832
   269
wenzelm@5832
   270
(* statements *)
wenzelm@5832
   271
wenzelm@6936
   272
fun statement f = (P.opt_thm_name ":" -- P.propp >> P.triple1) -- P.marg_comment >> f;
wenzelm@5832
   273
wenzelm@5832
   274
val theoremP =
wenzelm@6723
   275
  OuterSyntax.command "theorem" "state theorem" K.thy_goal
wenzelm@5832
   276
    (statement IsarThy.theorem >> (fn f => Toplevel.print o Toplevel.theory_to_proof f));
wenzelm@5832
   277
wenzelm@5832
   278
val lemmaP =
wenzelm@6723
   279
  OuterSyntax.command "lemma" "state lemma" K.thy_goal
wenzelm@5832
   280
    (statement IsarThy.lemma >> (fn f => Toplevel.print o Toplevel.theory_to_proof f));
wenzelm@5832
   281
wenzelm@5832
   282
val showP =
wenzelm@6723
   283
  OuterSyntax.command "show" "state local goal, solving current obligation" K.prf_goal
wenzelm@5832
   284
    (statement IsarThy.show >> (fn f => Toplevel.print o Toplevel.proof f));
wenzelm@5832
   285
wenzelm@5832
   286
val haveP =
wenzelm@6723
   287
  OuterSyntax.command "have" "state local goal" K.prf_goal
wenzelm@5832
   288
    (statement IsarThy.have >> (fn f => Toplevel.print o Toplevel.proof f));
wenzelm@5832
   289
wenzelm@6501
   290
val thusP =
wenzelm@6723
   291
  OuterSyntax.command "thus" "abbreviates \"then show\"" K.prf_goal
wenzelm@6501
   292
    (statement IsarThy.thus >> (fn f => Toplevel.print o Toplevel.proof f));
wenzelm@6501
   293
wenzelm@6501
   294
val henceP =
wenzelm@6723
   295
  OuterSyntax.command "hence" "abbreviates \"then have\"" K.prf_goal
wenzelm@6501
   296
    (statement IsarThy.hence >> (fn f => Toplevel.print o Toplevel.proof f));
wenzelm@6501
   297
wenzelm@5832
   298
wenzelm@5914
   299
(* facts *)
wenzelm@5832
   300
wenzelm@5832
   301
val thenP =
wenzelm@6723
   302
  OuterSyntax.command "then" "forward chaining" K.prf_chain
wenzelm@6727
   303
    (P.marg_comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.chain)));
wenzelm@5832
   304
wenzelm@5832
   305
val fromP =
wenzelm@6723
   306
  OuterSyntax.command "from" "forward chaining from given facts" K.prf_chain
wenzelm@6727
   307
    (P.xthms1 -- P.marg_comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.from_facts)));
wenzelm@5914
   308
wenzelm@6878
   309
val withP =
wenzelm@6878
   310
  OuterSyntax.command "with" "forward chaining from given and current facts" K.prf_chain
wenzelm@6878
   311
    (P.xthms1 -- P.marg_comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.with_facts)));
wenzelm@6878
   312
wenzelm@6773
   313
val noteP =
wenzelm@6723
   314
  OuterSyntax.command "note" "define facts" K.prf_decl
wenzelm@6755
   315
    (facts -- P.marg_comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.have_facts)));
wenzelm@5832
   316
wenzelm@5832
   317
wenzelm@5832
   318
(* proof context *)
wenzelm@5832
   319
wenzelm@5832
   320
val assumeP =
wenzelm@6869
   321
  OuterSyntax.command "assume" "assume propositions" K.prf_asm
wenzelm@7269
   322
    (P.and_list1 ((P.opt_thm_name ":" -- Scan.repeat1 P.propp >> P.triple1) -- P.marg_comment)
wenzelm@6727
   323
      >> (Toplevel.print oo (Toplevel.proof o IsarThy.assume)));
wenzelm@5832
   324
wenzelm@6850
   325
val presumeP =
wenzelm@6869
   326
  OuterSyntax.command "presume" "assume propositions, to be established later" K.prf_asm
wenzelm@7269
   327
    (P.and_list1 ((P.opt_thm_name ":" -- Scan.repeat1 P.propp >> P.triple1) -- P.marg_comment)
wenzelm@6850
   328
      >> (Toplevel.print oo (Toplevel.proof o IsarThy.presume)));
wenzelm@6850
   329
wenzelm@6953
   330
val defP =
wenzelm@6953
   331
  OuterSyntax.command "def" "local definition" K.prf_asm
wenzelm@6953
   332
    ((P.opt_thm_name ":" -- (P.name -- Scan.option (P.$$$ "::" |-- P.typ) --
wenzelm@6972
   333
      (P.$$$ "==" |-- P.termp)) >> P.triple1) -- P.marg_comment
wenzelm@6953
   334
      >> (Toplevel.print oo (Toplevel.proof o IsarThy.local_def)));
wenzelm@6953
   335
wenzelm@5832
   336
val fixP =
wenzelm@6869
   337
  OuterSyntax.command "fix" "fix variables (Skolem constants)" K.prf_asm
wenzelm@7415
   338
    (P.and_list1 (Scan.repeat1 P.name -- Scan.option (P.$$$ "::" |-- P.typ) -- P.marg_comment)
wenzelm@6727
   339
      >> (Toplevel.print oo (Toplevel.proof o IsarThy.fix)));
wenzelm@5832
   340
wenzelm@5832
   341
val letP =
wenzelm@6723
   342
  OuterSyntax.command "let" "bind text variables" K.prf_decl
wenzelm@8669
   343
    (P.and_list1 (P.enum1 "and" P.term -- (P.$$$ "=" |-- P.term) -- P.marg_comment)
wenzelm@8615
   344
      >> (Toplevel.print oo (Toplevel.proof o IsarThy.let_bind)));
wenzelm@5832
   345
wenzelm@8370
   346
val caseP =
wenzelm@8370
   347
  OuterSyntax.command "case" "invoke local context" K.prf_asm
wenzelm@8450
   348
    (P.xthm -- P.marg_comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.invoke_case)));
wenzelm@8370
   349
wenzelm@5832
   350
wenzelm@5832
   351
(* proof structure *)
wenzelm@5832
   352
wenzelm@5832
   353
val beginP =
wenzelm@9056
   354
  OuterSyntax.command "{" "begin explicit proof block" K.prf_open
wenzelm@9032
   355
    (P.marg_comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.begin_block)));
wenzelm@5832
   356
wenzelm@6687
   357
val endP =
wenzelm@9056
   358
  OuterSyntax.command "}" "end explicit proof block" K.prf_close
wenzelm@9032
   359
    (P.marg_comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.end_block)));
wenzelm@6687
   360
wenzelm@5832
   361
val nextP =
wenzelm@6723
   362
  OuterSyntax.command "next" "enter next proof block" K.prf_block
wenzelm@9032
   363
    (P.marg_comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.next_block)));
wenzelm@5832
   364
wenzelm@5832
   365
wenzelm@5832
   366
(* end proof *)
wenzelm@5832
   367
wenzelm@6404
   368
val qedP =
wenzelm@6735
   369
  OuterSyntax.command "qed" "conclude (sub-)proof" K.qed_block
wenzelm@7002
   370
    (Scan.option (P.method -- P.interest) -- P.marg_comment >> IsarThy.qed);
wenzelm@5832
   371
wenzelm@6404
   372
val terminal_proofP =
wenzelm@6723
   373
  OuterSyntax.command "by" "terminal backward proof" K.qed
wenzelm@7002
   374
    (P.method -- P.interest -- Scan.option (P.method -- P.interest)
wenzelm@7002
   375
      -- P.marg_comment >> IsarThy.terminal_proof);
wenzelm@6404
   376
wenzelm@8966
   377
val default_proofP =
wenzelm@8966
   378
  OuterSyntax.command ".." "default proof" K.qed
wenzelm@8966
   379
    (P.marg_comment >> IsarThy.default_proof);
wenzelm@8966
   380
wenzelm@6404
   381
val immediate_proofP =
wenzelm@6723
   382
  OuterSyntax.command "." "immediate proof" K.qed
wenzelm@7002
   383
    (P.marg_comment >> IsarThy.immediate_proof);
wenzelm@6404
   384
wenzelm@8966
   385
val done_proofP =
wenzelm@8966
   386
  OuterSyntax.command "done" "done proof" K.qed
wenzelm@8966
   387
    (P.marg_comment >> IsarThy.done_proof);
wenzelm@5832
   388
wenzelm@6888
   389
val skip_proofP =
wenzelm@7172
   390
  OuterSyntax.improper_command "sorry" "skip proof (quick-and-dirty mode only!)" K.qed
wenzelm@7002
   391
    (P.marg_comment >> IsarThy.skip_proof);
wenzelm@6888
   392
wenzelm@8210
   393
val forget_proofP =
wenzelm@8521
   394
  OuterSyntax.command "oops" "forget proof" K.qed_global
wenzelm@8210
   395
    (P.marg_comment >> IsarThy.forget_proof);
wenzelm@8210
   396
wenzelm@8210
   397
wenzelm@5832
   398
wenzelm@5832
   399
(* proof steps *)
wenzelm@5832
   400
wenzelm@8165
   401
val deferP =
wenzelm@8681
   402
  OuterSyntax.command "defer" "shuffle internal proof state" K.prf_script
wenzelm@8681
   403
    (Scan.option P.nat -- P.marg_comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.defer)));
wenzelm@8165
   404
wenzelm@8165
   405
val preferP =
wenzelm@8681
   406
  OuterSyntax.command "prefer" "shuffle internal proof state" K.prf_script
wenzelm@8681
   407
    (P.nat -- P.marg_comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.prefer)));
wenzelm@8165
   408
wenzelm@6850
   409
val applyP =
wenzelm@8681
   410
  OuterSyntax.command "apply" "initial refinement step (unstructured)" K.prf_script
wenzelm@8681
   411
    (P.method -- P.marg_comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.apply)));
wenzelm@5832
   412
wenzelm@8235
   413
val apply_endP =
wenzelm@8681
   414
  OuterSyntax.command "apply_end" "terminal refinement (unstructured)" K.prf_script
wenzelm@8681
   415
    (P.method -- P.marg_comment >> (Toplevel.print oo (Toplevel.proof o IsarThy.apply_end)));
wenzelm@5832
   416
wenzelm@6404
   417
val proofP =
wenzelm@6723
   418
  OuterSyntax.command "proof" "backward proof" K.prf_block
wenzelm@7002
   419
    (P.interest -- Scan.option (P.method -- P.interest) -- P.marg_comment
wenzelm@6727
   420
      >> (Toplevel.print oo (Toplevel.proof o IsarThy.proof)));
wenzelm@5832
   421
wenzelm@5832
   422
wenzelm@6773
   423
(* calculational proof commands *)
wenzelm@6773
   424
wenzelm@6878
   425
val calc_args =
wenzelm@6878
   426
  Scan.option (P.$$$ "(" |-- P.!!! ((P.xthms1 --| P.$$$ ")") -- P.interest));
wenzelm@6878
   427
wenzelm@6773
   428
val alsoP =
wenzelm@8562
   429
  OuterSyntax.command "also" "combine calculation and current facts" K.prf_decl
wenzelm@6878
   430
    (calc_args -- P.marg_comment >> IsarThy.also);
wenzelm@6773
   431
wenzelm@6773
   432
val finallyP =
wenzelm@8562
   433
  OuterSyntax.command "finally" "combine calculation and current facts, exhibit result" K.prf_chain
wenzelm@6878
   434
    (calc_args -- P.marg_comment >> IsarThy.finally);
wenzelm@6773
   435
wenzelm@8562
   436
val moreoverP =
wenzelm@8562
   437
  OuterSyntax.command "moreover" "augment calculation by current facts" K.prf_decl
wenzelm@8562
   438
    (P.marg_comment >> IsarThy.moreover);
wenzelm@8562
   439
wenzelm@8588
   440
val ultimatelyP =
wenzelm@8588
   441
  OuterSyntax.command "ultimately" "augment calculation by current facts, exhibit result"
wenzelm@8588
   442
    K.prf_chain (P.marg_comment >> IsarThy.ultimately);
wenzelm@8588
   443
wenzelm@6773
   444
wenzelm@6742
   445
(* proof navigation *)
wenzelm@5944
   446
wenzelm@5832
   447
val backP =
wenzelm@8235
   448
  OuterSyntax.command "back" "backtracking of proof command" K.prf_script
wenzelm@7368
   449
    (Scan.optional (P.$$$ "!" >> K true) false >>
wenzelm@7368
   450
      (Toplevel.print oo (Toplevel.proof o ProofHistory.back)));
wenzelm@5832
   451
wenzelm@5832
   452
wenzelm@6742
   453
(* history *)
wenzelm@6742
   454
wenzelm@6742
   455
val cannot_undoP =
wenzelm@6742
   456
  OuterSyntax.improper_command "cannot_undo" "report 'cannot undo' error message" K.control
wenzelm@9010
   457
    (P.name >> (Toplevel.no_timing oo IsarCmd.cannot_undo));
wenzelm@6742
   458
wenzelm@7733
   459
val clear_undosP =
wenzelm@7733
   460
  OuterSyntax.improper_command "clear_undos" "clear theory-level undo information" K.control
wenzelm@9010
   461
    (P.nat >> (Toplevel.no_timing oo IsarCmd.clear_undos_theory));
wenzelm@6742
   462
wenzelm@6742
   463
val redoP =
wenzelm@6742
   464
  OuterSyntax.improper_command "redo" "redo last command" K.control
wenzelm@9010
   465
    (Scan.succeed (Toplevel.no_timing o Toplevel.print o IsarCmd.redo));
wenzelm@6742
   466
wenzelm@6742
   467
val undos_proofP =
wenzelm@6742
   468
  OuterSyntax.improper_command "undos_proof" "undo last proof commands" K.control
wenzelm@9010
   469
    (P.nat >> ((Toplevel.no_timing o Toplevel.print) oo IsarCmd.undos_proof));
wenzelm@6742
   470
wenzelm@6742
   471
val undoP =
wenzelm@6742
   472
  OuterSyntax.improper_command "undo" "undo last command" K.control
wenzelm@9010
   473
    (Scan.succeed ((Toplevel.no_timing o Toplevel.print) o IsarCmd.undo));
wenzelm@6742
   474
wenzelm@8500
   475
val killP =
wenzelm@8500
   476
  OuterSyntax.improper_command "kill" "kill current history node" K.control
wenzelm@9010
   477
    (Scan.succeed ((Toplevel.no_timing o Toplevel.print) o IsarCmd.kill));
wenzelm@8500
   478
wenzelm@6742
   479
wenzelm@5832
   480
wenzelm@5832
   481
(** diagnostic commands (for interactive mode only) **)
wenzelm@5832
   482
wenzelm@8464
   483
val opt_modes = Scan.optional (P.$$$ "(" |-- P.!!! (Scan.repeat1 P.xname --| P.$$$ ")")) [];
wenzelm@8464
   484
wenzelm@8464
   485
wenzelm@7124
   486
val pretty_setmarginP =
wenzelm@7124
   487
  OuterSyntax.improper_command "pretty_setmargin" "change default margin for pretty printing"
wenzelm@9010
   488
    K.diag (P.nat >> (Toplevel.no_timing oo IsarCmd.pretty_setmargin));
wenzelm@7124
   489
wenzelm@5832
   490
val print_commandsP =
wenzelm@6723
   491
  OuterSyntax.improper_command "help" "print outer syntax (global)" K.diag
wenzelm@9010
   492
    (Scan.succeed (Toplevel.no_timing o OuterSyntax.print_help));
wenzelm@5832
   493
wenzelm@7308
   494
val print_contextP =
wenzelm@7308
   495
  OuterSyntax.improper_command "print_context" "print theory context name" K.diag
wenzelm@9010
   496
    (Scan.succeed (Toplevel.no_timing o IsarCmd.print_context));
wenzelm@7308
   497
wenzelm@5832
   498
val print_theoryP =
wenzelm@6723
   499
  OuterSyntax.improper_command "print_theory" "print logical theory contents (verbose!)" K.diag
wenzelm@9010
   500
    (Scan.succeed (Toplevel.no_timing o IsarCmd.print_theory));
wenzelm@5832
   501
wenzelm@5832
   502
val print_syntaxP =
wenzelm@6723
   503
  OuterSyntax.improper_command "print_syntax" "print inner syntax of theory (verbose!)" K.diag
wenzelm@9010
   504
    (Scan.succeed (Toplevel.no_timing o IsarCmd.print_syntax));
wenzelm@5832
   505
wenzelm@5881
   506
val print_theoremsP =
wenzelm@6723
   507
  OuterSyntax.improper_command "print_theorems" "print theorems known in this theory" K.diag
wenzelm@9010
   508
    (Scan.succeed (Toplevel.no_timing o IsarCmd.print_theorems));
wenzelm@5881
   509
wenzelm@5832
   510
val print_attributesP =
wenzelm@6723
   511
  OuterSyntax.improper_command "print_attributes" "print attributes known in this theory" K.diag
wenzelm@9010
   512
    (Scan.succeed (Toplevel.no_timing o IsarCmd.print_attributes));
wenzelm@5832
   513
wenzelm@5832
   514
val print_methodsP =
wenzelm@6723
   515
  OuterSyntax.improper_command "print_methods" "print methods known in this theory" K.diag
wenzelm@9010
   516
    (Scan.succeed (Toplevel.no_timing o IsarCmd.print_methods));
wenzelm@5832
   517
wenzelm@7616
   518
val thms_containingP =
wenzelm@7616
   519
  OuterSyntax.improper_command "thms_containing" "print theorems containing all given constants"
wenzelm@9010
   520
    K.diag (Scan.repeat P.xname >> (Toplevel.no_timing oo IsarCmd.print_thms_containing));
wenzelm@7616
   521
wenzelm@5832
   522
val print_bindsP =
wenzelm@6723
   523
  OuterSyntax.improper_command "print_binds" "print term bindings of proof context" K.diag
wenzelm@9010
   524
    (Scan.succeed (Toplevel.no_timing o IsarCmd.print_binds));
wenzelm@5832
   525
wenzelm@5832
   526
val print_lthmsP =
wenzelm@8370
   527
  OuterSyntax.improper_command "print_facts" "print facts of proof context" K.diag
wenzelm@9010
   528
    (Scan.succeed (Toplevel.no_timing o IsarCmd.print_lthms));
wenzelm@5832
   529
wenzelm@8370
   530
val print_casesP =
wenzelm@8370
   531
  OuterSyntax.improper_command "print_cases" "print cases of proof context" K.diag
wenzelm@9010
   532
    (Scan.succeed (Toplevel.no_timing o IsarCmd.print_cases));
wenzelm@8370
   533
wenzelm@5896
   534
val print_thmsP =
wenzelm@8464
   535
  OuterSyntax.improper_command "thm" "print theorems" K.diag
wenzelm@9010
   536
    (opt_modes -- P.xthms1 >> (Toplevel.no_timing oo IsarCmd.print_thms));
wenzelm@5832
   537
wenzelm@5832
   538
val print_propP =
wenzelm@6723
   539
  OuterSyntax.improper_command "prop" "read and print proposition" K.diag
wenzelm@9010
   540
    (opt_modes -- P.term >> (Toplevel.no_timing oo IsarCmd.print_prop));
wenzelm@5832
   541
wenzelm@5832
   542
val print_termP =
wenzelm@6723
   543
  OuterSyntax.improper_command "term" "read and print term" K.diag
wenzelm@9010
   544
    (opt_modes -- P.term >> (Toplevel.no_timing oo IsarCmd.print_term));
wenzelm@5832
   545
wenzelm@5832
   546
val print_typeP =
wenzelm@6723
   547
  OuterSyntax.improper_command "typ" "read and print type" K.diag
wenzelm@9010
   548
    (opt_modes -- P.typ >> (Toplevel.no_timing oo IsarCmd.print_type));
wenzelm@5832
   549
wenzelm@5832
   550
wenzelm@5832
   551
wenzelm@5832
   552
(** system commands (for interactive mode only) **)
wenzelm@5832
   553
wenzelm@5832
   554
val cdP =
wenzelm@8650
   555
  OuterSyntax.improper_command "cd" "change current working directory" K.diag
wenzelm@9010
   556
    (P.name >> (Toplevel.no_timing oo IsarCmd.cd));
wenzelm@5832
   557
wenzelm@5832
   558
val pwdP =
wenzelm@6723
   559
  OuterSyntax.improper_command "pwd" "print current working directory" K.diag
wenzelm@9010
   560
    (Scan.succeed (Toplevel.no_timing o IsarCmd.pwd));
wenzelm@5832
   561
wenzelm@5832
   562
val use_thyP =
wenzelm@6723
   563
  OuterSyntax.improper_command "use_thy" "use theory file" K.diag
wenzelm@9010
   564
    (P.name >> (Toplevel.no_timing oo IsarCmd.use_thy));
wenzelm@5832
   565
wenzelm@6694
   566
val use_thy_onlyP =
wenzelm@7102
   567
  OuterSyntax.improper_command "use_thy_only" "use theory file only, ignoring associated ML"
wenzelm@9010
   568
    K.diag (P.name >> (Toplevel.no_timing oo IsarCmd.use_thy_only));
wenzelm@6694
   569
wenzelm@6196
   570
val update_thyP =
wenzelm@6723
   571
  OuterSyntax.improper_command "update_thy" "update theory file" K.diag
wenzelm@9010
   572
    (P.name >> (Toplevel.no_timing oo IsarCmd.update_thy));
wenzelm@5832
   573
wenzelm@7102
   574
val update_thy_onlyP =
wenzelm@7102
   575
  OuterSyntax.improper_command "update_thy_only" "update theory file, ignoring associated ML"
wenzelm@9010
   576
    K.diag (P.name >> (Toplevel.no_timing oo IsarCmd.update_thy_only));
wenzelm@7102
   577
wenzelm@7102
   578
val touch_thyP =
wenzelm@7102
   579
  OuterSyntax.improper_command "touch_thy" "outdate theory, including descendants" K.diag
wenzelm@9010
   580
    (P.name >> (Toplevel.no_timing oo IsarCmd.touch_thy));
wenzelm@7102
   581
wenzelm@7102
   582
val touch_all_thysP =
wenzelm@7102
   583
  OuterSyntax.improper_command "touch_all_thys" "outdate all non-finished theories" K.diag
wenzelm@9010
   584
    (Scan.succeed (Toplevel.no_timing o IsarCmd.touch_all_thys));
wenzelm@7102
   585
wenzelm@7908
   586
val touch_child_thysP =
wenzelm@7908
   587
  OuterSyntax.improper_command "touch_child_thys" "outdate child theories" K.diag
wenzelm@9010
   588
    (P.name >> (Toplevel.no_timing oo IsarCmd.touch_child_thys));
wenzelm@7908
   589
wenzelm@7102
   590
val remove_thyP =
wenzelm@7102
   591
  OuterSyntax.improper_command "remove_thy" "remove theory from loader database" K.diag
wenzelm@9010
   592
    (P.name >> (Toplevel.no_timing oo IsarCmd.remove_thy));
wenzelm@7102
   593
wenzelm@7931
   594
val kill_thyP =
wenzelm@7931
   595
  OuterSyntax.improper_command "kill_thy" "kill theory -- try to remove from loader database"
wenzelm@9010
   596
    K.diag (P.name >> (Toplevel.no_timing oo IsarCmd.kill_thy));
wenzelm@7931
   597
wenzelm@5832
   598
val prP =
wenzelm@8886
   599
  OuterSyntax.improper_command "pr" "print current proof state (if present)" K.diag
wenzelm@9010
   600
    (opt_modes -- Scan.option P.nat >> (Toplevel.no_timing oo IsarCmd.pr));
wenzelm@7199
   601
wenzelm@7222
   602
val disable_prP =
wenzelm@7222
   603
  OuterSyntax.improper_command "disable_pr" "disable printing of toplevel state" K.diag
wenzelm@9010
   604
    (Scan.succeed (Toplevel.no_timing o IsarCmd.disable_pr));
wenzelm@5832
   605
wenzelm@7222
   606
val enable_prP =
wenzelm@7222
   607
  OuterSyntax.improper_command "enable_pr" "enable printing of toplevel state" K.diag
wenzelm@9010
   608
    (Scan.succeed (Toplevel.no_timing o IsarCmd.enable_pr));
wenzelm@7222
   609
wenzelm@5832
   610
val commitP =
wenzelm@6723
   611
  OuterSyntax.improper_command "commit" "commit current session to ML database" K.diag
wenzelm@9010
   612
    (P.opt_unit >> (Toplevel.no_timing oo K IsarCmd.use_commit));
wenzelm@5832
   613
wenzelm@5832
   614
val quitP =
wenzelm@6723
   615
  OuterSyntax.improper_command "quit" "quit Isabelle" K.control
wenzelm@9010
   616
    (P.opt_unit >> (Toplevel.no_timing oo K IsarCmd.quit));
wenzelm@5832
   617
wenzelm@5832
   618
val exitP =
wenzelm@6723
   619
  OuterSyntax.improper_command "exit" "exit Isar loop" K.control
wenzelm@9010
   620
    (Scan.succeed (Toplevel.no_timing o IsarCmd.exit));
wenzelm@5832
   621
wenzelm@7102
   622
val init_toplevelP =
wenzelm@7102
   623
  OuterSyntax.improper_command "init_toplevel" "restart Isar toplevel loop" K.control
wenzelm@9010
   624
    (Scan.succeed (Toplevel.no_timing o IsarCmd.init_toplevel));
wenzelm@5991
   625
wenzelm@7462
   626
val welcomeP =
wenzelm@8678
   627
  OuterSyntax.improper_command "welcome" "print welcome message" K.diag
wenzelm@9010
   628
    (Scan.succeed (Toplevel.no_timing o IsarCmd.welcome));
wenzelm@7462
   629
wenzelm@5832
   630
wenzelm@5832
   631
wenzelm@5832
   632
(** the Pure outer syntax **)
wenzelm@5832
   633
wenzelm@5832
   634
(*keep keywords consistent with the parsers, including those in
wenzelm@5832
   635
  outer_parse.ML, otherwise be prepared for unexpected errors*)
wenzelm@5832
   636
wenzelm@5832
   637
val keywords =
wenzelm@7415
   638
 ["!", "!!", "%", "%%", "(", ")", "+", ",", "--", ":", "::", ";", "<",
wenzelm@8669
   639
  "<=", "=", "==", "=>", "?", "[", "]", "and", "binder", "concl",
wenzelm@8896
   640
  "files", "in", "infixl", "infixr", "is", "output", "|"];
wenzelm@5832
   641
wenzelm@5832
   642
val parsers = [
wenzelm@5832
   643
  (*theory structure*)
wenzelm@8500
   644
  theoryP, end_excursionP, contextP,
wenzelm@7775
   645
  (*markup commands*)
wenzelm@7733
   646
  headerP, chapterP, sectionP, subsectionP, subsubsectionP, textP,
wenzelm@7862
   647
  text_rawP, sectP, subsectP, subsubsectP, txtP, txt_rawP,
wenzelm@5832
   648
  (*theory sections*)
wenzelm@7172
   649
  classesP, classrelP, defaultsortP, typedeclP, typeabbrP, nontermP,
wenzelm@8227
   650
  aritiesP, judgmentP, constsP, syntaxP, translationsP, axiomsP,
wenzelm@8723
   651
  defsP, constdefsP, theoremsP, lemmasP, globalP, localP, hideP, useP,
wenzelm@8723
   652
  mlP, ml_commandP, ml_setupP, setupP, parse_ast_translationP,
wenzelm@7891
   653
  parse_translationP, print_translationP, typed_print_translationP,
wenzelm@7616
   654
  print_ast_translationP, token_translationP, oracleP,
wenzelm@5832
   655
  (*proof commands*)
wenzelm@6850
   656
  theoremP, lemmaP, showP, haveP, thusP, henceP, assumeP, presumeP,
wenzelm@8464
   657
  defP, fixP, letP, caseP, thenP, fromP, withP, noteP, beginP, endP,
wenzelm@8966
   658
  nextP, qedP, terminal_proofP, default_proofP, immediate_proofP,
wenzelm@8966
   659
  done_proofP, skip_proofP, forget_proofP, deferP, preferP, applyP,
wenzelm@8966
   660
  apply_endP, proofP, alsoP, finallyP, moreoverP, ultimatelyP, backP,
wenzelm@8588
   661
  cannot_undoP, clear_undosP, redoP, undos_proofP, undoP, killP,
wenzelm@5832
   662
  (*diagnostic commands*)
wenzelm@7308
   663
  pretty_setmarginP, print_commandsP, print_contextP, print_theoryP,
wenzelm@7616
   664
  print_syntaxP, print_theoremsP, print_attributesP, print_methodsP,
wenzelm@8370
   665
  thms_containingP, print_bindsP, print_lthmsP, print_casesP,
wenzelm@8370
   666
  print_thmsP, print_propP, print_termP, print_typeP,
wenzelm@5832
   667
  (*system commands*)
wenzelm@7102
   668
  cdP, pwdP, use_thyP, use_thy_onlyP, update_thyP, update_thy_onlyP,
wenzelm@7931
   669
  touch_thyP, touch_all_thysP, touch_child_thysP, remove_thyP,
wenzelm@7931
   670
  kill_thyP, prP, disable_prP, enable_prP, commitP, quitP, exitP,
wenzelm@7931
   671
  init_toplevelP, welcomeP];
wenzelm@5832
   672
wenzelm@5832
   673
wenzelm@5832
   674
end;
wenzelm@5832
   675
wenzelm@5832
   676
wenzelm@6196
   677
(*install the Pure outer syntax*)
wenzelm@5832
   678
OuterSyntax.add_keywords IsarSyn.keywords;
wenzelm@5832
   679
OuterSyntax.add_parsers IsarSyn.parsers;