From e69a367c33e371ae22fd6e8c948e2067d0d14c9a Mon Sep 17 00:00:00 2001 From: Daniel Holle Date: Thu, 17 Aug 2023 10:17:09 +0200 Subject: [PATCH] Add printout --- .../parser/SyntaxTreeGenerator/StatementGenerator.java | 1 + .../dhbwstuttgart/syntaxtree/visual/OutputGenerator.java | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java b/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java index 1da80097..ab89d57b 100644 --- a/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java +++ b/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java @@ -277,6 +277,7 @@ public class StatementGenerator { ret.setStatement(); return ret; default: + System.out.println(stmt.getClass()); throw new NotImplementedException(); } } diff --git a/src/main/java/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java b/src/main/java/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java index b914ecab..26c3dc8c 100644 --- a/src/main/java/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java +++ b/src/main/java/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java @@ -413,7 +413,8 @@ public class OutputGenerator implements ASTVisitor { } untab(); out.append(tabs); - out.append("}"); + out.append("}::"); + switchStmt.getType().accept(this); } @Override @@ -445,8 +446,10 @@ public class OutputGenerator implements ASTVisitor { @Override public void visit(Yield aYield) { - out.append("yield "); + out.append("yield ("); aYield.retexpr.accept(this); + out.append(")::"); + aYield.getType().accept(this); } @Override