|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object finiteAutomata.CNFMenu
public class CNFMenu
Menu and query methods for the CNF class.
Constructor Summary | |
---|---|
CNFMenu()
|
Method Summary | |
---|---|
protected static void |
addTypeOneDialog(CNF cnf)
Queries user for n and t in the rule "vn -> t" and adds the correpsonding rule. |
protected static void |
addTypeZeroDialog(CNF cnf)
Queries user for n, i, and j in the rule "vn -> vi vj" and adds the correpsonding rule. |
protected static int |
constructorMenu()
Repeatedly displays constructor menu options until user makes a valid choice. |
protected static void |
menuHandler(CNF cnf,
int choice)
Takes the appropriate action based on menu options. |
protected static void |
predefinedDialog(CNF cnf)
Queries user regarding which pre-defined CNF they will use. |
protected static void |
printLanguageDialog(CNF cnf)
Queries user for max string length and prints this CNF's language. |
protected static java.lang.String |
queryAlphabet()
Queries user for alphabet of terminal symbols. |
protected static boolean |
queryAmbiguous()
Asks user if they want to have strings with ambiguous derivations be repeated. |
protected static int |
queryNumVars()
Prints constructor menu header and queries user regarding number of variables. |
protected static boolean |
queryPredefined()
Asks user if they want to use a pre-defined CNF. |
protected static void |
removeTypeOneDialog(CNF cnf)
Queries user for n and t, and removes rule "vn -> t". |
protected static void |
removeTypeZeroDialog(CNF cnf)
Queries user for n, i, and j, and removes rule "vn -> vi vj". |
protected static void |
ruleChangeDialog(CNF cnf)
Asks user which type of rule change they want to make and carries out that request. |
static void |
runMenu(CNF cnf)
Repeatedly obtains user's action choice and carries out that action. |
protected static void |
testStringDialog(CNF cnf)
Determines whether a user-specified String is generated by the given grammar. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CNFMenu()
Method Detail |
---|
public static void runMenu(CNF cnf)
cnf
- the CNF being operated onprotected static int constructorMenu()
protected static void menuHandler(CNF cnf, int choice)
cnf
- the CNF being operated onchoice
- integer code for user's desired actionprotected static boolean queryPredefined()
cnf
- the CNF being operated on
protected static void predefinedDialog(CNF cnf)
cnf
- the CNF being operated onprotected static java.lang.String queryAlphabet()
protected static int queryNumVars()
protected static boolean queryAmbiguous()
protected static void ruleChangeDialog(CNF cnf)
cnf
- the CNF being operated onprotected static void addTypeZeroDialog(CNF cnf)
cnf
- the CNF being operated onprotected static void addTypeOneDialog(CNF cnf)
cnf
- the CNF being operated onprotected static void removeTypeZeroDialog(CNF cnf)
cnf
- the CNF being operated onprotected static void removeTypeOneDialog(CNF cnf)
cnf
- the CNF being operated onprotected static void printLanguageDialog(CNF cnf)
cnf
- the CNF being operated onprotected static void testStringDialog(CNF cnf)
cnf
- the CNF being operated on
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |