Skip to content

A simple Java implementation of a symbol table for lexical analysis using a hash table with chaining for collision resolution

Notifications You must be signed in to change notification settings

allamed/SimpleJavaHashTable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

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.

About

A simple Java implementation of a symbol table for lexical analysis using a hash table with chaining for collision resolution

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages