From 889504fdb509848772f32392b9a80aae87bc9406 Mon Sep 17 00:00:00 2001 From: penguinc Date: Tue, 23 Nov 2004 02:37:02 +0000 Subject: [PATCH] Added an example input file and documented the format of this file. --- DFA.java | 12 ++++++++++++ minmachine.txt | 17 +++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 minmachine.txt diff --git a/DFA.java b/DFA.java index b4280c8..ca675e0 100644 --- a/DFA.java +++ b/DFA.java @@ -14,6 +14,18 @@ public class DFA { private boolean finalstates[]; // constructs a new DFA object from a file as per the in class specs + /* + * format of the input file: + * IntegerN - the number of terminal characters in the machine + * Terminal * N - all of the terminals separated by a space + * NumStates - number of states in the machine + * - next is NumStates * IntegerN rows of transitions + * StartState TerminalTransitionChar EndState + * NumFinalStates - number of final states + * FinalStates - the final states of the machine separated by spaces + * + * Check the minmachine.txt file for a complete minimizable example. + */ DFA ( String filename ) { BufferedReader infile = null; numstates = 0; diff --git a/minmachine.txt b/minmachine.txt new file mode 100644 index 0000000..f90ff13 --- /dev/null +++ b/minmachine.txt @@ -0,0 +1,17 @@ +2 +a b +6 +0 a 1 +0 b 3 +1 a 3 +1 b 4 +2 a 1 +2 b 4 +3 a 4 +3 b 3 +4 a 4 +4 b 4 +5 a 5 +5 b 5 +1 +4