Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 2001-06-11 10:57:16


From: joel de guzman <isis-tech_at_[hidden]>
> From: "John Max Skaller" :
>
> > Now, using this styalised Spirit syntax, write a parser
> > for styalised Spirit syntax.
> >
> > Compile this with C++. Execute the program on itself,
> > and you have a yacc version of Spirit which generates
> > yacc tables. So you have a version which is itself
> > very fast and which generates very fast parsers.
> >
> > The use: first use C++ to prototype your grammar,
> > then, after you are happy, you can compile a production
> > quality parser using the spirit->yacc translator.
> > This is also a 'C++' routine, but it is compiled
> > rather than interpreted (in some sense).
> >
>
> This is certainly possible. This is really worth exploring.
> So you use Spirit to do the prototyping and feed
> the finished SBNF (spirit bnf) code to a translator
> for a parser X (doesn't have to be yacc). In effect
> using the stock parser in spirit as a RAD tool (fast
> turn around, compile-debug cycle) and a front end
> to different parser gens.
>
> Did I get your idea correctly?
>
> First I thought it cannot be bootstapped because
> code in spirit is inlined. But on further thought, one
> could segregate SBNF code in a *.sbnf file that
> is included (e.g. #include <pascal.sbnf> ) in the
> c++ code. This same SBNF code can be the
> input file to a Spirit->X translator.
>
> Cool!

I liked better the idea that the Spirit would make
available the data structure that results from
initializing a parser and that structure could be
used to generate faster parsers.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk