src/Pure/Isar/spec_parse.ML
author wenzelm
Fri, 02 Jan 2009 15:44:33 +0100
changeset 29312 f369fb19146e
parent 29214 76c7fc5ba849
child 29360 a5be60c3674e
permissions -rw-r--r--
added type 'a parser, simplified signature;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22104
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
     1
(*  Title:      Pure/Isar/spec_parse.ML
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
     3
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
     4
Parsers for complex specifications.
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
     5
*)
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
     6
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
     7
signature SPEC_PARSE =
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
     8
sig
29312
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
     9
  type token = OuterParse.token
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    10
  type 'a parser = 'a OuterParse.parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    11
  val attrib: Attrib.src parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    12
  val attribs: Attrib.src list parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    13
  val opt_attribs: Attrib.src list parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    14
  val thm_name: string -> Attrib.binding parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    15
  val opt_thm_name: string -> Attrib.binding parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    16
  val spec: (Attrib.binding * string list) parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    17
  val named_spec: (Attrib.binding * string list) parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    18
  val spec_name: ((Binding.T * string) * Attrib.src list) parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    19
  val spec_opt_name: ((Binding.T * string) * Attrib.src list) parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    20
  val xthm: (Facts.ref * Attrib.src list) parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    21
  val xthms1: (Facts.ref * Attrib.src list) list parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    22
  val name_facts: (Attrib.binding * (Facts.ref * Attrib.src list) list) list parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    23
  val locale_mixfix: mixfix parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    24
  val locale_fixes: (Binding.T * string option * mixfix) list parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    25
  val locale_insts: (string option list * (Attrib.binding * string) list) parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    26
  val class_expr: string list parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    27
  val locale_expr: Locale.expr parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    28
  val locale_expression: Expression.expression parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    29
  val locale_keyword: string parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    30
  val context_element: Element.context parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    31
  val statement: (Attrib.binding * (string * string list) list) list parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    32
  val general_statement: (Element.context list * Element.statement) parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    33
  val statement_keyword: string parser
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    34
  val specification:
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    35
    (Binding.T * ((Attrib.binding * string list) list * (Binding.T * string option) list)) list parser
22104
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    36
end;
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    37
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    38
structure SpecParse: SPEC_PARSE =
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    39
struct
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    40
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    41
structure P = OuterParse;
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    42
type token = P.token;
29312
f369fb19146e added type 'a parser, simplified signature;
wenzelm
parents: 29214
diff changeset
    43
type 'a parser = 'a P.parser;
22104
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    44
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    45
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    46
(* theorem specifications *)
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    47
27816
0dfed2f2822a unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents: 27378
diff changeset
    48
val attrib = P.position ((P.keyword_ident_or_symbolic || P.xname) -- P.!!! Args.parse) >> Args.src;
24014
d3873741678d attribs: not cut (!!!);
wenzelm
parents: 24013
diff changeset
    49
val attribs = P.$$$ "[" |-- P.list attrib --| P.$$$ "]";
22104
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    50
val opt_attribs = Scan.optional attribs [];
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    51
28083
103d9282a946 explicit type Name.binding for higher-specification elements;
wenzelm
parents: 27816
diff changeset
    52
fun thm_name s = P.binding -- opt_attribs --| P.$$$ s;
103d9282a946 explicit type Name.binding for higher-specification elements;
wenzelm
parents: 27816
diff changeset
    53
22104
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    54
fun opt_thm_name s =
28965
1de908189869 cleaned up binding module and related code
haftmann
parents: 28722
diff changeset
    55
  Scan.optional ((P.binding -- opt_attribs || attribs >> pair Binding.empty) --| P.$$$ s)
1de908189869 cleaned up binding module and related code
haftmann
parents: 28722
diff changeset
    56
    Attrib.empty_binding;
22104
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    57
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    58
val spec = opt_thm_name ":" -- Scan.repeat1 P.prop;
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    59
val named_spec = thm_name ":" -- Scan.repeat1 P.prop;
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    60
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    61
val spec_name = thm_name ":" -- P.prop >> (fn ((x, y), z) => ((x, z), y));
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    62
val spec_opt_name = opt_thm_name ":" -- P.prop >> (fn ((x, y), z) => ((x, z), y));
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    63
24013
3063a756611d xthm: added [[declaration]] syntax (abbreviates dummy_thm [att]);
wenzelm
parents: 23919
diff changeset
    64
val xthm =
26361
7946f459c6c8 Facts.Named: include position;
wenzelm
parents: 26336
diff changeset
    65
  P.$$$ "[" |-- attribs --| P.$$$ "]" >> pair (Facts.named "") ||
