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