From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f5dbc8f688419657 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-12-08 03:45:37 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!hookup!newshost.marcam.com!zip.eecs.umich.edu!newsxfer.itd.umich.edu!gatech!swrinde!pipex!uunet!psinntp!shellgate!camo!rgh From: Richard G. Hash Subject: Re: Ada PostScript Pretty printer? Message-ID: Sender: usenet@shellgate.shell.com (USENET News System) Reply-To: rgh@shell.com Organization: Shell Bellaire Research Center References: <2EDFC62B@SMTPGATE2.STRATCOM.AF.MIL> Date: Wed, 7 Dec 1994 15:54:39 GMT Date: 1994-12-07T15:54:39+00:00 List-Id: > > 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