From 90bb7e959496c3a12bebe055f6344b9f06f22809 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Thu, 3 Aug 2017 15:28:17 +0200 Subject: Improving clarity through better Makefiles. --- instr-to-kodkod/cfg-to-paths/src/Parameters.java | 72 ++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 instr-to-kodkod/cfg-to-paths/src/Parameters.java (limited to 'instr-to-kodkod/cfg-to-paths/src/Parameters.java') diff --git a/instr-to-kodkod/cfg-to-paths/src/Parameters.java b/instr-to-kodkod/cfg-to-paths/src/Parameters.java new file mode 100644 index 0000000..91303d2 --- /dev/null +++ b/instr-to-kodkod/cfg-to-paths/src/Parameters.java @@ -0,0 +1,72 @@ +public class Parameters +{ + private final String model_file; + private final String root_node; + private final String id_prefix; + private final String output_file; + private final boolean are_valid; + + public static void print_usage () + { + System.out.println + ( + "Instr-to-kodkod\n" + + "USAGE:\n" + + "\tjava Main \n" + + "PARAMETERS:\n" + + "\t\tInstruction file describing the model.\n" + + "\t\tID of the root node for this DAG.\n" + + "\t\tPrefix for the IDs of generated paths.\n" + + "\t\tFile in which to output the generated" + + " instructions." + ); + } + + public Parameters (final String... args) + { + if (args.length != 4) + { + print_usage(); + + model_file = new String(); + root_node = new String(); + id_prefix = new String(); + output_file = new String(); + + are_valid = false; + } + else + { + model_file = args[0]; + root_node = args[1]; + id_prefix = args[2]; + output_file = args[3]; + are_valid = true; + } + } + + public String get_model_file () + { + return model_file; + } + + public String get_root_node () + { + return root_node; + } + + public String get_id_prefix () + { + return id_prefix; + } + + public String get_output_file () + { + return output_file; + } + + public boolean are_valid () + { + return are_valid; + } +} -- cgit v1.2.3-70-g09d2