compiler.pycodegen
index
/usr/local/lib/python2.5/compiler/pycodegen.py
Module Docs

 
Modules
       
compiler.ast
compiler.future
imp
marshal
compiler.misc
os
compiler.pyassem
struct
compiler.symbols
compiler.syntax
sys

 
Classes
       
AbstractClassCode
AbstractCompileMode
Expression
Interactive
Module
AbstractFunctionCode
CodeGenerator
Delegator
AugGetattr
AugName
AugSlice
AugSubscript
LocalNameFinder
NestedScopeMixin
ClassCodeGenerator(NestedScopeMixin, AbstractClassCode, CodeGenerator)
ExpressionCodeGenerator(NestedScopeMixin, CodeGenerator)
FunctionCodeGenerator(NestedScopeMixin, AbstractFunctionCode, CodeGenerator)
GenExprCodeGenerator(NestedScopeMixin, AbstractFunctionCode, CodeGenerator)
InteractiveCodeGenerator(NestedScopeMixin, CodeGenerator)
ModuleCodeGenerator(NestedScopeMixin, CodeGenerator)
OpFinder

 
class AbstractClassCode
     Methods defined here:
__init__(self, klass, scopes, module)
finish(self)
get_module(self)

 
class AbstractCompileMode
     Methods defined here:
__init__(self, source, filename)
compile(self)
getCode(self)

Data and other attributes defined here:
mode = None

 
class AbstractFunctionCode
     Methods defined here:
__init__(self, func, scopes, isLambda, class_name, mod)
finish(self)
generateArgUnpack(self, args)
get_module(self)
unpackSequence(self, tup)
unpackTuple = unpackSequence(self, tup)

Data and other attributes defined here:
lambdaCount = 0
optimized = 1

 
class AugGetattr(Delegator)
     Methods inherited from Delegator:
__getattr__(self, attr)
__init__(self, obj)

 
class AugName(Delegator)
     Methods inherited from Delegator:
__getattr__(self, attr)
__init__(self, obj)

 
class AugSlice(Delegator)
     Methods inherited from Delegator:
__getattr__(self, attr)
__init__(self, obj)

 
class AugSubscript(Delegator)
     Methods inherited from Delegator:
__getattr__(self, attr)
__init__(self, obj)

 
class ClassCodeGenerator(NestedScopeMixin, AbstractClassCode, CodeGenerator)
    
Method resolution order:
ClassCodeGenerator
NestedScopeMixin
AbstractClassCode
CodeGenerator

Methods defined here:
__init__(self, klass, scopes, module)
super_init = __init__(self)

Data and other attributes defined here:
scopes = None

Methods inherited from NestedScopeMixin:
initClass(self)

Methods inherited from AbstractClassCode:
finish(self)
get_module(self)

Methods inherited from CodeGenerator:
binaryOp(self, node, op)
bitOp(self, nodes, op)
checkClass(self)
Verify that class is constructed correctly
delName(self, name)
getCode(self)
Return a code object
isLocalName(self, name)
loadName(self, name)
mangle(self, name)
parseSymbols(self, tree)
set_lineno(self, node, force=False)
Emit SET_LINENO if necessary.
 
The instruction is considered necessary if the node has a
lineno attribute and it is different than the last lineno
emitted.
 
Returns true if SET_LINENO was emitted.
 
