internal void Correct_VisitorCallIsMadeByEachInstruction(IInstruction instruction, string expectedCalledMethod) { var visitorCallCounting = new CallCountingRuntime(); instruction.Accept(visitorCallCounting); Assert.Single(visitorCallCounting.CallCount); Assert.Equal(1, visitorCallCounting.CallCount[expectedCalledMethod]); }
/// <summary> /// Assembles the given instruction /// </summary> /// <param name="instruction">instruction to assemble</param> /// <remarks> /// The assembler assumes the instructions provided are valid on the current processor /// </remarks> /// <returns>the binary version of that instruction on the current processor</returns> public int Assemble(IInstruction instruction) { // Assemble and return last instruction instruction.Accept(visitor); return LastInstruction; }
public string[] AssembleInstruction(IInstruction instruction) { return instruction.Accept(_instructionVisitor); }
public string[] AssembleInstruction(IInstruction instruction) { return(instruction.Accept(_instructionVisitor)); }