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