edited by
19,883 views

3 Answers

Best answer
79 votes
79 votes

ans is A

$First(S)=First(C)=\{c,d\}$

There are no multiple entries in single row of parsing table hence grammar is LL1

Note : If we have $A \rightarrow B\mid C,$ for grammar to be LL(1) first(B) intersection First(C) should be null otherwise grammar is not LL1. If First(B) contains $\epsilon$ then Follow(A) intersection First(C) should be null. Using this we can say grammar is LL(1) or not without constructing parsing table.

An $\epsilon$ free LL(1) grammar is also SLR(1) and hence LALR(1) and LR(1) too.

edited by
4 votes
4 votes

Answer is A 

3 votes
3 votes

Ambiguous?

I think nope.

 

Left Recursive?

No.

 

Non-deterministic?

No.

 

For any $A\rightarrow \alpha \beta$ do the Firsts of $\alpha$ and  $\beta$ clash?

No.

 

So, this is LL(1).

 

Does it have $\epsilon$?

No.

Hence, this is SLR(1) and everything above it.

 

Option A

Answer:

Related questions

26 votes
26 votes
4 answers
3
67 votes
67 votes
10 answers
4
Kathleen asked Sep 16, 2014
26,978 views
Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar?Removing left recursion aloneFactoring the grammar aloneRemoving left recursion and factor...