This repository contains the implementation of a compiler for the ExpL language, following the roadmap outlined on the SILC NITC ExpL Documentation website.
The ExpL compiler is developed in stages, each building upon the previous one to create a fully functional compiler for the ExpL language. This project assumes background knowledge in C programming, Data Structures, and Principles of Computer Organization.
Below is a rough Abstract Syntax Tree (AST) representation of the ExpL language grammar:
The compiler development is divided into the following stages:
-
Installation: Setting up the necessary environment and tools.
-
Code Generation for Arithmetic Expressions: Implementing basic arithmetic operations.
-
Introduction to Static Storage Allocation: Managing memory for static variables.
-
Adding Flow Control Statements: Implementing conditional statements and loops.
-
User Defined Variables and Arrays: Supporting custom variables and array data structures.
-
Adding Functions: Implementing function calls and definitions.
-
User Defined Types and Dynamic Memory Allocation: Supporting custom data types and dynamic memory management.
-
Adding Objects – Data Encapsulation: Implementing object-oriented programming concepts.
-
Inheritance and Sub-type Polymorphism: Adding support for inheritance and polymorphism.
This project is based on the curriculum and roadmap provided by Compiler Lab NITC. I thank them for their comprehensive documentation and guidance.
