import gnu.trove.map.hash.THashMap;
import gnu.trove.map.hash.TIntObjectHashMap;
-import gnu.trove.map.hash.TObjectIntHashMap;
-import gnu.trove.set.hash.THashSet;
import gnu.trove.set.hash.TIntHashSet;
public class QAtom extends Query {
this.parameters = parameters;
}
- @Override
- public void collectFreeVariables(THashSet<Variable> vars) {
- for(Expression parameter : parameters)
- parameter.collectFreeVariables(vars);
- }
-
@Override
public void checkType(TypingContext context) {
// Type parameters
}
else {
optionalVariableByParameter[i] = -1;
- parameter.forVariables(procedure);
+ parameter.forVariableUses(procedure);
}
}
}
}
}
- private static void collectRefs(SCLRelation relation, TObjectIntHashMap<Object> allRefs,
- TIntHashSet refs) {
- if(relation instanceof CompositeRelation) {
- for(SCLRelation subrelation : ((CompositeRelation) relation).getSubrelations())
- collectRefs(subrelation, allRefs, refs);
- }
- else {
- int id = allRefs.get(relation);
- if(id >= 0)
- refs.add(id);
- }
- }
-
- @Override
- public void collectRefs(TObjectIntHashMap<Object> allRefs,
- TIntHashSet refs) {
- collectRefs(relation, allRefs, refs);
- for(Expression parameter : parameters)
- parameter.collectRefs(allRefs, refs);
- }
-
- @Override
- public void collectVars(TObjectIntHashMap<Variable> allVars,
- TIntHashSet vars) {
- for(Expression parameter : parameters)
- parameter.collectVars(allVars, vars);
- }
-
@Override
public Query replace(ReplaceContext context) {
Type[] newTypeParameters;
visitor.visit(this);
}
- @Override
- public void forVariables(VariableProcedure procedure) {
- for(Expression parameter : parameters)
- parameter.forVariables(procedure);
- }
-
@Override
public void splitToPhases(TIntObjectHashMap<ArrayList<Query>> result) {
int phase = relation.getPhase();