Boost logo

Boost :

From: Petr Kocmid (pkocmid_at_[hidden])
Date: 2002-10-21 16:47:12


I digged in spirit 1.5.1 last night. Impressive stuff, really.

Well, I sugest to reconsider about parser operator~ (with set complement semantics) for somewhat limited usage. While it is problematic at large (as noted in operators.html), it could be quite useful in lexers if applied on single character parsers, such as:

~ch_p('x') matches a single character, any other than x
~digit_p matches any non-digit character

and so on with any other single character parser primitives.
On contrary, it's usage for any string consuming parser or sequence should generate a compile time warning or error.

AFAIK, ANTLR uses such complement for characters, and even unicode intervals, which comes to be very handy.

Petr Kocmid
pkocmid_at_[hidden]


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