コード例 #1
0
 def test_processor(self):
     p = Processor()
     i = Instruction('add')
     p.AddInstruction(i)
     g = Group('R')
     g.AddInstruction(i)
     p.AddGroup(g)
     self.assertEqual(p.FindInstruction('add'), i)
コード例 #2
0
 def AddGroup(self, str, loc, tokens):
     group = Group(tokens[0])
     for instr in tokens[1:]:
         instruction = self.processor.FindInstruction(instr)
         if (instruction != None):
             group.AddInstruction(instruction)
         else:
             self.VArchCError('Invalid instruction', str, loc)
     self.processor.AddGroup(group)