Package compiler :: Module transformer
[hide private]
[frames] | no frames]

Module transformer

Parse tree transformation module.

Transforms Python source code into an abstract syntax tree (AST) defined in the ast module.

The simplest ways to invoke this module are via parse and parseFile. parse(buf) -> AST parseFile(path) -> AST

Classes [hide private]
WalkerError
Transformer
Utility object for transforming Python parse trees.
Functions [hide private]
 
parseFile(path)
 
parse(buf, mode='exec')
 
asList(nodes)
 
extractLineNo(ast)
 
Node(*args)
 
debug_tree(tree)
Variables [hide private]
  _doc_nodes = [269, 326, 300, 303, 304, 305, 306, 307, 309, 310...
  _cmp_types = {20: '<', 21: '>', 22: '==', 28: '==', 29: '!=', ...
  _legal_node_types = [261, 328, 266, 268, 274, 267, 291, 269, 2...
  _assign_types = [303, 304, 305, 306, 307, 309, 310, 311, 312, ...
  _names = {0: 'ENDMARKER', 1: 'NAME', 2: 'NUMBER', 3: 'STRING',...
  k = 51
  name = 'If'
  v = 'OP'

Imports: Slice, Const, Raise, For, AssTuple, Mul, Invert, RightShift, AssList, Add, Dict, flatten, UnaryAdd, Import, Print, Ellipsis, Sliceobj, Decorators, Subscript, Name, Assert, Return, Power, Exec, GenExprFor, Stmt, Or, Break, Bitand, FloorDiv, Tuple, Bitxor, TryExcept, Not, nodes, EmptyNode, With, Class, Mod, Printnl, Function, TryFinally, GenExprIf, While, AssAttr, Keyword, GenExpr, Module, AugAssign, List, Yield, IfExp, AssName, From, Continue, Backquote, Discard, Div, Expression, Assign, Lambda, And, LeftShift, Compare, GenExprInner, CallFunc, Global, Getattr, ListCompIf, Sub, ListCompFor, flatten_nodes, Pass, UnarySub, Bitor, ListComp, If, parser, symbol, token, sys, CO_VARARGS, CO_VARKEYWORDS, OP_ASSIGN, OP_DELETE, OP_APPLY, obj


Variables Details [hide private]

_doc_nodes

Value:
[269,
 326,
 300,
 303,
 304,
 305,
 306,
 307,
...

_cmp_types

Value:
{20: '<', 21: '>', 22: '==', 28: '==', 29: '!=', 30: '<=', 31: '>='}

_legal_node_types

Value:
[261,
 328,
 266,
 268,
 274,
 267,
 291,
 269,
...

_assign_types

Value:
[303, 304, 305, 306, 307, 309, 310, 311, 312, 313, 314, 315]

_names

Value:
{0: 'ENDMARKER',
 1: 'NAME',
 2: 'NUMBER',
 3: 'STRING',
 4: 'NEWLINE',
 5: 'INDENT',
 6: 'DEDENT',
 7: 'LPAR',
...