Skip to content

Commit

Permalink
Added an example input file and documented the format of this file.
Browse files Browse the repository at this point in the history
  • Loading branch information
penguinc committed Nov 23, 2004
1 parent 42d146c commit 889504f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
12 changes: 12 additions & 0 deletions DFA.java
Expand Up @@ -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;
Expand Down
17 changes: 17 additions & 0 deletions 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

0 comments on commit 889504f

Please sign in to comment.