edited by
1,840 views
8 votes
8 votes
Consider the following context-free grammar
S → SS + | SS*| a

It is

a)LL(1)

b)LR(0)

c)Both

d)none
edited by

2 Answers

Best answer
4 votes
4 votes
Its a LR(0) grammer so answer is B. No RR or SR conflicts.

Wrong answer was given in ace test series. This grammer is unambiguous because only one parse tree is possible for any string generated by it.

Having more than one expansion have nothing to do with ambiguity.
selected by
0 votes
0 votes
  • Given grammar is left recursive . And if a grammar is left recursive then it never be LL(1).

  • Given grammar is LR(0) HENCE SLR also . So option b is true .

Related questions

0 votes
0 votes
2 answers
1
atul_21 asked Nov 28, 2017
621 views
I think that the given grammar is LL(1) . please explain me if I'm wrong.
0 votes
0 votes
1 answer
2
Aibi asked Sep 22, 2017
715 views
S - AaA - AbA - cWhich of the following item is present in LR(1) item with S' - .S, $\$$ ?A) A - .Ab, $\$$B) A - .c, $\$$C) A - .Ab, a/bD) None
1 votes
1 votes
1 answer
3
thor asked Nov 17, 2016
316 views
0 votes
0 votes
1 answer
4