This repository contains a compiler for the Latte programming language. The compiler performs strict type checking and generates LLVM IR code as output.
- Strict type checking Support for:
- Functions
- Local variables and shadowing
- Heap allocated arrays and strings
- Simple reference counting
The compiler generated LLVM IR code. All helper LLVM functions are defined manually in lib/functions.ll.
You can run the compiler using either cabal or make:
cabal run file.lator
make && ./latc file.latThe compiler outputs:
- file.ll: LLVM IR code
- file.bc: binary LLVM bitcode generated via llvm-as
The bnfc/ folder contains files generated by BNFC (Backus–Naur Form Converter). The compiler is written in Haskell and uses the following libraries:
- mtl
- array
- containers
- process
- filepath