In short, parsepp is a tool for writing custom parsers using template programming techniques. In some ways it is similar to the venerable lex and yacc tools, but this style of parser is much easier and safer to work with and also has no separate tokenization/parsing steps (they are done at the same time).
LicensePublic Domain. Do as you will.
See the downloads page.
- A fairly small header-only implementation (templates-intensive).
- Uses only ISO C++ Standards-specified techniques.
- No 3rd-party code dependencies (only the STL).
- Fairly well documented, in the form of this web site and the API docs (in the header files).
- Really easy to use. The core interface revolves around only a small handful of functions and a useful set of parsing rules.
- Can be used to generate parsers of arbitrary complexity, limited only by system resources (or potentially compiler limitations).
- Has support for easily inserting matched tokens into standard containers.
- There is some very minimal (and fairly low-level) support for getting at exact parse error positions, but this should be extended.
- Only works with std::string input, the main implication being that all input has to be buffered before parsing begins.
- Currently relies on the null character to report EOF, so it cannot be used with binary data. In theory it'll be easy to switch it to parse arbitrary integer arrays, which would allow it to be parse UTF16 or binary data as well as ascii, provided we can reserve one int value to mark EOF.
- Figure out some reasonable error reporting techniques.
- Maybe templatize the iterator type so we can work on arbitrary input iterators. This requires a partial-buffering strategy similar to the one from PEGTL, which can figure out "from which point are we guaranteed to not have to backtrack?" and discard all input before that point.
First, see test.cpp in the source tree. Once that code makes sense, see parsepp_numeric.hpp, then parsepp_calc.hpp.