
Christopher Jefferson wrote:
Looking at the documentation, Boost::Spirit seems like a very big hammer to crack this quite small nut, and it is unclear to me how well it would fit into an existing recursive decent parser. Has anyone ever used it as such? Is there a simple alternative?
Spirit is well tuned for small parsing tasks like this. It is a modular RD parser. What you need is what you pay for. The code is as tight as it can be. Try the int parsing examples and see the generated assembler. One of Spirit's original goal is for such micro-parsing. You don't have to write an RD parser, Spirit is an RD parser. However, if you need to use an existing RD parser, then good! You can use any or all of Spirit facilities as-is by calling Spirit's parse functions (which accept forward iterators) from your RD environment. Or, the other way around, you can write a custom-parser in spirit that calls your RD parser. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net