|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object finiteAutomata.DFAMenu
public class DFAMenu
Menu and query methods for the DFA class.
Constructor Summary | |
---|---|
DFAMenu()
|
Method Summary | |
---|---|
protected static void |
changeTransitionDialog(DFA dfa)
Changes one transition based on user input. |
protected static int |
constructorMenu()
Displays constructor menu options until user makes a valid choice. |
static void |
main(java.lang.String[] args)
|
protected static boolean |
menuHandler(int choice,
DFA dfa)
Takes the appropriate action based on constructorMenu options. |
protected static int |
predefinedDialog()
Prompts user to choose a pre-defined DFA and returns that choice (int code) |
protected static void |
printLanguageDialog(DFA dfa)
Reports language of the specified DFA up through user-specified max length. |
protected static boolean |
pumpTest(DFA dfa,
java.lang.String inString)
Prints header for pump report and tests the pumping preconditions. |
protected static void |
queryAlphabet(DFA dfa)
Initializes alpha according to user input. |
protected static void |
queryFinal(DFA dfa)
Initializes isFinal array according to user input. |
protected static void |
queryLabels(DFA dfa)
Obtains and initializes state labels based on user input. |
protected static int |
queryNumStates()
Prints constructor menu banner and asks user how many states in DFA. |
protected static boolean |
queryPredefined()
Asks user if they want to use a pre-defined DFA. |
protected static int |
queryStart(DFA dfa)
Asks user for start state. |
protected static void |
queryTransition(DFA dfa)
For each state and each alphabet symbol, asks user for destination. |
protected static int |
queryValidState(DFA dfa)
Queries user repeatedly to enter a state label. |
protected static int |
queryValidSymbol(DFA dfa)
Queries user repeatedly to enter an input symbol. |
protected static int |
queryValidTransition(DFA dfa,
int i,
int j)
Queries user repeatedly to enter a valid destination state. |
protected static void |
testEpsilonDialog(DFA dfa)
Tests whether the epsilon string is accepted. |
protected static void |
testingHandler(DFA dfa)
Allows the user to repeatedly test strings or print the specified DFA's language. |
protected static int |
testingMenu()
Presents testing menu options to user and obtains valid choice. |
protected static void |
testStringDialog(DFA dfa)
Queries user for string to test and reports back. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DFAMenu()
Method Detail |
---|
protected static int constructorMenu()
protected static boolean menuHandler(int choice, DFA dfa)
choice
- user's desired action codedfa
- the DFA being operated on
protected static void testingHandler(DFA dfa)
dfa
- the DFA being operated onprotected static int testingMenu()
protected static void testEpsilonDialog(DFA dfa)
dfa
- the DFA being operated onprotected static void testStringDialog(DFA dfa)
dfa
- the DFA being operated onprotected static void printLanguageDialog(DFA dfa)
dfa
- the DFA being operated onprotected static int queryNumStates()
protected static void queryLabels(DFA dfa)
dfa
- the DFA being operated onprotected static boolean queryPredefined()
protected static int queryStart(DFA dfa)
dfa
- the DFA being operated on
protected static void queryAlphabet(DFA dfa)
dfa
- the DFA being operated onprotected static void queryFinal(DFA dfa)
dfa
- the DFA being operated onprotected static int queryValidState(DFA dfa)
dfa
- the DFA being operated on
protected static int queryValidSymbol(DFA dfa)
dfa
- the DFA being operated on
protected static int queryValidTransition(DFA dfa, int i, int j)
dfa
- the DFA being operated oni
- current state numberj
- index of input symbol being read (position in alpha)
protected static void queryTransition(DFA dfa)
dfa
- the DFA being operated onprotected static void changeTransitionDialog(DFA dfa)
dfa
- the DFA being operated onprotected static boolean pumpTest(DFA dfa, java.lang.String inString)
dfa
- the DFA being operated oninString
- String to be pumped
protected static int predefinedDialog()
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |