in Compiler Design retagged by
1,355 views
2 votes
2 votes

someone please explain how to draw operator precedence table to solve this question.

in Compiler Design retagged by
by
1.4k views

1 comment

Thanks for posting this question!
0
0

1 Answer

2 votes
2 votes
Best answer

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

4 Comments

yes your solution is correct
0
0
Please check about precedence, I think a,b,c having same precedence as they are at same level.
0
0
@sunil visit the link which i posted above, then you can understand why c has higher precedence than a and b, and why a is right associative.
0
0
Answer:

Related questions

0 votes
0 votes
3 answers
2