7946f459c6c8 Facts.Named: include position;
wenzelm
parents: 26336
diff changeset
    66
  (P.alt_string >> Facts.Fact ||
27816
0dfed2f2822a unified Args.T with OuterLex.token, renamed some operations;
wenzelm
parents: 27378
diff changeset
    67
    P.position P.xname -- Scan.option Attrib.thm_sel >> Facts.Named) -- opt_attribs;
24013
3063a756611d xthm: added [[declaration]] syntax (abbreviates dummy_thm [att]);
wenzelm
parents: 23919
diff changeset
    68
22104
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    69
val xthms1 = Scan.repeat1 xthm;
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    70
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    71
val name_facts = P.and_list1 (opt_thm_name "=" -- xthms1);
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    72
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    73
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    74
(* locale and context elements *)
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    75
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    76
val locale_mixfix = P.$$$ "(" -- P.$$$ "structure" -- P.!!! (P.$$$ ")") >> K Structure || P.mixfix;
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    77
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    78
val locale_fixes =
28083
103d9282a946 explicit type Name.binding for higher-specification elements;
wenzelm
parents: 27816
diff changeset
    79
  P.and_list1 (P.binding -- Scan.option (P.$$$ "::" |-- P.typ) -- locale_mixfix
22104
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    80
    >> (single o P.triple1) ||
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    81
  P.params >> map Syntax.no_syn) >> flat;
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    82
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    83
val locale_insts =
22658
263d42253f53 Experimental interpretation code for definitions.
ballarin
parents: 22104
diff changeset
    84
  Scan.optional (P.$$$ "[" |-- P.!!! (Scan.repeat1 (P.maybe P.term) --| P.$$$ "]")) []
25094
ba43514068fd Interpretation equations may have name and/or attribute.
ballarin
parents: 24869
diff changeset
    85
  -- Scan.optional (P.$$$ "where" |-- P.and_list1 (opt_thm_name ":" -- P.prop)) [];
22104
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    86
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    87
local
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    88
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    89
val loc_element =
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    90
  P.$$$ "fixes" |-- P.!!! locale_fixes >> Element.Fixes ||
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    91
  P.$$$ "constrains" |-- P.!!! (P.and_list1 (P.name -- (P.$$$ "::" |-- P.typ)))
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    92
    >> Element.Constrains ||
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    93
  P.$$$ "assumes" |-- P.!!! (P.and_list1 (opt_thm_name ":" -- Scan.repeat1 P.propp))
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    94
    >> Element.Assumes ||
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    95
  P.$$$ "defines" |-- P.!!! (P.and_list1 (opt_thm_name ":" -- P.propp))
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    96
    >> Element.Defines ||
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    97
  P.$$$ "notes" |-- P.!!! (P.and_list1 (opt_thm_name "=" -- xthms1))
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    98
    >> (curry Element.Notes "");
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
    99
24869
bad2b2be1f24 added class_expr;
wenzelm
parents: 24014
diff changeset
   100
fun plus1_unless test scan =
25999
f8bcd311d501 added ::: / @@@ scanner combinators;
wenzelm
parents: 25094
diff changeset
   101
  scan ::: Scan.repeat (P.$$$ "+" |-- Scan.unless test (P.!!! scan));
22104
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   102
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   103
val rename = P.name -- Scan.option P.mixfix;
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   104
29214
76c7fc5ba849 Strict prefixes in locales expressions.
ballarin
parents: 29033
diff changeset
   105
val prefix = P.name -- Scan.optional (P.$$$ "!" >> K true) false --| P.$$$ ":";
29033
721529248e31 Enable keyword 'structure' in for clause of locale expression.
ballarin
parents: 28965
diff changeset
   106
val named = P.name -- (P.$$$ "=" |-- P.term);
721529248e31 Enable keyword 'structure' in for clause of locale expression.
ballarin
parents: 28965
diff changeset
   107
val position = P.maybe P.term;
721529248e31 Enable keyword 'structure' in for clause of locale expression.
ballarin
parents: 28965
diff changeset
   108
val instance = P.$$$ "where" |-- P.and_list1 named >> Expression.Named ||
721529248e31 Enable keyword 'structure' in for clause of locale expression.
ballarin
parents: 28965
diff changeset
   109
  Scan.repeat1 position >> Expression.Positional;
721529248e31 Enable keyword 'structure' in for clause of locale expression.
ballarin
parents: 28965
diff changeset
   110
24869
bad2b2be1f24 added class_expr;
wenzelm
parents: 24014
diff changeset
   111
in
bad2b2be1f24 added class_expr;
wenzelm
parents: 24014
diff changeset
   112
