Compare commits
No commits in common. "aed7af7c681184016ecfd9d71a9f6d4cdf83b943" and "aa8a647fa1bbfa9fc9355c1ebf10dfe7e66a8f13" have entirely different histories.
aed7af7c68
...
aa8a647fa1
1
pom.xml
1
pom.xml
@ -26,7 +26,6 @@
|
|||||||
<mainClass>Compiler</mainClass>
|
<mainClass>Compiler</mainClass>
|
||||||
</manifest>
|
</manifest>
|
||||||
</archive>
|
</archive>
|
||||||
<finalName>NichtHaskellCompiler</finalName>
|
|
||||||
<descriptorRefs>
|
<descriptorRefs>
|
||||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||||
</descriptorRefs>
|
</descriptorRefs>
|
||||||
|
@ -15,9 +15,8 @@ import java.util.Objects;
|
|||||||
public class BinaryExpression extends AbstractType implements IExpression{
|
public class BinaryExpression extends AbstractType implements IExpression{
|
||||||
|
|
||||||
public String operator;
|
public String operator;
|
||||||
public IExpression left;
|
public IExpression left; // This needs TypeCheckResult
|
||||||
public IExpression right;
|
public IExpression right;
|
||||||
public String thisClass;
|
|
||||||
|
|
||||||
public BinaryExpression(String operator, IExpression left, IExpression right) {
|
public BinaryExpression(String operator, IExpression left, IExpression right) {
|
||||||
this.operator = operator;
|
this.operator = operator;
|
||||||
@ -29,10 +28,6 @@ public class BinaryExpression extends AbstractType implements IExpression{
|
|||||||
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 {
|
||||||
TypeCheckResult result = new TypeCheckResult();
|
TypeCheckResult result = new TypeCheckResult();
|
||||||
|
|
||||||
if(left instanceof LocalVarIdentifier localVarIdentifier)
|
|
||||||
localVarIdentifier.thisClass = this.thisClass;
|
|
||||||
if(right instanceof LocalVarIdentifier localVarIdentifier)
|
|
||||||
localVarIdentifier.thisClass = this.thisClass;
|
|
||||||
TypeCheckResult leftType = left.typeCheck(methodContext, typeContext, localVars);
|
TypeCheckResult leftType = left.typeCheck(methodContext, typeContext, localVars);
|
||||||
TypeCheckResult rightType = right.typeCheck(methodContext, typeContext, localVars);
|
TypeCheckResult rightType = right.typeCheck(methodContext, typeContext, localVars);
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ import TypeCheck.AbstractType;
|
|||||||
import TypeCheck.TypeCheckException;
|
import TypeCheck.TypeCheckException;
|
||||||
import TypeCheck.TypeCheckHelper;
|
import TypeCheck.TypeCheckHelper;
|
||||||
import TypeCheck.TypeCheckResult;
|
import TypeCheck.TypeCheckResult;
|
||||||
import abstractSyntaxTree.Expression.BinaryExpression;
|
|
||||||
import abstractSyntaxTree.Expression.IExpression;
|
import abstractSyntaxTree.Expression.IExpression;
|
||||||
import abstractSyntaxTree.Expression.InstVarExpression;
|
import abstractSyntaxTree.Expression.InstVarExpression;
|
||||||
import abstractSyntaxTree.Expression.LocalVarIdentifier;
|
import abstractSyntaxTree.Expression.LocalVarIdentifier;
|
||||||
@ -55,8 +54,6 @@ public class AssignStatementExpression extends AbstractType implements IExpressi
|
|||||||
methodCallStatementExpression.thisClass = this.thisClass;
|
methodCallStatementExpression.thisClass = this.thisClass;
|
||||||
if(right instanceof LocalVarIdentifier localVarIdentifierRight)
|
if(right instanceof LocalVarIdentifier localVarIdentifierRight)
|
||||||
localVarIdentifierRight.thisClass = this.thisClass;
|
localVarIdentifierRight.thisClass = this.thisClass;
|
||||||
if(right instanceof BinaryExpression binaryExpression)
|
|
||||||
binaryExpression.thisClass = this.thisClass;
|
|
||||||
|
|
||||||
TypeCheckResult rightType = right.typeCheck(methodContext, typeContext, localVars);
|
TypeCheckResult rightType = right.typeCheck(methodContext, typeContext, localVars);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user