Skip to content

This is a sample project for exploring how compilers work. Here a LLVM frontend is built to learn about lexing, parsing and intermediate code generation.

Notifications You must be signed in to change notification settings

RK4444/RandlangCompiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Randlang Compiler

Why?

Compiler fascinate me, since I learned to program. Because of that, I wanted to build a compiler myself one day. When I learned about LLVM, I realised this was the perfect chance and I started according to this tutorial.

Basic Structure

The project is ordered approximately like any cpp project is, with a src and a include folder

Build System

CMake is used as a build system. Note that in order to use the LLVM libraries, I compiled them from source like seen here and here. Once LLVM is compiled from source, cmake can be used on the CmakeLists.txt file. From within root folder, best practice is:

mkdir build && cd build
cmake ..

Recommended Development environment

For development, I use vscode with the C++ and CMake extensions installed. If you don't have the clang compiler installed, you are free to use gcc aswell, although clang is recommended by llvm.

About

This is a sample project for exploring how compilers work. Here a LLVM frontend is built to learn about lexing, parsing and intermediate code generation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published