##### Consider the following two statements: P: Ever...

Consider the following two statements:

P: Every regular grammar is LL(1)
Q: Every regular set has a LR(1) grammar

Which of the following is TRUE?

(A) Both P and Q are true

(B) P is true and Q is false

(C) P is false and Q is true

(D) Both P and Q are false

##### 1Comment
Aditya Jain 5 Nov 2018 10:13 am
P is false as Left recursive grammars are NOT LL(1) grammars and Regular grammars can be Left recursive, so NOT every Regular grammar is LL(1).

Now Left recursive grammars are accepted by LR(1) parsers and Regular set is a set of Regular languages, so every regular set will contain LR(1) grammars.