At a Glance
- An archive of the project (current as of 04/May/2008)
- A sporadically updated changefile of project updates
Notes and Documentation
- A draft copy of my LOLCODE grammar
- Instructions on how to compile and use LOL6502
- Discussion of various concepts used (mostly rambling)
Slides used for milestone presentations in class. Details the progress of my project, and explains most of the concepts I've used. Worth a look.
Prologue: Common Components
These files are required across both components of the project. LNode encapsulates all the information for a given node in the IR tree. JLex and java_cup are both required libraries in order to compile the .lex and .cup files respectively.
Stage I: Symbols and Grammar
- JLex Scanner: LOLCODE.lex | LScanner.java
- java_cup Parser: LOLCODE.cup | LParser.java | LSymbols.java
The first component is the scanning and parsing of a given input file. LOLCODE.lex is the specification file for JLex to produce the scanner, and LOLCODE.cup is the specs for java_cup to produce the parser.
Stage II: Compiler and Optimizations
- LOLCODE Compiler: LTools.java | LTable | LStackCompiler.java | LStackTable.java
- 6502 Simulator: stdlib.65s
The second component is the actual compilation from the IR tree, into 6502 assembly. LStackCompiler spits out a mixture of SM and actual assembly (making use of the LStackTable and LTable).
When running the output in a simulator, stdlib.65s is required to ensure the SM instructions are properly executed.
Epilogue: Example and Output
Examples written in LOLCODE, and the resulting output in 6502 assembly. Fun times abound.
on iPhone, iPad, AppleTV, PC. It's free.