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

Discussion

A parse of an input of 10 tokens completes successfully. How many shift actions does the parser perform?

  • A.10
  • B.9
  • C.11
  • D.20

Answer: A

Every token is shifted exactly once, so ten shifts occur. The number of reductions depends on the grammar and is unrelated to the token count in any simple way. A grammar full of unit productions performs many more reductions than shifts.

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

Post your comment

Please log in or register to post a comment.