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

Discussion

Predictive parsing selects the production to apply using

  • A.a record of which productions have already been tried
  • B.the contents of the symbol table for the current scope
  • C.the current lookahead token alone
  • D.the entire remaining input examined ahead of time

Answer: C

One token of lookahead determines the alternative uniquely, so no alternative is ever retried. This is what makes predictive parsing linear in the length of the input. Each token is examined once and each stack symbol is pushed and popped once.

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

Post your comment

Please log in or register to post a comment.