26 releases (15 breaking)
|0.16.0||Sep 3, 2018|
|0.15.2||May 3, 2018|
|0.15.1||Apr 5, 2018|
|0.15.0||Mar 22, 2018|
|0.2.0||Jul 27, 2015|
#5 in #yacc
702 downloads per month
LALRPOP is a Rust parser generator framework with usability as its primary goal. You should be able to write compact, DRY, readable grammars. To this end, LALRPOP offers a number of nifty features:
- Nice error messages in case parser constructor fails.
- Macros that let you extract common parts of your grammar. This
means you can go beyond simple repetition like
Id*and define things like
Comma<Id>for a comma-separated list of identifiers.
- Macros can also create subsets, so that you easily do something
Expr<"all">to represent the full range of expressions, but
Expr<"if">to represent the subset of expressions that can appear in an
- Builtin support for operators like
- Compact defaults so that you can avoid writing action code much of the time.
- Type inference so you can often omit the types of nonterminals.
Despite its name, LALRPOP in fact uses LR(1) by default (though you can opt for LALR(1)), and really I hope to eventually move to something general that can handle all CFGs (like GLL, GLR, LL(*), etc).
The LALRPOP book covers all things LALRPOP -- or at least it intends to! Here are some tips:
- The tutorial covers the basics of setting up a LALRPOP parser.
- For the impatient, you may prefer the quick start guide section, which describes
how to add LALRPOP to your
- The advanced setup chapter shows how to configure other aspects of LALRPOP's preprocessing.