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.TIntHashSet;
19 public class EError extends Expression {
21 public EError(long loc, Type type) {
29 public EError(long loc) {
30 this(loc, Types.metaVar(Kinds.STAR));
34 public void collectVars(TObjectIntHashMap<Variable> allVars,
39 protected void updateType() throws MatchException {
40 setType(Types.metaVar(Kinds.STAR));
44 public IVal toVal(CompilationContext context, CodeWriter w) {
45 throw new UnsupportedOperationException();
49 public Expression simplify(SimplificationContext context) {
54 public Expression resolve(TranslationContext context) {
59 public Expression inferType(TypingContext context) {
64 public void setLocationDeep(long loc) {
65 if(location == Locations.NO_LOCATION)
70 public void accept(ExpressionVisitor visitor) {
75 public Expression replace(ReplaceContext context) {
80 public Expression accept(ExpressionTransformer transformer) {
81 return transformer.transform(this);