A multi-language educational toolkit demonstrating key concepts in compiler construction, including lexical analysis and symbol table management.
Implemented in Python, Ruby, and Java, this collection of small projects showcases the core building blocks of a compiler.
Compiler_Design_Toolkit/ β βββ Project2/ β βββ Prog1.py # Python compiler-related script β βββ Project Report.pdf # Report for Project2 β βββ Ruby Lexical Analyzer/ β βββ lexer.rb # Ruby program for lexical analysis β βββ source_code.txt # Sample input for the lexer β βββ Screenshot of correct output.png β βββ Project Report.pdf β βββ README.md β βββ Table/ βββ symbolTable.java # Symbol table in Java βββ symbol_table.py # Symbol table in Python
-
Lexical Analysis (Ruby)
- Tokenizes source code into keywords, identifiers, operators, and more.
- Includes sample source code and screenshot of output.
-
Symbol Table Implementations
- Java version (
symbolTable.java) - Python version (
symbol_table.py) - Stores identifiers, data types, and related metadata.
- Java version (
-
Python Compiler Component
Prog1.pydemonstrates a compiler-related process (see PDF for details).
Requirements: Ruby 2.5+
cd "Ruby Lexical Analyzer"
ruby lexer.rb source_code.txt
Symbol Table (Java Version)
Requirements: Java JDK
bash
cd Table
javac symbolTable.java
java symbolTable
Symbol Table (Python Version)
Requirements: Python 3.x
bash
cd Table
python symbol_table.py
Python Compiler Script (Project2)
Requirements: Python 3.x
bash
cd Project2
python Prog1.py
π Technologies Used
Python β Compiler utilities & symbol table
Ruby β Lexical analysis
Java β Symbol table
Standard I/O for reading and processing code
π Documentation
Each subproject includes a PDF report covering:
Theory & background
Implementation steps
Example runs
Observations