From 6bdf1fc6c1b7afe18ffcae05f8fb11eca0f51258 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Tue, 25 Jun 2024 11:33:41 +0200 Subject: wip --- src/ast/nodes/ExprNode.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/ast/nodes/ExprNode.java') diff --git a/src/ast/nodes/ExprNode.java b/src/ast/nodes/ExprNode.java index 25c2016..39f397e 100644 --- a/src/ast/nodes/ExprNode.java +++ b/src/ast/nodes/ExprNode.java @@ -24,10 +24,13 @@ public class ExprNode implements Node { this.trailers = trailers; } + public String getId() { + return ((AtomNode) this.atom).getId(); + } + @Override public ArrayList checkSemantics(SymbolTable ST, int _nesting) { ArrayList errors = new ArrayList(); - if (atom != null) { errors.addAll(atom.checkSemantics(ST, _nesting)); } @@ -50,6 +53,10 @@ public class ExprNode implements Node { // FIXME: type for the expr @Override public Type typeCheck() { + if (this.atom != null) { + return this.atom.typeCheck(); + } + return new VoidType(); } -- cgit v1.2.3-18-g5258