src/Pure/pure_syn.ML
author wenzelm
Thu, 16 Apr 2015 15:00:03 +0200
changeset 60095 35f626b11422
parent 58999 ed09ae4ea2d8
child 60096 7b98dbc1d13e
permissions -rw-r--r--
more explicit bootstrap_thy; clarified error;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
48879
cb5cdbb645cd clarified bootstrapping of Pure;
wenzelm
parents:
diff changeset
     1
(*  Title:      Pure/pure_syn.ML
cb5cdbb645cd clarified bootstrapping of Pure;
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
cb5cdbb645cd clarified bootstrapping of Pure;
wenzelm
parents:
diff changeset
     3
58928
23d0ffd48006 plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents: 58918
diff changeset
     4
Outer syntax for bootstrapping Isabelle/Pure.
48879
cb5cdbb645cd clarified bootstrapping of Pure;
wenzelm
parents:
diff changeset
     5
*)
cb5cdbb645cd clarified bootstrapping of Pure;
wenzelm
parents:
diff changeset
     6
60095
35f626b11422 more explicit bootstrap_thy;
wenzelm
parents: 58999
diff changeset
     7
signature PURE_SYN =
35f626b11422 more explicit bootstrap_thy;
wenzelm
parents: 58999
diff changeset
     8
sig
35f626b11422 more explicit bootstrap_thy;
wenzelm
parents: 58999
diff changeset
     9
  val bootstrap_thy: theory
35f626b11422 more explicit bootstrap_thy;
wenzelm
parents: 58999
diff changeset
    10
end;
35f626b11422 more explicit bootstrap_thy;
wenzelm
parents: 58999
diff changeset
    11
35f626b11422 more explicit bootstrap_thy;
wenzelm
parents: 58999
diff changeset
    12
structure Pure_Syn: PURE_SYN =
48879
cb5cdbb645cd clarified bootstrapping of Pure;
wenzelm
parents:
diff changeset
    13
struct
cb5cdbb645cd clarified bootstrapping of Pure;
wenzelm
parents:
diff changeset
    14
58928
23d0ffd48006 plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents: 58918
diff changeset
    15
val _ =
58999
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    16
  Outer_Syntax.command ("header", @{here}) "theory header"
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    17
    (Parse.document_source >> Thy_Output.old_header_command);
58918
8d36bc5eaed3 simplified keyword kinds;
wenzelm
parents: 58852
diff changeset
    18
58928
23d0ffd48006 plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents: 58918
diff changeset
    19
val _ =
58999
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    20
  Outer_Syntax.command ("chapter", @{here}) "chapter heading"
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    21
    (Parse.opt_target -- Parse.document_source >> Thy_Output.document_command);
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    22
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    23
val _ =
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    24
  Outer_Syntax.command ("section", @{here}) "section heading"
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    25
    (Parse.opt_target -- Parse.document_source >> Thy_Output.document_command);
58918
8d36bc5eaed3 simplified keyword kinds;
wenzelm
parents: 58852
diff changeset
    26
48879
cb5cdbb645cd clarified bootstrapping of Pure;
wenzelm
parents:
diff changeset
    27
val _ =
58999
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    28
  Outer_Syntax.command ("subsection", @{here}) "subsection heading"
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    29
    (Parse.opt_target -- Parse.document_source >> Thy_Output.document_command);
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    30
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    31
val _ =
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    32
  Outer_Syntax.command ("subsubsection", @{here}) "subsubsection heading"
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    33
    (Parse.opt_target -- Parse.document_source >> Thy_Output.document_command);
58928
23d0ffd48006 plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents: 58918
diff changeset
    34
23d0ffd48006 plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents: 58918
diff changeset
    35
val _ =
58999
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    36
  Outer_Syntax.command ("text", @{here}) "formal comment (primary style)"
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    37
    (Parse.opt_target -- Parse.document_source >> Thy_Output.document_command);
58928
23d0ffd48006 plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents: 58918
diff changeset
    38
23d0ffd48006 plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents: 58918
diff changeset
    39
val _ =
58999
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    40
  Outer_Syntax.command ("txt", @{here}) "formal comment (secondary style)"
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    41
    (Parse.opt_target -- Parse.document_source >> Thy_Output.document_command);
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    42
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    43
val _ =
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    44
  Outer_Syntax.command ("text_raw", @{here}) "raw LaTeX text"
ed09ae4ea2d8 uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents: 58928
diff changeset
    45
    (Parse.document_source >> K (Toplevel.imperative I));
58928
23d0ffd48006 plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents: 58918
diff changeset
    46
23d0ffd48006 plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents: 58918
diff changeset
    47
val _ =
23d0ffd48006 plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents: 58918
diff changeset
    48
  Outer_Syntax.command ("theory", @{here}) "begin theory"
58852
621c052789b4 obsolete;
wenzelm
parents: 58842
diff changeset
    49
    (Thy_Header.args >>
621c052789b4 obsolete;
wenzelm
parents: 58842
diff changeset
    50
      (fn _ => Toplevel.init_theory (fn () => error "Missing theory initialization")));
48879
cb5cdbb645cd clarified bootstrapping of Pure;
wenzelm
parents:
diff changeset
    51
60095
35f626b11422 more explicit bootstrap_thy;
wenzelm
parents: 58999
diff changeset
    52
35f626b11422 more explicit bootstrap_thy;
wenzelm
parents: 58999
diff changeset
    53
val bootstrap_thy = ML_Context.the_global_context ();
35f626b11422 more explicit bootstrap_thy;
wenzelm
parents: 58999
diff changeset
    54
35f626b11422 more explicit bootstrap_thy;
wenzelm
parents: 58999
diff changeset
    55
val _ = Theory.setup (Config.put_global Outer_Syntax.bootstrap false);
35f626b11422 more explicit bootstrap_thy;
wenzelm
parents: 58999
diff changeset
    56
48879
cb5cdbb645cd clarified bootstrapping of Pure;
wenzelm
parents:
diff changeset
    57
end;