This is the final project for my Spring 2017 Compiler Theory course, a compiler built using Lex and Yacc.
Full details for the assignment are available in CompilerFinalProject.pdf
Full documentation for the VSL (very simple langauge) that this is a compiler for is available in VSL Programming Language.pdf
VSL_Lex.l is the lexical analyzer written in Lex, which after being run through Lex outputs lex.yy.c, the final lexical analyzer written in C. This simply gets the next token and returns the appropriate value to the parser.
VSL_YACC.y is the parser written in Yacc using Backus–Naur form, which after being run through Yacc outputs y.tab.c, the final compiler written in C. This requests the next token from the lexical analyzer, then decides what to do with it. The code is generated directly during the parsing here.
y.tab.h is the list of token definitions for use in both parts of this program.
The main final program is y.tab.c, but again all C portions of this project were generated by Lex and Yacc. I only wrote the Lex and Yacc code, and made some slight edits to the C code.
This compiler generates assembly code which can be assembled into binary instructions by my Two Pass Assembler, which can be run on my Virtual Machine, each in their own repository.