Question: for compiler design Compster Science epene CS 347 Compiler Design Assiznment 2 Due Date: October 28, 2018 Exercise 1 Consider the following grammar: cassign expr

 for compiler design Compster Science epene CS 347 Compiler Design Assiznment

for compiler design

Compster Science epene CS 347 Compiler Design Assiznment 2 Due Date: October 28, 2018 Exercise 1 Consider the following grammar: cassign expr l a) Show that this grammar is ambiguous. b) Do the necessary changes to make it unambiguous (you should consider that has more priority than -). Exercise 2 Consider the following BNF Grammar: A [B, A] | B B: CI(A; C) D::= a | b | c For each of the strings listed below, indicate all the non-terminals that can generate it a) [c, (b; a) c) IIla, b], c], a Exercise 3 Consider the following grammar: b) [(a; (b), [(a; c), fa ll S- Aa ABD a) Compute the First set for each right-hand side and the FOLLOW set for each non terminal of the grammar above. b) Construct the predictive parsing table for t c) Is this grammar LL(1)? Why or Why not? d Provide the LI(U narsing stens for the following expression: bdbdddaS. he grammar above

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!