Symbol table

Symbol table

In computer science, a symbol table is a data structure used by a language translator such as a compiler or interpreter, where each identifier in a program's source code is associated with information relating to its declaration or appearance in the source, such as its type, scope level and sometimes its location.

Implementation

A common implementation technique is to use a hash table implementation. A compiler may use one large symbol table for all symbols or use separated, hierarchical symbol tables for different scopes.

Uses

An object file will contain a symbol table of the identifiers it contains that are externally visible. During the linking of different object files, a linker will use these symbol tables to resolve any unresolved references.

A symbol table may only exist during the translation process, or it may be embedded in the output of that process for later exploitation, for example, during an interactive debugging session, or as a resource for formatting a diagnostic report during or after execution of a program.

Example

The symbol table of a small program is listed below. The table itself was generated using the GNU binutils' nm utility. There is one data symbol, holaamigosh (noted by the "D" type), and many functions (self defined as well as from the standard library). The first column is where the symbol is located in the memory, the second is " [http://sourceware.org/binutils/docs-2.17/binutils/nm.html#nm The symbol type] " and the third is the name of the symbol. By passing suitable parameters, the symbol table was made to sort on basis of address.

External links

* [http://sourceware.org/binutils/docs-2.17/binutils/nm.html#nm GNU nm]
* [http://compilers.iecc.com/comparch/article/93-02-114 An old usenet thread]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Symbol (typeface) — Symbol is one of the four standard fonts available on most PostScript based printers. It contains a complete unaccented Greek alphabet (upper and lower case) and a selection of commonly used mathematical symbols as well. Insofar as it fits into… …   Wikipedia

  • Symbol of Chaos — Variant of Symbol of Chaos, the Chaosphere of …   Wikipedia

  • Table des Marchand — Table des Marchand …   Deutsch Wikipedia

  • Table des marchands — Die Table des marchands (von franz. „La“ Table – Tisch der Händler) liegt in Locmariaquer im Département Morbihan in der Bretagne in Frankreich. Es ist eine der frühesten bekannten Megalithanlagen der Bretagne. Sie wird seit dem 18. Jahrhundert… …   Deutsch Wikipedia

  • Symbol rate — In digital communications, symbol rate (also known as baud or modulation rate) is the number of symbol changes (waveform changes or signalling events) made to the transmission medium per second using a digitally modulated signal or a line code.… …   Wikipedia

  • Symbol — For other uses, see Symbol (disambiguation). Symbology redirects here. For other uses, see Symbology (disambiguation). A symbol is something which represents an idea, a physical entity or a process but is distinct from it. The purpose of a symbol …   Wikipedia

  • Table de Mendeleïev — Tableau périodique des éléments Pour les articles homonymes, voir Tableau. Le tableau périodique des éléments, également appelé table de Mendeleïev, classification périodique des éléments (CPE) ou simplement tableau périodique, représente tous… …   Wikipédia en Français

  • Table périodique — Tableau périodique des éléments Pour les articles homonymes, voir Tableau. Le tableau périodique des éléments, également appelé table de Mendeleïev, classification périodique des éléments (CPE) ou simplement tableau périodique, représente tous… …   Wikipédia en Français

  • Table périodique des éléments — Tableau périodique des éléments Pour les articles homonymes, voir Tableau. Le tableau périodique des éléments, également appelé table de Mendeleïev, classification périodique des éléments (CPE) ou simplement tableau périodique, représente tous… …   Wikipédia en Français

  • Table Grove, Illinois — Geobox|Settlement name = Table Grove native name = other name = category = Village etymology = official name = motto = nickname = image caption = symbol = country = United States state = Illinois region = Fulton region type = County district =… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”