GATE CS 2021 Set 1 | Question 15
Compiler Design › Parser · MCQ · 1 mark · Answer: C
- Question 15Compiler Designmcq1 markConsider the following statements. : Every SLR(1) grammar is unambiguous but there are certain unambiguous grammars that are not SLR(1). : For any context-free grammar, there is a parser that takes at most time to parse a string of length . Which one of the following options is correct?
- A.is true and is false
- B.is false and is true
- C.is true and is true✓
- D.is false and is false
Answer: C
Solution
Every SLR(1) grammar is unambiguous, and some unambiguous grammars are not SLR(1) — is true. The CYK algorithm parses any CFG in time — is true. - A.
More GATE PYQ on Parser
All GATE CS Compiler Design PYQ →Attempt GATE CS 2021 Set 1 in real GATE exam mode
Full paper with a timer, the GATE interface and a topic-wise analysis — free.
Create free account →