
I'm trying to write a parser with elements that might not occur - is this possible? like: string ['-' number] that matches "foo" or "foo-123" -- Cory Nelson http://www.int64.org

Of "course". That is what the optional operator is for. Something like: *alpha_p << !(ch_p('-') << *digit_p) Cory Nelson wrote:
I'm trying to write a parser with elements that might not occur - is this possible?
like:
string ['-' number]
that matches "foo" or "foo-123"

Thankyou! I just noticed the quick reference page, it has been very helpful.
On Sat, 06 Nov 2004 11:13:05 -0500, Jeffrey Holle
Of "course". That is what the optional operator is for. Something like: *alpha_p << !(ch_p('-') << *digit_p)
Cory Nelson wrote:
I'm trying to write a parser with elements that might not occur - is this possible?
like:
string ['-' number]
that matches "foo" or "foo-123"
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Cory Nelson http://www.int64.org

Are there any tools to translate the various BNF formats into Spirit
code? I think this would be very useful.
On Sat, 06 Nov 2004 11:13:05 -0500, Jeffrey Holle
Of "course". That is what the optional operator is for. Something like: *alpha_p << !(ch_p('-') << *digit_p)
Cory Nelson wrote:
I'm trying to write a parser with elements that might not occur - is this possible?
like:
string ['-' number]
that matches "foo" or "foo-123"
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Cory Nelson http://www.int64.org

Cory Nelson wrote:
Are there any tools to translate the various BNF formats into Spirit code? I think this would be very useful.
AFAIK, no. -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
participants (3)
-
Cory Nelson
-
Jeffrey Holle
-
Joel