Re: Maintaining scope while parsing C with a YACC grammar

Robert A Duff <bobduff@shell01.TheWorld.com>
Tue, 26 Apr 2011 14:08:38 -0400

          From comp.compilers

Related articles
Maintaining scope while parsing C with a YACC grammar eliben@gmail.com (eliben) (2011-04-25)
Re: Maintaining scope while parsing C with a YACC grammar bobduff@shell01.TheWorld.com (Robert A Duff) (2011-04-26)
Re: Maintaining scope while parsing C with a YACC grammar bobduff@shell01.TheWorld.com (Robert A Duff) (2011-04-26)
Re: Maintaining scope while parsing C with a YACC grammar eliben@gmail.com (eliben) (2011-04-28)
Re: Maintaining scope while parsing C with a YACC grammar bobduff@shell01.TheWorld.com (Robert A Duff) (2011-05-02)
Re: Maintaining scope while parsing C with a YACC grammar torbenm@diku.dk (2011-05-03)
Re: Maintaining scope while parsing C with a YACC grammar paul@paulbmann.com (Paul B Mann) (2011-05-06)
Re: Maintaining scope while parsing C with a YACC grammar idbaxter@semdesigns.com (Ira Baxter) (2011-05-13)
Maintaining scope while parsing C with a Yacc grammar cfc@shell01.TheWorld.com (Chris F Clark) (2011-06-12)
| List of all articles for this month |

From: Robert A Duff <bobduff@shell01.TheWorld.com>
Newsgroups: comp.compilers
Date: Tue, 26 Apr 2011 14:08:38 -0400
Organization: The World Public Access UNIX, Brookline, MA
References: 11-04-036 11-04-038
Keywords: parse, symbols
Posted-Date: 27 Apr 2011 01:12:12 EDT

Robert A Duff <bobduff@shell01.TheWorld.com> 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



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.