百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

lalrpop

> 编程语言
开源

用于 Rust 的 LR(1) 解析器生成器

3.5K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

用于 Rust 的 LR(1) 解析器生成器

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:

  1. Nice error messages in case parser constructor fails.
  2. 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.
  3. Macros can also create subsets, so that you easily do something like Expr<"all"> to represent the full range of expressions, but Expr<"if"> to represent the subset of expressions that can appear in an if expression.
  4. Builtin support for operators like * and ?.
  5. Compact defaults so that you can avoid writing action code much of the time.
  6. 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.

GitHub Issues· 168 开放

在 GitHub 查看全部
  • #1136

    CLI: regenerate the grammar when compiling with diffferent features

    更新于 2026年9月3日
  • #1135

    Output ambiguous before local conflict?

    更新于 2026年8月5日
  • #1133

    multiple `pub` production rules can cause a LOT of duplicated generated code

    wishlist更新于 2026年6月30日
  • #966

    Allow specifying conditions in external token patterns (contextual keywords)

    更新于 2026年5月11日
  • #1114

    Unexpected build error upgrading to version 0.23.0

    更新于 2026年3月6日
  • #1089

    Return expected tokens as `&'static str` instead of `String`

    更新于 2026年3月6日
  • #1113

    New warning when updating to logos 0.16

    更新于 2026年3月1日
  • #1108

    Error message generation takes a very long time sometimes.

    更新于 2026年2月16日
  • #1110

    suppress type_complexity for clippy

    更新于 2026年2月9日
  • #656

    nondetermistic test failures 😢

    更新于 2026年1月26日

核心特点

  • •The [tutorial] covers the basics of setting up a LALRPOP parser.
  • •For the impatient, you may prefer the [quick start guide] section, which describes
  • •Returning users of LALRPOP may benefit from the [cheat sheet].
  • •The [advanced setup] chapter shows how to configure other aspects of LALRPOP's
  • •docs.rs API documentation for lalrpop and [lalrpop-util]
  • •If you have any questions join our [gitter lobby].
  • •[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

> 标签

Rustgrammarparser-generatorrust

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言