480 views
0 votes
0 votes

Extend the handling of field names in Fig. $6.18$ to classes and single-inheritance class hierarchies.

  1.  Give an implementation of class $Enu$ that allows linked symbol tables, so that a subclass can either redefine a field name or refer directly to a field name in a superclass.
  2. Give a translation scheme that allocates a contiguous data area for the fields in a class, including inherited fields. Inherited fields must maintain the relative addresses they were assigned in the layout for the superclass. 

 

Please log in or register to answer this question.

Related questions

0 votes
0 votes
0 answers
1
admin asked Sep 7, 2019
1,234 views
Determine the types and relative addresses for the identifiers in the following sequence of declarations:float x; record { float x; float y; } p; record { int tag; float ...
0 votes
0 votes
0 answers
2
admin asked Sep 7, 2019
695 views
Use the translation of Fig. $6.22$ to translate the following assignments: $x=a[i]+b[j]$$x=a[i][j]+b[i][j]$$x=a[b[i][j]][c[[k]]$
0 votes
0 votes
1 answer
3
admin asked Sep 7, 2019
1,688 views
Show how to transform a three-address code sequence into one in which each defined variable gets a unique variable name.