Phase 5: Declarations and Integer Sizes

In this phase you will add grammar rules to recognize C declarations involving different sizes of integers, both signed and unsigned. In particular, you need to recognize declarations involving the following types: char, short (int), and int. A char is 1 byte, a short is 2 bytes, and an int is 4 bytes. You should also introduce rules that allow you to recognize type casts involving the integer types.

In addition to adding a few new grammar rules, this phase involves propogating the types of expressions and introducing implicit type conversions (for assignments).

You do not need to deal with long integers.


Barney Maccabe
Last modified: Mon Sep 1 21:56:06 MDT 1997