Compiler for a simplistic C-syntaxed programming Language

Course Assignment, COL226 (Programming Languages), Spring'22

A simplistic compiler for the hypotheical WHILE programming language in SML

Being a course assignment for the Programming Languages course at IIT Delhi, this assignment was about understanding how programming languages and compilers work. We designed a simple programming language called WHILE which had syntax similar to C and was Turing-Complete with support for integers, boolean values, conditionals statements and loops. The assignment also gave us exposure to functional programming and was in SML. We used ML-Lex and ML-Yacc for the front-end of the compiler which handled tokenization and parsing respectively. These steps parse a program written in WHILE make sure it is syntactically correct (follows the grammar), they identify tokens in the program and generate an Abstract Syntax Tree (AST). Semantic analysis in the backend was done by building a VMC (value-memory-control) machine which is a stack based push down automaton.

Chinmay Mittal
Chinmay Mittal

My research interests include Artificial Intelligence, particularly applications of Deep Learning in Natural Language Processing.