mirror of
https://github.com/Scanavium21/lalrpop.git
synced 2026-06-15 12:31:51 +00:00
LR(1) parser generator for Rust
http://lalrpop.github.io/lalrpop/
- Rust 99.9%
- Shell 0.1%
https://github.com/lalrpop/lalrpop/pull/1065 attempted to fix issue #1064, but missed several cases. This fixes some remaining ones. I'm not 100% confident I got them all, but it is enough to make my project compile on the latest LALRPOP. |
||
|---|---|---|
| .config | ||
| .github | ||
| doc | ||
| lalrpop | ||
| lalrpop-test | ||
| lalrpop-util | ||
| tools | ||
| .clog.toml | ||
| .gitattributes | ||
| .gitignore | ||
| .mdl_style.rb | ||
| .mdlrc | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| LICENSE-APACHE | ||
| LICENSE-MIT | ||
| README.md | ||
| RELEASES.md | ||
| update_lrgrammar.sh | ||
| version.sh | ||
LALRPOP
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 likeComma<Id>for a comma-separated list of identifiers. - Macros can also create subsets, so that you easily do something
like
Expr<"all">to represent the full range of expressions, butExpr<"if">to represent the subset of expressions that can appear in anifexpression. - Builtin support for operators like
*and?. - 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).
Documentation
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
Cargo.toml. - Returning users of LALRPOP may benefit from the cheat sheet.
- The advanced setup chapter shows how to configure other aspects of LALRPOP's preprocessing.
- docs.rs API documentation for lalrpop and lalrpop-util
- If you have any questions join our gitter lobby.
Example Uses
- LALRPOP is itself implemented in LALRPOP.
- Gluon is a statically typed functional programming language.
- RustPython is Python 3.5+ rewritten in Rust
- Solang is Ethereum Solidity rewritten in Rust
Contributing
You really should read CONTRIBUTING.md if you intend to change LALRPOP's own grammar.