CSC 4101 Chapter : Homework 3 Solutions

14 views4 pages
15 Mar 2019
School
Course
Professor

Document Summary

Homework 3 solutions: instead of creating a new ident object for every occurrence of, say, the symbol "x, the idea is to ensure that every time the symbol "x is used, the same ident object gets returned. I. e. , for every symobol name a unique ident object should be created. This can be done by creating a hash table that maps symbol names (strings) into ident objects. When a symbol is seen for the first time, an ident object is created and is inserted into this hash table. The next time the same symbol is seen, the ident object is retrieved from the hash table. Instead of creating a new ident object for every occurrence of a symbol, the parser would make the appropriate calls on that hash table to ensure that every symbol is represented by a unique. The same idea is used in java for making string comparison more efficient.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents