Unformatted text preview: 2. Consider the grammar A ::= x B  C z B ::= A x C C ::= y B  ± where { A,B,C } is the set of nonterminal symbols, A is the start symbol, { x,y,z } is the set of terminal symbols, and ± denotes the empty string. Is the grammar LL(1)? Justify your answer. As part of your answer, show the ±IRST and ±OLLOW sets for each nonterminal symbol. 3. Consider the grammar A ::= x C  z B ::= y A C ::= B x  A y B where { A,B,C } is the set of nonterminal symbols, A is the start symbol, and { x,y,z } is the set of terminal symbols. The grammar is LL(1). Sketch Java code in reasonable detail for a recursivedescent parser based on the grammar. 1...
View
Full
Document
This note was uploaded on 03/14/2008 for the course CS 118 taught by Professor Chu during the Fall '08 term at UCLA.
 Fall '08
 CHU

Click to edit the document details