| 1 | (************************************************************************) |
| 2 | (* * The Rocq Prover / The Rocq Development Team *) |
| 3 | (* v * Copyright INRIA, CNRS and contributors *) |
| 4 | (* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 | (* \VV/ **************************************************************) |
| 6 | (* // * This file is distributed under the terms of the *) |
| 7 | (* * GNU Lesser General Public License Version 2.1 *) |
| 8 | (* * (see LICENSE file for the text of the license) *) |
| 9 | (************************************************************************) |
| 10 | |
| 11 | (* Merge with metasyntax? *) |
| 12 | open Constrexpr |
| 13 | open Notation_gram |
| 14 | |
| 15 | (** {6 Declare the parsing rules and entries of a (possibly uninterpreted) notation } *) |
| 16 | |
| 17 | val declare_notation_grammar : notation -> notation_grammar -> unit |
| 18 | val grammar_of_notation : notation -> notation_grammar |
| 19 | (** raise [Not_found] if not declared *) |
| 20 | |
| 21 | val declare_notation_non_terminals : notation -> Extend.constr_entry_key list -> unit |
| 22 | val non_terminals_of_notation : notation -> Extend.constr_entry_key list |
| 23 | |
| 24 | (** [longest_common_prefix ntn] looks among notations [ntn'] already |
| 25 | registered with [declare_notation_non_terminals ntn'] for the one |
| 26 | that shares the longest common prefix with [ntn], if any returns |
| 27 | [Some (ntn', k)] where [k] is the number of nonterminal symbols in |
| 28 | the common prefix between [ntn] and [ntn']. *) |
| 29 | val longest_common_prefix : notation -> (notation * int) option |
| 30 | |
| 31 | (** Returns notations with defined parsing/printing rules *) |
| 32 | val get_defined_notations : unit -> notation list |