private void VisitInstruction(CilInstruction instruction) { if (instruction is CilInstructionNone instructionNone) { InstructionNoneVisitor.VisitInstructionNone(instructionNone); } else if (instruction is CilInstructionMethod instructionMethod) { InstructionMethodVisitor.VisitInstructionMethod(instructionMethod); } else if (instruction is CilInstructionString instructionString) { InstructionStringVisitor.VisitInstructionString(instructionString); } else if (instruction is CilInstructionI instructionI) { InstructionIVisitor.VisitInstructionI(instructionI); } else if (instruction is CilInstructionType instructionType) { InstructionTypeVisitor.VisitInstructionType(instructionType); } else if (instruction is CilInstructionVar instructionVar) { InstructionVarVisitor.VisitInstructionVar(instructionVar); } else if (instruction is CilInstructionR instructionR) { InstructionRVisitor.VisitInstructionR(instructionR); } else if (instruction is CilInstructionBr instructionBr) { InstructionBrVisitor.VisitInstructionBr(instructionBr); } else if (instruction is CilInstructionField instructionField) { InstructionFieldVisitor.VisitInstructionField(instructionField); } else if (instruction is CilInstructionI8 instructionI8) { InstructionI8Visitor.VisitInstructionI8(instructionI8); } else if (instruction is CilInstructionSwitch instructionSwitch) { InstructionSwitchVisitor.VisitInstructionSwitch(instructionSwitch); } else if (instruction is CilInstructionTok instructionTok) { InstructionTokVisitor.VisitInstructionTok(instructionTok); } else { throw new ArgumentException($"CIL instruction cannot be recognized: '{instruction.ToString()}'."); } }
public InstructionNotSupportedException(CilInstruction instruction) : base($"The following instruction is not supported: \"{instruction.ToString()}\".") { }