There are no rules for when an AST node should have a lineno
attribute.  The transformer and AST code need to be reviewed
and a consistent policy implemented and documented.  Until
then, this method works around missing line numbers.
storeName(self, name)
unaryOp(self, node, op)
visitAdd(self, node)
visitAnd(self, node)
visitAssAttr(self, node)
visitAssList = _visitAssSequence(self, node, op='UNPACK_SEQUENCE')
visitAssName(self, node)
visitAssTuple = _visitAssSequence(self, node, op='UNPACK_SEQUENCE')
visitAssert(self, node)
visitAssign(self, node)
visitAugAssign(self, node)
visitAugGetattr(self, node, mode)
visitAugName(self, node, mode)
visitAugSlice(self, node, mode)
visitAugSubscript(self, node, mode)
visitBackquote(self, node)
visitBitand(self, node)
visitBitor(self, node)
visitBitxor(self, node)
visitBreak(self, node)
visitCallFunc(self, node)
visitClass(self, node)
visitCompare(self, node)
visitConst(self, node)
visitContinue(self, node)
visitDict(self, node)
visitDiscard(self, node)
visitDiv(self, node)
visitEllipsis(self, node)
visitExec(self, node)
visitExpression(self, node)
visitFloorDiv(self, node)
visitFor(self, node)
visitFrom(self, node)
visitFunction(self, node)
visitGenExpr(self, node)
visitGenExprFor(self, node)
visitGenExprIf(self, node, branch)
visitGenExprInner(self, node)
visitGetattr(self, node)
visitGlobal(self, node)
visitIf(self, node)
visitIfExp(self, node)
visitImport(self, node)
visitInvert(self, node)
visitKeyword(self, node)
visitLambda(self, node)
visitLeftShift(self, node)
visitList(self, node)
visitListComp(self, node)
visitListCompFor(self, node)
visitListCompIf(self, node, branch)
visitMod(self, node)
visitModule(self, node)
visitMul(self, node)
visitName(self, node)
visitNot(self, node)
visitOr(self, node)
visitPass(self, node)
visitPower(self, node)
visitPrint(self, node, newline=0)
visitPrintnl(self, node)
visitRaise(self, node)
visitReturn(self, node)
visitRightShift(self, node)
visitSlice(self, node, aug_flag=None)
visitSliceobj(self, node)
visitSub(self, node)
visitSubscript(self, node, aug_flag=None)
visitTest(self, node, jump)
visitTryExcept(self, node)
visitTryFinally(self, node)
visitTuple(self, node)
visitUnaryAdd(self, node)
visitUnaryInvert(self, node)
visitUnarySub(self, node)
visitWhile(self, node)
visitWith(self, node)
visitYield(self, node)

Data and other attributes inherited from CodeGenerator:
ClassGen = None
FunctionGen = None
NameFinder = <class compiler.pycodegen.LocalNameFinder at 0xb6d8f8fc>
Find local names in scope
class_name = None
optimized = 0

 
class CodeGenerator
    Defines basic code generator for Python bytecode
 
This class is an abstract base class.  Concrete subclasses must
define an __init__() that defines self.graph and then calls the
__init__() defined in this class.
 
The concrete class must also define the class attributes
NameFinder, FunctionGen, and ClassGen.  These attributes can be
defined in the initClass() method, which is a hook for
initializing these methods after all the classes have been
defined.
 
  Methods defined here:
__init__(self)
binaryOp(self, node, op)
bitOp(self, nodes, op)
checkClass(self)
Verify that class is constructed correctly
delName(self, name)
getCode(self)
Return a code object
get_module(self)
initClass(self)
This method is called once for each class
isLocalName(self, name)
loadName(self, name)
mangle(self, name)
parseSymbols(self, tree)
set_lineno(self, node, force=False)
Emit SET_LINENO if necessary.
 
The instruction is considered necessary if the node has a
lineno attribute and it is different than the last lineno
emitted.
 
Returns true if SET_LINENO was emitted.
 
