summaryrefslogtreecommitdiffstats
path: root/src/ast/nodes/ReturnStmtNode.java
diff options
context:
space:
mode:
authorEmanuele Grasso <96300448+L0P0P@users.noreply.github.com>2024-07-14 16:48:09 +0000
committerGitHub <noreply@github.com>2024-07-14 16:48:09 +0000
commitce49d20a5fe3726e1800bc495a25c7617212abf4 (patch)
tree5a1a79efa79e7bf6dcf3d3151aec2edf6a47b3e7 /src/ast/nodes/ReturnStmtNode.java
parent57599a42b863cc48050c137de2ec108aa1d59a44 (diff)
Reaching definition analysis (#17)
Co-authored-by: Santo Cariotti <santo@dcariotti.me> Co-authored-by: geno <gabriele.genovese2@studio.unibo.it> Co-authored-by: geno <gabrigeno@gmail.com>
Diffstat (limited to 'src/ast/nodes/ReturnStmtNode.java')
-rw-r--r--src/ast/nodes/ReturnStmtNode.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/ast/nodes/ReturnStmtNode.java b/src/ast/nodes/ReturnStmtNode.java
index 15c8d69..1264fa9 100644
--- a/src/ast/nodes/ReturnStmtNode.java
+++ b/src/ast/nodes/ReturnStmtNode.java
@@ -63,15 +63,24 @@ public class ReturnStmtNode implements Node {
}
@Override
- public String toPrint(String prefix) {
+ public String printAST(String prefix) {
String str = prefix + "ReturnStmt\n";
prefix += " ";
if (this.exprList != null) {
- str += this.exprList.toPrint(prefix);
+ str += this.exprList.printAST(prefix);
}
return str;
}
+ @Override
+ public String toPrint(String prefix) {
+ String str = prefix + "return ";
+ if (this.exprList != null) {
+ str += this.exprList.toPrint("");
+ }
+ return str + "\n";
+ }
+
}