[Gs-devel] Off topic? Use of DSC parser in GS
Russell Lang
gsview at ghostgum.com.au
Wed May 9 14:49:15 PDT 2001
> 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