1 package org.simantics.scl.compiler.elaboration.expressions;
3 import org.simantics.scl.compiler.common.names.Names;
4 import org.simantics.scl.compiler.elaboration.contexts.TranslationContext;
5 import org.simantics.scl.compiler.elaboration.modules.SCLValue;
6 import org.simantics.scl.compiler.errors.Locations;
8 public class ERange extends ASTExpression {
12 public ERange(Expression from, Expression to) {
18 public Expression resolve(TranslationContext context) {
19 from = from.resolve(context);
20 to = to.resolve(context);
21 SCLValue rangeFunction = context.getEnvironment().getValue(Names.Prelude_range);
22 return new EApply(location, new EConstant(rangeFunction), from, to);
26 public void setLocationDeep(long loc) {
27 if(location == Locations.NO_LOCATION) {
29 from.setLocationDeep(loc);
30 to.setLocationDeep(loc);
35 public Expression accept(ExpressionTransformer transformer) {
36 return transformer.transform(this);