forked from JavaTX/JavaCompilerCore
65 lines
1.7 KiB
Java
65 lines
1.7 KiB
Java
package strucTypes2;
|
|
|
|
import java.util.Map;
|
|
|
|
import de.dhbwstuttgart.syntaxtree.Method;
|
|
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
|
|
|
class AssTuple {
|
|
|
|
private Map<String, RefTypeOrTPHOrWildcardOrGeneric> fAss;
|
|
private Map<String, RefTypeOrTPHOrWildcardOrGeneric> mAss;
|
|
private Map<Method, Map<String, RefTypeOrTPHOrWildcardOrGeneric>> argAss;
|
|
|
|
public AssTuple(Map<String, RefTypeOrTPHOrWildcardOrGeneric> fAss,
|
|
Map<String, RefTypeOrTPHOrWildcardOrGeneric> mAss,
|
|
Map<Method, Map<String, RefTypeOrTPHOrWildcardOrGeneric>> argAss) {
|
|
super();
|
|
this.fAss = fAss;
|
|
this.mAss = mAss;
|
|
this.argAss = argAss;
|
|
}
|
|
|
|
public RefTypeOrTPHOrWildcardOrGeneric getTypeOfLocalVar(String name , Method method) {
|
|
|
|
// Schaue als erstes in den Argumenten dann in den Feldvariablen der Klasse
|
|
Map<String,RefTypeOrTPHOrWildcardOrGeneric> argAssMethod = argAss.get(method);
|
|
if (argAssMethod.containsKey(name)) {
|
|
return argAssMethod.get(name);
|
|
}
|
|
else if (fAss.containsKey(name)) {
|
|
return fAss.get(name);
|
|
}
|
|
else {
|
|
System.err.println("Fehler: Typ nicht bekannt");
|
|
return null;
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
public Map<String, RefTypeOrTPHOrWildcardOrGeneric> getfAss() {
|
|
return fAss;
|
|
}
|
|
|
|
public void setfAss(Map<String, RefTypeOrTPHOrWildcardOrGeneric> fAss) {
|
|
this.fAss = fAss;
|
|
}
|
|
|
|
public Map<String, RefTypeOrTPHOrWildcardOrGeneric> getmAss() {
|
|
return mAss;
|
|
}
|
|
|
|
public void setmAss(Map<String, RefTypeOrTPHOrWildcardOrGeneric> mAss) {
|
|
this.mAss = mAss;
|
|
}
|
|
|
|
public Map<Method, Map<String, RefTypeOrTPHOrWildcardOrGeneric>> getArgAss() {
|
|
return argAss;
|
|
}
|
|
|
|
public void setArgAss(Map<Method, Map<String, RefTypeOrTPHOrWildcardOrGeneric>> argAss) {
|
|
this.argAss = argAss;
|
|
}
|
|
} |