Skip to content

Second revision of my Kitteh language. Now comes with a compiler to x86.

Notifications You must be signed in to change notification settings

leijurv/Kitteh2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kitteh2

Second revision of my Kitteh language. Now comes with a compiler to x86.

Example programs (used to test the compiler)

Explanation of how the compiler works (1400 words + diagrams)

Build Status Codacy Badge codebeat badge

Build

Kitteh2 is written in Java 8 and uses ant as a build system. The repo itself is also set up as a NetBeans project. Building the compiler:

ant jar

Compiling a program:

java -jar dist/Kitteh2.jar -i test/tests/fizzbuzz.k -o output.s
gcc -o executable output.s
./executable

The first and second steps can optionally be combined:

java -jar dist/Kitteh2.jar -i test/tests/mandelbrot.k -o executable -e
./executable

Options

-v enable verbose mode. compiler will print a lot more information and outputted assembly will include helpful comments

-i inputFile.k set the input location

-o output set the output location

-I read input program from standard in

-O write output to standard out. not recommended except for debugging

-d enable deterministic builds. when this option is enabled, the compiler will produce consistent output when ran repeatedly on the same input

-e generate an executable file instead of the assembly as a string. this options simply runs gcc under the hood

-obf obfuscate labels and function names in output. compatible with -d