Home
  Contact
  Short Vita
  Research
  Teaching
  LSDIS Lab
  Links

Additional requirements for graduate students

In addition to implementing all of the features of Micro-C as described in class handouts, you will have to implement handling of the reference parameters and one-dimensional arrays.

  1. You must introduce the necessary modifications to the existing Micro-C grammar in order to incorporate declarations of reference parameters and array variables (you will have to recognize [, and ]). Arrays may use only int or float as the base type. You do not have to handle variables of pointer type.
  2. You will have to introduce changes to the fragment of the Micro-C grammar dealing with expressions to allow the access of array elements and calculating addresses (the address-of operator &).

Remember that arrays in C are passed by reference. It should be possible to supply an array actual parameter in place of a suitable reference formal parameter. When declaring an array as a parameter you must leave out its size in function declaration or definition, i.e. use only [].

As an illustration, please examine the the following two examples: factorial (with reference parameters) and sorting (with arrays).