Lrparsing, when regular expressions aren't enough
summary
LRparsing is a pure‑Python lexer plus parser generator that claims to be a Flex and Bison equivalent while remaining Pythonic, fast and well documented. It produces concrete parse trees, supports tokenization, priorities and associativity to remove ambiguities, can emit compiled Python code, and runs real test suites (SQLite example) successfully. Recent work adds IfExp(condition, 1, 2)‑style AST support using Python AST node classes so parsers can yield standard ASTs rather than raw tuples. Error messages and performance are practical.
AI-written summary · about
chapters (25)
- 0:00Introduction
- 0:35Disclaimer
- 1:02Pause
- 1:21The problem with parsing
- 3:18Breaking it down
- 3:38Nested list
- 4:02Mathematical expressions
- 5:49Data structure
- 6:23conventions of maths
- 6:44regular expressions
- 7:49grammar
- 11:37special cases
- 13:07ambiguous grammar
- 14:32Parse tree
- 15:14Priority list
- 20:04Final pathtree
- 21:13Optional extras
- 24:00Optional symbols
- 24:48tokens
- 27:05error messages
- 27:40lrparsing
- 28:02lrparsing runtime
- 28:48lrparsing book
- 29:55Conclusion
- 30:50Questions
related talks
45mReinventing the Parser Generator
01h 02mRuff: An Extremely Fast Python Linter and Code Formatter, Written in Rust
43mctparse: a practical parser for natural language time expressions...
20mA modern Python ruleset
34mAn Intuitive Grasp of RegEx’s in Python
59mWriting Domain Specific Languages with Python
22mDecoding: programming beyond text files
01h 13mHow to write a programming language
