]> matita.cs.unibo.it Git - helm.git/blob - matita/components/content_pres/cicNotationParser.mli
- disk dumping of ex-lexicon commands almost implemented
[helm.git] / matita / components / content_pres / cicNotationParser.mli
1 (* Copyright (C) 2005, HELM Team.
2  * 
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.
6  * 
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.
11  * 
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.
16  *
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,
20  * MA  02111-1307, USA.
21  * 
22  * For details, see the HELM World-Wide-Web page,
23  * http://helm.cs.unibo.it/
24  *)
25
26 exception Parse_error of string
27 exception Level_not_found of int
28
29 type db
30
31 class type g_status =
32  object
33   method notation_parser_db: db
34  end
35
36 class status: keywords:string list ->
37  object('self)
38   inherit g_status
39   method set_notation_parser_db: db -> 'self
40   method set_notation_parser_status: 'status. #g_status as 'status -> 'self
41  end
42
43 type checked_l1_pattern = private CL1P of NotationPt.term * int
44
45 val refresh_uri_in_checked_l1_pattern: checked_l1_pattern -> checked_l1_pattern 
46
47 (** {2 Parsing functions} *)
48
49   (** concrete syntax pattern: notation level 1, the 
50    *  integer is the precedence *)
51 val parse_level1_pattern: #status -> int -> Ulexing.lexbuf -> NotationPt.term
52
53   (** AST pattern: notation level 2 *)
54 val parse_level2_ast: #status -> Ulexing.lexbuf -> NotationPt.term
55 val parse_level2_meta: #status -> Ulexing.lexbuf -> NotationPt.term
56
57 (** {2 Grammar extension} *)
58
59 val check_l1_pattern: (* level1_pattern, pponly, precedence, assoc *)
60  NotationPt.term -> bool ->  int -> Gramext.g_assoc -> checked_l1_pattern
61
62 val extend:
63   #status as 'status -> 
64   checked_l1_pattern ->
65   (NotationEnv.t -> NotationPt.location -> NotationPt.term) ->
66     'status
67
68 (** {2 Grammar entries}
69  * needed by grafite parser *)
70
71 val level2_ast_grammar: #status -> Grammar.g
72
73 val term : #status -> NotationPt.term Grammar.Entry.e
74
75 val let_defs : #status ->
76   (NotationPt.term NotationPt.capture_variable list * NotationPt.term NotationPt.capture_variable * NotationPt.term * int) list
77     Grammar.Entry.e
78
79 val protected_binder_vars : #status ->
80   (NotationPt.term list * NotationPt.term option) Grammar.Entry.e
81
82 val parse_term: #status -> Ulexing.lexbuf -> NotationPt.term
83
84 (** {2 Debugging} *)
85
86   (** print "level2_pattern" entry on stdout, flushing afterwards *)
87 val print_l2_pattern: #status -> unit