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

Discussion

In a recursive descent parser, the parsing stack is

  • A.an explicit array of grammar symbols maintained by the parser
  • B.the token buffer from which the scanner supplies lookahead
  • C.the symbol table entries for the identifiers seen so far
  • D.the call stack of the host programming language

Answer: D

Correct answer: the call stack of the host programming language

There is no explicit stack of grammar symbols: the recursion of the procedures does the work, and the partly expanded grammar symbols are held in the sequence of active calls. This is what makes the method so compact, and it is also its limitation - a deeply nested input can exhaust the call stack.

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

Post your comment

Please log in or register to post a comment.