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/DottedNameNode.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/ast/nodes/DottedNameNode.java') diff --git a/src/ast/nodes/DottedNameNode.java b/src/ast/nodes/DottedNameNode.java index 827945a..ce00c00 100644 --- a/src/ast/nodes/DottedNameNode.java +++ b/src/ast/nodes/DottedNameNode.java @@ -44,7 +44,7 @@ public class DottedNameNode implements Node { } @Override - public String toPrint(String prefix) { + public String printAST(String prefix) { String str = prefix + "DottedName\n"; prefix += " "; @@ -55,4 +55,15 @@ public class DottedNameNode implements Node { return str; } + @Override + public String toPrint(String prefix) { + String str = prefix + names.get(0); + + for (int i = 1; i < names.size(); ++i) { + str += "." + names.get(i); + } + + return str; + } + } -- cgit v1.2.3-18-g5258