There are no rules for when an AST node should have a lineno
attribute.  The transformer and AST code need to be reviewed
and a consistent policy implemented and documented.  Until
then, this method works around missing line numbers.
storeName(self, name)
unaryOp(self, node, op)
visitAdd(self, node)
visitAnd(self, node)
visitAssAttr(self, node)
visitAssList = _visitAssSequence(self, node, op='UNPACK_SEQUENCE')
visitAssName(self, node)
visitAssTuple = _visitAssSequence(self, node, op='UNPACK_SEQUENCE')
visitAssert(self, node)
visitAssign(self, node)
visitAugAssign(self, node)
visitAugGetattr(self, node, mode)
visitAugName(self, node, mode)
visitAugSlice(self, node, mode)
visitAugSubscript(self, node, mode)
visitBackquote(self, node)
visitBitand(self, node)
visitBitor(self, node)
visitBitxor(self, node)
visitBreak(self, node)
visitCallFunc(self, node)
visitClass(self, node)
visitCompare(self, node)
visitConst(self, node)
visitContinue(self, node)
visitDict(self, node)
visitDiscard(self, node)
visitDiv(self, node)
visitEllipsis(self, node)
visitExec(self, node)
visitExpression(self, node)
visitFloorDiv(self, node)
visitFor(self, node)
visitFrom(self, node)
visitFunction(self, node)
visitGenExpr(self, node)
visitGenExprFor(self, node)
visitGenExprIf(self, node, branch)
visitGenExprInner(self, node)
visitGetattr(self, node)
visitGlobal(self, node)
visitIf(self, node)
visitIfExp(self, node)
visitImport(self, node)
visitInvert(self, node)
visitKeyword(self, node)
visitLambda(self, node)
visitLeftShift(self, node)
visitList(self, node)
visitListComp(self, node)
visitListCompFor(self, node)
visitListCompIf(self, node, branch)
visitMod(self, node)
visitModule(self, node)
visitMul(self, node)
visitName(self, node)
visitNot(self, node)
visitOr(self, node)
visitPass(self, node)
visitPower(self, node)
visitPrint(self, node, newline=0)
visitPrintnl(self, node)
visitRaise(self, node)
visitReturn(self, node)
visitRightShift(self, node)
visitSlice(self, node, aug_flag=None)
visitSliceobj(self, node)
visitSub(self, node)
visitSubscript(self, node, aug_flag=None)
visitTest(self, node, jump)
visitTryExcept(self, node)
visitTryFinally(self, node)
visitTuple(self, node)
visitUnaryAdd(self, node)
visitUnaryInvert(self, node)
visitUnarySub(self, node)
visitWhile(self, node)
visitWith(self, node)
visitYield(self, node)

Data and other attributes defined here:
ClassGen = None
FunctionGen = None
NameFinder = <class compiler.pycodegen.LocalNameFinder at 0xb6d8f8fc>
Find local names in scope
class_name = None
optimized = 0

 
class Delegator
    Base class to support delegation for augmented assignment nodes
 
To generator code for augmented assignments, we use the following
wrapper classes.  In visitAugAssign, the left-hand expression node
is visited twice.  The first time the visit uses the normal method
for that node .  The second time the visit uses a different method
that generates the appropriate code to perform the assignment.
These delegator classes wrap the original AST nodes in order to
support the variant visit methods.
 
  Methods defined here:
__getattr__(self, attr)
__init__(self, obj)

 
class Expression(AbstractCompileMode)
     Methods defined here:
compile(self)

Data and other attributes defined here:
mode = 'eval'

Methods inherited from AbstractCompileMode:
__init__(self, source, filename)
getCode(self)

 
class ExpressionCodeGenerator(NestedScopeMixin, CodeGenerator)
    
Method resolution order:
ExpressionCodeGenerator
NestedScopeMixin
CodeGenerator

Methods defined here:
__init__(self, tree)
get_module(self)

Data and other attributes defined here:
futures = ()
scopes = None

Methods inherited from NestedScopeMixin:
initClass(self)

Methods inherited from CodeGenerator:
binaryOp(self, node, op)
bitOp(self, nodes, op)
checkClass(self)
Verify that class is constructed correctly
delName(self, name)
getCode(self)
Return a code object
isLocalName(self, name)
loadName(self, name)
mangle(self, name)
parseSymbols(self, tree)
set_lineno(self, node, force=False)
Emit SET_LINENO if necessary.
 
The instruction is considered necessary if the node has a
lineno attribute and it is different than the last lineno
emitted.
 
Returns true if SET_LINENO was emitted.
 
