summaryrefslogtreecommitdiff
path: root/toplevel/metasyntax.mli
blob: d8dd0d5256780ed08dd447284b56e882b2bcd62f (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
61
62
63
64
65
66
67
(************************************************************************)
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
(* <O___,, *   INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2010     *)
(*   \VV/  **************************************************************)
(*    //   *      This file is distributed under the terms of the       *)
(*         *       GNU Lesser General Public License Version 2.1        *)
(************************************************************************)

(*i $Id: metasyntax.mli 13328 2010-07-26 11:05:30Z herbelin $ i*)

(*i*)
open Util
open Names
open Libnames
open Ppextend
open Extend
open Tacexpr
open Vernacexpr
open Notation
open Topconstr
(*i*)

val add_token_obj : string -> unit

(* Adding a tactic notation in the environment *)

val add_tactic_notation :
  int * grammar_tactic_prod_item_expr list * raw_tactic_expr -> unit

(* Adding a (constr) notation in the environment*)

val add_infix : locality_flag -> (lstring * syntax_modifier list) ->
  constr_expr -> scope_name option -> unit

val add_notation : locality_flag -> constr_expr ->
  (lstring * syntax_modifier list) -> scope_name option -> unit

(* Declaring delimiter keys and default scopes *)

val add_delimiters : scope_name -> string -> unit
val add_class_scope : scope_name -> Classops.cl_typ -> unit

(* Add only the interpretation of a notation that already has pa/pp rules *)

val add_notation_interpretation :
  (lstring * constr_expr * scope_name option) -> unit

(* Add a notation interpretation for supporting the "where" clause *)

val set_notation_for_interpretation : Constrintern.internalization_env ->
  (lstring * constr_expr * scope_name option) -> unit

(* Add only the parsing/printing rule of a notation *)

val add_syntax_extension :
  locality_flag -> (lstring * syntax_modifier list) -> unit

(* Add a syntactic definition (as in "Notation f := ...") *)

val add_syntactic_definition : identifier -> identifier list * constr_expr ->
  bool -> bool -> unit

(* Print the Camlp4 state of a grammar *)

val print_grammar : string -> unit

val check_infix_modifiers : syntax_modifier list -> unit