From 64395b31a06cbd77cf4790559dfe0a25b519e185 Mon Sep 17 00:00:00 2001 From: Carlos Galindo Date: Wed, 27 Mar 2019 11:55:19 +0100 Subject: [PATCH] Visitador: implemented returnStmts --- src/main/java/grafos/Visitador.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/grafos/Visitador.java b/src/main/java/grafos/Visitador.java index 935a5e7..45763d5 100755 --- a/src/main/java/grafos/Visitador.java +++ b/src/main/java/grafos/Visitador.java @@ -37,6 +37,15 @@ public class Visitador extends VoidVisitorAdapter { graph.connect(n, end); } + @Override + public void visit(ReturnStmt n, CFG arg) { + arg.addNode(n); + arg.connect(prevNode, n); + super.visit(n, arg); + arg.connect(n, arg.endNode()); + prevNode = Collections.emptyList(); + } + @Override public void visit(IfStmt n, CFG graph) { Node ifStart = n.getCondition();