<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
a	O
symbol	B-Application
table	I-Application
is	O
a	O
data	B-General_Concept
structure	I-General_Concept
used	O
by	O
a	O
language	O
translator	O
such	O
as	O
a	O
compiler	B-Language
or	O
interpreter	B-Application
,	O
where	O
each	O
identifier	O
(	O
or	O
symbol	O
)	O
,	O
constant	O
,	O
procedure	O
and	O
function	O
in	O
a	O
program	O
's	O
source	O
code	O
is	O
associated	O
with	O
information	O
relating	O
to	O
its	O
declaration	O
or	O
appearance	O
in	O
the	O
source	O
.	O
</s>
<s>
In	O
other	O
words	O
,	O
the	O
entries	O
of	O
a	O
symbol	B-Application
table	I-Application
store	O
the	O
information	O
related	O
to	O
the	O
entry	O
's	O
corresponding	O
symbol	O
.	O
</s>
<s>
A	O
symbol	B-Application
table	I-Application
may	O
only	O
exist	O
in	O
memory	O
during	O
the	O
translation	O
process	O
,	O
or	O
it	O
may	O
be	O
embedded	O
in	O
the	O
output	O
of	O
the	O
translation	O
,	O
such	O
as	O
in	O
an	O
ABI	B-Operating_System
object	B-Application
file	I-Application
for	O
later	O
use	O
.	O
</s>
<s>
For	O
example	O
,	O
it	O
might	O
be	O
used	O
during	O
an	O
interactive	O
debugging	B-Application
session	I-Application
,	O
or	O
as	O
a	O
resource	O
for	O
formatting	O
a	O
diagnostic	O
report	O
during	O
or	O
after	O
execution	B-General_Concept
of	O
a	O
program	O
.	O
</s>
<s>
The	O
minimum	O
information	O
contained	O
in	O
a	O
symbol	B-Application
table	I-Application
used	O
by	O
a	O
translator	O
and	O
intermediate	B-Application
representation	I-Application
(	O
IR	B-Application
)	O
includes	O
the	O
symbol	O
's	O
name	O
and	O
its	O
location	O
or	O
address	O
.	O
</s>
<s>
For	O
a	O
compiler	B-Language
targeting	O
a	O
platform	O
with	O
a	O
concept	O
of	O
relocatability	O
,	O
it	O
will	O
also	O
contain	O
relocatability	O
attributes	O
(	O
absolute	O
,	O
relocatable	O
,	O
etc	O
.	O
)	O
</s>
<s>
Symbol	B-Application
tables	I-Application
for	O
high-level	B-Language
programming	I-Language
languages	I-Language
may	O
store	O
the	O
symbol	O
's	O
type	O
:	O
string	O
,	O
integer	O
,	O
floating-point	O
,	O
etc.	O
,	O
its	O
size	O
,	O
and	O
its	O
dimensions	O
and	O
its	O
bounds	O
.	O
</s>
<s>
In	O
many	O
cases	O
,	O
the	O
symbol	O
's	O
cross-reference	O
information	O
is	O
stored	O
with	O
or	O
linked	O
to	O
the	O
symbol	B-Application
table	I-Application
.	O
</s>
<s>
Most	O
compilers	B-Language
print	O
some	O
or	O
all	O
of	O
this	O
information	O
in	O
symbol	B-Application
table	I-Application
and	O
cross-reference	O
listings	O
at	O
the	O
end	O
of	O
translation	O
.	O
</s>
<s>
Numerous	O
data	B-General_Concept
structures	I-General_Concept
are	O
available	O
for	O
implementing	O
tables	O
.	O
</s>
<s>
Trees	O
,	O
linear	O
lists	O
and	O
self-organizing	B-Data_Structure
lists	I-Data_Structure
can	O
all	O
be	O
used	O
to	O
implement	O
a	O
symbol	B-Application
table	I-Application
.	O
</s>
<s>
The	O
symbol	B-Application
table	I-Application
is	O
accessed	O
by	O
most	O
phases	O
of	O
a	O
compiler	B-Language
,	O
beginning	O
with	O
lexical	B-Application
analysis	I-Application
,	O
and	O
continuing	O
through	O
optimization	O
.	O
</s>
<s>
A	O
compiler	B-Language
may	O
use	O
one	O
large	O
symbol	B-Application
table	I-Application
for	O
all	O
symbols	O
or	O
use	O
separated	O
,	O
or	O
hierarchical	O
symbol	B-Application
tables	I-Application
for	O
different	O
scopes	B-Language
.	O
</s>
<s>
For	O
example	O
,	O
in	O
a	O
scoped	O
language	O
such	O
as	O
Algol	B-Language
or	O
PL/I	B-Language
a	O
symbol	O
"	O
p	O
"	O
can	O
be	O
declared	O
separately	O
in	O
several	O
procedures	O
,	O
perhaps	O
with	O
different	O
attributes	O
.	O
</s>
<s>
The	O
symbol	B-Application
table	I-Application
must	O
have	O
some	O
means	O
of	O
differentiating	O
references	O
to	O
the	O
different	O
"	O
p	O
"	O
s	O
.	O
</s>
<s>
A	O
common	O
data	B-General_Concept
structure	I-General_Concept
used	O
to	O
implement	O
symbol	B-Application
tables	I-Application
is	O
the	O
hash	B-Algorithm
table	I-Algorithm
.	O
</s>
<s>
The	O
time	O
for	O
searching	O
in	O
hash	B-Algorithm
tables	I-Algorithm
is	O
independent	O
of	O
the	O
number	O
of	O
elements	O
stored	O
in	O
the	O
table	O
,	O
so	O
it	O
is	O
efficient	O
for	O
a	O
large	O
number	O
of	O
elements	O
.	O
</s>
<s>
As	O
the	O
lexical	B-Application
analyser	I-Application
spends	O
a	O
great	O
proportion	O
of	O
its	O
time	O
looking	O
up	O
the	O
symbol	B-Application
table	I-Application
,	O
this	O
activity	O
has	O
a	O
crucial	O
effect	O
on	O
the	O
overall	O
speed	O
of	O
the	O
compiler	B-Language
.	O
</s>
<s>
A	O
symbol	B-Application
table	I-Application
must	O
be	O
organised	O
in	O
such	O
a	O
way	O
that	O
entries	O
can	O
be	O
found	O
as	O
quickly	O
as	O
possible	O
.	O
</s>
<s>
Hash	B-Algorithm
tables	I-Algorithm
are	O
usually	O
used	O
to	O
organise	O
a	O
symbol	B-Application
table	I-Application
,	O
where	O
the	O
keyword	O
or	O
identifier	O
is	O
'	O
hashed	O
 '	O
