 |
AXE is a recursive descent parser generator C++ library with the following
characteristics:
- uses C++11 facilities for natural EBNF-like grammar specification
- a large set of predefined syntax rules and semantic actions
- easily extensible with custom rules
- in-site rules and semantic actions creation using lambda functions
- most rules are character type agnostic, and can be reused with different
iterator types
- can be used to create parsers for text, binary, and mixed data
- no arbitrary distinction between lexical analisys (tokenezation) and parsing
- small run-time overhead resulting in fast, compact executable
- header only library, no linking required
- platform agnostic, uses only standard C++11 compiler
|
Examples:
Telephone number parser.
EBNF:
phone_number ::= "(" area_code ")" prefix "-" suffix;
area_code ::= number number number;
prefix ::= number number number;
suffix ::= number number number number;
AXE:
auto area_code = axe::r_numstr(3);
auto prefix = axe::r_numstr(3);
auto suffix = axe::r_numstr(4);
auto phone_number = '(' & area_code & ')' & prefix & '-' & suffix;
|
Version Matrix
C++11 compliant compiler required (supported VC++2010, gcc 4.5 and later)