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

Discussion

Computing the offset of each field within a record requires

  • A.the offsets to be supplied by the programmer in the source
  • B.an inherited attribute carrying the running total so far
  • C.a synthesised attribute computed after all fields are seen
  • D.two separate passes over the field list of the record

Answer: B

Correct answer: an inherited attribute carrying the running total so far

Each field is placed at the current total and advances it, so the offset must be passed along the list from left to right. That is an inherited attribute, and it makes the record layout definition L-attributed - one of the standard illustrations of why inherited attributes are needed at all.

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

Post your comment

Please log in or register to post a comment.