Related articles |
---|
How to design a symbol table? chris@tkdsoftware.com (2004-10-09) |
Re: How to design a symbol table? torbenm@diku.dk (2004-10-12) |
Re: How to design a symbol table? Jeffrey.Kenton@comcast.net (Jeff Kenton) (2004-10-12) |
Re: How to design a symbol table? rbates@southwind.net (Rodney M. Bates) (2004-10-17) |
Re: How to design a symbol table? nmm1@cus.cam.ac.uk (2004-10-21) |
Re: How to design a symbol table? skaller@nospam.com.au (John Max Skaller) (2004-10-21) |
From: | Jeff Kenton <Jeffrey.Kenton@comcast.net> |
Newsgroups: | comp.compilers |
Date: | 12 Oct 2004 00:57:35 -0400 |
Organization: | Comcast Online |
References: | 04-10-075 |
Keywords: | symbols |
Posted-Date: | 12 Oct 2004 00:57:35 EDT |
The simple answer: everything relevant goes in the symbol table, and the
declaration disappears from the AST.
You want access to the symbol table entry for every reference to the
variable/structure/... in the program. You want to do memory allocation
separately from AST processing as well. You want scoping information in the
symbol table. If you have variable initialization combined with your
declaration, that might stay in the AST (or move to some global intializer
code elsewhere), but the declaration info itself goes into the symbol table.
jeff
chris@tkdsoftware.com wrote:
> What constructing a symbol table entry, what information is relevant
> to keep in the symbol table for that entry versus storing in the
> abstract syntax tree where the symbol is defined/declared?
--
-------------------------------------------------------------------------
= Jeff Kenton Consulting and software development =
= http://home.comcast.net/~jeffrey.kenton =
-------------------------------------------------------------------------
Return to the
comp.compilers page.
Search the
comp.compilers archives again.