]> gerrit.simantics Code Review - simantics/platform.git/blob
d2828934f02f26d5ac1da2cab13fc9dfa456ec89
[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 CHRAstEquals extends CHRAstQuery {
11     public Expression left;
12     public Expression right;
13     
14     public CHRAstEquals(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.EQUALS,
27                 new Expression[] { left, right }, false, false));
28     }
29 }