From 580018e419c1c0d6cdc4f47103be2d7c1aad1eb7 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Mon, 17 Jul 2017 15:53:57 +0200 Subject: Fixes a few dumb mistakes, adds ps example. --- cfg-to-paths/src/Path.java | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'cfg-to-paths/src/Path.java') diff --git a/cfg-to-paths/src/Path.java b/cfg-to-paths/src/Path.java index 80b433f..76ba28a 100644 --- a/cfg-to-paths/src/Path.java +++ b/cfg-to-paths/src/Path.java @@ -31,6 +31,21 @@ public class Path { final Collection result; final Stack waiting_list; + final Node root_node; + + root_node = Node.get_node(root); + + if (root_node == null) + { + System.err.println + ( + "[E] Could not find root node \"" + + root + + "\"." + ); + + return null; + } result = new ArrayList(); waiting_list = new Stack(); @@ -63,17 +78,17 @@ public class Path return result; } - public static Collection> get_subpaths (final Path p) + public Collection> get_all_subpaths () { final Collection> result; final int path_length; result = new ArrayList>(); - path_length = p.nodes.size(); + path_length = nodes.size(); for (int i = 0; i < path_length; ++i) { - result.add(p.nodes.subList(i, path_length)); + result.add(nodes.subList(i, path_length)); } return result; -- cgit v1.2.3-70-g09d2