1 (* Copyright (C) 2005, HELM Team.
3 * This file is part of HELM, an Hypertextual, Electronic
4 * Library of Mathematics, developed at the Computer Science
5 * Department, University of Bologna, Italy.
7 * HELM is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * HELM is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with HELM; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22 * For details, see the HELM World-Wide-Web page,
23 * http://helm.cs.unibo.it/
26 exception Parse_error of string
27 exception Level_not_found of int
33 method notation_parser_db: db
36 class virtual status: string option -> keywords:string list ->
40 method set_notation_parser_db: db -> 'self
41 method set_notation_parser_status: 'status. #g_status as 'status -> 'self
42 method reset_loctable: unit -> unit
45 type checked_l1_pattern = private CL1P of NotationPt.term * int
47 val refresh_uri_in_checked_l1_pattern:
48 refresh_uri_in_term:(NCic.term -> NCic.term) ->
49 refresh_uri_in_reference:(NReference.reference -> NReference.reference) ->
50 checked_l1_pattern -> checked_l1_pattern
52 (** {2 Parsing functions} *)
54 (** concrete syntax pattern: notation level 1, the
55 * integer is the precedence *)
56 val parse_level1_pattern: #status -> int -> Ulexing.lexbuf -> NotationPt.term
58 (** AST pattern: notation level 2 *)
59 val parse_level2_ast: #status -> Ulexing.lexbuf -> NotationPt.term
60 val parse_level2_meta: #status -> Ulexing.lexbuf -> NotationPt.term
62 (** {2 Grammar extension} *)
64 val check_l1_pattern: (* level1_pattern, pponly, precedence, assoc *)
65 NotationPt.term -> bool -> int -> Gramext.g_assoc -> checked_l1_pattern
70 (NotationEnv.t -> NotationPt.location -> NotationPt.term) ->
73 (** {2 Grammar entries}
74 * needed by grafite parser *)
76 val level2_ast_grammar: #status -> Grammar.g
78 val term : #status -> NotationPt.term Grammar.Entry.e
80 val let_defs : #status ->
81 (NotationPt.term NotationPt.capture_variable list * NotationPt.term NotationPt.capture_variable * NotationPt.term * int) list
84 val protected_binder_vars : #status ->
85 (NotationPt.term list * NotationPt.term option) Grammar.Entry.e
89 (** print "level2_pattern" entry on stdout, flushing afterwards *)
90 val print_l2_pattern: #status -> unit