1 package org.simantics.scl.compiler.elaboration.query.pre;
3 import org.simantics.scl.compiler.elaboration.contexts.TranslationContext;
4 import org.simantics.scl.compiler.elaboration.expressions.Expression;
5 import org.simantics.scl.compiler.elaboration.expressions.QueryTransformer;
6 import org.simantics.scl.compiler.elaboration.java.EqRelation;
7 import org.simantics.scl.compiler.elaboration.query.QAtom;
8 import org.simantics.scl.compiler.elaboration.query.Query;
9 import org.simantics.scl.compiler.errors.Locations;
11 public class QPreEquals extends PreQuery {
12 public Expression left;
13 public Expression right;
15 public QPreEquals(Expression left, Expression right) {
21 public Query resolve(TranslationContext context) {
22 PreQuery oldPreQuery = context.currentPreQuery;
23 context.currentPreQuery = this;
24 QAtom atom = new QAtom(EqRelation.INSTANCE,
26 left.resolve(context),
27 right.resolve(context)});
28 context.currentPreQuery = oldPreQuery;
29 atom.location = location;
30 return withSideQueries(atom);
34 public void setLocationDeep(long loc) {
35 if(location == Locations.NO_LOCATION) {
37 left.setLocationDeep(loc);
38 right.setLocationDeep(loc);
43 public Query accept(QueryTransformer transformer) {
44 return transformer.transform(this);