0 votes 0 votes Does All LR parser {LR(0) , SLR , LALR , CLR } can accepts Left recursive and non deterministic language? by non deterministic I mean , gammer has production like A -> aB | aC | aD hence when we come across a , we don't know which production to use. mehul vaidya asked Sep 23, 2018 mehul vaidya 775 views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Shubhgupta commented Sep 23, 2018 reply Follow Share ambiguous grammar can't be parsed by above parsers. 0 votes 0 votes mehul vaidya commented Sep 24, 2018 reply Follow Share yes above parser cannot accepts ambiguous gammer but even if grammar is unambiguous , it can still be left recursive and non deterministic , https://gateoverflow.in/875/gate2002-22 alternatively even if we remove left recursion and non determinism , it can still be ambiguous. also there are some grammar which are unambiguous, deterministic and should not be left recursive. still no LR parser exist for them https://gateoverflow.in/906/gate2003-16 so my question is can all LR parser mentioned above accepts Left recursive as well as non deterministic language. I have this ref https://stackoverflow.com/questions/21461974/left-recursion-in-lr1-parsers Can some one give information in tabular from with rows indicating parser name and column Left recursive and non deterministic 0 votes 0 votes aambazinga commented Sep 24, 2018 i edited by aambazinga Sep 24, 2018 reply Follow Share it depends on the production. left factoring has nothing to do with the LR parsers... it has concern with LL parsers. so here, suppose your production are B->b,C->c,D->d then each of the above mentioned parser will parse. if we add one more production, say D->b, then none will be able to parse(not at least up to SLR). So, the point is, non-determinism has nothing to do with the parsers, because non-determinism has nothing to do with ambiguity. and parsers can't parse ambiguous grammars and it may or may not parse unambiguous grammars. also, we can remove non-determinism by left factoring the grammar... but even that won't guarantee that the grammar would be unambiguous. 1 votes 1 votes Please log in or register to add a comment.