Concept:
Syntax Directed Translation involves attaching rules to grammar productions to compute values (attributes) for nodes in a parse tree.
• Synthesized Attributes: Values are computed from the attributes of the node's children. These flow "up" the tree.
• Inherited Attributes: Values are computed from the attributes of the node's parent and/or its siblings. These flow "down" or "across" the tree.
Step 1: Defining the flow of information.
Attributes allow the compiler to pass information during the parsing process.
Inherited attributes are useful for passing context-dependent information.
Step 2: Identifying the source of Inherited values.
When a value comes from above, it is provided by the parent.
When a value comes from the same level, it is provided by a sibling.
This is typical for type checking and identifying variable declarations.
Step 3: Conclusion.
Because the definition excludes children and descendants.
Option (B) is the only choice that matches the "top-down" or "lateral" nature of inherited attributes.