Compiler and Translator Design Project
- University of Idaho - Department of Computer Science
- CS 445: Compiler and Translator Design, by Dr. Clinton Jeffery
This is a work-in-progress old-school compiler using Flex and Bison for a subset of C++, dubbed “120++” as it should work for most code written in CS 120, including basic classes.
This repo is located at: https://github.com/andschwa/uidaho-cs445
Assignment #1: A Lexical Analyzer
Assignment #2: A Syntax Tree
Per the requirements, my second goal was to write (or reuse) a 120++ grammar that works with Bison.
Assignment #3: Semantic Analysis
Per the requirements, my third goal was to perform semantic analysis (including populating symbol tables and type checking the expressions) on the syntax tree.
Assignment #4: Intermediate Code Generation
Per the requirements, my fourth goal was to implement intermediate code generation, i.e., a list of three-address instructions given the parse tree.
Assignment #5: Final Code Generation
Per the requirements, my fifth goal was to implement final code generation, i.e., either native (assembly) code, or three-address C code to demonstrate the correctness of the compiler’s memory layout and intermediate code logic.
Seeing as how I dislike assembly and have a greater need for my time than a perfect grade, I have chosen to implement TAC-C.