]> gerrit.simantics Code Review - simantics/platform.git/blob
95e865be30afd94e1aceff39330bb5f8db642bbb
[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.internal.codegen.writer.CodeWriter;
5
6 public class PreCommitOp extends PlanOp {
7     public PreCommitOp(long location) {
8         super(location);
9     }
10
11     @Override
12     public void toString(StringBuilder b) {
13         b.append("PRE_COMMIT");
14     }
15
16     @Override
17     public void generateCode(CompilationContext context, PlanContext planContext, CodeWriter w) {
18         for(PartnerFact activeFact : planContext.partnerFacts) {
19             if(activeFact.killAfterMatch)
20                 w.apply(location, activeFact.constraint.removeProcedure, planContext.storeVar, activeFact.factVar);
21         }
22         planContext.nextOp(w);
23     }
24
25 }