Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!intercon!news From: amanda@mermaid.intercon.com (Amanda Walker) Newsgroups: comp.lang.postscript Subject: Re: Compiled PostScript Message-ID: <1702@intercon.com> Date: 10 Jan 90 00:33:56 GMT References: <28@macuni.mqcc.mq.oz> <1989Dec31.053812.3410@ico.isc.com> <550@jvc.UUCP> Sender: news@intercon.com Reply-To: amanda@mermaid.intercon.com (Amanda Walker) Lines: 24 In article <550@jvc.UUCP>, lpw@jvc.UUCP (Lance Welsh) writes: > then why have we never seen anyone post a BNF for postscript or a > public domain parser? I'll bet it's harder than they think. The biggest problem is not with the actual parsing per se, it's that since a PostScript interpreter is actually executing its input stream (rather than reading a file and then executing it), you cannot statically analyze a PostScript program (take an 'image' command or a font download, for example). This is one of the reasons that the PostScript Document Structuring Conventions use comments instead of parsing the file. Comments are at least unambiguous. The only way I can see of doing a PostScript compiler is to write an interpreter which compiles executable arrays once they are constructed by the interpreter. I'd probably start with compiling to subroutine- threaded code, much in the way of a Forth compiler. Besides, there are several publically available PostScript parsers, they're just embedded in interpreters: GhostScript, Xps, and so on. Amanda Walker Speaker To PostScript InterCon Systems Corporation --