[ez a lap magyarul]

Olvashato compiler

This compiler translates an ad-hoc language to both prolog and standard ml languages.

I wrote the compiler in 2006 automn, when I took declarative programming. The big homework of this course consisted of writing a program in both prolog and sml. Both programs I handed in was generated with this compiler. You can download my homework solution and the sources from here.

I made up the olvashato language in such a way that it can easily be translated to both prolog and sml. Thus, the language is side-effectless, statically typed, and strict.

The compiler is written in ruby. Run it with the command ruby compile.rb foo.olv which will overwrite the outputs foo.pl and foo.sml.

Files to download

bkg.html: more information about the compiler (in hugarian)
compile.rb: the compiler
compile.rb: changed version of the compiler after the submission deadline
aknakereso.olv: the source for the big homework
aknakereso.pl: the prolog big homework
aknakereso.sml: the sml big homework
binoms.olv: the source for a small homework
binoms.pl
t1.olv: a simple test program
t1.pl
t1.sml
t2.olv: a test program for higher order functions
t2.pl
t2.sml
t2n.olv: even more higher level functions
t2n.pl
t2n.sml


Zsbán Ambrus, 2006. december 23.

Any comments and questions to ambrus@@mmaatthh..bbmmee..hhuu please.