FAQ

This page will be updated throughout the project period when relevant.

Note that questions related to the exam can be found on a separate page via the exam page, or via this direct link.

I get a type error due to the declaration of malloc in symbol.h
Just delete the declaration. In general, you are free to modify almost anything and do things your own way — the primary exception being the core programming language that you'll write a compiler for.

I noticed the -m32 option, but I have a 64 bit OS — is that a problem?
The whole thing is a little complicated. I've updated the requirements in part 2 of the project description, so check the formal requirements again.

I just want things to work as smoothly for you as possible. However, here are the complications: The assembler you learned in the architecture course was targeted at 32 bit. I would prefer that you don't get the extra complication of having to relearn some of that stuff — not that it's all that hard, but you have enough else to do right now. I would also like you to be able to use your own computers, instead of having to be stuck with only being able to use the terminal room, and if you're currently running a 32 bit OS, then you cannot handle the assembler targeted at 64 bit. Thus, I think we should run 32 bit this year.

The problem with that is that the termimal room has now been upgraded to 64 bit, and many of you probably also run 64 bit. However, there is backwards compatibility, so it is possible to run 32 bit assembler under a 64 bit OS.

Here's my solution: Your compiler itself should be architecture neutral, i.e., you should not use any -m32 or -m64 options when you compile your compiler. In this way, even if your working on a 32 bit machine, when you transfer to IMADA, you can still compile, even though we're running 64 bit. Your assembler code should be compiled using the -m32 option. This will work immediately for those of you running 32 bit, and I've arranged that it also works on IMADA's terminal room machines. Those of you running 64 bit may need to install gcc-multilib for this to work.

Can we have the LaTeX source for the official front page so we can insert the group information electronically?
Sure!

Bison indicates a default case, but it is not using it!
When considering the .output file, which Bison can generate for debugging purposes, some states end with a default statement. However, this should be read as an "otherwise" in a case statement, where the other cases consist of the listed next symbols on input. For a concrete next symbol on input, the action which is taken is the one not enclosed in square brackets.

Can we have the LaTeX source code for the grammar?
Sure!

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. It is 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 accepted. More than one call to malloc can be accepted 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.

How do we translate the words below, if we write our report in Danish?
["Words below" removed.] I'll answer this question in Danish! ツ I have worked the words into a separate page.

Last modified: Mon May 18 08:59:38 CEST 2015
Kim Skak Larsen (kslarsen@imada.sdu.dk)