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

_ClassType Transformer

Utility object for transforming Python parse trees.

Exposes the following methods:
    tree = transform(ast_tree)
    tree = parsesuite(text)
    tree = parseexpr(text)
    tree = parsefile(fileob | filename)

Instance Methods [hide private]
 
__init__(self)
 
transform(self, tree)
Transform an AST into a modified parse tree.
 
parsesuite(self, text)
Return a modified parse tree for the given suite text.
 
parseexpr(self, text)
Return a modified parse tree for the given expression text.
 
parsefile(self, file)
Return a modified parse tree for the contents of the given file.
 
compile_node(self, node)
 
single_input(self, node)
 
file_input(self, nodelist)
 
eval_input(self, nodelist)
 
decorator_name(self, nodelist)
 
decorator(self, nodelist)
 
decorators(self, nodelist)
 
funcdef(self, nodelist)
 
lambdef(self, nodelist)
 
old_lambdef(self, nodelist)
 
classdef(self, nodelist)
 
stmt(self, nodelist)
 
small_stmt(self, nodelist)
 
flow_stmt(self, nodelist)
 
compound_stmt(self, nodelist)
 
simple_stmt(self, nodelist)
 
parameters(self, nodelist)
 
varargslist(self, nodelist)
 
fpdef(self, nodelist)
 
fplist(self, nodelist)
 
dotted_name(self, nodelist)
 
comp_op(self, nodelist)
 
trailer(self, nodelist)
 
sliceop(self, nodelist)
 
argument(self, nodelist)
 
expr_stmt(self, nodelist)
 
print_stmt(self, nodelist)
 
del_stmt(self, nodelist)
 
pass_stmt(self, nodelist)
 
break_stmt(self, nodelist)
 
continue_stmt(self, nodelist)
 
return_stmt(self, nodelist)
 
yield_stmt(self, nodelist)
 
yield_expr(self, nodelist)
 
raise_stmt(self, nodelist)
 
import_stmt(self, nodelist)
 
import_name(self, nodelist)
 
import_from(self, nodelist)
 
global_stmt(self, nodelist)
 
exec_stmt(self, nodelist)
 
assert_stmt(self, nodelist)
 
if_stmt(self, nodelist)
 
while_stmt(self, nodelist)
 
for_stmt(self, nodelist)
 
try_stmt(self, nodelist)
 
with_stmt(self, nodelist)
 
with_var(self, nodelist)
 
suite(self, nodelist)
 
testlist(self, nodelist)
 
testlist_safe(self, nodelist)
 
testlist1(self, nodelist)
 
exprlist(self, nodelist)
 
testlist_gexp(self, nodelist)
 
test(self, nodelist)
 
or_test(self, nodelist)
 
old_test(self, nodelist)
 
and_test(self, nodelist)
 
not_test(self, nodelist)
 
comparison(self, nodelist)
 
expr(self, nodelist)
 
xor_expr(self, nodelist)
 
and_expr(self, nodelist)
 
shift_expr(self, nodelist)
 
arith_expr(self, nodelist)
 
term(self, nodelist)
 
factor(self, nodelist)
 
power(self, nodelist)
 
atom(self, nodelist)
 
atom_lpar(self, nodelist)
 
atom_lsqb(self, nodelist)
 
atom_lbrace(self, nodelist)
 
atom_backquote(self, nodelist)
 
atom_number(self, nodelist)
 
decode_literal(self, lit)
 
atom_string(self, nodelist)
 
atom_name(self, nodelist)
 
lookup_node(self, node)
 
com_node(self, node)
 
com_NEWLINE(self, *args)
 
com_arglist(self, nodelist)
 
com_fpdef(self, node)
 
com_fplist(self, node)
 
com_dotted_name(self, node)
 
com_dotted_as_name(self, node)
 
com_dotted_as_names(self, node)
 
com_import_as_name(self, node)
 
com_import_as_names(self, node)
 
com_bases(self, node)
 
com_try_except_finally(self, nodelist)
 
com_with(self, nodelist)
 
com_with_var(self, nodelist)
 
com_augassign_op(self, node)
 
com_augassign(self, node)
Return node suitable for lvalue of augmented assignment
 
com_assign(self, node, assigning)
 
com_assign_tuple(self, node, assigning)
 
com_assign_list(self, node, assigning)
 
com_assign_name(self, node, assigning)
 
com_assign_trailer(self, primary, node, assigning)
 
com_assign_attr(self, primary, node, assigning)
 
com_binary(self, constructor, nodelist)
Compile 'NODE (OP NODE)*' into (type, [ node1, ..., nodeN ]).
 
com_stmt(self, node)
 
com_append_stmt(self, stmts, node)
 
com_list_comprehension(self, expr, node)
 
com_list_iter(self, node)
 
com_list_constructor(self, nodelist)
 
com_generator_expression(self, expr, node)
 
com_gen_iter(self, node)
 
com_dictmaker(self, nodelist)
 
com_apply_trailer(self, primaryNode, nodelist)
 
com_select_member(self, primaryNode, nodelist)
 
com_call_function(self, primaryNode, nodelist)
 
com_argument(self, nodelist, kw)
 
com_subscriptlist(self, primary, nodelist, assigning)
 
com_subscript(self, node)
 
com_sliceobj(self, node)
 
com_slice(self, primary, node, assigning)
 
get_docstring(self, node, n=None)
Method Details [hide private]

com_augassign(self, node)

 

Return node suitable for lvalue of augmented assignment

Names, slices, and attributes are the only allowable nodes.