28722
bdb694e18bf8 Minor cleanup.
ballarin
parents: 28710
diff changeset
   113
val locale_keyword = P.$$$ "fixes" || P.$$$ "constrains" || P.$$$ "assumes" ||
bdb694e18bf8 Minor cleanup.
ballarin
parents: 28710
diff changeset
   114
   P.$$$ "defines" || P.$$$ "notes";
bdb694e18bf8 Minor cleanup.
ballarin
parents: 28710
diff changeset
   115
bdb694e18bf8 Minor cleanup.
ballarin
parents: 28710
diff changeset
   116
val class_expr = plus1_unless locale_keyword P.xname;
24869
bad2b2be1f24 added class_expr;
wenzelm
parents: 24014
diff changeset
   117
bad2b2be1f24 added class_expr;
wenzelm
parents: 24014
diff changeset
   118
val locale_expr =
22104
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   119
  let
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   120
    fun expr2 x = (P.xname >> Locale.Locale || P.$$$ "(" |-- P.!!! (expr0 --| P.$$$ ")")) x
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   121
    and expr1 x = (expr2 -- Scan.repeat1 (P.maybe rename) >> Locale.Rename || expr2) x
28722
bdb694e18bf8 Minor cleanup.
ballarin
parents: 28710
diff changeset
   122
    and expr0 x = (plus1_unless locale_keyword expr1 >> (fn [e] => e | es => Locale.Merge es)) x;
22104
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   123
  in expr0 end;
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   124
29033
721529248e31 Enable keyword 'structure' in for clause of locale expression.
ballarin
parents: 28965
diff changeset
   125
val locale_expression =
721529248e31 Enable keyword 'structure' in for clause of locale expression.
ballarin
parents: 28965
diff changeset
   126
  let
721529248e31 Enable keyword 'structure' in for clause of locale expression.
ballarin
parents: 28965
diff changeset
   127
    fun expr2 x = P.xname x;
29214
76c7fc5ba849 Strict prefixes in locales expressions.
ballarin
parents: 29033
diff changeset
   128
    fun expr1 x = (Scan.optional prefix ("", false) -- expr2 --
29033
721529248e31 Enable keyword 'structure' in for clause of locale expression.
ballarin
parents: 28965
diff changeset
   129
      Scan.optional instance (Expression.Named []) >> (fn ((p, l), i) => (l, (p, i)))) x;
721529248e31 Enable keyword 'structure' in for clause of locale expression.
ballarin
parents: 28965
diff changeset
   130
    fun expr0 x = (plus1_unless locale_keyword expr1) x;
721529248e31 Enable keyword 'structure' in for clause of locale expression.
ballarin
parents: 28965
diff changeset
   131
  in expr0 -- Scan.optional (P.$$$ "for" |-- P.!!! locale_fixes) [] end;
721529248e31 Enable keyword 'structure' in for clause of locale expression.
ballarin
parents: 28965
diff changeset
   132
22104
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   133
val context_element = P.group "context element" loc_element;
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   134
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   135
end;
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   136
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   137
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   138
(* statements *)
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   139
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   140
val statement = P.and_list1 (opt_thm_name ":" -- Scan.repeat1 P.propp);
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   141
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   142
val obtain_case =
28083
103d9282a946 explicit type Name.binding for higher-specification elements;
wenzelm
parents: 27816
diff changeset
   143
  P.parbinding -- (Scan.optional (P.simple_fixes --| P.$$$ "where") [] --
22104
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   144
    (P.and_list1 (Scan.repeat1 P.prop) >> flat));
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   145
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   146
val general_statement =
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   147
  statement >> (fn x => ([], Element.Shows x)) ||
28722
bdb694e18bf8 Minor cleanup.
ballarin
parents: 28710
diff changeset
   148
  Scan.repeat context_element --
22104
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   149
   (P.$$$ "obtains" |-- P.!!! (P.enum1 "|" obtain_case) >> Element.Obtains ||
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   150
    P.$$$ "shows" |-- P.!!! statement >> Element.Shows);
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   151
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   152
val statement_keyword = P.$$$ "obtains" || P.$$$ "shows";
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   153
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   154
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   155
(* specifications *)
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   156
28083
103d9282a946 explicit type Name.binding for higher-specification elements;
wenzelm
parents: 27816
diff changeset
   157
val specification = P.enum1 "|" (P.parbinding -- (P.and_list1 spec -- P.for_simple_fixes));
22104
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   158
e8a1c88be824 Parsers for complex specifications (material from outer_parse.ML);
wenzelm
parents:
diff changeset
   159
end;