Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2005-10-30 22:27:28


On 10/23/2005 01:08 PM, Larry Evans wrote:
[snip]
>
> Hopefully, the file:
>
> proto_static_disp.cpp
>
> will also generate some ideas. AFAICT, the arith_expr_gram typedef
> in that file contains all the grammar (which is recursive) and
> *maybe* could be further developed to eliminate dynamic dispatching.
> Of course, I've only compiled it and not yet tried to parse anything
> with it. It's also not readable, but I'm thinking that maybe
> the proposed typeof and << and | and spirit operators could be used to
> replace the 2nd part of the mpl::pair's in the mpl::map.

There's now a proto_static_disp.zip containing code and it's output for
two inputs:

   ident
   ident * ident

The code avoids any dynamic dispatching by using the "Curiously
Recurring Template Pattern" (See Abrahams and Gurtovoy's _C++ Template
Metaprogramming_, section 9.8) in Grammar template.


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