Every compiler stores data in different symbol tables. Symbol table is a special data structure that is designed for easy insertion of new symbol with associated data and quick search through all elements in the table.
|
Each identifier symbol table must be created before it can be used. Turbo pascal uses diferent parameters (number of linked lists) for different identifier symbol tables.
|
Storing identifiers into symbol table is simple because of the way how Turbo Pascal organizes symbol tables.
|
This function searches for current identifier in specified symbol table. The speed of this function and the design of symbol tables (hash function) have a significant impact on the speed of the compiler.
|
This function checks for identifier that should be already declared. If Token is Token_Identifier it checks if identifier is declared under current scope. If not the error is reported.
|
After each module is compiled the symbol tables are compacted to remove unused space.
|
Turbo Pascal calculates a checksum of public identifiers for every unit to quickly check if something has been changed.
|
All Turbo Pascal reserved words are stored in a dedicated symbol table.
|