This repository contains my implementation of ExpL(Experimental Language) Compiler done as part of the Compiler Laboratory course I took in 2023.
The compiler was written in C using the C lexer which is present in lex.yy.c and YACC parser which is present in the y.tab.c file.
It compiles the source language ExpL(spec here and here) to the low-level XSM (eXperimental String Machine) machine code (ABI here) which runs on ExpOS (Experimental Operating System) a simulator for which can be found here.
The project is divided into 8 incremental stages and as such, the repository has a folder which contains the state of the project at the end of each stage. The stages are as follows:
- Arithmetic Expressions
- Static Storage Allocation
- Flow Control Statements
- User Defined Variables and Arrays
- Functions
- User-defined Types and Dynamic Memory Allocation
- Objects – Data Encapsulation
- Inheritance and Sub-type Polymorphism
More details about the project can be found on the website.