edited by
2,041 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

682
views
2 answers
0 votes
atul_21 asked Nov 28, 2017
682 views
I think that the given grammar is LL(1) . please explain me if I'm wrong.
754
views
1 answers
0 votes
Aibi asked Sep 22, 2017
754 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
338
views
1 answers
1 votes
thor asked Nov 17, 2016
338 views
729
views
1 answers
0 votes