Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Symbol table
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Example== Consider the following program written in [[C (programming language)|C]]: <syntaxhighlight lang="C"> // Declare an external function extern double bar(double x); // Define a public function double foo(int count) { double sum = 0.0; // Sum all the values bar(1) to bar(count) for (int i = 1; i <= count; i++) sum += bar((double) i); return sum; } </syntaxhighlight> A C compiler that parses this code will contain at least the following symbol table entries: {| class="wikitable" |- style="background:silver" !style="width:8em" | Symbol name !style="width:10em" | Type !style="width:10em" | Scope |- | <code>bar</code> || function, double || extern |- | <code>x</code> || double || function parameter |- | <code>foo</code> || function, double || global |- | <code>count</code> || int || function parameter |- | <code>sum</code> || double || block local |- | <code>i</code> || int || for-loop statement |- |} In addition, the symbol table may also contain entries generated by the compiler for intermediate expression values (e.g., the expression that casts the <code>i</code> loop variable into a <code>double</code>, and the return value of the call to function <code>bar()</code>), statement labels, and so forth.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)