There are no rules for when an AST node should have a lineno
attribute.  The transformer and AST code need to be reviewed
and a consistent policy implemented and documented.  Until
then, this method works around missing line numbers.
storeName(self, name)
unaryOp(self, node, op)
visitAdd(self, node)
visitAnd(self, node)
visitAssAttr(self, node)
visitAssList = _visitAssSequence(self, node, op='UNPACK_SEQUENCE')
visitAssName(self, node)
visitAssTuple = _visitAssSequence(self, node, op='UNPACK_SEQUENCE')
visitAssert(self, node)
visitAssign(self, node)
visitAugAssign(self, node)
visitAugGetattr(self, node, mode)
visitAugName(self, node, mode)
visitAugSlice(self, node, mode)
visitAugSubscript(self, node, mode)
visitBackquote(self, node)
visitBitand(self, node)
visitBitor(self, node)
visitBitxor(self, node)
visitBreak(self, node)
visitCallFunc(self, node)
visitClass(self, node)
visitCompare(self, node)
visitConst(self, node)
visitContinue(self, node)
visitDict(self, node)
visitDiscard(self, node)
visitDiv(self, node)
visitEllipsis(self, node)
visitExec(self, node)
visitExpression(self, node)
visitFloorDiv(self, node)
visitFor(self, node)
visitFrom(self, node)
visitFunction(self, node)
visitGenExpr(self, node)
visitGenExprFor(self, node)
visitGenExprIf(self, node, branch)
visitGenExprInner(self, node)
visitGetattr(self, node)
visitGlobal(self, node)
visitIf(self, node)
visitIfExp(self, node)
visitImport(self, node)
visitInvert(self, node)
visitKeyword(self, node)
visitLambda(self, node)
visitLeftShift(self, node)
visitList(self, node)
visitListComp(self, node)
visitListCompFor(self, node)
visitListCompIf(self, node, branch)
visitMod(self, node)
visitModule(self, node)
visitMul(self, node)
visitName(self, node)
visitNot(self, node)
visitOr(self, node)
visitPass(self, node)
visitPower(self, node)
visitPrint(self, node, newline=0)
visitPrintnl(self, node)
visitRaise(self, node)
visitReturn(self, node)
visitRightShift(self, node)
visitSlice(self, node, aug_flag=None)
visitSliceobj(self, node)
visitSub(self, node)
visitSubscript(self, node, aug_flag=None)
visitTest(self, node, jump)
visitTryExcept(self, node)
visitTryFinally(self, node)
visitTuple(self, node)
visitUnaryAdd(self, node)
visitUnaryInvert(self, node)
visitUnarySub(self, node)
visitWhile(self, node)
visitWith(self, node)
visitYield(self, node)

Data and other attributes inherited from CodeGenerator:
ClassGen = None
FunctionGen = None
NameFinder = <class compiler.pycodegen.LocalNameFinder at 0xb6d8f8fc>
Find local names in scope
class_name = None
optimized = 0

 
class FunctionCodeGenerator(NestedScopeMixin, AbstractFunctionCode, CodeGenerator)
    
Method resolution order:
FunctionCodeGenerator
NestedScopeMixin
AbstractFunctionCode
CodeGenerator

Methods defined here:
__init__(self, func, scopes, isLambda, class_name, mod)
super_init = __init__(self)

Data and other attributes defined here:
scopes = None

Methods inherited from NestedScopeMixin:
initClass(self)

Methods inherited from AbstractFunctionCode:
finish(self)
generateArgUnpack(self, args)
get_module(self)
unpackSequence(self, tup)
unpackTuple = unpackSequence(self, tup)

Data and other attributes inherited from AbstractFunctionCode:
lambdaCount = 0
optimized = 1

Methods inherited from CodeGenerator:
binaryOp(self, node, op)
bitOp(self, nodes, op)
checkClass(self)
Verify that class is constructed correctly
delName(self, name)
getCode(self)
Return a code object
isLocalName(self, name)
loadName(self, name)
mangle(self, name)
parseSymbols(self, tree)
set_lineno(self, node, force=False)
Emit SET_LINENO if necessary.
 
The instruction is considered necessary if the node has a
lineno attribute and it is different than the last lineno
emitted.
 
Returns true if SET_LINENO was emitted.
 
