Re: Recognition of typedefs in C ?

Joachim Pimiskern <Joachim.Pimiskern@de.bosch.com>
19 Jan 2001 23:28:15 -0500

          From comp.compilers

Related articles
Recognition of typedefs in C ? davidpereira@home.com (David Pereira) (2001-01-18)
Re: Recognition of typedefs in C ? henry@spsystems.net (2001-01-19)
Re: Recognition of typedefs in C ? apiron@ulb.ac.be (Anthony PIRON) (2001-01-19)
Re: Recognition of typedefs in C ? Joachim.Pimiskern@de.bosch.com (Joachim Pimiskern) (2001-01-19)
Re: Recognition of typedefs in C ? jos@and.nl (Jos A. Horsmeier) (2001-01-26)
| List of all articles for this month |
From: Joachim Pimiskern <Joachim.Pimiskern@de.bosch.com>
Newsgroups: comp.compilers
Date: 19 Jan 2001 23:28:15 -0500
Organization: Robert Bosch GmbH
References: 01-01-096
Keywords: C, types
Posted-Date: 19 Jan 2001 23:28:15 EST

Hello David,


David Pereira schrieb:
> At first glance, it seemed that building a table of typedef names
> was enough - the lexer would consult this table and return TYPENAME
> if the name was found in this table, otherwise IDENTIFIER.


Use a stack of hashtables. Whenever a new brace is entered, push a new
hashtable onto the stack, and pop it, when leaving a context.


If an identifier cannot be found in the last context, search in the
table before, and so on.


Regards,
Joachim
[That's a fine way to handle scopes, but it doesn't help with the
ambiguity between type and variable names. -John]





Post a followup to this message

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