For the heap implementation, are we allowed to use malloc or
other system calls?
The intention is that you should experience managing a heap area
yourself. Thus, you must allocate a large amount of memory at start-up
and then handle memory allocation explicitly in your compiler.
This means, as a starting point, that a user program can run out of
memory. You could have a check for this and terminate
in a controlled fashion if it happens.
You can allocate the large amount of memory using the technique
demonstrated in
the example GNU assembler program on global variables.
You are also allowed to make one (1) call to malloc to allocate
this large amount of memory once and for all.
Thus, calls to malloc or other systems call in connection with
every memory allocation for records and arrays is not acceptable.
More than one call to malloc can be acceptable if it is carried out
within the spirit of the above. For instance, you may allocate
a large amount of memory with malloc at start-up and whenever
you run out of memory, allocate an additional large amount of
memory using malloc again.
The important issue is that you demonstrate that you can manage
a heap yourself.
In the report template, what do you mean by "resources"?
"Resources" appears in the phase diagram that I've used because in some
situations for compilers in general, this can be an
important phase. Resources include the amount of space
you need or anything else which might be limited. For
multi-process programs, it could include the number of
processers required. For jobs released to a Grid-system,
it could be the number of machines of a certain
architecure requested to carry out a given job.
In the case of our programming language, space is the only
really interesting resource, and one would naturally assume
that there is enough. It is fine to omit that section
from the report.