use of suite.instructionexecutor.InstructionUtil.Insn in project suite by stupidsing.
the class InstructionExtractor method extract.
private Instruction extract(List<Node> rs) {
String insnName = ((Atom) rs.get(0)).name;
Insn insn;
if (Objects.equals(insnName, "EVALUATE")) {
Atom atom = (Atom) rs.remove(3);
TermOp operator = TermOp.find(atom.name);
insn = InstructionUtil.getEvalInsn(operator);
} else
insn = InstructionUtil.getInsn(insnName);
if (insn != null) {
Instruction instruction = new //
Instruction(//
insn, //
getRegisterNumber(rs, 1), //
getRegisterNumber(rs, 2), getRegisterNumber(rs, 3));
if (insn == Insn.FRAMEBEGIN____)
frameBegins.push(instruction);
else if (insn == Insn.FRAMEEND______)
frameBegins.pop();
return instruction;
} else
return Fail.t("unknown opcode " + insnName);
}
Aggregations