Attempt at creating a toy compiler
Ruby C
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
doc
examples
lib
samples
spec
.gitignore
README.md
Rakefile
compiler.rb
parser.l
parser.rb
runtime.c

README.md

This is my first attempt at a simple compiler following the Ruby compiler series: http://www.hokstad.com/tag/compiler%20in%20Ruby%20bottom%20up

The article however uses x86 assembler, when this is an attempt at generating x64 assembler. I know nothing of x64 assembler, and the code generated is deduced from gcc -S as indicated by the article series. This means that more than likely the code is either suboptimal, or plain incorrect.

The command used to compile is:

ruby compiler.rb > hello.s ; gcc -o hello hello.s

Some useful links: