protected void simplify(Item i) { Item.Instruction instr = null; if (i instanceof Item.Instruction) instr = (Item.Instruction) i; try { i.simplify(); } catch (LegacyInstr.ImmediateRequired e) { ERROR.ConstantExpected((SyntacticOperand) e.operand); } catch (LegacyInstr.InvalidImmediate e) { ERROR.ConstantOutOfRange( instr.operands[e.number - 1], e.value, StringUtil.interval(e.low, e.high)); } catch (LegacyInstr.InvalidRegister e) { ERROR.IncorrectRegister(instr.operands[e.number - 1], e.register, e.set.toString()); } catch (LegacyInstr.RegisterRequired e) { ERROR.RegisterExpected((SyntacticOperand) e.operand); } catch (LegacyInstr.WrongNumberOfOperands e) { ERROR.WrongNumberOfOperands(instr.name, e.found, e.expected); } }