author | blanchet |
Thu, 27 May 2010 16:42:03 +0200 | |
changeset 37169 | f69efa106feb |
parent 36947 | 285b39022372 |
child 38230 | ed147003de4b |
permissions | -rw-r--r-- |
36947 | 1 |
/* Title: Pure/Isar/keyword.scala |
29449
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
2 |
Author: Makarius |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
3 |
|
34158
8b66bd211dcf
class Outer_Keyword wraps symbol interpretation, lexicon, keyword table;
wenzelm
parents:
32450
diff
changeset
|
4 |
Isar command keyword classification and keyword tables. |
29449
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
5 |
*/ |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
6 |
|
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
7 |
package isabelle |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
8 |
|
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
9 |
|
36947 | 10 |
object Keyword |
32450 | 11 |
{ |
36681 | 12 |
/* kinds */ |
13 |
||
29449
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
14 |
val MINOR = "minor" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
15 |
val CONTROL = "control" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
16 |
val DIAG = "diag" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
17 |
val THY_BEGIN = "theory-begin" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
18 |
val THY_SWITCH = "theory-switch" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
19 |
val THY_END = "theory-end" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
20 |
val THY_HEADING = "theory-heading" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
21 |
val THY_DECL = "theory-decl" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
22 |
val THY_SCRIPT = "theory-script" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
23 |
val THY_GOAL = "theory-goal" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
24 |
val QED = "qed" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
25 |
val QED_BLOCK = "qed-block" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
26 |
val QED_GLOBAL = "qed-global" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
27 |
val PRF_HEADING = "proof-heading" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
28 |
val PRF_GOAL = "proof-goal" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
29 |
val PRF_BLOCK = "proof-block" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
30 |
val PRF_OPEN = "proof-open" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
31 |
val PRF_CLOSE = "proof-close" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
32 |
val PRF_CHAIN = "proof-chain" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
33 |
val PRF_DECL = "proof-decl" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
34 |
val PRF_ASM = "proof-asm" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
35 |
val PRF_ASM_GOAL = "proof-asm-goal" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
36 |
val PRF_SCRIPT = "proof-script" |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
37 |
|
36681 | 38 |
|
39 |
/* categories */ |
|
40 |
||
29449
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
41 |
val minor = Set(MINOR) |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
42 |
val control = Set(CONTROL) |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
43 |
val diag = Set(DIAG) |
29450 | 44 |
val heading = Set(THY_HEADING, PRF_HEADING) |
45 |
val theory1 = Set(THY_BEGIN, THY_SWITCH, THY_END) |
|
29449
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
46 |
val theory2 = Set(THY_DECL, THY_GOAL) |
29450 | 47 |
val proof1 = |
48 |
Set(QED, QED_BLOCK, QED_GLOBAL, PRF_GOAL, PRF_BLOCK, PRF_OPEN, PRF_CLOSE, PRF_CHAIN, PRF_DECL) |
|
29449
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
49 |
val proof2 = Set(PRF_ASM, PRF_ASM_GOAL) |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
50 |
val improper = Set(THY_SCRIPT, PRF_SCRIPT) |
36681 | 51 |
|
52 |
||
53 |
/* reports */ |
|
54 |
||
55 |
object Keyword_Decl { |
|
56 |
def unapply(msg: XML.Tree): Option[String] = |
|
57 |
msg match { |
|
58 |
case XML.Elem(Markup.KEYWORD_DECL, List((Markup.NAME, name)), _) => Some(name) |
|
59 |
case _ => None |
|
60 |
} |
|
61 |
} |
|
62 |
||
63 |
object Command_Decl { |
|
64 |
def unapply(msg: XML.Tree): Option[(String, String)] = |
|
65 |
msg match { |
|
66 |
case XML.Elem(Markup.COMMAND_DECL, List((Markup.NAME, name), (Markup.KIND, kind)), _) => |
|
67 |
Some((name, kind)) |
|
68 |
case _ => None |
|
69 |
} |
|
70 |
} |
|
29449
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
71 |
} |
6e7745d35a30
added outer_keyword.scala: Isar command keyword classification;
wenzelm
parents:
diff
changeset
|
72 |