🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #4002

Re: PostScript disassembler?

#4002
From: Dick Dunn
Date: Sun, 08 Nov 1992 06:11
38 lines
2051 bytes
rothman@tegra.com writes:
>Sometimes self-contained, perfectly functional PS programs get pretty hard
>to decipher, because a lot of procedure definitions are made, operators are
>redefined, etc. Does anyone know of a program that could eat a legal, but 
>cryptic PS program and spew out Red Book standard PS?...

It's not clear what you mean by "Red Book standard"--if it's a legal
program, it's "red book" by some plausible definition.  Green book...now,
that would be a help.

Unwinding procedures is a hard one, because you've got recursion and
dynamic binding.  Even if you don't try to unwind any recursive procedures,
it seems that expanding them out might well make a program harder to read
rather than easier.

Operator redefinitions can be found; this is something an interpreter could
be made to do with a little rewiring.

Why don't you sketch out some examples for us--original program and what
you'd like as the result of the processing?  That might make it easier to
get a handle on the problem.

>...Obviously, the
>output would be far larger than the input, but possibly it might be easier to
>debug...

Is your goal really more at a PostScript debugger?  If that's what you're
after, let's take that tack instead.

>PS: Icing on the cake would be a pretty-print formatter, if this isn't
>too ridiculous for PostScript. (Is there such a thing as pretty PS?)

Well, there's definitely such a thing as ugly PS!  But yes, it's not hard
to derive rules for formatting PS according to a style like the one the
green book uses.
-- 
Dick Dunn    rcd@raven.eklektix.com   -or-   raven!rcd    Boulder, Colorado
	...Simpler is better.
Technical Details
Message-ID: <1992Nov8.061155@eklektix.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!yale.edu!think.com!ames!purdue!yuma!csn!raven!rcd
References: <Bx90n0.3H5@tegra.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.postscript
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!yale.edu!think.com!ames!purdue!yuma!csn!raven!rcd
From: rcd@raven.eklektix.com (Dick Dunn)
Subject: Re: PostScript disassembler?
Message-ID: <1992Nov8.061155@eklektix.com>
Organization: eklektix - Boulder, Colorado
References: <Bx90n0.3H5@tegra.com>
Date: Sun, 8 Nov 1992 06:11:55 GMT
Lines: 38