Home » Compiler Design » Compiler design miscellaneous » Question

Compiler design miscellaneous

  1. Which of the following grammar rules violate the requirement of an operator grammar? P, Q, R are non – terminals, and r, s, t are terminals.
    1. P → Q R
    2. P → Q S R
    3. P → ε
    4. P → Q t R r
    1. 1 only
    2. 1 and 3
    3. 2 and 3
    4. 3 and 4
Correct Option: B

1. P → QR is not possible since two NT should include one operator as Terminal.
2. Correct
3. Again incorrect.
4. Correct.
Hence (b) is correct option.



Your comments will be displayed only after manual approval.