Gate2020 cs Q28

0. Consider the following grammar.
S → aSB | d
B → b
The number of reduction steps taken by a bottom-up parser while accepting string aaadbbb is ______ .

  • Option : B
  • Explanation :
    S → aSB
    → aaSBB [S → aSB]
    → aaaSBBB [S → aSB]
    → aaadBBB [S → d]
    → aaadbBB [B → b]
    → aaadbbB [B → b]
    → aaadbbb [B → b]
    Total 7 steps require
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 *