]> gerrit.simantics Code Review - simantics/platform.git/blob
5426ae00dc3a69570b7d980e5c737ce1ff0ae2f2
[simantics/platform.git] /
1 package org.simantics.scl.compiler.elaboration.chr.plan;
2
3 import org.simantics.scl.compiler.compilation.CompilationContext;
4 import org.simantics.scl.compiler.elaboration.expressions.Expression;
5 import org.simantics.scl.compiler.internal.codegen.writer.CodeWriter;
6
7 public class ExecuteOp extends PlanOp {
8     Expression expression;
9     
10     public ExecuteOp(long location, Expression expression) {
11         super(location);
12         this.expression = expression;
13     }
14
15     @Override
16     public void toString(StringBuilder b) {
17         b.append("EXECUTE ").append(expression);
18
19     }
20
21     @Override
22     public void generateCode(CompilationContext context, PlanContext planContext, CodeWriter w) {
23         expression.toVal(context.environment, w);
24         planContext.nextOp(w);
25     }
26
27 }