A C compiler that parses this code will contain at least the following symbol table entries

Consider the following program written in 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;
}

A C compiler that parses this code will contain at least the following symbol table entries:

Symbol name Type Scope
bar function, double extern
x double function parameter
foo function, double global
count int function parameter
sum double block local
i int for-loop statement

In addition, the symbol table will also contain entries generated by the compiler for intermediate expression values (e.g., the expression that casts the i loop variable into a double, and the return value of the call to function bar()), statement labels, and so forth.

https://en.wikipedia.org/wiki/Symbol_table

时间: 2024-10-09 11:37:10

A C compiler that parses this code will contain at least the following symbol table entries的相关文章

Code First Migrations: Making __MigrationHistory not a system table

https://blog.oneunicorn.com/2012/02/27/code-first-migrations-making-__migrationhistory-not-a-system-table/ Code First Migrations uses a table called __MigrationHistory as a place to store metadata about the migrations that have been applied to the da

Error code:1728 Cannot load from mysql.proc. The table is probably corrupted

http://bugs.mysql.com/bug.php? id=50183 原因是mysql.proc 在5.1 comment char(64) -> 5.5 comment text 导致 The difference seen in the mysql.proc table is 5.5 <   `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, --- 5.1 >   `comment` char(64)

Linking code for an enhanced application binary interface (ABI) with decode time instruction optimization

A code sequence made up multiple instructions and specifying an offset from a base address is identified in an object file. The offset from the base address corresponds to an offset location in a memory configured for storing an address of a variable

Ubuntu 16.04上安装SkyEye及测试

说明一下,在Ubuntu 16.04上安装SkyEye方法不是原创,是来自互联网,仅供学习参考. 1.检查支持软件包 gcc,make,vim(optional),ssh,subversionbinutils-dev (bfd)atk-dev (libatk1.0-dev)gtk+-2.0-dev (libgtk2.0-dev)pkg-configpango-dev (libpango1.0-dev)freetype2-dev (libfreetype6-dev)glib-dev (libgli

linux 2.6 内核的移植

内核移植过程   下载 linux 内核 从 http://www.kernel.org/pub/linux/kernel/v2.6/linux­2.6.14.1.tar.bz2 下载 linux­2.6.14.1 内核至 home/arm/dev_home/kernel. [[email protected] ~]#su arm [[email protected] ~]#cd $KERNEL [[email protected] kernel]#tar ­xzvf linux­2.6.14.

ARM Compiler toolchain Compiler -- Supported ARM architectures

--cpu=name This option enables code generation for the selected ARM processor or architecture. Syntax --cpu=name Where: name is the name of a processor or architecture. If name is the name of a processor, enter it as shown on ARM data sheets, for exa

Windows下安装Code::Blocks 13.12进行C/C++开发

CodeBlocks 是一个开放源码的全功能的跨平台C/C++集成开发环境.CodeBlocks是开放源码软件.CodeBlocks由纯粹的C++语言开发完成,它使用 了蓍名的图形界面库wxWidgets(2.6.2unicode)版.对于追求完美的C++程序员,再也不必忍受Eclipse的缓慢,再也不必忍受 VS.NET的庞大和高昂的价格. CodeBlocks 提供了许多工程模板,这包括:控制台应用.DirectX应用.动态连接库.FLTK应用.GLFW应用.Irrlicht工程.OGRE应

Code:Blocks编写后出现如下错误

"Demo1 - Debug": The compiler's setup (LLVM D Compiler) is invalid, so Code::Blocks cannot find/run the compiler.Probably the toolchain path within the compiler options is not setup correctly?! (Do you have a compiler installed?)Goto "Setti

01-K Code

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 728    Accepted Submission(s): 209 Problem Description Consider a code string S of N symbols, each symbol can only be 0 or 1. In any consecutive