Question: 1) Using the grammar in Example 3.4 show a parse tree and a leftmost derivation for each of the following statements (make sure that you

1) Using the grammar in Example 3.4 show a parse tree and a leftmost derivation for each of the following statements (make sure that you do not omit parentheses in your derivations): A = A * B * (C + (A *B))

Grammar = A | B | C + | * | () |

2.) Consider the following grammar (S is the start symbol; 0 and 1 are terminal symbols; A and B are nonterminals): S 0A | 1B A 1B | 1 B 0A | 0

Which of the following sentences are in the language generated by the grammar? Show derivations. If a sentence cannot be generated by the grammar, explain why. a) 011001 b) 010101 c) 100110 d) 101010

3) For the following grammar and the right sentential form E+ (F + id), draw a parse tree and show all phrases and simple phrases. Find the handle (E, T, and F are nonterminal symbols; id is a terminal symbol). Explain. E E + T | T T T * F | F F (E) | id

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!