parsing
关于程序 parser 的一些备忘
Earley 算法
- Earley Parsing Explained,详细解释,说明和图解非常好。
- A Pint-sized Earley Parser
Earley parser generators
- Parsing absolutely anything in JavaScript using Earley algorithm | by Gajus Kuizinas | Medium。代码可见于 gajus/scalpel: A CSS selector parser.
Nearley.js
PEG
- 解析表达文法 - Wikiwand
- PEG.js – Parser Generator for JavaScript, 生成 JS 程序
- harc/ohm: A library and language for building parsers, interpreters, compilers, etc. 基于 PEG
JS 下的 parser 生态
- Parsing in JavaScript: all the tools and libraries you can use。最后介绍了 Chevrotain/chevrotain: Parser Building Toolkit for JavaScript 这个库,感觉挺有意思。
- francisrstokes/arcsecond: ✨Zero Dependency Parser Combinator Library for JS Based on Haskell's Parsec parser combinator
AST and CST
- [[abstract-syntax-tree]]
- compiler construction - What's the difference between parse trees and abstract syntax trees (ASTs)? - Stack Overflow
其他 Parser Generator
- lark-parser/lark: Lark is a parsing toolkit for Python, built with a focus on ergonomics, performance and modularity. python 写的项目,有一个 Lark.js 可以生成 js 的代码。 支持 Earley 和 LALR(1) 算法