Commit 2bdbc88d authored by Benoit Perrot's avatar Benoit Perrot
Browse files

Specify instruction kind.

parent 04a80fcd
2003-07-29 Benot Perrot <benoit@lrde.epita.fr>
* dev/mipsy.xml, dev/mips.py:
Specify instruction kind.
2003-07-29 Benot Perrot <benoit@lrde.epita.fr>
* dev/mipsy-scanner-gen.py,
......
......@@ -157,9 +157,10 @@ class SyntaxBuilder:
## -------------------------------------
class Instruction:
def __init__(self, opcode, level, format, syntaxes):
def __init__(self, opcode, level, kind, format, syntaxes):
self.opcode = opcode
self.level = level
self.kind = kind
self.format = format
self.syntaxes = syntaxes
......@@ -175,6 +176,7 @@ class InstructionBuilder:
def reset(self):
self.opcode = ""
self.level = ""
self.kind = ""
self.format = Format("")
self.syntaxes = []
def __init__(self):
......@@ -184,12 +186,15 @@ class InstructionBuilder:
self.opcode = opcode
def set_level(self, level):
self.level = level
def set_kind(self, kind):
self.kind = kind
def set_format(self, format):
self.format = format
def add_syntax(self, syntax):
self.syntaxes.append(syntax)
def get(self):
return Instruction(self.opcode, self.level, self.format, self.syntaxes)
return Instruction(self.opcode, self.level, self.kind,
self.format, self.syntaxes)
## -------------------------------------
......@@ -205,6 +210,7 @@ class InstructionSetHandler(ContentHandler):
self.ib.reset()
self.ib.set_opcode(attrs["opcode"])
self.ib.set_level(attrs["level"])
self.ib.set_kind(attrs["kind"])
elif name == "format":
self.fb = FormatBuilder()
elif name == "syntax":
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment