6698
|
1 |
(* Title: Pure/Interface/isamode.ML
|
|
2 |
ID: $Id$
|
|
3 |
Author: Markus Wenzel, TU Muenchen
|
|
4 |
|
|
5 |
Configuration for David Aspinall's Isamode.
|
|
6 |
*)
|
|
7 |
|
|
8 |
signature ISAMODE =
|
|
9 |
sig
|
|
10 |
val setup: (theory -> theory) list
|
|
11 |
val init: bool -> unit
|
|
12 |
end;
|
|
13 |
|
|
14 |
structure Isamode: ISAMODE =
|
|
15 |
struct
|
|
16 |
|
|
17 |
(** compile-time theory setup **)
|
|
18 |
|
|
19 |
(* token translations *)
|
|
20 |
|
|
21 |
val isamodeN = "Isamode";
|
|
22 |
|
|
23 |
local
|
|
24 |
|
|
25 |
val end_tag = "\^A0";
|
|
26 |
val tclass_tag = "\^A1";
|
|
27 |
val tfree_tag = "\^A2";
|
|
28 |
val tvar_tag = "\^A3";
|
|
29 |
val free_tag = "\^A4";
|
|
30 |
val bound_tag = "\^A5";
|
|
31 |
val var_tag = "\^A6";
|
|
32 |
|
|
33 |
fun tagit p x = (p ^ x ^ end_tag, real (size x));
|
|
34 |
|
|
35 |
in
|
|
36 |
|
|
37 |
val isamode_trans =
|
|
38 |
Syntax.tokentrans_mode isamodeN
|
|
39 |
[("class", tagit tclass_tag),
|
|
40 |
("tfree", tagit tfree_tag),
|
|
41 |
("tvar", tagit tvar_tag),
|
|
42 |
("free", tagit free_tag),
|
|
43 |
("bound", tagit bound_tag),
|
|
44 |
("var", tagit var_tag)];
|
|
45 |
|
|
46 |
end;
|
|
47 |
|
|
48 |
|
|
49 |
(* setup *)
|
|
50 |
|
|
51 |
val setup = [Theory.add_tokentrfuns isamode_trans];
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
(** run-time initialization **)
|
|
56 |
|
|
57 |
fun init isamode =
|
|
58 |
if isamode then print_mode := [Symbol.isabelle_fontN, Symbol.symbolsN, isamodeN]
|
|
59 |
else print_mode := [Symbol.isabelle_fontN, Symbol.symbolsN];
|
|
60 |
|
|
61 |
|
|
62 |
end;
|