Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 3: Symbol Table 1 Compiler Designs and Constructions Chapter 3: Symbol Table Objectives: (7.6) Introduction to Symbol Table Implementation of Symbol.

Similar presentations


Presentation on theme: "Chapter 3: Symbol Table 1 Compiler Designs and Constructions Chapter 3: Symbol Table Objectives: (7.6) Introduction to Symbol Table Implementation of Symbol."— Presentation transcript:

1 Chapter 3: Symbol Table 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

2 Chapter 3: Symbol Table2 Implementation Techniques insert & search  Unordered List Index+1indexbucket O(n)  Ordered List Find location O(log2n)  Binary Tree  Hash Table

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

4 Chapter 3: Symbol Table4 Hash function Methods a.Digital Selection abcdefghefh b.Division digits MOD prime_Number c.Multiplication abcd * defg d.Folding ab+cd+de+ef

5 Chapter 3: Symbol Table5 Resolving Collisions a.Closed Hashing Leaner Resolution Quadratic Probing Double Hashing

6 Chapter 3: Symbol Table6 Resolving Collisions b.Open Hashing Chaining

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

8 Chapter 3: Symbol Table8 Symbol Table  Symbol Table Entry:  Scope Rules:  Block:  Symbol Table Types: Static Dynamic

9 Chapter 3: Symbol Table9 Symbol Table  Summary: Token Name Token Value Token Type Token Scope MaxSize Array


Download ppt "Chapter 3: Symbol Table 1 Compiler Designs and Constructions Chapter 3: Symbol Table Objectives: (7.6) Introduction to Symbol Table Implementation of Symbol."

Similar presentations


Ads by Google