1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/compiler/__init__.py Fri May 18 20:51:41 2012 +0200
1.3 @@ -0,0 +1,29 @@
1.4 +"""Package for parsing and compiling Python source code
1.5 +
1.6 +There are several functions defined at the top level that are imported
1.7 +from modules contained in the package.
1.8 +
1.9 +parse(buf, mode="exec") -> AST
1.10 + Converts a string containing Python source code to an abstract
1.11 + syntax tree (AST). The AST is defined in compiler.ast.
1.12 +
1.13 +parseFile(path) -> AST
1.14 + The same as parse(open(path))
1.15 +
1.16 +walk(ast, visitor, verbose=None)
1.17 + Does a pre-order walk over the ast using the visitor instance.
1.18 + See compiler.visitor for details.
1.19 +
1.20 +compile(source, filename, mode, flags=None, dont_inherit=None)
1.21 + Returns a code object. A replacement for the builtin compile() function.
1.22 +
1.23 +compileFile(filename)
1.24 + Generates a .pyc file by compiling filename.
1.25 +"""
1.26 +from warnings import warnpy3k
1.27 +warnpy3k("the compiler package has been removed in Python 3.0", stacklevel=2)
1.28 +del warnpy3k
1.29 +
1.30 +from compiler.transformer import parse, parseFile
1.31 +from compiler.visitor import walk
1.32 +from compiler.pycodegen import compile, compileFile