* update the Checklist to reflect the current ast/compiler
This commit is contained in:
parent
0bc1b01905
commit
967e96d1ed
36
pep-0306.txt
36
pep-0306.txt
|
@ -2,7 +2,7 @@ PEP: 306
|
||||||
Title: How to Change Python's Grammar
|
Title: How to Change Python's Grammar
|
||||||
Version: $Revision$
|
Version: $Revision$
|
||||||
Last-Modified: $Date$
|
Last-Modified: $Date$
|
||||||
Author: Michael Hudson <mwh@python.net>
|
Author: Michael Hudson <mwh@python.net>, Jack Diederich <jackdied@gmail.com>, Nick Coghlan <ncoghlan@gmail.com>
|
||||||
Status: Active
|
Status: Active
|
||||||
Type: Informational
|
Type: Informational
|
||||||
Content-Type: text/plain
|
Content-Type: text/plain
|
||||||
|
@ -33,13 +33,26 @@ Rationale
|
||||||
|
|
||||||
Checklist
|
Checklist
|
||||||
|
|
||||||
__ Grammar/Grammar: OK, you'd probably worked this one out :)
|
__ Grammar/Grammar: OK, you'd probably worked this one out :)
|
||||||
|
|
||||||
__ Python/compile.c: you'll most likely need to edit both the
|
__ Parser/Python.asdl may need changes to match the Grammar.
|
||||||
actual compiler and the symtable builder (which is to say both
|
Use Parser/asdl_c.py to regenerate Include/Python-ast.h
|
||||||
the com_foo and the sym_foo functions).
|
|
||||||
|
|
||||||
__ You may need to regenerate Lib/symbol.py and/or Lib/token.py.
|
__ Python/Python-ast.c may need changes to create the AST
|
||||||
|
objects involved with the Grammar change. Lib/compiler/ast.py
|
||||||
|
will need matching changes to the pure-python AST objects.
|
||||||
|
|
||||||
|
__ Parser/pgen needs to be rerun to regenerate Include/graminit.h
|
||||||
|
and Python/graminit.c
|
||||||
|
|
||||||
|
__ Python/symbtable.c: This handles the symbol collection pass
|
||||||
|
that happens immediately before the compilation pass
|
||||||
|
|
||||||
|
__ Python/compile.c: You will need to create or modify the
|
||||||
|
compiler_* functions for your productions.
|
||||||
|
|
||||||
|
__ You may need to regenerate Lib/symbol.py and/or Lib/token.py
|
||||||
|
and/or Lib/keyword.py
|
||||||
|
|
||||||
__ The parser module. Add some of your new syntax to test_parser,
|
__ The parser module. Add some of your new syntax to test_parser,
|
||||||
bang on parsermodule.c until it passes.
|
bang on parsermodule.c until it passes.
|
||||||
|
@ -47,22 +60,17 @@ Checklist
|
||||||
__ The compiler package. A good test is to compile the standard
|
__ The compiler package. A good test is to compile the standard
|
||||||
library and test suite with the compiler package and then check
|
library and test suite with the compiler package and then check
|
||||||
it runs. You did add some of your new syntax to the test
|
it runs. You did add some of your new syntax to the test
|
||||||
suite, didn't you? There's a script in Tools/compiler that
|
suite, didn't you?
|
||||||
does this.
|
|
||||||
|
|
||||||
__ If you've gone so far as to change the token structure of
|
__ If you've gone so far as to change the token structure of
|
||||||
Python, then the tokenizer library module will need to be
|
Python, then the Lib/tokenizer.py library module will need to
|
||||||
changed.
|
be changed.
|
||||||
|
|
||||||
__ Certain changes may require tweaks to the library module
|
__ Certain changes may require tweaks to the library module
|
||||||
pyclbr.
|
pyclbr.
|
||||||
|
|
||||||
__ Jython too will need work, but I don't know what. Explanations
|
|
||||||
gratefully received.
|
|
||||||
|
|
||||||
__ Documentation must be written!
|
__ Documentation must be written!
|
||||||
|
|
||||||
|
|
||||||
References
|
References
|
||||||
|
|
||||||
[1] SF Bug #676521, parser module validation failure
|
[1] SF Bug #676521, parser module validation failure
|
||||||
|
|
Loading…
Reference in New Issue