public void SimpleInstruction() { var op0 = new Operand(OperandType.Variable, "x", 0); var op1 = new Operand(OperandType.Literal, 1, 0); var inst = new Instruction(OpCode.MOV, 1, op0, op1); var inst2 = new Instruction(OpCode.MOV, 2, op0, op1); Assert.AreEqual("00001:", inst.IndexName); Assert.AreEqual("00002:", inst2.IndexName); }
public Runnable GetScript(Instruction[] instructions, int secondIndex) { var stream = new InstrucStream(instructions); var function = new Function(Function.MainName, 0); var dofunction = new Function("Do", secondIndex); var ftable = new FunctionTable { { Function.MainName, function }, { "Do", dofunction} }; return new Runnable(stream, ftable); }
public RuntimeContext GetContextWithMain(Instruction[] instructions) { var runnable = GetRunnableWithMainFor(instructions); return new RuntimeContext(runnable); }