instvar debugging
This commit is contained in:
parent
10f5dc692d
commit
62060462a9
@ -100,6 +100,6 @@ public class Compiler {
|
|||||||
System.out.println("No TypeCheck errors found.");
|
System.out.println("No TypeCheck errors found.");
|
||||||
|
|
||||||
abstractSyntaxTree.codeGen();
|
abstractSyntaxTree.codeGen();
|
||||||
System.out.println("Your input was compiler. You can find the output at ???");// todo wo output? überhaupt hinschreiben?
|
System.out.println("Your input was compiled. You can find the output at ???");// todo wo output? überhaupt hinschreiben?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,10 @@ public class InstVarExpression extends AbstractType implements IExpression{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws TypeCheckException {
|
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws TypeCheckException {
|
||||||
|
if(this.receivers.get(0).identifier != null){
|
||||||
|
thisClass = localVars.get(this.receivers.get(0).identifier);
|
||||||
|
}
|
||||||
|
|
||||||
String varType = typeContext.get(thisClass).get(fieldName);
|
String varType = typeContext.get(thisClass).get(fieldName);
|
||||||
if (varType == null) {
|
if (varType == null) {
|
||||||
throw new TypeCheckException("Field " + fieldName + " was not found in class " + thisClass + ".");
|
throw new TypeCheckException("Field " + fieldName + " was not found in class " + thisClass + ".");
|
||||||
|
Loading…
Reference in New Issue
Block a user