1 package org.simantics.scl.compiler.elaboration.expressions;
3 import org.simantics.scl.compiler.compilation.CompilationContext;
4 import org.simantics.scl.compiler.elaboration.contexts.ReplaceContext;
5 import org.simantics.scl.compiler.elaboration.contexts.SimplificationContext;
6 import org.simantics.scl.compiler.elaboration.contexts.TranslationContext;
7 import org.simantics.scl.compiler.elaboration.contexts.TypingContext;
8 import org.simantics.scl.compiler.errors.Locations;
9 import org.simantics.scl.compiler.internal.codegen.references.IVal;
10 import org.simantics.scl.compiler.internal.codegen.writer.CodeWriter;
11 import org.simantics.scl.compiler.internal.elaboration.utils.ExpressionDecorator;
12 import org.simantics.scl.compiler.types.Type;
13 import org.simantics.scl.compiler.types.Types;
14 import org.simantics.scl.compiler.types.exceptions.MatchException;
15 import org.simantics.scl.compiler.types.kinds.Kinds;
17 import gnu.trove.map.hash.TObjectIntHashMap;
18 import gnu.trove.set.hash.THashSet;
19 import gnu.trove.set.hash.TIntHashSet;
21 public class EError extends Expression {
23 public EError(long loc, Type type) {
31 public EError(long loc) {
32 this(loc, Types.metaVar(Kinds.STAR));
35 public void collectRefs(TObjectIntHashMap<Object> allRefs, TIntHashSet refs) {
39 public void collectVars(TObjectIntHashMap<Variable> allVars,
44 protected void updateType() throws MatchException {
45 setType(Types.metaVar(Kinds.STAR));
49 public IVal toVal(CompilationContext context, CodeWriter w) {
50 throw new UnsupportedOperationException();
54 public void collectFreeVariables(THashSet<Variable> vars) {
58 public Expression simplify(SimplificationContext context) {
63 public Expression resolve(TranslationContext context) {
68 public Expression inferType(TypingContext context) {
73 public Expression decorate(ExpressionDecorator decorator) {
78 public void collectEffects(THashSet<Type> effects) {
82 public void setLocationDeep(long loc) {
83 if(location == Locations.NO_LOCATION)
88 public void accept(ExpressionVisitor visitor) {
93 public Expression replace(ReplaceContext context) {
98 public void forVariables(VariableProcedure procedure) {
102 public Expression accept(ExpressionTransformer transformer) {
103 return transformer.transform(this);