This is the compiler i built for my programming lanugage barium, a fun little project to understand compilers.
Tech Stack : Flex, Bison, LLVM
Lexical Analyzer (Lex) -> Semantic Parsing (Bison) -> Assembly (LLVM) -> Executable
- Add Data Types (decimal, fraction)
- Operators, Symbols, Reserved Keywords
- Add Looping Statements - ongoing (parse done)
- Add Control Statements - ongoing (parse done)
- Add Output Statements - uses vprintf
- Add Input Statements
- Add Arrays Support - ongoing (parse done)
- Create a CI/CD Pipeline
- Output executables instead of obj files (partial support)
- locations (YYLTYPE, and @$)
- Make it a Library
- Add Boost Math Support
- Containerize the Compiler using Docker
- LLVM 9.0.1
- Bison 3.5.2
- Flex 2.6.4
- Spacing is required between operators to remove ambiguity
$ sudo sh build.sh
$ sh run_tests.sh
Normal Run
$ ./barium test_files/test_all_ir.bar -v OFF
Debug Verbose Run
$ ./barium test_files/test_all_ir.bar -v INFO