This compiler was developed as a project for the CS-340 course of the Computer Science Department of the University of Crete.
- Lexical Analysis using Flex
- Syntax Analysis using Bison
- Intermediate code generation using Syntax Directed Translation
- Target code generation
Simply run make
or make all
in order to compile the α-compiler and produce the alang
executable.
To compile your Alpha (.asc) program, simply run ./alang [path-to-file.asc] [optional -d]
. This command will
compile the program and generate the binary file to be passed to the Alpha virtual machine. If you want to see the SymbolTable entries, Quads, Constants Tables & Target code information that are generated by the compiler,
just add the -d
flag after the source file's path.
You can also perform the steps specified by make all
one by one. Simply run make flex
in order to generate the lexical analyzer (scanner.c
file), make bison
to generate the syntax parser (parser.c/h file
), make tcode_gen
to create the target code generator and lastly, make comp
in order to compile all the required source files and link them together to produce the final alang
executable.