Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx01.iad01.newshosting.com!209.197.12.246.MISMATCH!nx02.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!transit3.readnews.com!news-out.readnews.com!news-xxxfer.readnews.com!news.misty.com!news.iecc.com!nerds-end From: Robert A Duff Newsgroups: comp.compilers Subject: Re: Maintaining scope while parsing C with a YACC grammar Date: Tue, 26 Apr 2011 14:08:38 -0400 Organization: The World Public Access UNIX, Brookline, MA Lines: 18 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <11-04-039@comp.compilers> References: <11-04-036@comp.compilers> <11-04-038@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: gal.iecc.com 1303881132 13357 64.57.183.58 (27 Apr 2011 05:12:12 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Wed, 27 Apr 2011 05:12:12 +0000 (UTC) Keywords: parse, symbols Posted-Date: 27 Apr 2011 01:12:12 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: x330-a1.tempe.blueboxinc.net comp.compilers:106 Robert A Duff writes: > [The point of the generic symbol table stuff is that you have to remember the names somehow, and that seems less awful than doing a > strdup() for each name and hanging the strings off the AST. -John] Oh, yeah, sure -- I didn't understand what you meant. You want a table of identifiers, so multiple occurrences are just an index into that table or whatever. But no particular semantic information attached to those identifiers. I once wrote a compiler-like tool that represented identifiers as an index into the source code. But I later decided that was a dumb idea. - Bob