There are no rules for when an AST node should have a lineno
attribute.  The transformer and AST code need to be reviewed
and a consistent policy implemented and documented.  Until
then, this method works around missing line numbers.
storeName(self, name)
unaryOp(self, node, op)
visitAdd(self, node)
visitAnd(self, node)
visitAssAttr(self, node)
visitAssList = _visitAssSequence(self, node, op='UNPACK_SEQUENCE')
visitAssName(self, node)
visitAssTuple = _visitAssSequence(self, node, op='UNPACK_SEQUENCE')
visitAssert(self, node)
visitAssign(self, node)
visitAugAssign(self, node)
visitAugGetattr(self, node, mode)
visitAugName(self, node, mode)
visitAugSlice(self, node, mode)
visitAugSubscript(self, node, mode)
visitBackquote(self, node)
visitBitand(self, node)
visitBitor(self, node)
visitBitxor(self, node)
visitBreak(self, node)
visitCallFunc(self, node)
visitClass(self, node)
visitCompare(self, node)
visitConst(self, node)
visitContinue(self, node)
visitDict(self, node)
visitDiscard(self, node)
visitDiv(self, node)
visitEllipsis(self, node)
visitExec(self, node)
visitExpression(self, node)
visitFloorDiv(self, node)
visitFor(self, node)
visitFrom(self, node)
visitFunction(self, node)
visitGenExpr(self, node)
visitGenExprFor(self, node)
visitGenExprIf(self, node, branch)
visitGenExprInner(self, node)
visitGetattr(self, node)
visitGlobal(self, node)
visitIf(self, node)
visitIfExp(self, node)
visitImport(self, node)
visitInvert(self, node)
visitKeyword(self, node)
visitLambda(self, node)
visitLeftShift(self, node)
visitList(self, node)
visitListComp(self, node)
visitListCompFor(self, node)
visitListCompIf(self, node, branch)
visitMod(self, node)
visitModule(self, node)
visitMul(self, node)
visitName(self, node)
visitNot(self, node)
visitOr(self, node)
visitPass(self, node)
visitPower(self, node)
visitPrint(self, node, newline=0)
visitPrintnl(self, node)
visitRaise(self, node)
visitReturn(self, node)
visitRightShift(self, node)
visitSlice(self, node, aug_flag=None)
visitSliceobj(self, node)
visitSub(self, node)
visitSubscript(self, node, aug_flag=None)
visitTest(self, node, jump)
visitTryExcept(self, node)
visitTryFinally(self, node)
visitTuple(self, node)
visitUnaryAdd(self, node)
visitUnaryInvert(self, node)
visitUnarySub(self, node)
visitWhile(self, node)
visitWith(self, node)
visitYield(self, node)

Data and other attributes inherited from CodeGenerator:
ClassGen = None
FunctionGen = None
NameFinder = <class compiler.pycodegen.LocalNameFinder at 0xb6d8f8fc>
Find local names in scope
class_name = None

 
class GenExprCodeGenerator(NestedScopeMixin, AbstractFunctionCode, CodeGenerator)
    
Method resolution order:
GenExprCodeGenerator
NestedScopeMixin
AbstractFunctionCode
CodeGenerator

Methods defined here:
__init__(self, gexp, scopes, class_name, mod)
super_init = __init__(self)

Data and other attributes defined here:
scopes = None

Methods inherited from NestedScopeMixin:
initClass(self)

Methods inherited from AbstractFunctionCode:
finish(self)
generateArgUnpack(self, args)
get_module(self)
unpackSequence(self, tup)
unpackTuple = unpackSequence(self, tup)

Data and other attributes inherited from AbstractFunctionCode:
lambdaCount = 0
optimized = 1

Methods inherited from CodeGenerator:
binaryOp(self, node, op)
bitOp(self, nodes, op)
checkClass(self)
Verify that class is constructed correctly
delName(self, name)
getCode(self)
Return a code object
isLocalName(self, name)
loadName(self, name)
mangle(self, name)
parseSymbols(self, tree)
set_lineno(self, node, force=False)
Emit SET_LINENO if necessary.
 
The instruction is considered necessary if the node has a
lineno attribute and it is different than the last lineno
emitted.
 
Returns true if SET_LINENO was emitted.
 
