The relevant code in setup.py first tries to find pgen
pgen = find_executable(
'pgen', os.pathsep.join([os.environ['PATH'], os.path.join(get_python_inc(), '..', 'Parser')]))
if not pgen:
print ("Unable to find pgen, not compiling formal grammar.")
If pgen is found, then file Cython/Parser/Grammar
is given as argument to pgen
else:
parser_dir = os.path.join(os.path.dirname(__file__), 'Cython', 'Parser')
grammar = os.path.join(parser_dir, 'Grammar')
subprocess.check_call([
pgen,
os.path.join(grammar),
os.path.join(parser_dir, 'graminit.h'),
os.path.join(parser_dir, 'graminit.c'),
])
The first lines of Cython/Parser/Grammar,
# Grammar for Cython, based on the Grammar for Python 3
# Note: This grammar is not yet used by the Cython parser and is subject to change.
That comment seems to suggests that even if pgen is available, the code produced by it won't be used.