Question: please answer Q 6 and 7. Problem 2. Consider the grammar S-ABC A- A E B-a B b b C-Calb Assume that the conventions we
Problem 2. Consider the grammar S-ABC A- A E B-a B b b C-Calb Assume that the conventions we discussed in class for writing grammars are followed. 1. What is the start symbol? Explain briefly! 2. What are the non-terminals? Explain briefly! 3. What are the terminals? Explain briefly! 4. Give a parse tree for the input: a aa a aabbbbbbaa 5. In the parse tree of a a aa a abbbbbba a the root node is labeled S and its children are labeled A, B and C from left to right. Which parts of the input correspond to the children of Sin the parse tree? You answer should have the following format: The part of input that corresponds to A is... The part of input that corresponds to Bis... The part of input that corresponds to Cis... 6. What is the language of this grammar (remember that the language of a grammar is the set of strings that can be derived from the start symbol or equivalently, the set of strings that have parse trees according to the grammar). In your description of the language, you should try to be as precise but as brief as possible. 7. Is this grammar ambiguous? Explain! (hint: think of a rightmost derivation)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
