cpython/Parser
Pablo Galindo 1f24a719e7
bpo-35808: Retire pgen and use pgen2 to generate the parser (GH-11814)
Pgen is the oldest piece of technology in the CPython repository, building it requires various #if[n]def PGEN hacks in other parts of the code and it also depends more and more on CPython internals. This commit removes the old pgen C code and replaces it for a new version implemented in pure Python. This is a modified and adapted version of lib2to3/pgen2 that can generate grammar files compatibles with the current parser.

This commit also eliminates all the #ifdef and code branches related to pgen, simplifying the code and making it more maintainable. The regen-grammar step now uses $(PYTHON_FOR_REGEN) that can be any version of the interpreter, so the new pgen code maintains compatibility with older versions of the interpreter (this also allows regenerating the grammar with the current CI solution that uses Python3.5). The new pgen Python module also makes use of the Grammar/Tokens file that holds the token specification, so is always kept in sync and avoids having to maintain duplicate token definitions.
2019-03-01 15:34:44 -08:00
..
pgen bpo-35808: Retire pgen and use pgen2 to generate the parser (GH-11814) 2019-03-01 15:34:44 -08:00
acceler.c
asdl.py
asdl_c.py bpo-35766 follow-up: Kill half-support for FunctionType in PyAST_obj2mod (#11714) 2019-02-01 11:37:34 -08:00
grammar1.c bpo-31338 (#3374) 2017-09-14 18:13:16 -07:00
listnode.c Use NULL rather than 0. (#778) 2017-03-23 17:53:47 +02:00
myreadline.c bpo-35436: Add missing PyErr_NoMemory() calls and other minor bug fixes. (GH-11015) 2018-12-07 12:11:30 +02:00
node.c bpo-33416: Add end positions to Python AST (GH-11605) 2019-01-22 11:18:22 +00:00
parser.c bpo-35766: Merge typed_ast back into CPython (GH-11645) 2019-01-31 12:40:27 +01:00
parser.h bpo-35224: PEP 572 Implementation (#10497) 2019-01-24 16:49:56 -07:00
parsetok.c bpo-35808: Retire pgen and use pgen2 to generate the parser (GH-11814) 2019-03-01 15:34:44 -08:00
Python.asdl bpo-35766: Merge typed_ast back into CPython (GH-11645) 2019-01-31 12:40:27 +01:00
token.c bpo-35766: Merge typed_ast back into CPython (GH-11645) 2019-01-31 12:40:27 +01:00
tokenizer.c bpo-35808: Retire pgen and use pgen2 to generate the parser (GH-11814) 2019-03-01 15:34:44 -08:00
tokenizer.h bpo-35808: Retire pgen and use pgen2 to generate the parser (GH-11814) 2019-03-01 15:34:44 -08:00