in Compiler Design retagged by
1,554 views
0 votes
0 votes

Why isn't it LL(1) ?

in Compiler Design retagged by
1.6k views

3 Comments

First of A= a $\cap$ a = not $\varnothing$ hence not LL(1)
0
0
What must be the condition for LL(1)?
0
0
Why is it LR(1)
0
0

3 Answers

3 votes
3 votes
Best answer

Given grammar is not LL(1) because for Non-terminal "A" contains two entries in LL(1) table .

  a b $
S S-->aAb    
A

A-->aAb

A--->a

   

Given grammar is  LR(1)  because there is no conflict while constructing DFA for LR(1).

selected by

2 Comments

edited by
Why is it LR(1) ? here LR(1) means SLR(1) or CLR(1) ?
0
0
LR(1) means CLR(1)
it uses canonical collection of LR(1) items
0
0
1 vote
1 vote

Not LL(1)

by
0 votes
0 votes
This grammar is not LL(1) coz we encounter a SR conflict while making canonical collection of LR(0) items.

but in case of LR(1) or CLR(1) we don't have any conflict so the correct option is c.
Answer:

Related questions

1 vote
1 vote
1 answer
2
thor asked in Compiler Design Nov 17, 2016
327 views
thor asked in Compiler Design Nov 17, 2016
by thor
327 views