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));
34 public void collectRefs(TObjectIntHashMap<Object> allRefs, TIntHashSet refs) {
38 public void collectVars(TObjectIntHashMap<Variable> allVars,
43 protected void updateType() throws MatchException {
44 setType(Types.metaVar(Kinds.STAR));
48 public IVal toVal(CompilationContext context, CodeWriter w) {
49 throw new UnsupportedOperationException();
53 public void collectFreeVariables(THashSet<Variable> vars) {
57 public Expression simplify(SimplificationContext context) {
62 public Expression resolve(TranslationContext context) {
67 public Expression inferType(TypingContext context) {
72 public void collectEffects(THashSet<Type> effects) {
76 public void setLocationDeep(long loc) {
77 if(location == Locations.NO_LOCATION)
82 public void accept(ExpressionVisitor visitor) {
87 public Expression replace(ReplaceContext context) {
92 public Expression accept(ExpressionTransformer transformer) {
93 return transformer.transform(this);