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

Discussion

Consider the following statements about attribute classes.
1. Every S-attributed definition is also L-attributed.
2. Every L-attributed definition is also S-attributed.
3. L-attributed definitions can be evaluated in one depth first pass.

  • A.1 and 3 only
  • B.2 only
  • C.1 only
  • D.All of them

Answer: A

Correct answer: 1 and 3 only

Statements 1 and 3 are correct: an S-attributed definition has no inherited attributes at all, so it satisfies the L-attributed condition vacuously, and L-attributed definitions evaluate in one depth-first pass. Statement 2 reverses the containment - an L-attributed definition may use inherited attributes, which an S-attributed one by definition does not.

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

Post your comment

Please log in or register to post a comment.