Merge remote-tracking branch 'origin/johns-branch' into code-generator
This commit is contained in:
commit
91f7db24f6
@ -1,8 +1,10 @@
|
|||||||
package ast;
|
package ast;
|
||||||
|
|
||||||
import ast.expression.ExpressionNode;
|
import ast.expression.ExpressionNode;
|
||||||
|
import semantic.SemanticVisitor;
|
||||||
|
import typechecker.TypeCheckResult;
|
||||||
|
|
||||||
public class LiteralNode extends ExpressionNode {
|
public class LiteralNode implements ExpressionNode {
|
||||||
|
|
||||||
int value;
|
int value;
|
||||||
private String type;
|
private String type;
|
||||||
@ -20,4 +22,8 @@ public class LiteralNode extends ExpressionNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TypeCheckResult accept(SemanticVisitor visitor) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
package ast.expression;
|
package ast.expression;
|
||||||
|
|
||||||
public class BinaryExpressionNode extends ExpressionNode {
|
import semantic.SemanticVisitor;
|
||||||
|
import typechecker.TypeCheckResult;
|
||||||
|
|
||||||
|
public class BinaryExpressionNode implements ExpressionNode {
|
||||||
public ExpressionNode left;
|
public ExpressionNode left;
|
||||||
public ExpressionNode right;
|
public ExpressionNode right;
|
||||||
public String operator; // Stores the operator as a string (e.g., "+", "-", "&&")
|
public String operator; // Stores the operator as a string (e.g., "+", "-", "&&")
|
||||||
@ -10,4 +13,9 @@ public class BinaryExpressionNode extends ExpressionNode {
|
|||||||
this.right = right;
|
this.right = right;
|
||||||
this.operator = operator;
|
this.operator = operator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TypeCheckResult accept(SemanticVisitor visitor) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,9 +1,18 @@
|
|||||||
package ast.expression;
|
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 String name;
|
||||||
|
|
||||||
public IdentifierExpressionNode(String name) {
|
public IdentifierExpressionNode(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TypeCheckResult accept(SemanticVisitor visitor) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
package ast.expression;
|
package ast.expression;
|
||||||
|
|
||||||
public class UnaryExpressionNode extends ExpressionNode {
|
import semantic.SemanticVisitor;
|
||||||
|
import typechecker.TypeCheckResult;
|
||||||
|
|
||||||
|
public class UnaryExpressionNode implements ExpressionNode {
|
||||||
public ExpressionNode expression;
|
public ExpressionNode expression;
|
||||||
public String operator; // Stores the operator (e.g., "-", "!")
|
public String operator; // Stores the operator (e.g., "-", "!")
|
||||||
|
|
||||||
@ -8,4 +11,9 @@ public class UnaryExpressionNode extends ExpressionNode {
|
|||||||
this.expression = expression;
|
this.expression = expression;
|
||||||
this.operator = operator;
|
this.operator = operator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TypeCheckResult accept(SemanticVisitor visitor) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user