Flex code:
This code identifies the tokens (see previous posts) in the LC-3 language
Bison code:
This code specifies and identifies statements, valid sequences of tokens
This code took code from a simple version of Assembly adapted for LC-3, a simplified model of a computer, and turned it into binary (0s and 1s). Here you can see my output versus the output of an online LC-3 compiler.
(^The result of 30+ hours of toil and tribulation)
Even with this (small) success, I've barely made progress on my overall project of making a compiler.
Referring to the above diagram, I have only researched and coded for the "Front End", and especially simple code at that. Starting the year, I knew this was an ambitious project, normally undertaken only by upperclassmen undergrad students. At my rate, it doesn't appear that I can finish a full compiler.
Instead, I will switch to a different (and tastier) topic in computer science that I have been interested in for a while:
COOKIES
(coming at you next time!)
Sources:
Blood
Sweat
Tears
http://dinosaur.compilertools.net/
No comments:
Post a Comment