Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2001-05-21 07:54:19


joel de guzman wrote:

> Spirit is an object oriented recursive descent parser generator framework
> implemented using template meta-programming techniques. Expression templates
> allow us to approximate the syntax of Extended Backus Normal Form (EBNF)
> completely in C++. The Spirit framework enables a target grammar to be
> written exclusively in C++. EBNF grammar specifications can mix freely with
> other C++ code and, thanks to the generative power of C++ templates, are
> immediately executable. In retrospect, conventional compiler-compilers or
> parser-generators have to perform an additional translation step from the
> source EBNF code to C or C++ code.

> I wonder if anyone out there would be interested in such a beast.
> If anyones's interested, I'd be very glad to boostify the code
> and collaborate with people.

This is interesting, but probably is not usefull.
With small grammars this might work, but for large ones I see a serious
drawback. Template metaprograms are very hard to write, debug and use.
Can you make reasonable error reporting? Can you make reasonable conflict
reporting? And so on.

Moreover, recursive descent parser (= LL(1)) will have lots of conflicts. How
would you disambiguate? (The URL you've given doesn't work, so I haven't
looked there).

So, my final opinion is that "conventional compiler-compler" is better.

-- 
Regards,
Vladimir

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