Question: ( 3 0 pt ) Consider Boolean expressions containing operands ( id ) , operators ( and , or ) , and parentheses, where and

(30pt) Consider Boolean expressions containing operands (id), operators (and, or), and parentheses,
where and has higher precedence than or.
(a)(10pt) Write an SLR(1) grammar, G, which is not LL(1), for such expressions, which obeys the
precedences indicated.
(b)(5pt) Compute the First(x) and Follow(x) sets for all nonterminals x and PREdiCt(i) sets for
all productions i.
(c)(5pt) Prove that G is not LL(1).
(d)(10pt) Prove that G is SLR(1) by drawing the SLR graph and show there are no conflicts. Build the
graph as shown in the examples we did in class (and done by jflap), not the condensed form in the
textbook. For each state with potential conflicts (two LR-items, one with the dot in the middle, one
with the dot at the end), explain clearly why there is no shift/reduce conflict.
 (30pt) Consider Boolean expressions containing operands (id), operators (and, or), and

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!