Thursday, October 18, 2007

Compiler construction

I am currently working on the compiler construction course with my greek partner, and its one of the baddest courses in my msc program. We basically have a reference compiler written in C, called asterix, and we are meant to make the compiler recognize record structures. The code generation part has to generate c-structs for the records. For the second assignment, we are meant to change the entire back end code generator from producing C code to assembly.
So far so good, things are alright, we were able to compile a simple record program, and our compiler was able to generate C structs, which was a relief.
Now we need to implement the dot (.) operator so that it is possible to do stuff like this:

record foo is
begin
a:int;
end

Now, our extended compiler should be able to handle statements like

f:foo /*record declaration */

f.a:=2.

But unfortunately, we still get a segmentation fault, which we might tackle tomorrow.
Well more news later, and Im still thesis hunting.

No comments: