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

Discussion

A symbol table implemented as a stack of scopes supports block exit by

  • A.marking each entry as invalid without removing any
  • B.rehashing the whole of the table into a smaller bucket array
  • C.copying the surviving entries into a fresh table
  • D.popping every entry installed since the block was entered

Answer: D

A marker pushed at block entry records where to stop popping. The operation is cheap, which matters because deeply nested code enters and leaves scopes constantly. A loop body inside a procedure inside a module may open three scopes at once.

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

Post your comment

Please log in or register to post a comment.