From ce49d20a5fe3726e1800bc495a25c7617212abf4 Mon Sep 17 00:00:00 2001 From: Emanuele Grasso <96300448+L0P0P@users.noreply.github.com> Date: Sun, 14 Jul 2024 18:48:09 +0200 Subject: Reaching definition analysis (#17) Co-authored-by: Santo Cariotti Co-authored-by: geno Co-authored-by: geno --- src/ast/nodes/SimpleStmtsNode.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/ast/nodes/SimpleStmtsNode.java') diff --git a/src/ast/nodes/SimpleStmtsNode.java b/src/ast/nodes/SimpleStmtsNode.java index 8e5c924..e7a5557 100644 --- a/src/ast/nodes/SimpleStmtsNode.java +++ b/src/ast/nodes/SimpleStmtsNode.java @@ -44,16 +44,31 @@ public class SimpleStmtsNode implements Node { } @Override - public String toPrint(String prefix) { + public String printAST(String prefix) { String str = prefix + "SimpleStmts\n"; prefix += " "; for (Node stmt : stmts) { - str += stmt.toPrint(prefix); + str += stmt.printAST(prefix); + } + + return str; + } + + @Override + public String toPrint(String prefix) { + String str = ""; + + for (Node stmt : stmts) { + str += stmt.toPrint(prefix) + "\n"; } return str; } + public ArrayList getStmts() { + return stmts; + } + } -- cgit v1.2.3-18-g5258