Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2008-03-24 12:10:08


On 03/23/08 16:02, Larry Evans wrote:
> On 03/22/08 22:12, Eric Niebler wrote:
> > Larry Evans wrote:
> [snip]
> >> The following grammar I think summarizes the difference between
> >> grammar and expression:
> >>
> >> expr //describes an expression.
> >> = terminal
> >> | expr+
> >> //i.e. 1 or more expressions (e.g. expr<tag::plus,expr0,expr1>)
> >> ;
>
> In addition, I wanted some way to tell what's
> a valid 1st arg to matches. The above description of expr is for a
> grammar. Now a valid 1st arg to matches would apply ::type to each
> node in the above tree, AFAICT. At first, I thought of:
>
> expr_type
> = terminal::type
> | expr_type+
> ;
>
> but that would make:
>
> ( terminal::type, terminal::type, terminal::type )
>
> a valid expresion when what's needed is:
>
> ( terminal::type, terminal::type, terminal::type )::type
>

OOPS (again). I guess this would produce what's needed:

   expr_type
      = terminal::type
      | (expr_type+)::type
      ;


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