Search for question
Question

Problem 3. Consider the grammar A->BCD|DCB B -> b B c | c B | b | & C-+cd|c D -+ d Dc | bC where A, B, C, and D are non-terminal, A is the start symbol and b, c and d are tokens. Remember that & represents the empty sequence. Y -> & means that Y does not have to match any tokens or, equivalently, it matches an empty sequence of tokens. 1. Give a parse tree for the sequence of tokens: bccbccbc 2. Give a another (different) parse tree for the sequence of tokens: bccbccbc 3. Is this grammar ambiguous?

Fig: 1