Qa - CD Unit-3
Qa - CD Unit-3
Inherited attribute:
For example:
1. Initially, the value of offset is set to zero. The computation of offset can be
done by using the formula offset = offset + width.
2. In the above translation scheme, T.type, T.width are the synthesized
attributes. The type indicates the data type of corresponding identifier and width
is used to indicate the memory units associated with an identifier of
corresponding type. For instance integer has width 4 and real has 8.
3. The rule D → id: T is a declarative statements for id declaration. The enter_tab
is a function used for creating the symbol table entry for identifier along with its
type and offset.
4. The width of array is obtained by multiplying the width of each element by
number of elements in the array.
5. The width of pointer types of supposed to be 4.