开发者

What is the function of symbol table in front-end and back-end of compiler?

What is 开发者_C百科the function of symbol table in front-end and back-end of compiler?


Symbol table stores the information about the symbols you use in your program.

For example, consider a simple C declaration statement.

int a;

Information regarding 'a', are

  1. Name of the variable used is 'a'.
  2. It is an integer variable.
  3. It is declared in global scope.
  4. It is uninitialized by user (global variables will be initialized to zero but to do that you need the information).

Likewise for every symbol you use in your program, the information will be updated in the symbol table for the translation to low level language.

Use of symbol tables lie mostly in front-end, in the back-end it may be used to handle the symbol names wherever necessary (like printing module). But I am not sure though!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