Home | Trees | Index | Help |
---|
Package analysis :: Package output :: Package visitors :: Module instruction :: Class InstructionVisitor |
|
ASTVisitor
--+ |Visitor
--+ | InstructionVisitor
A simple abstract-instruction-emitting visitor.
Special label codes:
C constant L label E label (at end of block)Method Summary | |
---|---|
Initialise the visitor with the given 'generator'. | |
Write the code needed to call the function referenced by the given 'node', using the specified 'targets' to determine which specialisations are involved. | |
Write the code needed to access the global referenced by the given 'node', using the specified 'instruction' method or function to actually produce the code. | |
Write the code needed to access the local referenced by the given 'node', using the specified 'instruction' method or function to actually produce the code. | |
visitAdd(self,
node)
| |
visitAssAttr(self,
node)
| |
visitAssign(self,
node)
| |
visitAssList(self,
node)
| |
visitAssName(self,
node)
| |
visitAssTuple(self,
node)
| |
visitCallFunc(self,
node)
| |
visitClass(self,
node)
| |
visitCompare(self,
node)
| |
visitConst(self,
node)
| |
visitFunction(self,
node)
| |
visitGetattr(self,
node)
| |
visitGlobal(self,
node)
| |
visitIf(self,
node)
| |
visitList(self,
node)
| |
visitModule(self,
node)
| |
visitName(self,
node)
| |
visitReturn(self,
node)
| |
visitSub(self,
node)
| |
visitSubscript(self,
node)
| |
visitWhile(self,
node)
| |
Using the given 'instruction', write a reference to the attribute of the given object or class 'obj' with the given 'attrname'. | |
Write the locals for the given block 'node' having the given name 'prefix'. | |
Write the parameters/arguments for a function call using the 'params' list of parameters. | |
Inherited from Visitor | |
| |
| |
| |
| |
Inherited from ASTVisitor | |
| |
| |
Do preorder walk of tree using visitor |
Class Variable Summary | |
---|---|
Inherited from ASTVisitor | |
int |
VERBOSE = 0 |
Method Details |
---|
__init__(self,
generator)
Initialise the visitor with the given 'generator'.
|
call_function(self, node)Write the code needed to call the function referenced by the given 'node', using the specified 'targets' to determine which specialisations are involved. |
visit_global(self, node, instruction)Write the code needed to access the global referenced by the given 'node', using the specified 'instruction' method or function to actually produce the code. |
visit_local(self, node, instruction)Write the code needed to access the local referenced by the given 'node', using the specified 'instruction' method or function to actually produce the code. |
write_attr(self, instruction, obj, attrname, write_case=0)Using the given 'instruction', write a reference to the attribute of the given object or class 'obj' with the given 'attrname'. If the optional 'write_case' parameter is set to a true value, generate a case instruction linking the 'obj' or the type of 'obj' to the 'instruction'. |
write_locals(self, node, prefix, static=0)Write the locals for the given block 'node' having the given name 'prefix'. This generally should not write any code or static space allocation since locals occur upon every visit to a block and thus may occur several times for any given block on the stack. However, if the optional 'static' parameter is given a true value, static definitions (for things like modules and classes) will be written. |
write_parameters(self, params, refcontext)Write the parameters/arguments for a function call using the 'params' list of parameters. The 'refcontext' is used to determine how to refer to references used in the call. NOTE: Support star and dstar args. |
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Tue Dec 20 00:05:45 2005 | http://epydoc.sf.net |