There are no rules for when an AST node should have a lineno
attribute.  The transformer and AST code need to be reviewed
and a consistent policy implemented and documented.  Until
then, this method works around missing line numbers.
storeName(self, name)
unaryOp(self, node, op)
visitAdd(self, node)
visitAnd(self, node)
visitAssAttr(self, node)
visitAssList = _visitAssSequence(self, node, op='UNPACK_SEQUENCE')
visitAssName(self, node)
visitAssTuple = _visitAssSequence(self, node, op='UNPACK_SEQUENCE')
visitAssert(self, node)
visitAssign(self, node)
visitAugAssign(self, node)
visitAugGetattr(self, node, mode)
visitAugName(self, node, mode)
visitAugSlice(self, node, mode)
visitAugSubscript(self, node, mode)
visitBackquote(self, node)
visitBitand(self, node)
visitBitor(self, node)
visitBitxor(self, node)
visitBreak(self, node)
visitCallFunc(self, node)
visitClass(self, node)
visitCompare(self, node)
visitConst(self, node)
visitContinue(self, node)
visitDict(self, node)
visitDiscard(self, node)
visitDiv(self, node)
visitEllipsis(self, node)
visitExec(self, node)
visitExpression(self, node)
visitFloorDiv(self, node)
visitFor(self, node)
visitFrom(self, node)
visitFunction(self, node)
visitGenExpr(self, node)
visitGenExprFor(self, node)
visitGenExprIf(self, node, branch)
visitGenExprInner(self, node)
visitGetattr(self, node)
visitGlobal(self, node)
visitIf(self, node)
visitIfExp(self, node)
visitImport(self, node)
visitInvert(self, node)
visitKeyword(self, node)
visitLambda(self, node)
visitLeftShift(self, node)
visitList(self, node)
visitListComp(self, node)
visitListCompFor(self, node)
visitListCompIf(self, node, branch)
visitMod(self, node)
visitModule(self, node)
visitMul(self, node)
visitName(self, node)
visitNot(self, node)
visitOr(self, node)
visitPass(self, node)
visitPower(self, node)
visitPrint(self, node, newline=0)
visitPrintnl(self, node)
visitRaise(self, node)
visitReturn(self, node)
visitRightShift(self, node)
visitSlice(self, node, aug_flag=None)
visitSliceobj(self, node)
visitSub(self, node)
visitSubscript(self, node, aug_flag=None)
visitTest(self, node, jump)
visitTryExcept(self, node)
visitTryFinally(self, node)
visitTuple(self, node)
visitUnaryAdd(self, node)
visitUnaryInvert(self, node)
visitUnarySub(self, node)
visitWhile(self, node)
visitWith(self, node)
visitYield(self, node)

Data and other attributes inherited from CodeGenerator:
ClassGen = None
FunctionGen = None
NameFinder = <class compiler.pycodegen.LocalNameFinder at 0xb6d8f8fc>
Find local names in scope
class_name = None

 
class Interactive(AbstractCompileMode)
     Methods defined here:
compile(self)

Data and other attributes defined here:
mode = 'single'

Methods inherited from AbstractCompileMode:
__init__(self, source, filename)
getCode(self)

 
class InteractiveCodeGenerator(NestedScopeMixin, CodeGenerator)
    
Method resolution order:
InteractiveCodeGenerator
NestedScopeMixin
CodeGenerator

Methods defined here:
__init__(self, tree)
get_module(self)
visitDiscard(self, node)

Data and other attributes defined here:
futures = ()
scopes = None

Methods inherited from NestedScopeMixin:
initClass(self)

Methods inherited from CodeGenerator:
binaryOp(self, node, op)
bitOp(self, nodes, op)
checkClass(self)
Verify that class is constructed correctly
delName(self, name)
getCode(self)
Return a code object
isLocalName(self, name)
loadName(self, name)
mangle(self, name)
parseSymbols(self, tree)
set_lineno(self, node, force=False)
Emit SET_LINENO if necessary.
 
The instruction is considered necessary if the node has a
lineno attribute and it is different than the last lineno
emitted.
 
Returns true if SET_LINENO was emitted.
 
