1 package org.simantics.scl.compiler.elaboration.chr.plan;
4 import org.simantics.scl.compiler.compilation.CompilationContext;
5 import org.simantics.scl.compiler.elaboration.expressions.Expression;
6 import org.simantics.scl.compiler.elaboration.expressions.Variable;
7 import org.simantics.scl.compiler.internal.codegen.references.IVal;
8 import org.simantics.scl.compiler.internal.codegen.writer.CodeWriter;
10 public class IterateListOp extends PlanOp {
11 public Variable variable;
12 public Expression list;
14 public IterateListOp(long location, Variable variable, Expression list) {
16 this.variable = variable;
21 public void toString(StringBuilder b) {
22 b.append("ITERATE ").append(variable).append(" <- ").append(list);
26 public void generateCode(CompilationContext context, PlanContext planContext, CodeWriter w) {
27 IVal listValue = list.toVal(context.environment, w);
28 planContext.iterateList(location, w, variable, listValue);