EXPL-NITC
Compiler Design Project
+--------------------+ +--------------------+ +--------------------+
| Source Code (EXPL) |--------->| Lexical Analyzer |--------->| Syntax Analyzer |
+--------------------+ +--------------------+ +--------------------+
| (Recognizes tokens) (Checks grammar)
v | v
+---------+ +---------+ +---------+
| Scanner | | Parser | | Symbol Table |
+---------+ +---------+ +---------+
| (Builds token stream) (Builds AST)
v | v
+---------+ +---------+ +---------+
| Error | | Error | | Semantic Analyzer |
+---------+ +---------+ +---------+
| (Reports lexical errors) (Reports syntax errors)
v v
+---------+ +---------+
| Output | | Intermediate |
+---------+ +---------+
| (Intermediate Representation) | Representation |
v v
+---------+ +---------+
| (Optional) | | Target Code |
+---------+ +---------+
| (Assembly or Bytecode) | Generation |
v v
+---------+ +---------+
| Optimized | | (Optional) |
+---------+ +---------+
| (Improved Intermediate Representation) | Optimization |
Specifications:
- Source Language: Experimental Language (ExpL) - Informal specification here.
- Extension for Object Oriented Programming: Specs here.
- Target Platform ABI: Experimental Operating System (ExpOS) on Experimental String Machine (XSM) - ABI here.
Description:
Designed and implemented a compiler for ExpL, a language developed for instructional purposes. The project involved:
- Lexical analysis using LEX to identify lexical elements.
- Syntax analysis phase to check for syntax errors.
- Semantic analysis phase to detect type and scope errors.
- Generation of abstract syntax tree representation.
- Front end compilation process from lexical analysis to abstract syntax tree generation.
This project required systematic mapping of source language constructs to semantically equivalent constructs in the target language, while preserving program semantics.
Main Achievements:
- Successfully implemented lexical analysis, syntax analysis, and semantic analysis phases.
- Developed an intermediate representation of source programs in the form of abstract syntax trees.
- Ensured preservation of program semantics throughout the translation process.
EXPL-NITC