From b50c7e99603e9f85d82d700d62c16c4fcef88715 Mon Sep 17 00:00:00 2001 From: Geno <48206120+gabrielegenovese@users.noreply.github.com> Date: Thu, 11 Jul 2024 12:57:56 +0200 Subject: Code generation (#20) Co-authored-by: geno Co-authored-by: Santo Cariotti --- src/ast/nodes/TrailerNode.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/ast/nodes/TrailerNode.java') diff --git a/src/ast/nodes/TrailerNode.java b/src/ast/nodes/TrailerNode.java index d8301b8..d70e962 100644 --- a/src/ast/nodes/TrailerNode.java +++ b/src/ast/nodes/TrailerNode.java @@ -28,15 +28,15 @@ public class TrailerNode implements Node { } @Override - public ArrayList checkSemantics(SymbolTable ST, int _nesting) { + public ArrayList checkSemantics(SymbolTable ST, int _nesting, FunctionType ft) { ArrayList errors = new ArrayList<>(); if (arglist != null) { - errors.addAll(arglist.checkSemantics(ST, _nesting)); + errors.addAll(arglist.checkSemantics(ST, _nesting, ft)); } for (var expr : exprs) { - errors.addAll(expr.checkSemantics(ST, _nesting)); + errors.addAll(expr.checkSemantics(ST, _nesting, ft)); } return errors; @@ -59,9 +59,11 @@ public class TrailerNode implements Node { return new VoidType(); } - // TODO: add code generation for trailer node @Override public String codeGeneration() { + if (arglist != null) { + return arglist.codeGeneration(); + } return ""; } -- cgit v1.2.3-18-g5258