Boost logo

Boost :

From: isis-tech_at_[hidden]
Date: 2001-05-26 21:26:52


> }
> } But this can be done in Spirit:
> }
> } ((a|b) - abb) >> abb
> }
> } Spirit's EBNF syntax has the &, -, and ^ which are
> } very powerful set operators missing in other EBNF
> } dialects.
>
> ...but that isn't the same language. aabbababb is (should be)
accepted by
> the first expression and (if I understand your notation) will not be
> accepted by the EBNF version.
>
> } Cheers,
> } Joel de Guzman
> --Greg

For some reason I am not receiving boost posts. Anyway.

OK, how about this spirit code:

ChLit<> a('a');
ChLit<> b('b');
Rule<> abb = a >> b >> b;
Rule<> abbend = a >> b >> b >> '\0';
Rule<> r = *((a|b) - abbend) >> abb;

"aabbababb" parses OK

Joel de Guzman


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