There is one practical assignment in this cource.
Deadlines - kuolleet viivat - and returning the assignment
The are two possible deadlines:
- Till June 8th, grading till the end of June
- Till July 31th, grading till the end of August
July 31th is quite a final deadline. A few days may be given to finish the assignment, if it's already almost done.
The assignment fulfilling the requirements is returned by e-mail. Do as follows:
- Store all files needed to compile your compiler in a subdirectory. Include a makefile, which compiles you compiler, in that directory.
- Move one directory up and pack the directory using command like
tar -zcvf packagename.tgz directoryname/.
- Send the package as an attachment by e-mail before the deadline to jyrkinen@lut.fi.
I let you correct your compiler once, if needed. I will probably accept minor errors, though. If requirements are not fulfilled, you will definately get a boomerang :) Please test that you program can be compiled in Linux workstations in Pentinkulma (1339). I won't be pleased if I cannot even compile the code returned :)
No separate documentation isn't required. If you use some strange structures and solutions, comment them in the code, though. I may ask you to visit me, too, if needed.
Assignment
You job is to design and implement a simple C compiler using
flex and yacc. The project can be done in a group of two students.
A more precise project description is available
in Finnish and
in English.
All information needed to write the compiler should have been learnt in lectures and exercises or given in the project description. Remember especially the debugging tools mentioned in the exercises 8. I may have forgotten to mention something important, though, so don't hesitate to ask - maybe all the others are fighting with the same problem. At best I'm reachable in May and probably at worst in July in the summer - so I advice you to write the project as soon as you can, if you think you might need my advices. In the summer my working hours may be quite irregular, so at best you can reach me by e-mail (jyrkinen@lut.fi). We can then agree about a meeting, if needed.
Notifications
Any chances or solutions for problems will be added here.
- All kind of copying if forbidden. If you get caught, your project is automatically failed! Exercises can be naturally used when programming the compiler.
- Snprintf might be a better choice instead of the sprintf function, when making temporary variables and labels. Two years ago a few people seemed to have problems with sprintf. If so, you can contact me and let's see, what's the problem.
- 19.5 Ask if you are not sure! It is the teaching assistant, who decides the requirements, not you! Some students seem to think everything is acceptable what is not mentioned as forbidden. For example, coding together in a group of four students and returning two almost identical projects is regarded as copying (=both failed), if two separate similar projects are returned, although many people seem to think that's compelely OK! And if you return it together, you haven't followed the instructions. You are here to learn, not to copy or avoid work!
- 23.5 Definition of assembler part started
- 26.5 Hints for assembler available - I extended the first deadline
till June 8th, because I won't start checking the projects before that
anyway - trying to finish my master thesis instead
- 28.5 When using an own header file (f.ex. compiler.h), include it before the bison header file (compiler.tab.h) in the flex file (compiler.l) - otherwise you may get strange errors and warnings, like
warning: no semicolon at end of struct or union.
- 5.6 Changes in assembler: I've made two changes into the assembler instructions. Datatype
.byte is not 32-bit so let's forget the use of it if you haven't already implemented that. (Otherwise we would end into problems using movl ...) Example of the use of idiv mnemonic has been corrected.
- 15.7 Wrong use of %ebx register may cause segmentation fault when programs compiled by your compiler finishes. This may happen when compiling assembler with gcc in some systems. I won't consider that as such a bad mistake if that's the only one, but if you are interested in and want more information about that, read the information profived by Pekka Paalanen.
- 15.7 All practical assignments returned so far are checked and results sent. The rest of the month I'm mostly on a vocation so I can not provide to much help any more.
|