Syntax Analysis39

0. Consider the following grammar G.
S → F | H
F → p | c
H → d | c
Where S, F and H are non-terminal symbols, p, d and c are terminal symbols. Which of the following statement(s) is/are correct?
S1: LL(1) can parse all strings that are generated using grammar G.
S2: LR(1) can parse all strings that are generated using grammar G.

  • Option : D
  • Explanation :
    The given grammar is ambiguous so neither LL(1) nor LR(1).
    First Leftmost Derivation
    S → F
    F → c
    Second Leftmost Derivation
    S → H
    H → c
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *