Added an example input file and documented the format of this file.
parent
42d146c241
commit
889504fdb5
12
DFA.java
12
DFA.java
|
@ -14,6 +14,18 @@ public class DFA {
|
||||||
private boolean finalstates[];
|
private boolean finalstates[];
|
||||||
|
|
||||||
// constructs a new DFA object from a file as per the in class specs
|
// 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 ) {
|
DFA ( String filename ) {
|
||||||
BufferedReader infile = null;
|
BufferedReader infile = null;
|
||||||
numstates = 0;
|
numstates = 0;
|
||||||
|
|
|
@ -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
|
Reference in New Issue