Merge remote-tracking branch 'origin/johns-branch' into code-generator

This commit is contained in:
i22007 2024-05-14 13:00:54 +02:00
commit 91f7db24f6
4 changed files with 35 additions and 4 deletions

View File

@ -1,8 +1,10 @@
package ast;
import ast.expression.ExpressionNode;
import semantic.SemanticVisitor;
import typechecker.TypeCheckResult;
public class LiteralNode extends ExpressionNode {
public class LiteralNode implements ExpressionNode {
int value;
private String type;
@ -20,4 +22,8 @@ public class LiteralNode extends ExpressionNode {
}
@Override
public TypeCheckResult accept(SemanticVisitor visitor) {
return null;
}
}

View File

@ -1,6 +1,9 @@
package ast.expression;
public class BinaryExpressionNode extends ExpressionNode {
import semantic.SemanticVisitor;
import typechecker.TypeCheckResult;
public class BinaryExpressionNode implements ExpressionNode {
public ExpressionNode left;
public ExpressionNode right;
public String operator; // Stores the operator as a string (e.g., "+", "-", "&&")
@ -10,4 +13,9 @@ public class BinaryExpressionNode extends ExpressionNode {
this.right = right;
this.operator = operator;
}
@Override
public TypeCheckResult accept(SemanticVisitor visitor) {
return null;
}
}

View File

@ -1,9 +1,18 @@
package ast.expression;
public class IdentifierExpressionNode extends ExpressionNode {
import semantic.SemanticVisitor;
import typechecker.TypeCheckResult;
import typechecker.Visitable;
public class IdentifierExpressionNode implements ExpressionNode {
public String name;
public IdentifierExpressionNode(String name) {
this.name = name;
}
@Override
public TypeCheckResult accept(SemanticVisitor visitor) {
return null;
}
}

View File

@ -1,6 +1,9 @@
package ast.expression;
public class UnaryExpressionNode extends ExpressionNode {
import semantic.SemanticVisitor;
import typechecker.TypeCheckResult;
public class UnaryExpressionNode implements ExpressionNode {
public ExpressionNode expression;
public String operator; // Stores the operator (e.g., "-", "!")
@ -8,4 +11,9 @@ public class UnaryExpressionNode extends ExpressionNode {
this.expression = expression;
this.operator = operator;
}
@Override
public TypeCheckResult accept(SemanticVisitor visitor) {
return null;
}
}