23623
|
1 |
(* Title: Pure/General/markup.ML
|
|
2 |
ID: $Id$
|
|
3 |
Author: Makarius
|
|
4 |
|
|
5 |
Common markup elements.
|
|
6 |
*)
|
|
7 |
|
|
8 |
signature MARKUP =
|
|
9 |
sig
|
|
10 |
type property = string * string
|
|
11 |
type T = string * property list
|
|
12 |
val none: T
|
|
13 |
val property: string * string -> T -> T
|
|
14 |
val nameN: string
|
23626
|
15 |
val pos_lineN: string
|
|
16 |
val pos_nameN: string
|
23623
|
17 |
val classN: string
|
|
18 |
val class: string -> T
|
|
19 |
val tyconN: string
|
|
20 |
val tycon: string -> T
|
|
21 |
val constN: string
|
|
22 |
val const: string -> T
|
|
23 |
val axiomN: string
|
|
24 |
val axiom: string -> T
|
|
25 |
val sortN: string
|
|
26 |
val sort: T
|
|
27 |
val typN: string
|
|
28 |
val typ: T
|
|
29 |
val termN: string
|
|
30 |
val term: T
|
|
31 |
val keywordN: string
|
|
32 |
val keyword: string -> T
|
|
33 |
val commandN: string
|
|
34 |
val command: string -> T
|
|
35 |
end;
|
|
36 |
|
|
37 |
structure Markup: MARKUP =
|
|
38 |
struct
|
|
39 |
|
|
40 |
type property = string * string;
|
|
41 |
type T = string * property list;
|
|
42 |
|
|
43 |
val none = ("", []);
|
|
44 |
|
|
45 |
|
|
46 |
(* properties *)
|
|
47 |
|
|
48 |
fun property x (name, xs) : T = (name, x :: xs);
|
|
49 |
|
|
50 |
val nameN = "name";
|
23626
|
51 |
val pos_lineN = "pos_line";
|
|
52 |
val pos_nameN = "pos_name";
|
23623
|
53 |
|
|
54 |
|
|
55 |
(* logical entities *)
|
|
56 |
|
|
57 |
val classN = "class";
|
|
58 |
fun class name = (classN, [(nameN, name)]);
|
|
59 |
|
|
60 |
val tyconN = "tycon";
|
|
61 |
fun tycon name = (tyconN, [(nameN, name)]);
|
|
62 |
|
|
63 |
val constN = "const";
|
|
64 |
fun const name = (constN, [(nameN, name)]);
|
|
65 |
|
|
66 |
val axiomN = "axiom";
|
|
67 |
fun axiom name = (axiomN, [(nameN, name)]);
|
|
68 |
|
|
69 |
|
|
70 |
(* inner syntax *)
|
|
71 |
|
|
72 |
val sortN = "sort";
|
|
73 |
val sort = (sortN, []);
|
|
74 |
|
|
75 |
val typN = "typ";
|
|
76 |
val typ = (typN, []);
|
|
77 |
|
|
78 |
val termN = "term";
|
|
79 |
val term = (termN, []);
|
|
80 |
|
|
81 |
|
|
82 |
(* outer syntax *)
|
|
83 |
|
|
84 |
val keywordN = "keyword";
|
|
85 |
fun keyword name = (keywordN, [(nameN, name)]);
|
|
86 |
|
|
87 |
val commandN = "command";
|
|
88 |
fun command name = (commandN, [(nameN, name)]);
|
|
89 |
|
|
90 |
end;
|