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

Discussion

The attribute value carried with an identifier token is usually

  • A.the numerical value that the identifier currently holds
  • B.the line number on which the identifier was first declared
  • C.the machine address at which the variable will be stored
  • D.a pointer to the symbol table entry for that identifier

Answer: D

Correct answer: a pointer to the symbol table entry for that identifier

The token itself carries only the category id, which is all the parser needs, and the attribute carries a pointer to the symbol table entry where the name, type, scope and everything else about the identifier is recorded. Storing the value or the address in the token would be impossible at this stage, since neither has yet been determined.

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

Post your comment

Please log in or register to post a comment.