From 5f06e34bc24876739c1d4af1d45f7cb322a19559 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Wed, 26 Jul 2017 14:32:28 +0200 Subject: First shot at (logic, not VHDL) functions. --- instr-to-kodkod/src/VHDLLevel.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'instr-to-kodkod/src/VHDLLevel.java') diff --git a/instr-to-kodkod/src/VHDLLevel.java b/instr-to-kodkod/src/VHDLLevel.java index 738adaf..57bb8c4 100644 --- a/instr-to-kodkod/src/VHDLLevel.java +++ b/instr-to-kodkod/src/VHDLLevel.java @@ -60,7 +60,11 @@ public class VHDLLevel } else if (input[0].equals("add_predicate")) { - success = handle_add_predicate(input, m); + success = handle_add_predicate(input, m, false); + } + else if (input[0].equals("add_function")) + { + success = handle_add_predicate(input, m, true); } else { @@ -128,7 +132,8 @@ public class VHDLLevel private static boolean handle_add_predicate ( final String[] cmd, - final VHDLModel m + final VHDLModel m, + final boolean is_function ) { final String[] signature; @@ -137,7 +142,8 @@ public class VHDLLevel { System.err.println ( - "[E] Badly formed \"add_predicate\" instruction: \"" + "[E] Badly formed \"add_predicate\" or \"add_function\"" + + " instruction: \"" + String.join(" ", cmd) + "\"." ); @@ -152,6 +158,6 @@ public class VHDLLevel signature[i - 2] = cmd[i]; } - return m.add_predicate(cmd[1], signature); + return m.add_predicate(cmd[1], signature, is_function); } } -- cgit v1.2.3-70-g09d2