Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bbn!apple!voder!wlbr!mh From: mh@wlbr.EATON.COM (Mike Hoegeman) Newsgroups: comp.lang.postscript Subject: Re: Wanted: a PostScript pretty-printer Keywords: postscript Message-ID: <26038@wlbr.EATON.COM> Date: 28 Jan 89 21:18:06 GMT References: <477@grand.UUCP> Reply-To: mh@wlbr.eaton.com.UUCP (Mike Hoegeman) Organization: Eaton IMSD, Westlake Village, CA Lines: 57 In article <477@grand.UUCP> day@grand.UUCP (Dave Yost) writes: >Anyone know of a PostScript pretty-printer? > >Anyone want to start a discussion of PS indenting style? (heh, heh) > > --dave yost ......well, maybe a little , i prefer indentation similar to the original K&R book C indentation style. /procname { % i ususally just use the same indent level for the scope dict of a procedure % as the procedure itself, otherwise the indent level just gets too deep.. % within the procedure body. 10 dict begin bool_val { % stuff here } { % more stuff here } ifelse % if i have a big array defn i usually do it like this.. /my_array [ 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 ] def % if it smaller it's just /small_array [ 1 2 3 4 5] def end } def % even if the procedure is pretty small i'll still indent it like a big one /dummy_proc { 0 pop } def % one thing i don't particularly like is putting comments on the same line % as code like... /lame { % a lot of people put a short proc description here, i hate this %% proc body here.... } def it's to hard to scan thru comments if you are trying figure out the general workings of a procedure anyway in response to your query, Josh Seigel (siegel@hc.dspo.gov) has made a good postscript pretty printer. it's on the SEX (software exchange) tape from the miami sun user's group conference held last december. i would'nt be surprised if it was on titan.rice.edu in the sun-spots archive either. if you have trouble finding it I'll post it. mike.