Consider the following two statements: P: Every regular grammar is LL(1) Q: Every regular set has LR(1) grammar Which of the following

Consider the following two statements:
P: Every regular grammar is LL(1)
Q: Every regular set has 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
 
Answer: a
Explanation: LL(1) parsers can recognize the regular grammars also LL(1) is subset of LR(1) or CLR grammar so it also recognizes regular sets. So both accept regular grammar.
 

Tìm kiếm

Back
Top