Re: Pretty-printer and tabulation boxes

From: Pierre Weis (weis@pauillac.inria.fr)
Date: Tue Sep 02 1997 - 20:16:28 MET DST


From: Pierre Weis <weis@pauillac.inria.fr>
Message-Id: <199709021816.UAA09228@pauillac.inria.fr>
Subject: Re: Pretty-printer and tabulation boxes
In-Reply-To: <199709011524.RAA06592@lsun24.lannion.cnet.fr> from "Guillaume LATU - STAGIAIRE A FT.BD/CNET/DTL/MSV" at "Sep 1, 97 05:24:45 pm"
To: latu@lannion.cnet.fr (Guillaume LATU - STAGIAIRE A FT.BD/CNET/DTL/MSV)
Date: Tue, 2 Sep 1997 20:16:28 +0200 (MET DST)

> Bonjour,
>
> Travaillant `a la r'ealisation d'un pretty-printer en Objective Caml,
> je souhaiterais utiliser toutes les possibilit'ees offertes par le
> module "Format". Je suis `a la recherche de quelques exemples
> d'impl'ementation de pretty-printer mettant en oeuvre -si possible-
> les bo^ites de tabulation (c'est `a dire utilisant 'open_tbox' et
> 'close_tbox').

Il y a des exemples d'imprimeurs dans la FAQ de caml
(http://pauillac.inria.fr/caml/FAQ/format-fra.html).

Malheureusement, il n'y a pas d'exemples avec les boi^tes de
tabulation. Ces boi^tes ne sont pas destine'es a` l'impression
d'arbres mais a` l'impression simple de structures plus line'aires
(tableaux de chiffres par exemple).

De plus, les boi^tes de tabulation obe'issent a` une logique
diffe'rente des boi^tes d'impression habituelles, avec lesquelles
elles ne doivent pas e^tre me'lange'es. (Autrement dit, le module
format imple'mente ces deux types de boi^tes ``en paralle`le'', sans
donner le moyen de les utiliser simultane'ment).

> -----------
>
> Hello,
>
> Working at the realisation in Objective Caml of a Pretty-Printer, I
> would like to use all possibilities provided by the "Format"
> module. I'm looking for some existing pretty-printer examples. I'm
> interesting in finding a few which use the tabulation boxes (i.e
> invoking the functions 'open_tbox' and 'close_tbox').

There are some examples of regular pretty-printers in the caml FAQ
(http://pauillac.inria.fr/caml/FAQ/format-eng.html).

Unfortunately, there is no examples using tabulation boxes.
Note that these boxes are not suitable to print trees but can be use to print
simpler structures (more linear than trees), for instance integer arrays.
Moreover, the tabulation mechanism is different from regular boxes:
hence you may not mix both kind of boxes in the same program.
(In a sense, the format module provides two distinct implementations
for these two styles of boxes into the same file).

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:12 MET