public override void execute(Interpret interpreter) { NumericVariable v = interpreter.getNumVariable(varIndex.eval(interpreter)); int listInd = interpreter.getNumVariable(listIndex.eval(interpreter)).getValue(); var list = interpreter.getList(listInd); int counter = 0; int index = 0; while (index < list.Count) { v.assign(list[index].getValue()); directive.executeAll(interpreter); index++; counter++; if (counter > LoopLimit) { break; } } }
public void assign(int value, Interpret interpreter) { NumericVariable var = interpreter.getNumVariable(variableIndex); var.assign(value); }