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.types.Type;
12 import org.simantics.scl.compiler.types.Types;
13 import org.simantics.scl.compiler.types.exceptions.MatchException;
14 import org.simantics.scl.compiler.types.kinds.Kinds;
16 import gnu.trove.map.hash.TObjectIntHashMap;
17 import gnu.trove.set.hash.THashSet;
18 import gnu.trove.set.hash.TIntHashSet;
20 public class EError extends Expression {
22 public EError(long loc, Type type) {
30 public EError(long loc) {
31 this(loc, Types.metaVar(Kinds.STAR));
35 public void collectVars(TObjectIntHashMap<Variable> allVars,
40 protected void updateType() throws MatchException {
41 setType(Types.metaVar(Kinds.STAR));
45 public IVal toVal(CompilationContext context, CodeWriter w) {
46 throw new UnsupportedOperationException();
50 public void collectFreeVariables(THashSet<Variable> vars) {
54 public Expression simplify(SimplificationContext context) {
59 public Expression resolve(TranslationContext context) {
64 public Expression inferType(TypingContext context) {
69 public void setLocationDeep(long loc) {
70 if(location == Locations.NO_LOCATION)
75 public void accept(ExpressionVisitor visitor) {
80 public Expression replace(ReplaceContext context) {
85 public Expression accept(ExpressionTransformer transformer) {
86 return transformer.transform(this);