(************************************************************************) (* * The Rocq Prover / The Rocq Development Team *) (* v * Copyright INRIA, CNRS and contributors *) (* <O___,, * (see version control and CREDITS file for authors & dates) *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (* * (see LICENSE file for the text of the license) *) (************************************************************************)
(** Entry keys for constr notations *)
type production_position =
| BorderProd of Constrexpr.side * Gramlib.Gramext.g_assoc option
| InternalProd
type production_level =
| NextLevel
| NumLevel of int
| DefaultLevel (** Interpreted differently at the border or inside a rule *)
(** User-level types used to tell how to parse or interpret of the non-terminal *)
type'a constr_entry_key_gen =
| ETIdent
| ETName
| ETGlobal
| ETBigint
| ETBinder ofbool(* open list of binders if true, closed list of binders otherwise *)
| ETConstr of Constrexpr.notation_entry * Notation_term.notation_binder_kind option * 'a
| ETPattern ofbool * int option(* true = strict pattern, i.e. not a single variable *)
let constr_entry_key_eq = constr_entry_key_eq_gen (Option.equal Notationextern.notation_binder_kind_eq)
let constr_entry_key_eq_ignore_binder_kind = constr_entry_key_eq_gen (fun _ _ -> true)
(** Entries level (left-hand side of grammar rules) *)
type constr_entry_key =
(production_level * production_position) constr_entry_key_gen
(** Entries used in productions, vernac side (e.g. "x bigint" or "x ident") *)
type simple_constr_prod_entry_key =
production_level constr_entry_key_gen
(** Entries used in productions (in right-hand-side of grammar rules), to parse non-terminals *)
type binder_target = ForBinder | ForTerm
type binder_entry_kind = ETBinderOpen | ETBinderClosed of constr_prod_entry_key option * (bool * string) list
and constr_prod_entry_key =
| ETProdIdent (* Parsed as an ident *)
| ETProdName (* Parsed as a name (ident or _) *)
| ETProdGlobal (* Parsed as a global reference *)
| ETProdBigint (* Parsed as an (unbounded) integer *)
| ETProdOneBinder ofbool(* Parsed as name, or name:type or 'pattern, possibly in closed form *)
| ETProdConstr of Constrexpr.notation_entry * (production_level * production_position) (* Parsed as constr or custom when extending a constr or custom entry; parsed as pattern or custom pattern when extending a pattern or custom pattern entry *)
| ETProdPattern of int (* Parsed as pattern as a binder (as subpart of a constr) *)
| ETProdConstrList of Constrexpr.notation_entry * (production_level * production_position) * (bool * string) list(* Parsed as a non-empty list of constr or custom entry *)
| ETProdBinderList of binder_entry_kind (* Parsed as non-empty list of local binders *)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.