Simple Compiler (C)
This project is a simple compiler / executor which was written as part of a project for a Programming Languages course. It takes a program written in a simple, custom language (developed for the purpose of this project), converts it into a simpler form analagous to an assembly program, and executes it. The language that this compiler takes may be found in the semantic.c comments.
The compiler program itself is essentially one large recursive loop: a reader function reads a single line of the input code and hands it off to a specific processing function (different types of lines will be sent to different processing functions). The processing function will parse and encodce the input code line, and will then call the function to read and parse the next line. This recursive structure is used instead of a more traditional structure (in which the processing functions would return control to the reader function which called them, instead of calling the reader and sending the program level deeper) so that the specific processing functions may perform post-processing and linking after
The program may be downloaded from the link below. Included is the program itself, a Makefile to compile the program, and a series of tests to demonstrate the program's functionality. These tests may be run (on Linux) by executing the .sh files.