Back to index

python3.2  3.2.2
Functions | Variables
makeopcodetargets Namespace Reference

Functions

def find_module
def write_contents

Variables

list target = sys.argv[1]
tuple f = open(target, "w")

Function Documentation

def makeopcodetargets.find_module (   modname)
Finds and returns a module in the local dist/checkout.

Definition at line 13 of file makeopcodetargets.py.

00013 
00014 def find_module(modname):
00015     """Finds and returns a module in the local dist/checkout.
00016     """
00017     modpath = os.path.join(
00018         os.path.dirname(os.path.dirname(__file__)), "Lib")
00019     return imp.load_module(modname, *imp.find_module(modname, [modpath]))

Here is the caller graph for this function:

Write C code contents to the target file object.

Definition at line 20 of file makeopcodetargets.py.

00020 
00021 def write_contents(f):
00022     """Write C code contents to the target file object.
00023     """
00024     opcode = find_module("opcode")
00025     targets = ['_unknown_opcode'] * 256
00026     for opname, op in opcode.opmap.items():
00027         if opname == "STOP_CODE":
00028             # XXX opcode not implemented
00029             continue
00030         targets[op] = "TARGET_%s" % opname
00031     f.write("static void *opcode_targets[256] = {\n")
00032     f.write(",\n".join(["    &&%s" % s for s in targets]))
00033     f.write("\n};\n")
00034 

Here is the call graph for this function:


Variable Documentation

tuple makeopcodetargets.f = open(target, "w")

Definition at line 42 of file makeopcodetargets.py.

Definition at line 39 of file makeopcodetargets.py.