to	O
produce	O
an	O
array	O
subscript	O
.	O
</s>
<s>
Collisions	B-Algorithm
are	O
inevitable	O
in	O
a	O
hash	B-Algorithm
table	I-Algorithm
,	O
and	O
a	O
common	O
way	O
of	O
handling	O
them	O
is	O
to	O
store	O
the	O
synonym	O
in	O
the	O
next	O
available	O
free	O
space	O
in	O
the	O
table	O
.	O
</s>
<s>
An	O
object	B-Application
file	I-Application
will	O
contain	O
a	O
symbol	B-Application
table	I-Application
of	O
the	O
identifiers	O
it	O
contains	O
that	O
are	O
externally	O
visible	O
.	O
</s>
<s>
During	O
the	O
linking	B-Application
of	O
different	O
object	B-Application
files	I-Application
,	O
a	O
linker	B-Application
will	O
identify	O
and	O
resolve	O
these	O
symbol	O
references	O
.	O
</s>
<s>
Usually	O
all	O
undefined	O
external	O
symbols	O
will	O
be	O
searched	O
for	O
in	O
one	O
or	O
more	O
object	B-Library
libraries	I-Library
.	O
</s>
<s>
If	O
a	O
module	O
is	O
found	O
that	O
defines	O
that	O
symbol	O
it	O
is	O
linked	O
with	O
together	O
with	O
the	O
first	O
object	B-Application
file	I-Application
,	O
and	O
any	O
undefined	O
external	O
identifiers	O
are	O
added	O
to	O
the	O
list	O
of	O
identifiers	O
to	O
be	O
looked	O
up	O
.	O
</s>
<s>
While	O
reverse	O
engineering	O
an	O
executable	O
,	O
many	O
tools	O
refer	O
to	O
the	O
symbol	B-Application
table	I-Application
to	O
check	O
what	O
addresses	O
have	O
been	O
assigned	O
to	O
global	O
variables	O
and	O
known	O
functions	O
.	O
</s>
<s>
If	O
the	O
symbol	B-Application
table	I-Application
has	O
been	O
stripped	B-Application
or	O
cleaned	O
out	O
before	O
being	O
converted	O
into	O
an	O
executable	O
,	O
tools	O
will	O
find	O
it	O
harder	O
to	O
determine	O
addresses	O
or	O
understand	O
anything	O
about	O
the	O
program	O
.	O
</s>
<s>
Consider	O
the	O
following	O
program	O
written	O
in	O
C	B-Language
:	O
</s>
<s>
A	O
C	B-Language
compiler	B-Language
that	O
parses	O
this	O
code	O
will	O
contain	O
at	O
least	O
the	O
following	O
symbol	B-Application
table	I-Application
entries	O
:	O
</s>
<s>
In	O
addition	O
,	O
the	O
symbol	B-Application
table	I-Application
may	O
also	O
contain	O
entries	O
generated	O
by	O
the	O
compiler	B-Language
for	O
intermediate	O
expression	O
values	O
(	O
e.g.	O
,	O
the	O
expression	O
that	O
casts	O
the	O
i	O
loop	O
variable	O
into	O
a	O
double	O
,	O
and	O
the	O
return	O
value	O
of	O
the	O
call	O
to	O
function	O
bar( )	O
)	O
,	O
statement	O
labels	O
,	O
and	O
so	O
forth	O
.	O
</s>
<s>
An	O
example	O
of	O
a	O
symbol	B-Application
table	I-Application
can	O
be	O
found	O
in	O
the	O
SysV	B-Operating_System
Application	B-Operating_System
Binary	I-Operating_System
Interface	I-Operating_System
(	O
ABI	B-Operating_System
)	O
specification	O
,	O
which	O
mandates	O
how	O
symbols	O
are	O
to	O
be	O
laid	O
out	O
in	O
a	O
binary	O
file	O
,	O
so	O
that	O
different	O
compilers	B-Language
,	O
linkers	B-Application
and	O
loaders	O
can	O
all	O
consistently	O
find	O
and	O
work	O
with	O
the	O
symbols	O
in	O
a	O
compiled	B-Language
object	O
.	O
</s>
<s>
The	O
SysV	B-Operating_System
ABI	B-Operating_System
is	O
implemented	O
in	O
the	O
GNU	B-Application
binutils	I-Application
 '	I-Application
