SDG Goal: SDG 4 – Quality Education
Project Overview
This project demonstrates the implementation of a Symbol Table using Hashing in Python as part of Compiler Design. A symbol table is a fundamental data structure in compilers used to store and manage information about program identifiers such as variables, constants, functions, and keywords. By applying hashing techniques, the project enables fast insertion, searching, and retrieval of symbols, simulating real compiler behavior and improving understanding of data structures and compiler concepts.
Key Steps
Data Input & Storage:
Accept user input for symbol name and type.
Compute hash index using a simple hash function.
Store symbols at the computed index.
Handle collisions using chaining (list of symbols at the same index).
Operations:
Insert: Add new identifiers into the symbol table.
Search: Look up existing identifiers to check their type and existence.
Display: Show the complete symbol table with all stored entries and their indexes.
Visualization:
Optionally, display the symbol table in a structured format showing index vs stored symbols, helping users understand hash allocation and collision handling.
Tools Used
Python 3
Console Input/Output
Data Structures (Lists, Hashing)
Objective
To help students understand compiler design concepts and data structure implementation. This project promotes SDG 4 – Quality Education by encouraging hands-on learning, improving programming logic, and demonstrating practical applications of hashing in compilers.