Assignment title: Information


1. For each of the following grammars, devise predictive parsers and show the parsing tables. You may left-factor and/of eliminate left-recursion from your grammars first. a) S 051101 with string 000111. b) S +55|*SS/a with string +*aaa. c) S S (S) S\e with string (()()). d) S -> S + S\S S\(S)\S *\a with string (a+a)*a. e) S-> (L)/a and L-> L , 5|5 with string ((a,a),a,(a)). f) S -> a565|& 5 a5|e with string aabbab. 2. Compute FIRST and FOLLOW for the grammar of Exercise below : Consider the context-free grammar: S-> SS+\SS*\a and the string aa+a* a) Give a leftmost derivation for the string. b) Give a rightmost derivation for the string. c) Give a parse tree for the string. d) Is the grammar ambiguous or unamigous? justify your answer. e) Describe the language generated by this grammar. 3. Show the right most derivation for boht sentential forms and underline the handles in each form. For the grammar S->0S1101 indicate the handle in each of the following right-sentential forms: a) 000111 b) 00S11

>