|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectSentenceGenerator
public class SentenceGenerator
This is my version of a CIT594 assignment to read in a BNF grammar and produce sentences from that grammar.
| Field Summary | |
|---|---|
(package private) java.util.Random |
random
|
| Constructor Summary | |
|---|---|
SentenceGenerator()
|
|
| Method Summary | |
|---|---|
static void |
main(java.lang.String[] args)
Prompts the user for a file containing a BNF grammar, then generates several sentences from that grammar. |
(package private) void |
readGrammar()
Prompts the user to choose an input file, then reads and parses a BNF grammar from that file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
java.util.Random random
| Constructor Detail |
|---|
public SentenceGenerator()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
args - Unused.
void readGrammar()
throws java.io.IOException
<np> ::= <det> <n> | <det> <adjs> <n> <np> ::= <det> <n> <pp>
java.io.IOException - If there is an error reading the file.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||