C to Assembly - Compiler and Interpreter
C to Assembly is an online compiler of micro-C code (a subset of C large enough for demonstration) and interpreter of hypothetical Assembly (micro-C is compiled to hypothetical Assembly which looks a lot like x86 asm).
See docs here:
src/main/java/com/ctoassembly/compiler- Java compiler (micro-C to hypothetical-asm)
- Yeah, yeah, yeah, I am not joking - Java is compiling c to asm.
mycc.lex- scanner written in Backus-Naur form.
mycc.cup- LR parser that defines the grammar. All the code generation is executed from here (when a rule is matched), so it's a good starting point for reading code.
ccode.html- compiling happens here.
js/angular/controller.js- angular controller backing up the ccode.html. It calls the servlet holding the compiler, presents the asm code and interprets (executes) it line by line.
js/asmmetamodel.js- all asm instructions and their execution strategy is encapsulated here
js/ui.js- ui support (drawing and such)
js/constants.js- CPU constants
js/util.js- util support for everything above
- Enlarge the subset of C that the compiler can compile
- Fix bugs
Free Software, Hell Yeah!