December 2021
Beginner
840 pages
47h 29m
English
PLY is a parser generator for Python akin to lex and yacc for C. In PLY, tokens are specified using regular expressions and a context-free grammar is specified using a variation of EBNF. The
function is used to automatically generate the scanner/parser; it returns an object containing a parsing function. As with yacc, it is up to the programmer to specify the actions to be performed during parsing to build an abstract-syntax representation (Section 9.5).
The following is the PLY analog of the lex and yacc specifications from Section 3.5 to generate a parser for the symbolic expression language: ...