At a Glance
- An archive of the project (current as of 04/May/2008)
- A sporadically updated changefile of project updates
- What is LOLCODE? What is the 6502 CPU?
- Read all about the project and the resources used
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)
PowerPoint Presentations
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
- IR Tree: LNode.java
- Required Libraries: JLex | java_cup
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
- LOLCODE:
- 6502:
Examples written in LOLCODE, and the resulting output in 6502 assembly. Fun times abound.





