]> gerrit.simantics Code Review - simantics/platform.git/blob
2b6c6771135ba2ace7d009a153870d6bc21340ae
[simantics/platform.git] /
1 package org.simantics.scl.compiler.elaboration.query;
2
3 import org.simantics.scl.compiler.elaboration.contexts.TranslationContext;
4 import org.simantics.scl.compiler.elaboration.contexts.TypingContext;
5 import org.simantics.scl.compiler.elaboration.expressions.Variable;
6 import org.simantics.scl.compiler.errors.Locations;
7
8 import gnu.trove.map.hash.TObjectIntHashMap;
9 import gnu.trove.set.hash.THashSet;
10 import gnu.trove.set.hash.TIntHashSet;
11
12 public abstract class QAbstractModifier extends Query {
13     public Query query;
14     
15     public QAbstractModifier(Query query) {
16         this.query = query;
17     }
18
19     public void collectFreeVariables(THashSet<Variable> vars) {
20         query.collectFreeVariables(vars);
21     }
22     
23     @Override
24     public Query resolve(TranslationContext context) {
25         query = query.resolve(context);
26         return this;
27     }
28
29     @Override
30     public void checkType(TypingContext context) {
31         query.checkType(context);
32     }
33     
34     @Override
35     public void collectRefs(TObjectIntHashMap<Object> allRefs,
36             TIntHashSet refs) {
37         query.collectRefs(allRefs, refs);
38     }
39     
40     @Override
41     public void collectVars(TObjectIntHashMap<Variable> allVars,
42             TIntHashSet vars) {
43         query.collectVars(allVars, vars);
44     }
45     
46     @Override
47     public void setLocationDeep(long loc) {
48         if(location == Locations.NO_LOCATION) {
49             location = loc;
50             query.setLocationDeep(loc);
51         }
52     }
53 }