There are no rules for when an AST node should have a lineno
attribute.  The transformer and AST code need to be reviewed
and a consistent policy implemented and documented.  Until
then, this method works around missing line numbers.
storeName(self, name)
unaryOp(self, node, op)
visitAdd(self, node)
visitAnd(self, node)
visitAssAttr(self, node)
visitAssList = _visitAssSequence(self, node, op='UNPACK_SEQUENCE')
visitAssName(self, node)
visitAssTuple = _visitAssSequence(self, node, op='UNPACK_SEQUENCE')
visitAssert(self, node)
visitAssign(self, node)
visitAugAssign(self, node)
visitAugGetattr(self, node, mode)
visitAugName(self, node, mode)
visitAugSlice(self, node, mode)
visitAugSubscript(self, node, mode)
visitBackquote(self, node)
visitBitand(self, node)
visitBitor(self, node)
visitBitxor(self, node)
visitBreak(self, node)
visitCallFunc(self, node)
visitClass(self, node)
visitCompare(self, node)
visitConst(self, node)
visitContinue(self, node)
visitDict(self, node)
visitDiv(self, node)
visitEllipsis(self, node)
visitExec(self, node)
visitExpression(self, node)
visitFloorDiv(self, node)
visitFor(self, node)
visitFrom(self, node)
visitFunction(self, node)
visitGenExpr(self, node)
visitGenExprFor(self, node)
visitGenExprIf(self, node, branch)
visitGenExprInner(self, node)
visitGetattr(self, node)
visitGlobal(self, node)
visitIf(self, node)
visitIfExp(self, node)
visitImport(self, node)
visitInvert(self, node)
visitKeyword(self, node)
visitLambda(self, node)
visitLeftShift(self, node)
visitList(self, node)
visitListComp(self, node)
visitListCompFor(self, node)
visitListCompIf(self, node, branch)
visitMod(self, node)
visitModule(self, node)
visitMul(self, node)
visitName(self, node)
visitNot(self, node)
visitOr(self, node)
visitPass(self, node)
visitPower(self, node)
visitPrint(self, node, newline=0)
visitPrintnl(self, node)
visitRaise(self, node)
visitReturn(self, node)
visitRightShift(self, node)
visitSlice(self, node, aug_flag=None)
visitSliceobj(self, node)
visitSub(self, node)
visitSubscript(self, node, aug_flag=None)
visitTest(self, node, jump)
visitTryExcept(self, node)
visitTryFinally(self, node)
visitTuple(self, node)
visitUnaryAdd(self, node)
visitUnaryInvert(self, node)
visitUnarySub(self, node)
visitWhile(self, node)
visitWith(self, node)
visitYield(self, node)

Data and other attributes inherited from CodeGenerator:
ClassGen = None
FunctionGen = None
NameFinder = <class compiler.pycodegen.LocalNameFinder at 0xb6d8f8fc>
Find local names in scope
class_name = None
optimized = 0

 
class LocalNameFinder
    Find local names in scope
 
  Methods defined here:
__init__(self, names=())
getLocals(self)
visitAssName(self, node)
visitClass(self, node)
visitDict(self, node)
visitFrom(self, node)
visitFunction(self, node)
visitGlobal(self, node)
visitImport(self, node)
visitLambda(self, node)

 
class Module(AbstractCompileMode)
     Methods defined here:
compile(self, display=0)
dump(self, f)
getPycHeader(self)

Data and other attributes defined here:
MAGIC = '\xb3\xf2\r\n'
mode = 'exec'

Methods inherited from AbstractCompileMode:
__init__(self, source, filename)
getCode(self)

 
class ModuleCodeGenerator(NestedScopeMixin, CodeGenerator)
    
Method resolution order:
ModuleCodeGenerator
NestedScopeMixin
CodeGenerator

Methods defined here:
__init__(self, tree)
get_module(self)

Data and other attributes defined here:
scopes = None

Methods inherited from NestedScopeMixin:
initClass(self)

Methods inherited from CodeGenerator:
binaryOp(self, node, op)
bitOp(self, nodes, op)
checkClass(self)
Verify that class is constructed correctly
delName(self, name)
getCode(self)
Return a code object
isLocalName(self, name)
loadName(self, name)
mangle(self, name)
parseSymbols(self, tree)
set_lineno(self, node, force=False)
Emit SET_LINENO if necessary.
 
The instruction is considered necessary if the node has a
lineno attribute and it is different than the last lineno
emitted.
 
Returns true if SET_LINENO was emitted.
 
