comp.lang.ada
 help / color / mirror / Atom feed
From: Richard G. Hash <rgh@shell.com>
Subject: Re: Ada PostScript Pretty printer?
Date: Wed, 7 Dec 1994 15:54:39 GMT
Date: 1994-12-07T15:54:39+00:00	[thread overview]
Message-ID: <rgh.786815679@camo> (raw)
In-Reply-To: 2EDFC62B@SMTPGATE2.STRATCOM.AF.MIL

> > Oh, here's the vgrind_defs_file I use:
> > # Originally submitted from Fraser Wilson
> > # Ada!
> > ada|Ada:\
> >     :cb=--:ce=$:bb=if|case|begin|loop:be=end:lb=':le=':oc:\
> >     :pb=(^\d?(procedure|function|package|package body))\d\p:\
> >     :sb=":se=":id=_.:\
> >     :kw=abort abs abstract accept access aliased all and array at\
> >     begin body case constant declare delay delta digits do else\
> >     elsif end entry exception exit for function generic goto if in is\
> >     limited loop mod new not null of or others out package pragma\
> >     private procedure protected raise range record rem renames requeue\
> >     return reverse select separate subtype tagged task terminate then\
> >     type until use when while with xor:
> 
> I found that the above has a problem with attributes, because the "lb" and
> "le" terms makes two attributes 20 lines apart look like one string
> constant.  Anybody no a way to get around this (short of allowing reserved
> word emphasis in strings constants :-)  ?

A couple years ago I took vgrind and rewrote it to "pgrind", which just
generates PostScript directly. I've been trying to get permission to
release it ever since (major-sigh. Let me know if you are interested and
I can use it as ammunition). I was too lazy to rewrite the regexp stuff,
which you would really need to (MHO) to always handle ticks right, so
I made a few assumptions on formatting (using an idea from Kent Mitchell)
and currently use:
 # In order to get the ticks to work, we are assuming that there will be
 # whitespace before a literal (like '"') and *not* when used for an
 # attribute (like 'Length).
 # For sb/se, assuming literals have whitespace before/after.
Ada|ada:\
        :nf=Courier:\
        :bf=Courier-Bold:\
        :if=Courier-Oblique:\
        :tf=Bookman-Light:\
        :pb=^\d?(procedure|function|package|package\dbody)\d\p:\
        :bb=begin:be=end:\
        :cb=--:ce=$:\
        :sb=( |\t|\()":se="( |\t|;|,):\
        :lb=(>| |\t)':le='(\)| |\t|;):\
        :tl:\
        :oc:\
        :kw=abort abs accept access all and array at begin body case\
        constant declare delay delta digits do else elsif end entry\
        exception exit for function generic goto if in is limited loop\
        mod new not null of or others out package pragma private procedure\
        raise range record rem renames return reverse select separate\
        subtype task terminate then type use when while with xor:

This isn't perfect, but it's better.

--
Richard G. Hash                                      email: rgh@shell.com
Shell Development Company, Bellaire Research Center  phone: (713) 245-7311
Member Team Ada                Free Ada94 compilers: cs.nyu.edu:/pub/gnat



  reply	other threads:[~1994-12-07 15:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-12-03  1:17 Ada PostScript Pretty printer? Bennett, Chip (KTR) ~U
1994-12-07 15:54 ` Richard G. Hash [this message]
  -- strict thread matches above, loose matches on Subject: below --
1994-12-01 19:47 Tony Leavitt
1994-12-02  0:09 ` David Weller
1994-12-02 10:05   ` Rolf Ebert
1994-12-03  4:27     ` David Weller
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox