public virtual PsudoInstruction CopyTo(PsudoMethod newMethod) { // by default this will work but where needed we can override. PsudoInstruction copy = this.MemberwiseClone() as PsudoInstruction; copy.Method = newMethod; return(copy); }
public ForLoopInstruction(int lineNumber, PsudoMethod method, string variable, string initVal, string endVal) : base(lineNumber, method, variable + " <= " + endVal) { InitInstruction = new AssignVariable(lineNumber, method, variable, initVal); UpdateInstruction = new MathmaticAssignmentInstruction(lineNumber, method, variable, variable + " + 1"); }
private ForLoopInstruction(int lineNumber, PsudoMethod method, string expression, PsudoInstruction init) : base(lineNumber, method, expression) { InitInstruction = init.CopyTo(method); }
public static PsudoInstruction CompileInstruction(string line, int lineNum, PsudoMethod method) { lastInstruction = RealCompileInstruction(line, lineNum, method); return(lastInstruction); }