Question: cise 1 4 1 Start with the grammar G 6 , repeated here: G 6 : :: = + | :: = * | ::

cise 1 41 Start with the grammar G6, repeated here: G6: ::=+| ::=*| ::=()| a | b | c Modify it in the following ways: a. Add subtraction and division operators (-and /) with the customary prece-dence and associativity. b. Then add a left-associative operator % between + and * in precedence. c. Then add a right-associative operator = at lower precedence than any of the other operators. Exercise 2 Give an EBNF grammar for each of the languages of Exercise 1. Use the EBNF extensions wherever possible to simplify the grammars. Include what-ever notes to the reader are required to make the associativity of the operators clear.

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 Programming Questions!