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);
        }
示例#2
0
 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");
 }
示例#3
0
 private ForLoopInstruction(int lineNumber, PsudoMethod method, string expression, PsudoInstruction init)
     : base(lineNumber, method, expression)
 {
     InitInstruction = init.CopyTo(method);
 }
示例#4
0
 public static PsudoInstruction CompileInstruction(string line, int lineNum, PsudoMethod method)
 {
     lastInstruction = RealCompileInstruction(line, lineNum, method);
     return(lastInstruction);
 }