in Compiler Design retagged by
3,986 views
0 votes
0 votes
consider the grammar G:   S->A|B        A->a|c      B->b|c where {S,A,B} are non-terminals,{a,b,c} are terminals.

Does LR(1) can parse all strings that are generated by grammar G.?

Please any one help me to how to check it?
in Compiler Design retagged by
by
4.0k views

3 Comments

Only way is " Constructing the LR(1) items ", if there is no conflicts, then it is OK

Note that, it should be unambiguous grammar first !
0
0
@ shaik Masthan, I am new to this.will you please explain this example  in detail.
0
0
if you don't know about Bottom-Up parsers, just left it !
0
0

1 Answer

0 votes
0 votes
The above given grammar is not LL(1) so it is not LR(1) as well. You can first check it for ll(1).

1 comment

What do you mean? Can you cite some proof that LL(1) grammar is a superset of LR(1)?
0
0

Related questions