Machine-translated by Google. Questions are authored in English.
Top

Discussion

The right side of a chosen production is pushed onto the stack in reverse order because

  • A.reversing removes the need to compute the FOLLOW sets at all
  • B.the parser processes the input from right to left
  • C.the leftmost symbol must end up on top to be processed first
  • D.the stack grows downward in memory on most machines

Answer: C

A stack yields symbols in the reverse of the order they were pushed. Pushing the right side backwards therefore presents its symbols left to right, matching the input order. Getting the direction wrong is a classic bug when the driver is written by hand.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.