Fehler in parserPostProcessing behoben

This commit is contained in:
JanUlrich 2015-01-23 16:49:09 +01:00
parent 99d3ecf030
commit 6e6908d460
7 changed files with 34 additions and 3 deletions

View File

@ -675,6 +675,15 @@ public class Method extends Field implements IItemWithOffset, TypeInsertable
//Bei dem Elterntyp der Methode darf es sich nur um eine Klasse handeln, daher Cast ohne Prüfung: //Bei dem Elterntyp der Methode darf es sich nur um eine Klasse handeln, daher Cast ohne Prüfung:
Class parentClass = (Class)parent; Class parentClass = (Class)parent;
if(this.returntype == null)this.returntype = TypePlaceholder.fresh(this); if(this.returntype == null)this.returntype = TypePlaceholder.fresh(this);
this.returntype.parserPostProcessing(this);
if(this.parameterlist != null){
for(FormalParameter fp : this.parameterlist){
fp.parserPostProcessing(this);
}
}
for(GenericTypeVar gtv : this.getGenericParameter()){
gtv.parserPostProcessing(this);
}
} }
@Override @Override

View File

@ -142,4 +142,10 @@ public class ExtendsWildcardType extends WildcardType implements ITypeContainer,
return ret; return ret;
} }
@Override
public void parserPostProcessing(SyntaxTreeNode parent) {
super.parserPostProcessing(parent);
this.extendsType.parserPostProcessing(this);
}
} }

View File

@ -170,7 +170,7 @@ public class GenericTypeVar extends Type
*/ */
return new JavaCodeResult(this.name.toString()); return new JavaCodeResult(this.name.toString());
} }
public TypePlaceholder getTypePlaceHolder(SyntaxTreeNode environment) { public TypePlaceholder getTypePlaceHolder(SyntaxTreeNode environment) {
String hashValue = this.getName().toString()+environment.hashCode(); String hashValue = this.getName().toString()+environment.hashCode();
if(!GenericTypeVar.tph.containsKey(hashValue)){ if(!GenericTypeVar.tph.containsKey(hashValue)){

View File

@ -830,6 +830,14 @@ public class RefType extends Type implements IMatchable
throw new TypeinferenceException("Der Typ "+this.getName()+" ist nicht korrekt", parent); throw new TypeinferenceException("Der Typ "+this.getName()+" ist nicht korrekt", parent);
return t; return t;
} }
@Override
public void parserPostProcessing(SyntaxTreeNode parent) {
super.parserPostProcessing(parent);
if(this.parameter != null)for(Type param : this.parameter){
param.parserPostProcessing(this);
}
}
} }
// ino.end // ino.end

View File

@ -138,4 +138,10 @@ public class SuperWildcardType extends WildcardType implements ITypeContainer, I
ret.addAll(this.superType.getInvolvedTypePlaceholder()); ret.addAll(this.superType.getInvolvedTypePlaceholder());
return ret; return ret;
} }
@Override
public void parserPostProcessing(SyntaxTreeNode parent) {
super.parserPostProcessing(parent);
this.superType.parserPostProcessing(this);
}
} }

View File

@ -89,5 +89,7 @@ public class WildcardType extends Type{
return false; return false;
} }
} }
} }

View File

@ -33,7 +33,7 @@ public class FunNMethod extends Method{
} }
pl.formalparameter = fpList; pl.formalparameter = fpList;
this.parameterlist = pl; this.parameterlist = pl;
this.parent = new Class("Fun"+paralist.size(), 0); this.parserPostProcessing(new Class("Fun"+paralist.size(), 0));
} }
public FunNMethod(int N){ public FunNMethod(int N){
@ -51,7 +51,7 @@ public class FunNMethod extends Method{
} }
pl.formalparameter = fpList; pl.formalparameter = fpList;
this.parameterlist = pl; this.parameterlist = pl;
this.parent = new Class("Fun"+N, 0); this.parserPostProcessing(new Class("Fun"+N, 0));
} }
@Override @Override