Editing Symbol Table

Jump to: navigation, search

Please note that you are now editing the latest revision of this page, which is not the approved one shown by default.

Warning: You are not logged in.

Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
anZqHC  <a href="http://hxtkvupaooum.com/">hxtkvupaooum</a>, [url=http://kouhoeduydfs.com/]kouhoeduydfs[/url], [link=http://jdcizwyawfdx.com/]jdcizwyawfdx[/link], http://zskbgvaxrivw.com/
+
During semantic analysis (scope or type checking), it is necessary to remember declarations (variables, types, functions, etc) so that we can detect inconsistencies and misuses of the identifiers. This identifiers memorization is the task of a symbol table. Note that a symbol table is a compile-time data structure; it's not used during run time.
 +
Formally, '''a symbol table (also called identifiers table) maps names into declarations''' (called attributes), such as mapping the variable name x to its type int.
 +
<br><br>
 +
 
 +
More specifically, a symbol table stores:
 +
 
 +
* for each "''type name''", its type definition (eg. for the C type declaration ''typedef int* mytype'', it maps the name ''mytype'' to a data structure that represents the type ''int*'').
 +
 
 +
* for "''each variable name''", its type. If the variable is an ''array'', it also stores dimension information. It may also store storage class, offset in activation record etc.
 +
 
 +
* for each "''constant name''", its type and value.
 +
 
 +
* for each "''function and procedure''", its formal parameter list and its output type.
 +
 
 +
<br><br>
 +
Each formal parameter must have name, type, type of passing (by-reference or by-value), etc. Due to its very efficient search/retrieval algorithm, one convenient data structure for symbol tables is a hash table, that maps names (the hash table keys) to attributs.
 +
 
 +
[[Category:Basic Concepts]]

Please note that all contributions to eplmediawiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Eplmediawiki:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)
Personal tools
Namespaces

Variants
Actions
Navigation
extras
Toolbox