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?

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? Correct Answer Both P and Q are true

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.

Related Questions

Consider the following grammar (that admits a series of declarations, followed by expressions) and the associated syntax directed translation (SDT) actions, given as pseudo-code: P → D* E* D → int ID {record that ID.lexeme is of type int} D → bool ID { record that ID.lexeme is of type bool} E → E1 + E2 {check that E1.type = E2.type = int; set E.type := int} E → !E1 {check that E1.type = bool; set E.type := bool} E → ID {set E.type := int} With respect to the above grammar; which one of the following choices is correct?