0 votes 0 votes Let us say + and * are both left and right associative then how is expression evaluated in top down parse? E- E*E / E+E / num Does it follow left most derivation? Compiler Design compiler-design parsing ll-parser + – iarnav asked Nov 21, 2017 iarnav 474 views answer comment Share Follow See all 6 Comments See all 6 6 Comments reply Show 3 previous comments Rishabh Gupta 2 commented Nov 21, 2017 reply Follow Share @joshi It might be wrong to say that it can't be parsed with any parser. You can create a parser for it manually. When you create the parsing table, you might get multiple entries in some blocks, just make it a single entry by analysing which production should be used. This is called applying disambiguating rules. see example 4.33(pg 16) in this http://tinman.cs.gsu.edu/~raj/4340/sp12/notes/bottomup-Ullman.pdf Here if we chose S' -> eS, instead of S' -> epsilon we resolve the conflict. @iarnav If you can create such a parser, then YES, you will get left-most derivation, since top-down parser's working is such that it will always produce left-most derivation. 1 votes 1 votes joshi_nitish commented Nov 21, 2017 reply Follow Share @Rishabh yes, i saw it, but this in this you are modifying your parser to follow some additional rule, one more example is YACC tool in general, if i give you some ambigous grammer G, and ask you among {LL(1), LR(0), LALR(1), CLR(1)} which could be created for G??....your answer should be none of them. 1 votes 1 votes Rishabh Gupta 2 commented Nov 21, 2017 reply Follow Share Yes. the answer should be none of them. Since the grammar is none of these. 0 votes 0 votes Please log in or register to add a comment.