Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 574 Bytes

README.md

File metadata and controls

23 lines (19 loc) · 574 Bytes

Compilation Example

Compiles to JVM bytecode, using the ASM bytecode manipulation library.

If you're interested in seeing a bigger language which compiles to MIPS assembly, see this example (and its branches).

Grammar

x is a variable
i is an integer
b is a boolean
t is a type
e is an expression
op is a binary operator
s is a statement
p is a program
t ::= int | bool
e ::= x | i | b | e1 op e2
op ::= + | - | / | *
s ::= t x = e; | x = e; | print(x);
p ::= s*