Lines Matching refs:tokens

59 def setHandlerStyle(tokens):
61 if len(tokens) != 2:
63 style = tokens[1]
69 # Set handler_size_bytes to the value of tokens[1], and handler_size_bits to
73 def setHandlerSize(tokens):
77 if len(tokens) != 2:
83 handler_size_bytes = bytes = int(tokens[1])
98 def importFile(tokens):
99 if len(tokens) != 2:
101 source = tokens[1]
103 appendSourceFile(tokens[1], getGlobalSubDict(), c_fp, None)
105 appendSourceFile(tokens[1], getGlobalSubDict(), asm_fp, None)
114 def setAsmStub(tokens):
118 if len(tokens) != 2:
121 stub_fp = open(tokens[1])
132 def setAsmAltStub(tokens):
136 if len(tokens) != 2:
138 default_alt_stub = tokens[1]
145 def opStart(tokens):
148 if len(tokens) != 2:
152 default_op_dir = tokens[1]
159 def altEntry(tokens):
161 if len(tokens) != 3:
166 index = opcodes.index(tokens[1])
168 raise DataParseError("unknown opcode %s" % tokens[1])
169 if alt_opcode_locations.has_key(tokens[1]):
171 % (tokens[1], alt_opcode_locations[tokens[1]], tokens[2])
172 alt_opcode_locations[tokens[1]] = tokens[2]
179 def opEntry(tokens):
181 if len(tokens) != 3:
186 index = opcodes.index(tokens[1])
188 raise DataParseError("unknown opcode %s" % tokens[1])
189 if opcode_locations.has_key(tokens[1]):
191 % (tokens[1], opcode_locations[tokens[1]], tokens[2])
192 opcode_locations[tokens[1]] = tokens[2]
212 def opEnd(tokens):
214 if len(tokens) != 1:
228 def genaltop(tokens):
231 if len(tokens) != 1:
445 tokens = line.strip().split(' ', 2)
446 if len(tokens) < 2:
449 alt_source = tokens[1].strip("\"")
455 if len(tokens) == 3:
456 new_dict.update(eval(tokens[2]))
463 tokens = line.strip().split(' ', 1)
464 if len(tokens) < 2:
466 defaultValues = eval(tokens[1])
580 tokens = line.split(' ') # tokenize
581 #print "%d: %s" % (len(tokens), tokens)
582 if len(tokens[0]) == 0:
585 elif tokens[0][0] == '#':
589 if tokens[0] == "handler-size":
590 setHandlerSize(tokens)
591 elif tokens[0] == "import":
592 importFile(tokens)
593 elif tokens[0] == "asm-stub":
594 setAsmStub(tokens)
595 elif tokens[0] == "asm-alt-stub":
596 setAsmAltStub(tokens)
597 elif tokens[0] == "op-start":
598 opStart(tokens)
599 elif tokens[0] == "op-end":
600 opEnd(tokens)
601 elif tokens[0] == "alt":
602 altEntry(tokens)
603 elif tokens[0] == "op":
604 opEntry(tokens)
605 elif tokens[0] == "handler-style":
606 setHandlerStyle(tokens)
607 elif tokens[0] == "alt-ops":
608 genaltop(tokens)
609 elif tokens[0] == "split-ops":
612 raise DataParseError, "unrecognized command '%s'" % tokens[0]
614 print "tokens[0] = %s" % tokens[0]