Simple language supports variables, arithmetic operations and printing to console and is compiled (translated) to C language
In order to compile the compiler you'll need gcc, flex and bison. To install them on Ubuntu:
sudo apt-get update
sudo apt-get install build-essential flex bison
Generate syntax analyzer code:
bison -d -o parser.c parser.y
Generate semantic analyzer code:
flex -o scanner.c scanner.l
Compile the compiler:
gcc -o compiler parser.c scanner.c ast.c -lfl
Compile any .mylang file:
./compiler example.mylang > example.c
View generated C code:
cat example.c