nm	B-Application
utility	O
.	O
</s>
<s>
This	O
format	O
uses	O
a	O
sorted	O
memory	B-General_Concept
address	I-General_Concept
field	O
,	O
a	O
"	O
symbol	O
type	O
"	O
field	O
,	O
and	O
a	O
symbol	O
identifier	O
(	O
called	O
"	O
Name	O
"	O
)	O
.	O
</s>
<s>
The	O
symbol	O
types	O
in	O
the	O
SysV	B-Operating_System
ABI	B-Operating_System
(	O
and	O
nm	B-Application
's	O
output	O
)	O
indicate	O
the	O
nature	O
of	O
each	O
entry	O
in	O
the	O
symbol	B-Application
table	I-Application
.	O
</s>
<s>
For	O
example	O
,	O
symbol	B-Application
table	I-Application
entries	O
representing	O
initialized	O
data	O
are	O
denoted	O
by	O
the	O
character	O
"	O
d	O
"	O
and	O
symbol	B-Application
table	I-Application
entries	O
for	O
functions	O
have	O
the	O
symbol	O
type	O
"	O
t	O
"	O
(	O
because	O
executable	O
code	O
is	O
located	O
in	O
the	O
text	O
section	O
of	O
an	O
object	B-Application
file	I-Application
)	O
.	O
</s>
<s>
The	O
Python	B-Language
programming	I-Language
language	I-Language
includes	O
extensive	O
support	O
for	O
creating	O
and	O
manipulating	O
symbol	B-Application
tables	I-Application
.	O
</s>
<s>
Some	O
programming	O
languages	O
allow	O
the	O
symbol	B-Application
table	I-Application
to	O
be	O
manipulated	O
at	O
run-time	O
,	O
so	O
that	O
symbols	O
can	O
be	O
added	O
at	O
any	O
time	O
.	O
</s>
<s>
Racket	B-Operating_System
is	O
an	O
example	O
of	O
such	O
a	O
language	O
.	O
</s>
<s>
Both	O
the	O
LISP	B-Language
and	O
the	O
Scheme	B-Language
programming	I-Language
languages	I-Language
allow	O
arbitrary	O
,	O
generic	O
properties	O
to	O
be	O
associated	O
with	O
each	O
symbol	O
.	O
</s>
<s>
The	O
Prolog	B-Language
programming	I-Language
language	I-Language
is	O
essentially	O
a	O
symbol-table	O
manipulation	O
language	O
;	O
symbols	O
are	O
called	O
atoms	O
,	O
and	O
the	O
relationships	O
between	O
symbols	O
can	O
be	O
reasoned	O
over	O
.	O
</s>
<s>
Similarly	O
,	O
OpenCog	B-Application
provides	O
a	O
dynamic	O
symbol	B-Application
table	I-Application
,	O
called	O
the	O
atomspace	O
,	O
which	O
is	O
used	O
for	O
knowledge	O
representation	O
.	O
</s>
