Compare commits

...

2 Commits

Author SHA1 Message Date
Krauß, Josefine
74e3cb8016 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	src/main/java/Compiler.java
#	src/main/java/abstractSyntaxTree/Class/MethodDecl.java
#	src/main/java/abstractSyntaxTree/Class/RefType.java
#	src/main/java/abstractSyntaxTree/Program.java
2024-05-14 14:48:25 +02:00
Krauß, Josefine
2f549e31e9 interface changes, added localvaridentifier, removed iclass interface, some type check for statements, delete varrefexpression 2024-05-14 14:45:04 +02:00
21 changed files with 141 additions and 129 deletions

View File

@@ -1,5 +1,14 @@
import abstractSyntaxTree.Class.RefType;
import abstractSyntaxTree.Datatype.BoolDatatype;
import abstractSyntaxTree.Datatype.IntDatatype;
import abstractSyntaxTree.Expression.InstVarExpression;
import abstractSyntaxTree.Expression.LocalVarIdentifier;
import abstractSyntaxTree.Expression.UnaryExpression;
import abstractSyntaxTree.Program;
import abstractSyntaxTree.Statement.IStatement;
import abstractSyntaxTree.Statement.LocalVarDecl;
import abstractSyntaxTree.Statement.ReturnStatement;
import abstractSyntaxTree.StatementExpression.AssignStatementExpression;
import astGenerator.ASTGenerator;
import gen.DecafLexer;
import gen.DecafParser;

View File

@@ -5,7 +5,9 @@ class Example {
}
class Example2 {
int i;
boolean j;
boolean instVarBool;
void m(int i){
return;
}
}

View File

@@ -0,0 +1,6 @@
public class TestClass {
public static void main(String[] args){
new Example();
new Example2();
}
}

View File

