Class RandomSentenceGenerator

  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


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

Method Detail


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

toString in class Object


public static void main(String[] args)