Home | Trees | Index | Help |
---|
Package analysis :: Package output :: Package visitors :: Module C :: Class CVisitor |
|
ASTVisitor
--+ |Visitor
--+ | CVisitor
Method Summary | |
---|---|
Initialise the visitor with the given 'generator' to which the final output is sent. | |
Write function calls, associated with the given 'node'. | |
default(self,
node)
| |
get_const_value(self,
value)
| |
Return the generator according to the output status attributes. | |
Write a TYPEOF test for the 'operand' compared to the given 'ref'. | |
visitAdd(self,
node)
| |
visitAnd(self,
node)
| |
visitAssAttr(self,
node)
| |
visitAssign(self,
node)
| |
visitAssList(self,
node)
| |
visitAssName(self,
node)
| |
visitAssTuple(self,
node)
| |
Translate this... | |
visitClass(self,
node)
| |
visitCompare(self,
node)
| |
visitConst(self,
node)
| |
visitDiscard(self,
node)
| |
visitFor(self,
node)
| |
visitFunction(self,
node)
| |
visitGetattr(self,
node)
| |
visitGlobal(self,
node)
| |
visitIf(self,
node)
| |
visitImport(self,
node)
| |
visitList(self,
node)
| |
Visit the module 'node', producing the top-level declarations and initialisations. | |
visitName(self,
node)
| |
visitNot(self,
node)
| |
visitOr(self,
node)
| |
visitPass(self,
node)
| |
visitPrintnl(self,
node)
| |
visitReturn(self,
node)
| |
visitSlice(self,
node)
| |
visitStmt(self,
node)
| |
visitSub(self,
node)
| |
visitSubscript(self,
node)
| |
visitTuple(self,
node)
| |
visitWhile(self,
node)
| |
For the given 'node' expressing an attribute lookup, Write a reference to the attribute of the given object or class 'obj' using the suggested 'attr' and having the given 'attrname'. | |
write_compare(self,
compare)
| |
Write the locals for the given block 'node'. | |
Write the name for the given 'node' according to scope and style of access. | |
Write a reference to a new object instantiated by the given 'node'. | |
Write the parameters associated with the given function call 'node' using the given call 'args' and a 'refcontext' used to indicate how reference objects used in the call are to be represented. | |
write_signature(self,
node)
| |
write_stack(self,
generator)
| |
Write the test which selects a particular function call. | |
Write the end of the function call selection test. | |
Inherited from Visitor | |
| |
| |
| |
| |
Inherited from ASTVisitor | |
| |
Do preorder walk of tree using visitor |
Class Variable Summary | |
---|---|
int |
constant_start = 0 |
int |
FUNCTION = 3 |
int |
FUNCTION_BODY = 4 |
int |
magic_number = 100 |
int |
MAIN = 0 |
int |
TOP_LEVEL_DECLARATIONS = 2 |
int |
TOP_LEVEL_DEFINITIONS = 1 |
Inherited from ASTVisitor | |
int |
VERBOSE = 0 |
Method Details |
---|
__init__(self,
generator,
header_generator=None)
|
call_function(self, node)Write function calls, associated with the given 'node'. Sequences of calls are generated in the following form: IGNORE(f1(args)) || IGNORE(f2(args)) || IGNORE(f3(args)) |
get_generator(self)Return the generator according to the output status attributes. |
type_of(self, operand, ref)Write a TYPEOF test for the 'operand' compared to the given 'ref'. |
visitCallFunc(self, node)Translate this... expr(x, y, z) ...into this: (_tmp = expr) ? (TYPEOF(_tmp) == C) ? new(C, 3) : (TYPEOF(_tmp) == D) ? new(D, 4) : None : None ...or this: (_tmp = expr) ? (FNAME(_tmp) == FNAME(f)) ? f(x, y, z) : (FNAME(_tmp) == FNAME(g)) ? g(x, y, z) : None : None |
visitModule(self, node)Visit the module 'node', producing the top-level declarations and initialisations. The module is constructed from the contents of the generators written in the following order: * generator (the main one), producing globals and constants * top-level, producing class and object definitions, and function declarations * function, producing function definitions * generator, producing the main function * main, producing the main function code |
write_attr(self, node, obj, attr, attrname, write_case=0)For the given 'node' expressing an attribute lookup, Write a reference to the attribute of the given object or class 'obj' using the suggested 'attr' and having the given 'attrname'. |
write_locals(self, node, prefix=None, include_parameters=1, declaration_mode=None)Write the locals for the given block 'node'. |
write_name(self, node)Write the name for the given 'node' according to scope and style of access. |
write_new(self, node)Write a reference to a new object instantiated by the given 'node'. |
write_parameters(self, node, args, refcontext)Write the parameters associated with the given function call 'node' using the given call 'args' and a 'refcontext' used to indicate how reference objects used in the call are to be represented. |
write_target_test(self, node, args, refcontext, target)Write the test which selects a particular function call. |
write_target_test_end(self, node, args, refcontext, target)Write the end of the function call selection test. |
Class Variable Details |
---|
constant_start
|
FUNCTION
|
FUNCTION_BODY
|
magic_number
|
MAIN
|
TOP_LEVEL_DECLARATIONS
|
TOP_LEVEL_DEFINITIONS
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Tue Dec 20 00:05:45 2005 | http://epydoc.sf.net |