import org.simantics.scl.compiler.types.Type;
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 abstract class DecoratingExpression extends SimplifiableExpression {
public Expression expression;
this.expression = expression;
}
- @Override
- public void collectRefs(TObjectIntHashMap<Object> allRefs, TIntHashSet refs) {
- expression.collectRefs(allRefs, refs);
- }
-
- @Override
- public void collectVars(TObjectIntHashMap<Variable> allVars,
- TIntHashSet vars) {
- expression.collectVars(allVars, vars);
- }
-
@Override
protected void updateType() throws MatchException {
setType(expression.getType());
}
- @Override
- public void collectFreeVariables(THashSet<Variable> vars) {
- expression.collectFreeVariables(vars);
- }
-
@Override
public Expression simplify(SimplificationContext context) {
expression = expression.simplify(context);
public int getFunctionDefinitionPatternArity() throws NotPatternException {
return expression.getFunctionDefinitionPatternArity();
}
-
- @Override
- public void collectEffects(THashSet<Type> effects) {
- expression.collectEffects(effects);
- }
@Override
public void setLocationDeep(long loc) {
}
}
- @Override
- public void forVariables(VariableProcedure procedure) {
- expression.forVariables(procedure);
- }
-
@Override
public IVal toVal(CompilationContext context, CodeWriter w) {
throw new InternalCompilerError("Cannot generate code for " + getClass().getSimpleName() + ".");