3 votes 3 votes Grammar S $\rightarrow$ S1 S1 $\rightarrow$ S1 = S1 | a Where = is the assignment operator in C LALR(1) Machine cannot be constructed with this grammer inadequate states can be resolved using the fact that the = is left associative inadequate states can be resolved using the fact that the = is right associative Both 2 and 3 Compiler Design parsing compiler-design + – pC asked Nov 20, 2015 pC 622 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply radha gogia commented Dec 5, 2015 reply Follow Share I guess the grammar is ambiguous and therefore it cannot be parsed by any parser so answer should be option A , Am I correct ? 0 votes 0 votes LeenSharma commented Apr 22, 2017 reply Follow Share Given grammar is ambiguous so it can't parse by any parser.I think answer should be a. 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes Option 4 You will have to remove ambiguity first. Then it will be possible by taking a convention for = , either left or right associative. Check out here : http://www.univ-orleans.fr/lifo/Members/Mirian.Halfeld/Cours/TLComp/res2-CG.pdf Mojo-Jojo answered Nov 21, 2015 Mojo-Jojo comment Share Follow See 1 comment See all 1 1 comment reply Vishal Goyal commented May 22, 2017 reply Follow Share i think u r explanation is not soo clear can u explain in detail 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes GIVEN GRAMMAR IS OPERATOR PRECEDENCE GRAMMAR,SO WE CAN CONSTRUCT THE PARSING TABLE,EVEN THOUGH IT IS AMBIGUOUS Santhosh Devulapally answered Dec 20, 2015 Santhosh Devulapally comment Share Follow See 1 comment See all 1 1 comment reply Vishal Goyal commented May 22, 2017 reply Follow Share bro but also this is also true na that lalrr parse cannot be constructed as it is ambigious 0 votes 0 votes Please log in or register to add a comment.