[Gs-devel] Adding to DSC parser [was: Off topic? Use of DSC parser in GS]

Tom Kacvinsky tjk at ams.org
Thu May 10 08:30:56 PDT 2001


Hi all,

I see that the DSC parser does not recognize these DSC comments:

%%DocumentSuppliedResources
%%DocumentNeededResources
%%CreationDate
%%Begin/EndFile

I *think* I can "fix up" dscparse.{c,h} to account for these DSC comments, and
perhaps a few others, but before I delve into this, I want some pointers on
gotchas to watch out for.

Any suggestions?

Thanks,

Tom

On Thu, 10 May 2001, Russell Lang wrote:

> > What do I need to link against?  I am going to try tom compile dscutil.cpp in
> > standalong mode on Solaris 2.7...  I have gs 7.00 compiled and installed
> > already.
>
> When using dscutil.cpp, the DSC parser is independent of Ghostscript.
> If you use the files from GSview, you would compile with:
> gcc -c dscparse.cpp
> gcc -c -DSTANDALONE -DUNIX dscutil.cpp
> gcc -o dscutil dscutil.o dscparse.o
>
> To parse t.ps, use
> ./dscutil t.ps
>
> Note that you can also access the dsc parser from PostScript code
> within Ghostscript.  This is used by the pdfwrite device to gain some
> extra information about the PostScript input file.
> This work was done by Dan Copy and Ray Johnston (I think).
>
> > On Wed, 9 May 2001, Russell Lang wrote:
> >
> > > > I am looking for sample code that uses the DSC parser built into GS.
> > > >
> > > > In particular, I am after a tool for verifying that a PS document conforms to
> > > > the DSC specifiation, and all Begin/End pairs match up as they should...
> > > >
> > > > Matching of Begin/End comments is a very imnportant prerequisite for a project I
> > > > am currently working on...
> > >
> > > The DSC parser doesn't verify everything, but it does check for
> > > matching Begin/End pairs and gives a text warning if they don't
> > > match.
> > >
> > > There are two C modules to the DSC parser.  Ghostscript uses only the
> > > first, dscparse.c/cpp.  The second is only in GSview and provides
> > > sample code for how to use it.  This is dscutil.cpp.
>
>
> Russell Lang                   gsview at ghostgum.com.au
> Ghostgum Software Pty Ltd      http://www.ghostgum.com.au/
>





More information about the gs-devel mailing list