This repository contains a collection of programming assignments written in OCaml that cover various aspects of compiler design. The assignments are organized into different modules, each focusing on a different topic.
Foundations - Module 0:
In this module, you will find fundamental concepts and implementations, operations over data structures including binary tree implementation, algebraic data types and prime number functions.
Lexical Analysis and Parsing - Module 1:
This module delves into lexical analysis and parsing with the following assignments:
- Recursive descent parser for a simple calculator language.
- Lexer to tokenize input for the calculator language.
Assembly Programming - Module 2:
Converting a C program to x86 assembly language, gaining insight into assembly-level programming.
Compiler Implementation - cigrid:
In this folder, you will find the comprehensive implementation of a compiler for a subset language of C++. The compiler includes:
- Lexer: Tokenizes the source code.
- Parser: Builds a syntax tree from the tokenized input.
- Intermediate Representations: Utilizes intermediate representations for efficient code generation.
- Abstract syntac tree: Implements the syntactic representation of the language.
- Testing: Compiles and tests the compiler with the provided subset language of C++.