Syntax Analysis34

0. What is the maximum number of reduces moves that can be taken by a bottom up parser for a grammar without epsilon and limit productions (i.e. of type A → ε and A → a) to parse a string with n tokens?

  • Option : B
  • Explanation :
    As per given question, a grammar with no epsilon and unit -production (i.e., of type A → ε and A → a).
    So To Reduce input string of n tokens, first Reduce n – 2 tokens using n – 2 reduce moves and then Reduce last 2 tokens using production which has. So total of n – 2 + 1 = n – 1 Reduce moves
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 *