This project implements a simple compiler for the SnMsLang language using ANTLR and LLVM.
ast_builder.py: Responsible for parsing SnMsLang code and building the AST.ir_generator.py: Converts AST into LLVM IR.SnMsLang.g4: ANTLR grammar file for SnMsLang language.
- Install dependencies:
pip install -r requirements.txt - Generate the lexer and parser from the ANTLR grammar:
java -jar antlr-4.9.3-complete.jar -Dlanguage=Python3 grammar/SnMsLang.g4** correct version! **
To run the compiler:
- python3 main.py <test_etap?>/<file_with_code>
- ./llc_to_exe.sh