...
Question 15125 – DSSSB TGT 2021
April 13, 2024
Question 8810 – Number-Systems
April 13, 2024
Question 15125 – DSSSB TGT 2021
April 13, 2024
Question 8810 – Number-Systems
April 13, 2024

Question 9277 – Compiler-Design

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?

Correct Answer: C

Question 62 Explanation: 
Every regular grammar is LL(1) is false, as the grammar may have left recursion or left factoring or also it is possible that grammar is ambiguous.
For ex: Consider a regular grammar
S -> aS | a | ϵ
this grammar is ambiguous as for string “a” two parse tree is possible.

Hence it is regular but not LL(1).

But every regular set has a language accept or as DFA , so every regular set must have atleast one grammar which is unambiguous.
Hence, every regular set has LR(1) grammar.

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
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!