Skip to content

Latest commit

 

History

History
26 lines (15 loc) · 1.25 KB

README.md

File metadata and controls

26 lines (15 loc) · 1.25 KB

Simple Java Symbol Table

This repository contains a basic implementation of a symbol table for lexical analysis in Java. The symbol table is a widely-used data structure in compilers and interpreters for storing information about identifiers such as variables and functions. This particular implementation uses a hash table with chaining for collision resolution.

Features

  • Simple and easy-to-understand code
  • Chaining for collision resolution
  • Basic operations: insert and search
  • Customizable for specific use cases

Usage

The SymbolTable class contains methods for inserting and searching identifiers in the symbol table. To use the class, first compile the SymbolTable.java file: javac SymbolTable.java

Then, run the compiled HashTable.class file:

java SymbolTable

This will execute the sample code provided in the main method, which demonstrates how to insert, search, and delete items in the hash table.

Limitations

Please note that this implementation is designed for educational purposes and may not cover all features that one might expect from a symbol table in a real-world compiler or interpreter. However, it serves as a solid foundation for understanding key concepts of symbol tables and can be extended to meet specific needs.