Class RandomSentenceGenerator

java.lang.Object
  extended by RandomSentenceGenerator

public class RandomSentenceGenerator
extends Object

A Random Sentence Generator This class currently parses a grammar file from standard input. Your job is to extend it to print random sentences from the grammar.


Constructor Summary
RandomSentenceGenerator(Scanner in)
          Create a new grammar from the given file.
 
Method Summary
static void main(String[] args)
           
 String toString()
          Print out the grammar.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RandomSentenceGenerator

public RandomSentenceGenerator(Scanner in)
Create a new grammar from the given file.

Method Detail

toString

public String toString()
Print out the grammar. Useful for debugging.

Overrides:
toString in class Object

main

public static void main(String[] args)