|Postscript Parser firstname.lastname@example.org (1997-10-17)|
|Re: Postscript Parser email@example.com (Tom Lane) (1997-10-19)|
|Re: Postscript Parser firstname.lastname@example.org (1997-10-19)|
|Re: Postscript Parser email@example.com (1997-10-21)|
|Re: Postscript Parser Wolfgang.Glunz@mchp.siemens.de (Wolfgang Glunz) (1997-10-26)|
|From:||Tom Lane <firstname.lastname@example.org>|
|Date:||19 Oct 1997 00:53:25 -0400|
|Organization:||Netcom Online Communications Services|
email@example.com (David Withers) writes:
> I'm trying to create a tool that recognises rectangles and text in
> PostScript diagrams and makes HTML image maps. Does anyone know of a
> PostScript parser that creates AST's or a grammar that I can use to
> make one?
> [Sounds impossible to do perfectly, but I suspect some heuristic pattern
> matching could catch a lot of common cases. Postscript has practially no
> syntax, parsing it is just turning RPN into a tree. -John]
More to the point, rectangles and other graphics are the *output*
of the execution of a Postscript program. Parsing is the least
of your worries; if you don't have a full Postscript interpreter,
your chances of getting the right answer are slim to none.
You might possibly be able to get away with pure parsing to understand
the output of certain applications that output very stylized subsets
of Postscript. But the robustness of your code will be nil.
I believe recent releases of Ghostscript can be used in a mode
where evaluated graphics primitives are passed to your output
driver (as opposed to passing a finished bitmap to your driver).
Check it out; that's the only approach that has any hope of
regards, tom lane
Return to the
Search the comp.compilers archives again.