Consider the following program skeleton and below figure which shows…

PYQ GATE 1988

Consider the following program skeleton and below figure which shows activation records of procedures involved in the calling sequence p → s → q → r → q. Write the access links of the activation records to enable correct access and variables in the procedures from other procedures involved in the calling sequence

Five activation records in dynamic order p, s, q, r, q, each with an empty access-link slot to be filled; lexical program skeleton nests q and s directly in p and r directly in q.
procedure p;
  procedure q;
    procedure r;
      begin q end r;
    begin r end q;
  procedure s;
    begin q end s;
  begin s end p;

Sign up free to check your answer

Sign up free

Explore the full course: Compiler Design

Loading lesson…