import org.simantics.scl.compiler.elaboration.expressions.list.CompiledQualifier;
import org.simantics.scl.compiler.elaboration.expressions.list.ListQualifier;
import org.simantics.scl.compiler.errors.Locations;
-import org.simantics.scl.compiler.internal.elaboration.utils.ExpressionDecorator;
import org.simantics.scl.compiler.types.Type;
import org.simantics.scl.compiler.types.Types;
import org.simantics.scl.compiler.types.exceptions.MatchException;
-import gnu.trove.map.hash.TObjectIntHashMap;
-import gnu.trove.set.hash.THashSet;
-import gnu.trove.set.hash.TIntHashSet;
-
public class EListComprehension extends SimplifiableExpression {
public Expression head;
this.head = head;
this.qualifier = qualifier;
}
-
- @Override
- public void collectRefs(TObjectIntHashMap<Object> allRefs,
- TIntHashSet refs) {
- head.collectRefs(allRefs, refs);
- qualifier.collectRefs(allRefs, refs);
- }
-
- @Override
- public void collectVars(TObjectIntHashMap<Variable> allVars,
- TIntHashSet vars) {
- head.collectVars(allVars, vars);
- qualifier.collectVars(allVars, vars);
- }
@Override
public Expression checkBasicType(TypingContext context, Type requiredType) {
setType(Types.list(head.getType()));
}
- @Override
- public void collectFreeVariables(THashSet<Variable> vars) {
- head.collectFreeVariables(vars);
- qualifier.collectFreeVariables(vars);
- }
-
@Override
public Expression simplify(SimplificationContext context) {
context.pushLocation(location);
return this;
}
- @Override
- public Expression decorate(ExpressionDecorator decorator) {
- head = head.decorate(decorator);
- qualifier.decorate(decorator);
- return decorator.decorate(this);
- }
-
- @Override
- public void collectEffects(THashSet<Type> effects) {
- head.collectEffects(effects);
- qualifier.collectEffects(effects);
- }
-
@Override
public void setLocationDeep(long loc) {
if(location == Locations.NO_LOCATION) {
public void accept(ExpressionVisitor visitor) {
visitor.visit(this);
}
-
- @Override
- public void forVariables(VariableProcedure procedure) {
- head.forVariables(procedure);
- qualifier.forVariables(procedure);
- }
@Override
public Expression accept(ExpressionTransformer transformer) {