From: Douglas Gregor (gregod_at_[hidden])
Date: 2001-08-18 15:18:57
I've uploaded a library that contains a generic expression parser
(bottom-up, single token lookahead) that parses based on operator types
(prefix, postfix, infix, confix, etc) and relative precedence/associativity
of operators. It can disambiguate operator names (i.e., the '-' symbol in
mathematics can be prefix or infix), support building expression trees, and
give precise error information (i.e., relative precedence of op1 and op2
Packages examples include the obligatory calculator example and a more
comprehensive example: a language that allows creation of new operators and
declaring their relative precedences, then parsing expressions using those
operators to build expression trees.
The library is available at:
The contents are more easily accessible at:
Is there interest for this library in Boost?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk