author | wenzelm |
Wed, 22 Apr 2015 19:48:32 +0200 | |
changeset 60189 | 0d3a62127057 |
parent 60096 | 7b98dbc1d13e |
child 61036 | f6f2959bed67 |
permissions | -rw-r--r-- |
48879 | 1 |
(* Title: Pure/pure_syn.ML |
2 |
Author: Makarius |
|
3 |
||
60096 | 4 |
Outer syntax for bootstrapping: commands that are accessible outside a |
5 |
regular theory context. |
|
48879 | 6 |
*) |
7 |
||
60095 | 8 |
signature PURE_SYN = |
9 |
sig |
|
10 |
val bootstrap_thy: theory |
|
11 |
end; |
|
12 |
||
13 |
structure Pure_Syn: PURE_SYN = |
|
48879 | 14 |
struct |
15 |
||
58928
23d0ffd48006
plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents:
58918
diff
changeset
|
16 |
val _ = |
58999
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
17 |
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
|
18 |
(Parse.document_source >> Thy_Output.old_header_command); |
58918 | 19 |
|
58928
23d0ffd48006
plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents:
58918
diff
changeset
|
20 |
val _ = |
58999
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
21 |
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
|
22 |
(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
|
23 |
|
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
24 |
val _ = |
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
25 |
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
|
26 |
(Parse.opt_target -- Parse.document_source >> Thy_Output.document_command); |
58918 | 27 |
|
48879 | 28 |
val _ = |
58999
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
29 |
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
|
30 |
(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
|
31 |
|
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
32 |
val _ = |
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
33 |
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
|
34 |
(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
|
35 |
|
23d0ffd48006
plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents:
58918
diff
changeset
|
36 |
val _ = |
58999
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
37 |
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
|
38 |
(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
|
39 |
|
23d0ffd48006
plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents:
58918
diff
changeset
|
40 |
val _ = |
58999
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
41 |
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
|
42 |
(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
|
43 |
|
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
44 |
val _ = |
ed09ae4ea2d8
uniform treatment of all document markup commands: 'text' and 'txt' merely differ in LaTeX style;
wenzelm
parents:
58928
diff
changeset
|
45 |
Outer_Syntax.command ("text_raw", @{here}) "raw LaTeX text" |
60189 | 46 |
(Parse.document_source >> K (Toplevel.keep (fn _ => ()))); |
58928
23d0ffd48006
plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents:
58918
diff
changeset
|
47 |
|
23d0ffd48006
plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents:
58918
diff
changeset
|
48 |
val _ = |
23d0ffd48006
plain value Keywords.keywords, which might be used outside theory for bootstrap purposes;
wenzelm
parents:
58918
diff
changeset
|
49 |
Outer_Syntax.command ("theory", @{here}) "begin theory" |
58852 | 50 |
(Thy_Header.args >> |
51 |
(fn _ => Toplevel.init_theory (fn () => error "Missing theory initialization"))); |
|
48879 | 52 |
|
60095 | 53 |
|
54 |
val bootstrap_thy = ML_Context.the_global_context (); |
|
55 |
||
56 |
val _ = Theory.setup (Config.put_global Outer_Syntax.bootstrap false); |
|
57 |
||
48879 | 58 |
end; |