aboutsummaryrefslogtreecommitdiff
path: root/interp/ppextend.ml
diff options
context:
space:
mode:
authorherbelin2002-11-14 18:37:54 +0000
committerherbelin2002-11-14 18:37:54 +0000
commite88e0b2140bdd2d194a52bc09f8338b5667d0f92 (patch)
tree67ca22f77ddb98725456e5f9a0b5ad613ae28da5 /interp/ppextend.ml
parente4efb857fa9053c41e4c030256bd17de7e24542f (diff)
Réforme de l'interprétation des termes :
- Le parsing se fait maintenant via "constr_expr" au lieu de "Coqast.t" - "Coqast.t" reste pour l'instant pour le pretty-printing. Un deuxième pretty-printer dans ppconstr.ml est basé sur "constr_expr". - Nouveau répertoire "interp" qui hérite de la partie interprétation qui se trouvait avant dans "parsing" (constrintern.ml remplace astterm.ml; constrextern.ml est l'équivalent de termast.ml pour le nouveau printer; topconstr.ml; contient la définition de "constr_expr"; modintern.ml remplace astmod.ml) - Libnames.reference tend à remplacer Libnames.qualid git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@3235 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'interp/ppextend.ml')
-rw-r--r--interp/ppextend.ml57
1 files changed, 57 insertions, 0 deletions
diff --git a/interp/ppextend.ml b/interp/ppextend.ml
new file mode 100644
index 0000000000..e2e60dc154
--- /dev/null
+++ b/interp/ppextend.ml
@@ -0,0 +1,57 @@
+(***********************************************************************)
+(* v * The Coq Proof Assistant / The Coq Development Team *)
+(* <O___,, * INRIA-Rocquencourt & LRI-CNRS-Orsay *)
+(* \VV/ *************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(***********************************************************************)
+
+(*i $Id$ *)
+
+(*i*)
+open Pp
+open Util
+open Names
+(*i*)
+
+(*s Pretty-print. *)
+
+(* Dealing with precedences *)
+
+type precedence = int
+
+type parenRelation = L | E | Any | Prec of precedence
+
+type tolerability = precedence * parenRelation
+
+type ppbox =
+ | PpHB of int
+ | PpHOVB of int
+ | PpHVB of int
+ | PpVB of int
+ | PpTB
+
+type ppcut =
+ | PpBrk of int * int
+ | PpTbrk of int * int
+ | PpTab
+ | PpFnl
+
+let ppcmd_of_box = function
+ | PpHB n -> h n
+ | PpHOVB n -> hov n
+ | PpHVB n -> hv n
+ | PpVB n -> v n
+ | PpTB -> t
+
+let ppcmd_of_cut = function
+ | PpTab -> tab ()
+ | PpFnl -> fnl ()
+ | PpBrk(n1,n2) -> brk(n1,n2)
+ | PpTbrk(n1,n2) -> tbrk(n1,n2)
+
+type unparsing =
+ | UnpMetaVar of identifier * tolerability
+ | UnpTerminal of string
+ | UnpBox of ppbox * unparsing list
+ | UnpCut of ppcut