retagged by
1,378 views

1 Answer

Best answer
2 votes
2 votes

strings in the language generated by this grammar: adcb, aadcbb, aaadcbbb, ... so on

It's an unambiguous grammar. So this grammar decides its own rule.

Rules: 
1. a=b, a and b have the same precedence. 
2. a is right associative hence, hence a<a 
3. d is highest precedence terminal hence d>c, d>b, d>a 
4. c has higher precedence than a and b, so c>a, c>b

(D) is incorrect precedence relation!

To understand more on operator precedence parsing:
https://www.tutorialspoint.com/compiler_design/operator_precedence_parsing.asp

edited by
Answer:

Related questions

0 votes
0 votes
3 answers
2
0 votes
0 votes
1 answer
3
saumya mishra asked Jun 15, 2018
2,198 views
What is the difference between operator grammar and operator precedence grammar?
0 votes
0 votes
1 answer
4
jatin khachane 1 asked Jun 7, 2017
497 views
E → E + E | E * E | ( E ) | idWhat will be operator precedence for above grammar.Is precedence differs due to ambiguity