tags:

views:

90

answers:

2

How is the scope of a variable/identifier maintained in the symbol table of a c/c++ compiler.

Please suggest some good links and books to know the how compiling process of c/c++
program is implemented for better understanding.

A: 

If you're interested in theory, why not start e.g. with the infamous dragon book? It's probably not as up-to-date as other, more recent books, but it's a classic after all, and AFAIK it has chapters about symbol tables etc. towards the end of the book.

If you're interested in a concrete implementation, I would still recommend you take a look at the GNU compiler collection (especially gcc or g++), as it is perhaps the most popular open-source C compiler that's available. However, don't forget that noone can relieve you of the task to sort out the pieces of code that are of interest to you from the whole rest! (You simply won't find a compiler that consists only of symbol table / variable scope management stuff.)


P.S.: If you're interested in hashing algorithms (you mentioned this in a comment), you could start on Wikipedia. Bob Jenkins' hash functions (link mentioned on Wikipedia) are quite popular for producing good hashes.

stakx
A: 

Hope these link might help you

http://hissa.nist.gov/publications/nistir5691/vol1/

or

codeproject.com/KB/recipes/llparser.aspx

harsha