import org.simantics.scl.compiler.types.exceptions.UnificationException;
import org.simantics.scl.compiler.types.kinds.Kinds;
-import gnu.trove.map.hash.TObjectIntHashMap;
-import gnu.trove.set.hash.THashSet;
-import gnu.trove.set.hash.TIntHashSet;
-
public class EBind extends SimplifiableExpression {
public Expression pattern;
public Expression value;
public Expression in;
- private EVariable monadEvidence;
+ public EVariable monadEvidence;
SCLValue bindFunction;
Type monadType;
Type valueContentType;
this.value = value;
this.in = in;
}
-
- @Override
- public void collectRefs(final TObjectIntHashMap<Object> allRefs, final TIntHashSet refs) {
- value.collectRefs(allRefs, refs);
- in.collectRefs(allRefs, refs);
- }
-
- @Override
- public void collectVars(TObjectIntHashMap<Variable> allVars,
- TIntHashSet vars) {
- value.collectVars(allVars, vars);
- in.collectVars(allVars, vars);
- }
@Override
protected void updateType() throws MatchException {
return simplified.simplify(context);
}
- @Override
- public void collectFreeVariables(THashSet<Variable> vars) {
- in.collectFreeVariables(vars);
- value.collectFreeVariables(vars);
- pattern.removeFreeVariables(vars);
- }
-
@Override
public Expression resolve(TranslationContext context) {
value = value.resolve(context);
return this;
}
- @Override
- public void collectEffects(THashSet<Type> effects) {
- pattern.collectEffects(effects);
- value.collectEffects(effects);
- in.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) {
- pattern.forVariables(procedure);
- value.forVariables(procedure);
- if(monadEvidence != null)
- monadEvidence.forVariables(procedure);
- }
@Override
public Expression accept(ExpressionTransformer transformer) {