DR Language & Compiler
DR is a custom programming language designed and built from scratch, along with its own compiler, as part of a deep exploration into compiler design, programming language theory, and software engineering.
This project implements the complete compilation pipeline—from lexical analysis to syntax parsing and semantic analysis—turning raw .dr source code into structured, validated executable logic.
DR was created to understand how real programming languages work under the hood by building every compiler component manually.
Project Overview
The project introduces a new programming language called DR, featuring its own syntax, grammar rules, keywords, data types, operators, and execution model.
The compiler reads .dr source files and processes them through multiple stages:
Lexical Analysis (Scanner)
Breaks source code into tokens such as:
Keywords
Identifiers
Numbers
Operators
Symbols
String literals
Syntax Analysis (Parser)
Builds a parse tree based on the language grammar and validates program structure.
Semantic Analysis
Performs:
Symbol table generation
Variable declaration validation
Type checking
Scope validation
Duplicate identifier detection
Error Handling
Provides meaningful compile-time error messages with line tracking for easier debugging.
Language Features
DR currently supports:
Variable declarations
Primitive data types
Arithmetic operations
Conditional statements
Loops
Functions
Nested scopes
Custom syntax rules
.dr source files
Technologies Used
C#
.NET
Object-Oriented Programming
Compiler Design
Data Structures
Parsing Algorithms
Tokenization
Abstract Syntax Trees
Symbol Tables
Why This Project Matters
Building a programming language from scratch demonstrates strong knowledge in:
Problem Solving
System Design
Algorithm Design
Language Theory
Low-level software architecture
This project reflects the ability to design complex software systems beyond traditional application development.
Future Enhancements
Abstract Syntax Tree Visualization
Intermediate Code Generation
Bytecode Generation
Optimization Passes
GUI-based IDE for DR Language
Syntax Highlighting
Debugger Integration