[Python-3000] parser/compiler interface [was Re: compiler module]
"Martin v. Löwis"
martin at v.loewis.de
Fri Jan 11 16:22:28 CET 2008
> * you can parse things with parser.suite(), but not create an AST from
> the parse result
> * you can create an AST with an undocumented flag to compile(), but not
> compile the resulting AST
The flag is documented, in the document referred to.
There are good reasons for why things are that way. In proceeding, it
is always important to remember these reasons.
> * there are too many modules that have to do with parsing and compiling:
> token, symbol, parser, _ast, symtable
I fail to see that as a problem. token and symbol are just collections
of symbolic constants - what's wrong with that?
> I'd suggest a single package to unify all this functionality and an API
> that makes it easy to go from every compiling stage to the next, or to
> the final code object.
Unifying might be a good thing, but I don't see how it helps to solve
the problems you report (except for the last one, perhaps - but then,
you might end up with a single package with too many modules). To go
from one step to the next, you first have to implement the code to make
that possible. Only then it becomes relevant whether that code all
should live in a single package.
More information about the Python-3000