]> gerrit.simantics Code Review - simantics/platform.git/blob
aa78f4e9853f6585ce6698b65ea3cfc02eace08b
[simantics/platform.git] /
1 package org.simantics.scl.compiler.elaboration.chr.ast;
2
3 import java.util.ArrayList;
4
5 import org.simantics.scl.compiler.elaboration.chr.CHRLiteral;
6 import org.simantics.scl.compiler.elaboration.chr.relations.SpecialCHRRelation;
7 import org.simantics.scl.compiler.elaboration.contexts.TranslationContext;
8 import org.simantics.scl.compiler.elaboration.expressions.Expression;
9
10 public class CHRAstBinds extends CHRAstQuery {
11     public Expression left;
12     public Expression right;
13     
14     public CHRAstBinds(Expression left, Expression right) {
15         this.left = left;
16         this.right = right;
17     }
18     
19     @Override
20     public void accept(CHRAstQueryVisitor visitor) {
21         visitor.visit(this);
22     }
23     
24     @Override
25     protected void translate(TranslationContext context, boolean isHead, ArrayList<CHRLiteral> literals) {
26         literals.add(new CHRLiteral(location, SpecialCHRRelation.MEMBER,
27                 new Expression[] { left, right }, false, false));
28     }
29 }