1,359 views
0 votes
0 votes
Consider the statements: (i) Every regular grammar is LL(1) (ii) Every LL(1) grammar is LALR(1) (iii) All LR(0) grammars are LL(k) (iv) A context-free grammar without left factoring and left recursion can be ambiguous Which of the above statement/s is/are TRUE?
(i) only
(i) and (iii) only
(ii) and (iv) only
(iv) only

2 Answers

0 votes
0 votes
(i) Every regular grammar is LL(1)

- No, because regular grammar can be ambiguous/ left recursive/left factored.

(ii) Every LL(1) grammar is LALR(1)

- No, It's opposite.

(iii) All LR(0) grammars are LL(k)

- No, both are different types of parser. LR(0) just need to be unambiguous but LL(1) needs to be unambiguous + Not left recursive + not left factored.

(iv) A context-free grammar without left factoring and left recursion can be ambiguous

- True.

Related questions

1 votes
1 votes
0 answers
1
junaid ahmad asked Dec 20, 2018
627 views
An $\epsilon$ free LL(1) grammar is also a SLR(1) and hence LALR(1) and LR(1) too.Is this statement true ?
0 votes
0 votes
1 answer
2
0 votes
0 votes
3 answers
3
Dheeraj Pant asked Nov 8, 2018
844 views
S->Aa | Bc A->a B->a1. Is the above grammer left factored ?? If not ,then do left factoring on it ??2. Is above grammer deterministic ?? 3. Is every left factored...
0 votes
0 votes
1 answer
4
Pavan Karthik asked Oct 28, 2018
448 views
#CDcompute first and follow forS->SS+\SS*\a