comp.lang.ada
 help / color / mirror / Atom feed
* Ada PostScript Pretty printer?
@ 1994-12-01 19:47 Tony Leavitt
  1994-12-02  0:09 ` David Weller
  0 siblings, 1 reply; 6+ messages in thread
From: Tony Leavitt @ 1994-12-01 19:47 UTC (permalink / raw)


Does anybody know of a publicly available piece of software that will generate
a PostScript file of pretty Ada code.  What I mean pretty Ada code is that
resevred words are in bold and comments are in italics.  I do NOT want a
reformatter and autoindenter or anything like that.

TIA,

-- 

Tony Leavitt

Lockheed Aeronautical Systems Company
Marietta,  GA 30063-0670

Voice: 404-494-7648
Fax:   404-494-6989
Email: tony@gelac.lasc.lockheed.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Ada PostScript Pretty printer?
  1994-12-01 19:47 Tony Leavitt
@ 1994-12-02  0:09 ` David Weller
  1994-12-02 10:05   ` Rolf Ebert
  0 siblings, 1 reply; 6+ messages in thread
From: David Weller @ 1994-12-02  0:09 UTC (permalink / raw)


In article <3bl980$jvs@pong.lasc.lockheed.com>,
Tony Leavitt <tony@deepthought.Sgi.COM> wrote:
>Does anybody know of a publicly available piece of software that will generate
>a PostScript file of pretty Ada code.  What I mean pretty Ada code is that
>resevred words are in bold and comments are in italics.  I do NOT want a
>reformatter and autoindenter or anything like that.
>

Why not just jam the source through vgrind, then pipe it through
psprint (or some other wild script, like mine here):

	vgrind -d <vgrind_defs_file> -lada -o1- -t -w $* | thack | lpr

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:



-- 
Proud (and vocal) member of Team Ada! (and Team OS/2)        ||This is not your
   	      Ada -- Very Cool.  Doesn't Suck.               ||  father's Ada 
For all sorts of interesting Ada tidbits, run the command:   ||________________
"finger dweller@starbase.neosoft.com | more" (or e-mail with "finger" as subj.)
	|"Quitting C++ isn't so difficult, provided you show as much |
	|	persistence stopping as you did starting." dweller   |



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Ada PostScript Pretty printer?
  1994-12-02  0:09 ` David Weller
@ 1994-12-02 10:05   ` Rolf Ebert
  1994-12-03  4:27     ` David Weller
  0 siblings, 1 reply; 6+ messages in thread
From: Rolf Ebert @ 1994-12-02 10:05 UTC (permalink / raw)




David> In article <3bl980$jvs@pong.lasc.lockheed.com>, Tony Leavitt
David> <tony@deepthought.Sgi.COM> wrote:
>> Does anybody know of a publicly available piece of software that
>> will generate a PostScript file of pretty Ada code.  What I mean
>> pretty Ada code is that resevred words are in bold and comments
>> are in italics.  I do NOT want a reformatter and autoindenter or
>> anything like that.
>> 

David> Why not just jam the source through vgrind, then pipe it
David> through psprint (or some other wild script, like mine here):

