O'Reilly logo

Compilers: Principles and Practice by Himanshu B. Dave, Parag H. Dave

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9.3 Data Structures

We now discuss how data structures, especially vectors, arrays and records or constructs like struct in C are handled by the code generator. Two aspects of these code constructs are to be considered – the layout of the structure in the memory and run-time access code generation.

9.3.1 Vectors and Arrays

These structures are characterized by having elements of exactly the same size and type, arranged in a linear sequence of consecutive memory addresses. That makes the code generation relatively simple. The elements in the vector or array could be of primitive data types like char, int, float, double, a pointer or it can be a user-defined data type, which may have any arbitrary size.

9.3.2 Vectors

A vector V of elements e of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required