end
module Level2Parser = Grammar.GMake (Level2Lexer)
+module Level3Lexer =
+struct
+ type te = string * string
+ let lexer = CicNotationLexer.ast_pattern_lexer
+end
+module Level3Parser = Grammar.GMake (Level3Lexer)
+
let level1_pattern = Level1Parser.Entry.create "level1_pattern"
let level2_pattern = Level2Parser.Entry.create "level2_pattern"
+let level3_interpretation = Level3Parser.Entry.create "level3_interpretation"
let return_term loc term = ()
END
(* }}} *)
+(* {{{ Grammar for interpretation, notation level 3 *)
+GEXTEND Level3Parser
+ GLOBAL: level3_interpretation;
+ level3_interpretation: [ [ i = interpretation -> () ] ];
+ argument: [
+ [ i = IDENT -> ()
+ | SYMBOL <:unicode<eta>> (* η *); SYMBOL "."; a = SELF -> ()
+ | SYMBOL <:unicode<eta>> (* η *); i = IDENT; SYMBOL "."; a = SELF -> ()
+ ]
+ ];
+ term: [
+ [ u = URI -> ()
+ | a = argument -> ()
+ | SYMBOL "("; terms = LIST1 SELF; SYMBOL ")" -> ()
+ ]
+ ];
+ interpretation: [
+ [ IDENT "interpretation"; s = SYMBOL; args = LIST1 argument; IDENT "as";
+ t = term ->
+ ()
+ ]
+ ];
+END
+(* }}} *)
+
let exc_located_wrapper f =
try
f ()
(fun () ->
(Level2Parser.Entry.parse level2_pattern (Level2Parser.parsable stream)))
+let parse_interpretation stream =
+ exc_located_wrapper
+ (fun () ->
+ (Level3Parser.Entry.parse level3_interpretation
+ (Level3Parser.parsable stream)))
+
(* vim:set encoding=utf8 foldmethod=marker: *)