D.4 Problems for Chapter 7: Run-Time Environment

D.4.1 Storage Allocation

Problem 4.1.19   We have seen a few language constructs – like variable length strings, dynamic arrays, nested and recursive procedures, etc. – that cannot be handled by static storage allocation. What other constructs cannot be handled by static storage allocation?

Solution:

  1. Explicit storage request and release (similar to malloc() and free() in C) at run-time.
  2. Run-time output format specifications, for example, as available in PL/I.

Problem 4.1.20   It is suggested that the value of variables be kept in the symbol table during runtime (as it was done in the original BASIC language implementations). Discuss advantages and disadvantages of this scheme. Are there any implementation ...

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.