5 LOCAL VARIABLES
Up to this point, you’ve been able to compile only programs that return constant expressions. In this chapter, you’ll implement local variables, which will let you compile far more interesting programs. Your compiler will need to support a more expressive grammar so it can parse C programs that declare, assign values to, and refer to variables. It will also need to contend with the ways that variables can be declared and used incorrectly. To catch these potential errors, you’ll add a semantic analysis stage, ...
Get Writing a C Compiler 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.