aboutsummaryrefslogtreecommitdiffhomepage
path: root/parsing/egrammar.mli
blob: e8292bf051f3f458790b3a9c8c84a2629c3a5c75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
(************************************************************************)
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
(*   \VV/  **************************************************************)
(*    //   *      This file is distributed under the terms of the       *)
(*         *       GNU Lesser General Public License Version 2.1        *)
(************************************************************************)

(*i $Id$ i*)

(*i*)
open Util
open Topconstr
open Ast
open Coqast
open Vernacexpr
open Ppextend
open Extend
open Rawterm
open Mod_subst
(*i*)

type notation_grammar = 
    int * Gramext.g_assoc option * notation * prod_item list * int list option

type all_grammar_command =
  | Notation of (precedence * tolerability list) * notation_grammar
  | Grammar of grammar_command
  | TacticGrammar of
      (string * (string * grammar_production list) * 
      (Names.dir_path * Tacexpr.raw_tactic_expr))
      list

val extend_grammar : all_grammar_command -> unit

(* Add grammar rules for tactics *)
type grammar_tactic_production =
  | TacTerm of string
  | TacNonTerm of loc * (Token.t Gramext.g_symbol * Genarg.argument_type) * string option

val extend_tactic_grammar :
  string -> (string * grammar_tactic_production list) list -> unit

val extend_vernac_command_grammar :
  string -> (string * grammar_tactic_production list) list -> unit

val get_extend_tactic_grammars :
 unit -> (string * (string * grammar_tactic_production list) list) list
val get_extend_vernac_grammars :
 unit -> (string * (string * grammar_tactic_production list) list) list
val reset_extend_grammars_v8 : unit -> unit

val subst_all_grammar_command :
  substitution -> all_grammar_command -> all_grammar_command

val interp_entry_name : string -> string -> 
  entry_type * Token.t Gramext.g_symbol

val recover_notation_grammar :
  notation -> (precedence * tolerability list) -> notation_grammar