Compiler Design course project done under Prof. Amey Karkare and Prof. Subhajit Roy, 2021-22-II semester. SIT triplet:
- Source - Golang
- Implementation - C++
- Target - X86
Name | Roll No | |
---|---|---|
Shubh Agrawal | 190828 | [email protected] |
Shubhankar Gambhir | 190835 | [email protected] |
Tarun Kanodia | 190902 | [email protected] |
V. Pramodh Gopalan | 190933 | [email protected] |
- GNU Flex
- GNU Bison
- GNU Make
- Native data types: Int, Char, Bool
- Variables and Expressions (Large expressions also supported)
- Conditional: if, if-else
- Loops: for
- Break, Continue
- Arrays
- Input, output
- Functions (support for arbitrary number of parameters), recursion
- Pointers
- Arithmetic operators
- Logical and bitwise operators
- Multiple assignments in single line (a, b, c := 1,2,3)
- Dynamic Memory Allocation
- Auto-type inference
- Short variable declaration
- Multidimensional Arrays
- Multilevel Pointers
- Global variables
Steps to the generate the X86 code
make
./bin/parser <path to go file>
Then execute the generated binary by:
./a.out