MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Inherited attribute is a natural choice in
A
Tracking declaration of a variable
B
Correct use of L and R values
C
All the above
D
None of these
Explanation: 

Detailed explanation-1: -An inherited attribute is one that is inherited from a parent product class. You customize an inherited attribute domain by editing its definition at the subclass level. When you edit an inherited attribute definition, the changes propagate to all members of the subclass, including other subclasses under that subclass.

Detailed explanation-2: -An attribute is said to be Inherited attribute if its parse tree node value is determined by the attribute value at parent and/or siblings node. 2. The production must have non-terminal as its head. The production must have non-terminal as a symbol in its body.

Detailed explanation-3: -Inherited attributes – An attribute of a nonterminal on the right-hand side of a production is called an inherited attribute. The attribute can take value either from its parent or from its siblings (variables in the LHS or RHS of the production).

Detailed explanation-4: -Likewise, C can take values from S, A, and B then S is said to be Inherited Attribute. 2. Design. As mentioned above in case of Synthesized attribute the production must have non-terminal as its head. On other hand in case of Inherited attribute the production must have non-terminal as a symbol in its body.

There is 1 question to complete.