Consider the following CFG S→aSbS | bSaS | ϵ Select the wrong option
Consider the following CFG S→aSbS | bSaS | ϵ Select the wrong option
Answer: D. The grammar can be parsed by CLR(1) parser — The grammar is ambiguous, as it has two parse tree for string “abab”, So it cannot be parsed by CLR(1) and LL(1) parser
- A.
The grammar cannot be parsed by LL(1) parser
- B.
The grammar is ambiguous
- C.
The grammar generate DCFL
- D.
The grammar can be parsed by CLR(1) parser
Attempted by 91 students.
Show answer & explanation
Correct answer: D
The grammar is ambiguous, as it has two parse tree for string “abab”, So it cannot be parsed by CLR(1) and LL(1) parser

Loading lesson…