[David's vgrind script and famous signature deleted]

Here is another commercial for Emacs:

If you use the new Ada Mode for GNU Emacs (available at
ftp://cs.nyu.edu/pub/gnat; soon to be updated), go and get the package
ps-print.el from any emacs archive
(e.g. ftp://archive.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive/) 

With this package you can print your code as you see it on the screen,
say with bold keywords and italic comments.

	Rolf

--
Rolf Ebert			Beratung fuer Energiesysteme und Informatik
Erich Kaestner Str. 17               Conseil en Energetique et Informatique
D - 80797 Muenchen        (Team Ada)               Tel.: +49-89-30.77.88.00
Germany                                            Fax.: +49-89-30.77.91.00
-- 
Rolf Ebert			Beratung fuer Energiesysteme und Informatik
Erich Kaestner Str. 17               Conseil en Energetique et Informatique
D - 80797 Muenchen        (Team Ada)               Tel.: +49-89-30.77.88.00
Germany                                            Fax.: +49-89-30.77.91.00



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Ada PostScript Pretty printer?
@ 1994-12-03  1:17 Bennett, Chip (KTR) ~U
  1994-12-07 15:54 ` Richard G. Hash
  0 siblings, 1 reply; 6+ messages in thread
From: Bennett, Chip (KTR) ~U @ 1994-12-03  1:17 UTC (permalink / raw)


David Weller <dweller@STARBASE.NEOSOFT.COM> wrote

> Tony Leavitt <tony@deepthought.Sgi.COM> wrote:
> >Does anybody know of a publicly available piece of software that will
> >generate
> >a PostScript file of pretty Ada code.  What I mean pretty Ada code is
that
> >resevred words are in bold and comments are in italics.  I do NOT want a
> >reformatter and autoindenter or anything like that.
>
>
> Why not just jam the source through vgrind, then pipe it through
> psprint (or some other wild script, like mine here):
>
>        vgrind -d <vgrind_defs_file> -lada -o1- -t -w $* | thack | lpr
>
> 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 :-)  ?

Also, is there a way to get vgrind to generate monospaced output?  (or is
this a function of our Sun's "lpr -t" translation into Postscript.)

*****************************************************************
* Chip Bennett, GDE Systems Inc | BennettC@j64.stratcom.af.mil  *
* USSTRATCOM/J64213             | Voice (402)294-7360           *
* 901 SAC Blvd, Suite 2B24      | FAX   (402)294-7912           *
* Offutt AFB, NE 68113-6600     | Proud member of Team Ada      *
* Opinions expressed here are my own _so_,  TTFWTW              *
*****************************************************************



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Ada PostScript Pretty printer?
  1994-12-02 10:05   ` Rolf Ebert
@ 1994-12-03  4:27     ` David Weller
  0 siblings, 0 replies; 6+ messages in thread
From: David Weller @ 1994-12-03  4:27 UTC (permalink / raw)


In article <RE.94Dec2110519@waporo.muc.de>,
Rolf Ebert <re@waporo.muc.de> wrote:
>[David's vgrind script and famous signature deleted]
>
*Blush*

>Here is another commercial for Emacs:
>
>If you use the new Ada Mode for GNU Emacs (available at
>ftp://cs.nyu.edu/pub/gnat; soon to be updated), go and get the package
>ps-print.el from any emacs archive
>(e.g. ftp://archive.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive/) 
>
>With this package you can print your code as you see it on the screen,
>say with bold keywords and italic comments.
>

Agreed!  ROlf deserves a pat on the back for this one!  I'm just now
trying to get my head around emacs, and the new Ada mode (plus the
new&improved, very cool Presentation Manager (OS/2) interface for the
new version of emacs makes things VERY easy!) is quite a wonderful
addition.



-- 
Proud (and vocal) member of Team Ada! (and Team OS/2)        ||This is not your
   	      Ada -- Very Cool.  Doesn't Suck.               ||  father's Ada 
For all sorts of interesting Ada tidbits, run the command:   ||________________
"finger dweller@starbase.neosoft.com | more" (or e-mail with "finger" as subj.)
	|"Quitting C++ isn't so difficult, provided you show as much |
	|	persistence stopping as you did starting." dweller   |



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Ada PostScript Pretty printer?
  1994-12-03  1:17 Ada PostScript Pretty printer? Bennett, Chip (KTR) ~U
@ 1994-12-07 15:54 ` Richard G. Hash
  0 siblings, 0 replies; 6+ messages in thread
From: Richard G. Hash @ 1994-12-07 15:54 UTC (permalink / raw)


> > 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



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1994-12-07 15:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1994-12-03  1:17 Ada PostScript Pretty printer? Bennett, Chip (KTR) ~U
1994-12-07 15:54 ` Richard G. Hash
  -- 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

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