How to Read Inference Rules: PEG Semantics as an Example
O. Intro
其实在 Fluent Python: Chapter 7 - Function Decorators and Closures 有讲,但没有专注在 signature 上。
Output Type 1: Boolean (i.e. acceptance only)
ast module (vs deprecated parser module for parse trees)
Parse Trees vs ASTs
tokenize module
tokenize module
keyword Module
Docs: keyword — Testing for Python keywords Source Code: cpython/Lib/keyword.py
token module (with intro to globals())
1. Python token module
本文是对 Josh Haberman 的 LL and LR in Context: Why Parsing Tools Are Hard 的总结。
参考:Practical GeneralTop-down Parsers, by Ali Afroozeh and Anastasia Izmaylova