@@ -12,8 +12,9 @@ public class TypeCheckHelper {
if(type1Primitiv && type2Primitiv){
if(Objects.equals(type1, type2)){
result = type1;
}else{
throw new Exception("no upper bound");
}
throw new Exception("no upper bound");
}else if(type1Primitiv || type2Primitiv){
throw new Exception("no upper bound");
}else{

View File

@@ -13,7 +13,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class FieldDecl extends AbstractType implements IClass, Node {
public class FieldDecl extends AbstractType implements Node {
public String type; // from parser
public String identifier; // from parser
@@ -39,7 +39,6 @@ public class FieldDecl extends AbstractType implements IClass, Node {
return null;
}
@Override
public void codeGen(ClassWriter cw) {
//TODO: Do we have fields with initial values?
FieldVisitor fv = cw.visitField(Opcodes.ACC_PUBLIC, identifier, getFieldDescriptor(), null, null);

View File

@@ -14,7 +14,7 @@ import java.util.List;
import java.util.Map;
import java.util.Stack;
public class MethodDecl implements Node {
public class MethodDecl implements IClass, Node {
//Class Name
public String classThatContainsMethod;
@@ -36,11 +36,13 @@ public class MethodDecl implements Node {
this.localVars = new HashMap<>();
}
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext) throws Exception {
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext, HashMap<String, HashMap<String, String>> typeContext) throws Exception {
// jede methode als block statement aufrufen und jede neue locale varibale in localvars schreiben
codeBlock.typeCheck(methodContext, typeContext);
return null;
TypeCheckResult result = new TypeCheckResult();
codeBlock.typeCheck(methodContext, typeContext, localVars);
result.type = codeBlock.returnType;
return result;
}

View File

@@ -3,7 +3,6 @@ package abstractSyntaxTree.Class;
import TypeCheck.AbstractType;
import TypeCheck.TypeCheckResult;
import abstractSyntaxTree.Node;
import abstractSyntaxTree.Parameter.ParameterList;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Opcodes;
@@ -73,7 +72,8 @@ public class RefType extends AbstractType implements Node {
// Method for code generation which iterates over all the field declarations
// and method declarations and calls their CodeGen methods
public void codeGen(ClassWriter cw, HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext) throws Exception {
public void codeGen(ClassWriter cw, HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext) throws Exception {
cw.visit(Opcodes.V1_8, Opcodes.ACC_PUBLIC, name, null,
"java/lang/Object", null);
@@ -83,7 +83,7 @@ public class RefType extends AbstractType implements Node {
}
for (MethodDecl method : methodDecls) {
method.codeGen(cw, methodContext);
method.codeGen(cw);
}
cw.visitEnd();
}

View File

@@ -1,15 +1,19 @@
package abstractSyntaxTree.Expression;
import TypeCheck.TypeCheckHelper;
import TypeCheck.TypeCheckResult;
import org.objectweb.asm.MethodVisitor;
import java.util.Map;
public class LocalVarIdentifier implements IExpression{
public class VarRefExpression implements IExpression{
String identifier;
public LocalVarIdentifier(String identifier){
this.identifier = identifier;
}
//Parameters that are needed here
private String varName;
private Map<String, Integer> localVars;
public String getIdentifier() {
return identifier;
}
@Override
public TypeCheckResult typeCheck() throws Exception {
@@ -18,6 +22,6 @@ public class VarRefExpression implements IExpression{
@Override
public void codeGen(MethodVisitor mv) throws Exception {
throw new Exception("CodeGen not implemented for VarRefExpression");
}
}

View File

@@ -12,6 +12,10 @@ import java.util.Objects;
public class UnaryExpression extends AbstractType implements IExpression{
public String operator;
public IDatatype operand;
public UnaryExpression(String operator, IDatatype operand){
this.operator = operator;
this.operand = operand;
}
@Override
public TypeCheckResult typeCheck() throws Exception {
TypeCheckResult result = new TypeCheckResult();
@@ -29,12 +33,13 @@ public class UnaryExpression extends AbstractType implements IExpression{
}
case "-":
case "+":
case "":
case "+":{
if (Objects.equals(operandType, "int")){
result.type = "int";
}
break;
}
}
setTypeCheckResult(result);

View File

@@ -4,6 +4,7 @@ import TypeCheck.TypeCheckResult;
import abstractSyntaxTree.Class.FieldDecl;
import abstractSyntaxTree.Class.MethodDecl;
import abstractSyntaxTree.Class.RefType;
import abstractSyntaxTree.Parameter.Parameter;
import abstractSyntaxTree.Parameter.ParameterList;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Opcodes;

View File

@@ -2,6 +2,8 @@ package abstractSyntaxTree.Statement;
import TypeCheck.TypeCheckResult;
import TypeCheck.AbstractType;
import abstractSyntaxTree.Class.FieldDecl;
import abstractSyntaxTree.Parameter.ParameterList;
import org.objectweb.asm.*;
import java.util.HashMap;
@@ -11,8 +13,8 @@ public class BlockStatement extends AbstractType implements IStatement{
//We will need a parameter which holds the symbol table
HashMap<String, String > localVars;
String returnType;
List<IStatement> statements;
public String returnType;
public List<IStatement> statements;
// do we need expression, statementexpression
public BlockStatement(List<IStatement> statements, String returnType){
@@ -21,31 +23,24 @@ public class BlockStatement extends AbstractType implements IStatement{
}
@Override
public TypeCheckResult typeCheck() throws Exception {
return null;
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception {
return null;
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext) throws Exception {
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext,
HashMap<String, HashMap<String, String>> typeContext,
HashMap<String, String> localVars) throws Exception {
TypeCheckResult result = new TypeCheckResult();
if(statements.size() == 0){
result.type = "void";
}
TypeCheckResult blockType = new TypeCheckResult();
for (IStatement statement : statements) {
TypeCheckResult typeOfCurrentStatement = statement.typeCheck(methodContext, typeContext, localVars);
if (!typeOfCurrentStatement.equals(this.returnType) && !blockType.equals("void")) {
throw new IllegalArgumentException("Block returns type that it should not return");
if (!typeOfCurrentStatement.type.equals(this.returnType)) {
if(!typeOfCurrentStatement.type.equals("void"))
throw new Exception("TypeCheck Exception: Block returns the wrong type.");
}
}
result.type = this.returnType;
// todo check if the block returns the needed return type in every case
// todo ignore unreadchable statements?
return result;

View File

@@ -2,26 +2,16 @@ package abstractSyntaxTree.Statement;
import TypeCheck.TypeCheckResult;
import TypeCheck.AbstractType;
import abstractSyntaxTree.Parameter.ParameterList;
import org.objectweb.asm.MethodVisitor;
import java.util.HashMap;
import java.util.List;
public class EmptyStatement extends AbstractType implements IStatement{
@Override
public TypeCheckResult typeCheck() throws Exception {
TypeCheckResult result = new TypeCheckResult();
result.type = "void";
return result;
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception {
return typeCheck(methodContext, typeContext);
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext) throws Exception {
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception {
TypeCheckResult result = new TypeCheckResult();
result.type = "void";
return result;

View File

@@ -2,6 +2,7 @@ package abstractSyntaxTree.Statement;
import TypeCheck.TypeCheckResult;
import abstractSyntaxTree.Node;
import abstractSyntaxTree.Parameter.ParameterList;
import org.objectweb.asm.MethodVisitor;
import java.util.HashMap;
@@ -9,15 +10,7 @@ import java.util.List;
public interface IStatement extends Node {
TypeCheckResult typeCheck() throws Exception;
TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception;
TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext) throws Exception;
TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception;
void codeGen(MethodVisitor mv, HashMap<String, String> localVars) throws Exception;
}

View File

@@ -3,6 +3,7 @@ package abstractSyntaxTree.Statement;
import TypeCheck.TypeCheckResult;
import TypeCheck.AbstractType;
import abstractSyntaxTree.Expression.IExpression;
import abstractSyntaxTree.Parameter.ParameterList;
import org.objectweb.asm.*;
import java.util.HashMap;
@@ -19,8 +20,9 @@ public class IfElseStatement extends AbstractType implements IStatement{
this.elseStatement = elseStatement;
}
@Override
public TypeCheckResult typeCheck() throws Exception {
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception {
TypeCheckResult result = new TypeCheckResult();
TypeCheckResult conditionType = condition.typeCheck();
@@ -29,8 +31,8 @@ public class IfElseStatement extends AbstractType implements IStatement{
throw new IllegalArgumentException("should be boolean");
}
TypeCheckResult ifStatementType = ifStatement.typeCheck();
TypeCheckResult elseStatementType = elseStatement.typeCheck();
TypeCheckResult ifStatementType = ifStatement.typeCheck(methodContext, typeContext, localVars);
TypeCheckResult elseStatementType = elseStatement.typeCheck(methodContext, typeContext, localVars);
if (!ifStatementType.equals(elseStatementType)) {
throw new IllegalArgumentException("if and else have different types");
@@ -40,16 +42,6 @@ public class IfElseStatement extends AbstractType implements IStatement{
return result;
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception {
return null;
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext) throws Exception {
return null;
}
@Override
public void codeGen(MethodVisitor mv, HashMap<String, String> localVars) throws Exception {

View File

@@ -3,6 +3,7 @@ package abstractSyntaxTree.Statement;
import TypeCheck.TypeCheckResult;
import TypeCheck.AbstractType;
import abstractSyntaxTree.Expression.IExpression;
import abstractSyntaxTree.Parameter.ParameterList;
import org.objectweb.asm.*;
import java.util.HashMap;
@@ -18,8 +19,9 @@ public class IfStatement extends AbstractType implements IStatement{
this.condition = condition;
this.ifStatement = ifStatement;
}
@Override
public TypeCheckResult typeCheck() throws Exception {
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception {
TypeCheckResult result = new TypeCheckResult();
TypeCheckResult conditionType = condition.typeCheck();
@@ -28,21 +30,11 @@ public class IfStatement extends AbstractType implements IStatement{
throw new Exception("TypeCheck Exception: Condition of If-Statement should be bool.");
}
TypeCheckResult ifStatementType = ifStatement.typeCheck();
TypeCheckResult ifStatementType = ifStatement.typeCheck(methodContext, typeContext, localVars);
result.type = ifStatementType.type;
return result;
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception {
return null;
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext) throws Exception {
return null;
}
@Override
public void codeGen(MethodVisitor mv, HashMap<String, String> localVars) throws Exception {

View File

@@ -0,0 +1,35 @@
package abstractSyntaxTree.Statement;
import TypeCheck.TypeCheckHelper;
import TypeCheck.TypeCheckResult;
import abstractSyntaxTree.Parameter.ParameterList;
import org.objectweb.asm.MethodVisitor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
public class LocalVarDecl implements IStatement{
String type;
String identifier;
public LocalVarDecl(String type, String identifier) {
this.type = type;
this.identifier = identifier;
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception {
TypeCheckHelper.typeExists(this.type, new ArrayList<>(methodContext.keySet()));
localVars.put(this.identifier, this.type);
TypeCheckResult result = new TypeCheckResult();
result.type = "void";
return result;
}
@Override
public void codeGen(MethodVisitor mv, HashMap<String, String> localVars) throws Exception {
}
}

View File

@@ -3,6 +3,7 @@ package abstractSyntaxTree.Statement;
import TypeCheck.TypeCheckResult;
import TypeCheck.AbstractType;
import abstractSyntaxTree.Expression.IExpression;
import abstractSyntaxTree.Parameter.ParameterList;
import org.objectweb.asm.*;
import java.util.HashMap;
@@ -16,7 +17,7 @@ public class ReturnStatement extends AbstractType implements IStatement{
}
@Override
public TypeCheckResult typeCheck() throws Exception {
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception {
TypeCheckResult result = new TypeCheckResult();
if (expression == null) {
@@ -29,17 +30,6 @@ public class ReturnStatement extends AbstractType implements IStatement{
return result;
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception {
return null;
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext) throws Exception {
return null;
}
//TODO: We do not differentiate between primitive types and reference types
// This is a problem at "BinaryExpression" and here because we need to know the type to return
// At this point in time we can either return reference types or have an error message

View File

@@ -3,6 +3,7 @@ package abstractSyntaxTree.Statement;
import TypeCheck.TypeCheckResult;
import TypeCheck.AbstractType;
import abstractSyntaxTree.Expression.IExpression;
import abstractSyntaxTree.Parameter.ParameterList;
import org.objectweb.asm.*;
import java.util.HashMap;
@@ -18,7 +19,7 @@ public class WhileStatement extends AbstractType implements IStatement {
}
@Override
public TypeCheckResult typeCheck() throws Exception {
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception {
TypeCheckResult result = new TypeCheckResult();
TypeCheckResult conditionType = condition.typeCheck();
@@ -27,22 +28,12 @@ public class WhileStatement extends AbstractType implements IStatement {
throw new IllegalArgumentException("Expected boolean");
}
TypeCheckResult statementType = statement.typeCheck();
TypeCheckResult statementType = statement.typeCheck(methodContext, typeContext, localVars);
result.type = statementType.type;
return result;
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception {
return null;
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext) throws Exception {
return null;
}
@Override
public void codeGen(MethodVisitor mv, HashMap<String, String> localVars) throws Exception {
Label conditionFalse = new Label();

View File

@@ -5,12 +5,12 @@ import TypeCheck.TypeCheckHelper;
import TypeCheck.TypeCheckResult;
import abstractSyntaxTree.Expression.IExpression;
import abstractSyntaxTree.Expression.InstVarExpression;
import abstractSyntaxTree.Expression.VarRefExpression;
import abstractSyntaxTree.Expression.LocalVarIdentifier;
import abstractSyntaxTree.Parameter.ParameterList;
import abstractSyntaxTree.Statement.IStatement;
import org.objectweb.asm.*;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
public class AssignStatementExpression extends AbstractType implements IExpression, IStatement {
@@ -18,12 +18,27 @@ public class AssignStatementExpression extends AbstractType implements IExpressi
public IExpression left;
public IExpression right;
public AssignStatementExpression(String operator, IExpression leftExpression, IExpression rightExpression){
this.operator = operator;
this.left = leftExpression;
this.right = rightExpression;
}
@Override
public TypeCheckResult typeCheck() throws Exception {
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception {
TypeCheckHelper helper = new TypeCheckHelper();
TypeCheckResult result = new TypeCheckResult();
TypeCheckResult leftType = left.typeCheck();
if(leftType == null){ //left expression is the identifier of a var
leftType = new TypeCheckResult();
if (left instanceof LocalVarIdentifier) {
LocalVarIdentifier localVarIdentifier = (LocalVarIdentifier) left;
String identifier = localVarIdentifier.getIdentifier();
leftType.type = localVars.get(identifier);
}
// not local var
}
TypeCheckResult rightType = right.typeCheck();
String upperbound = helper.upperBound(leftType.type, rightType.type);
@@ -34,21 +49,16 @@ public class AssignStatementExpression extends AbstractType implements IExpressi
return result;
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception {
return null;
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext) throws Exception {
return null;
}
@Override
public void codeGen(MethodVisitor mv, HashMap<String, String> localVars) throws Exception {
}
@Override
public TypeCheckResult typeCheck() throws Exception {
return null;
}
@Override
public void codeGen(MethodVisitor mv) throws Exception {
left.codeGen(mv);

View File

@@ -5,6 +5,7 @@ import TypeCheck.TypeCheckResult;
import abstractSyntaxTree.Class.MethodDecl;
import abstractSyntaxTree.Class.RefType;
import abstractSyntaxTree.Expression.IExpression;
import abstractSyntaxTree.Parameter.ParameterList;
import abstractSyntaxTree.Statement.IStatement;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.MethodVisitor;
@@ -44,13 +45,9 @@ public class MethodCallStatementExpression extends AbstractType implements IExpr
return result;
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception {
return null;
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext) throws Exception {
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception {
return null;
}

View File

@@ -3,6 +3,7 @@ package abstractSyntaxTree.StatementExpression;
import TypeCheck.AbstractType;
import TypeCheck.TypeCheckResult;
import abstractSyntaxTree.Expression.IExpression;
import abstractSyntaxTree.Parameter.ParameterList;
import abstractSyntaxTree.Statement.IStatement;
import org.objectweb.asm.MethodVisitor;
@@ -15,13 +16,10 @@ public class NewStatementExpression extends AbstractType implements IExpression,
return null;
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception {
return null;
}
@Override
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, List<String>>>> methodContext, HashMap<String, HashMap<String, String>> typeContext) throws Exception {
public TypeCheckResult typeCheck(HashMap<String, HashMap<String, HashMap<String, ParameterList>>> methodContext, HashMap<String, HashMap<String, String>> typeContext, HashMap<String, String> localVars) throws Exception {
return null;
}