Assignment 5

CS 152
due December 11, 2000
100 points

In one of the languages Ada, C++, Java, or Scheme, write a program that will take a context-free grammar and determine whether it can be parsed with predictive parsing (i.e., recursive descent/top-down parsing with one symbol of lookahead and no backtracking). Check at least the test grammars of the file a5.dat, available from the class web site. For the language you choose, use the same constraints and assumptions as in the appropriate one of Assignments 1-4.

In any case, you should detect and report the presence of left recursion, both direct and indirect, as well as instances where the two First sets for a nonterminal overlap. You may assume that pure BNF is used -- that is, that no optionality, alteration, or indefinite repetition is used.