]>
Commit | Line | Data |
---|---|---|
4710c53d | 1 | """Package for parsing and compiling Python source code\r |
2 | \r | |
3 | There are several functions defined at the top level that are imported\r | |
4 | from modules contained in the package.\r | |
5 | \r | |
6 | parse(buf, mode="exec") -> AST\r | |
7 | Converts a string containing Python source code to an abstract\r | |
8 | syntax tree (AST). The AST is defined in compiler.ast.\r | |
9 | \r | |
10 | parseFile(path) -> AST\r | |
11 | The same as parse(open(path))\r | |
12 | \r | |
13 | walk(ast, visitor, verbose=None)\r | |
14 | Does a pre-order walk over the ast using the visitor instance.\r | |
15 | See compiler.visitor for details.\r | |
16 | \r | |
17 | compile(source, filename, mode, flags=None, dont_inherit=None)\r | |
18 | Returns a code object. A replacement for the builtin compile() function.\r | |
19 | \r | |
20 | compileFile(filename)\r | |
21 | Generates a .pyc file by compiling filename.\r | |
22 | """\r | |
23 | \r | |
24 | import warnings\r | |
25 | \r | |
26 | warnings.warn("The compiler package is deprecated and removed in Python 3.x.",\r | |
27 | DeprecationWarning, stacklevel=2)\r | |
28 | \r | |
29 | from compiler.transformer import parse, parseFile\r | |
30 | from compiler.visitor import walk\r | |
31 | from compiler.pycodegen import compile, compileFile\r |