There are no rules for when an AST node should have a lineno
attribute.  The transformer and AST code need to be reviewed
and a consistent policy implemented and documented.  Until
then, this method works around missing line numbers.
storeName(self, name)
unaryOp(self, node, op)
visitAdd(self, node)
visitAnd(self, node)
visitAssAttr(self, node)
visitAssList = _visitAssSequence(self, node, op='UNPACK_SEQUENCE')
visitAssName(self, node)
visitAssTuple = _visitAssSequence(self, node, op='UNPACK_SEQUENCE')
visitAssert(self, node)
visitAssign(self, node)
visitAugAssign(self, node)
visitAugGetattr(self, node, mode)
visitAugName(self, node, mode)
visitAugSlice(self, node, mode)
visitAugSubscript(self, node, mode)
visitBackquote(self, node)
visitBitand(self, node)
visitBitor(self, node)
visitBitxor(self, node)
visitBreak(self, node)
visitCallFunc(self, node)
visitClass(self, node)
visitCompare(self, node)
visitConst(self, node)
visitContinue(self, node)
visitDict(self, node)
visitDiscard(self, node)
visitDiv(self, node)
visitEllipsis(self, node)
visitExec(self, node)
visitExpression(self, node)
visitFloorDiv(self, node)
visitFor(self, node)
visitFrom(self, node)
visitFunction(self, node)
visitGenExpr(self, node)
visitGenExprFor(self, node)
visitGenExprIf(self, node, branch)
visitGenExprInner(self, node)
visitGetattr(self, node)
visitGlobal(self, node)
visitIf(self, node)
visitIfExp(self, node)
visitImport(self, node)
visitInvert(self, node)
visitKeyword(self, node)
visitLambda(self, node)
visitLeftShift(self, node)
visitList(self, node)
visitListComp(self, node)
visitListCompFor(self, node)
visitListCompIf(self, node, branch)
visitMod(self, node)
visitModule(self, node)
visitMul(self, node)
visitName(self, node)
visitNot(self, node)
visitOr(self, node)
visitPass(self, node)
visitPower(self, node)
visitPrint(self, node, newline=0)
visitPrintnl(self, node)
visitRaise(self, node)
visitReturn(self, node)
visitRightShift(self, node)
visitSlice(self, node, aug_flag=None)
visitSliceobj(self, node)
visitSub(self, node)
visitSubscript(self, node, aug_flag=None)
visitTest(self, node, jump)
visitTryExcept(self, node)
visitTryFinally(self, node)
visitTuple(self, node)
visitUnaryAdd(self, node)
visitUnaryInvert(self, node)
visitUnarySub(self, node)
visitWhile(self, node)
visitWith(self, node)
visitYield(self, node)

Data and other attributes inherited from CodeGenerator:
ClassGen = None
FunctionGen = None
NameFinder = <class compiler.pycodegen.LocalNameFinder at 0xb6d8f8fc>
Find local names in scope
class_name = None
optimized = 0

 
class NestedScopeMixin
    Defines initClass() for nested scoping (Python 2.2-compatible)
 
  Methods defined here:
initClass(self)

 
class OpFinder
     Methods defined here:
__init__(self)
visitAssAttr = visitAssName(self, node)
visitAssName(self, node)
visitSubscript = visitAssName(self, node)

 
Functions
       
StringIO(...)
StringIO([s]) -- Return a StringIO-like stream for reading or writing
compile(source, filename, mode, flags=None, dont_inherit=None)
Replacement for builtin compile() function
compileFile(filename, display=0)
findOp(node)
Find the op (DELETE, LOAD, STORE) in an AssTuple tree
generateArgList(arglist)
Generate an arg list marking TupleArgs
is_constant_false(node)
wrap_aug(node)

 
Data
        CO_FUTURE_ABSIMPORT = 16384
CO_FUTURE_DIVISION = 8192
CO_FUTURE_WITH_STATEMENT = 32768
CO_GENERATOR = 32
CO_NESTED = 16
CO_NEWLOCALS = 2
CO_VARARGS = 4
CO_VARKEYWORDS = 8
END_FINALLY = 4
EXCEPT = 2
LOOP = 1
SC_CELL = 4
SC_FREE = 3
SC_GLOBAL = 2
SC_LOCAL = 1
TRY_FINALLY = 3
VERSION = 2
callfunc_opcode_info = {(0, 0): 'CALL_FUNCTION', (0, 1): 'CALL_FUNCTION_KW', (1, 0): 'CALL_FUNCTION_VAR', (1, 1): 'CALL_FUNCTION_VAR_KW'}
wrapper = {<class compiler.ast.Getattr at 0xb6de8a4c>: <class compiler.pycodegen.AugGetattr at 0xb6d8fb6c>, <class compiler.ast.Name at 0xb6de8d4c>: <class compiler.pycodegen.AugName at 0xb6d8fb9c>, <class compiler.ast.Slice at 0xb6de8f2c>: <class compiler.pycodegen.AugSlice at 0xb6d8fbcc>, <class compiler.ast.Subscript at 0xb6df102c>: <class compiler.pycodegen.AugSubscript at 0xb6d8fbfc>}