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

Discussion

The lookahead in a recursive descent parser is normally held in

  • A.the symbol table entry for the enclosing procedure
  • B.a single variable holding the current token from the scanner
  • C.an array containing every token of the whole input
  • D.the call stack alongside the procedure activation records

Answer: B

One variable suffices for LL(1). Advancing it means calling the scanner for the next token, which is why the two phases are so tightly coupled in this design. Extra lookahead would require buffering tokens the scanner has already produced.

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

Post your comment

Please log in or register to post a comment.