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