stevenleelfc / minijava-compiler Goto Github PK
View Code? Open in Web Editor NEWThis project forked from paulcc/minijava-compiler
tutorial compiler for a java subset, in Haskell
This project forked from paulcc/minijava-compiler
tutorial compiler for a java subset, in Haskell
Compiler - for a subset of Java, based on Appel "Modern Compiler Design in Java" Run with runhugs -98 Main.lhs BinaryTree.java or with hugs -98 Main.lhs compile "BinaryTree.java" IMPORTANT: the "-98" flag turns on a few extensions to Hugs - don't omit! Hugs is the Haskell interpreter, and is widely available in package repos. You can also use GHC but I've not tested it recently. NB assumes JS in the current directory, so copy as required etc This produces some files * BinaryTree.c - resulting C code!!! * BinaryTree.1-lex - lexer output * BinaryTree.2-tree - parsed tree, pretty printed (ie fixed layout) * BinaryTree.3-table - symbol table - info about variables and methods * BinaryTree.4-trans - first basic translation, unpacking the OO details * BinaryTree.5-lin - linearised nested form into simpler sequences * BinaryTree.6-traces - forming basic blocks and removing some inefficient jumps To compile the .c file, run this gcc rts.c BinaryTree.c This joins the raw C code with a simple run-time system in rts.[ch] - which basically just provides a stack for holding fn args and local vars. And run the executable (assuming Unix/Linux) with ./a.out
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.