diff options
| author | Pierre-Marie Pédrot | 2015-10-25 18:43:32 +0100 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2015-10-26 11:42:20 +0100 |
| commit | 010775eba60ea89645792b48a0686ff15c4ebcb5 (patch) | |
| tree | 5edfed592e117b4b2e3174cb8ca2641bbc4c2347 /parsing/entry.mli | |
| parent | af89d24f9d54b18068046545af1268dffbeb3e07 (diff) | |
Pcoq entries are given a proper module.
Entries defined in the Pcoq AST of symbols must be marshallable, because they
are present in the libstack. Yet, CAMLP4/5 entries are not marshallable as
they contain functional values. This is why the Pcoq module used a pair
[string * string] to describe entries. It is obviously type-unsafe, so
we define a new abstract type in its own module. There is a little issue
though, which is that our entries and CAMLP4/5 entries must be kept
synchronized through an association table. The Pcoq module tries to
maintain this invariant.
Diffstat (limited to 'parsing/entry.mli')
| -rw-r--r-- | parsing/entry.mli | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/parsing/entry.mli b/parsing/entry.mli new file mode 100644 index 0000000000..6854a5cb45 --- /dev/null +++ b/parsing/entry.mli @@ -0,0 +1,50 @@ +(************************************************************************) +(* v * The Coq Proof Assistant / The Coq Development Team *) +(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2015 *) +(* \VV/ **************************************************************) +(* // * This file is distributed under the terms of the *) +(* * GNU Lesser General Public License Version 2.1 *) +(************************************************************************) + +(** Typed grammar entries *) + +type 'a t +(** Typed grammar entries. We need to defined them here so that they are + marshallable and defined before the Pcoq.Gram module. They are basically + unique names made of a universe and an entry name. They should be kept + synchronized with the {!Pcoq} entries though. *) + +type repr = +| Static of string * string +| Dynamic of string +(** Representation of entries. *) + +(** Table of Coq statically defined grammar entries *) + +type universe + +(** There are four predefined universes: "prim", "constr", "tactic", "vernac" *) + +val get_univ : string -> universe +val univ_name : universe -> string + +val uprim : universe +val uconstr : universe +val utactic : universe +val uvernac : universe + +(** {5 Uniquely defined entries} *) + +val create : universe -> string -> 'a t +(** Create an entry. They should be synchronized with the entries defined in + {!Pcoq}. *) + +(** {5 Meta-programming} *) + +val dynamic : string -> 'a t +(** Dynamic entries. They refer to entries defined in the code source and may + only be used in meta-programming definitions from the grammar directory. *) + +val repr : 'a t -> repr + +val unsafe_of_name : (string * string) -> 'a t |
