1 / 9

Compiler Designs and Constructions

Compiler Designs and Constructions. Chapter 3: Symbol Table Objectives: (7.6) Introduction to Symbol Table Implementation of Symbol Table Hash Functions & Types of Hash Functions Dr. Mohsen Chitsaz. Implementation Techniques insert & search. Unordered List Index+1 index bucket

noma
Download Presentation

Compiler Designs and Constructions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Compiler Designs and Constructions Chapter 3: Symbol Table Objectives: (7.6) Introduction to Symbol Table Implementation of Symbol Table Hash Functions & Types of Hash Functions Dr. Mohsen Chitsaz Chapter 3: Symbol Table

  2. Implementation Techniquesinsert & search • Unordered List • Index+1 index bucket • O(n) • Ordered List • Find location • O(log2n) • Binary Tree • Hash Table Chapter 3: Symbol Table

  3. Hash Functions 1-How to use Hash Functions: 2-Hash Functions: Index = f(token) 3-Characteristics of hash functions Chapter 3: Symbol Table

  4. Hash function Methods • Digital Selection abcdefgh efh • Division digits MOD prime_Number • Multiplication abcd * defg • Folding ab+cd+de+ef Chapter 3: Symbol Table

  5. Resolving Collisions • Closed Hashing • Leaner Resolution • Quadratic Probing • Double Hashing Chapter 3: Symbol Table

  6. Resolving Collisions • Open Hashing • Chaining Chapter 3: Symbol Table

  7. Symbol Table Operators: CreateASymbolTable(size) Insert(Token) Lookup(Token) Delete(Token) GetAttributes( Token, … ) AddAttributes( Token, …. ) Chapter 3: Symbol Table

  8. Symbol Table • Symbol Table Entry: • Scope Rules: • Block: • Symbol Table Types: • Static • Dynamic Chapter 3: Symbol Table

  9. Symbol Table • Summary: Chapter 3: Symbol Table

More Related