EXERCISES

  1. Give a layout of the Activation Record for the legacy C compiler function calling conventions discussed in Section 7.1.2. Compare it with the theoretical Activation Record layout. Is there a static links area in this AR? Why? Is it possible to access identifier in the outer block? If yes, how can that be arranged?
  2. Write a C program divided in two source files to demonstrate the effect of various scope and visibility rules of identifiers in C.
  3. Original BASIC language had only 26 variables named A to Z. How would have this limitation simplified the Symbol Table and Run-Time environment?
  4. A student wrote the following code to print values of elements of an array a:
    int a[100]; int main(){ int n; // compute the array a[] n = 0; while(n ...

Get Compilers: Principles and Practice now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.