PEGParser Versions Save

💡 Build your own programming language! A C++17 PEG parser generator supporting parser combination, memoization, left-recursion and context-dependent grammars.

v2.2.0

3 years ago

Now allows querying expressions by rule names. When passing a string to the subscript operator, the first subexpression parsed with the matching rule name is returned. Thanks to @jteuber for the idea and PR #60!

Example

ParserGenerator<bool> program;
program["Word"] << "[a-z]+";
program["Yell"] << "[A-Z]+";
program["Start"] << "Word | Yell" >> [](auto e){ return bool(e["Yell"]); }
REQUIRE(!program.run("hello"));
REQUIRE(program.run("HELLO"));

v2.1.1

3 years ago

v2.1

3 years ago

v2.0

4 years ago

v1.10

4 years ago

v1.9

5 years ago

v1.8

5 years ago
  • support for iOS < 11.0 (C++17's std::get is not supported)
  • consistent cmake option names

v1.7

5 years ago

v1.6

5 years ago

v1.5

5 years ago