|Recognition of typedefs in C ? firstname.lastname@example.org (David Pereira) (2001-01-18)|
|Re: Recognition of typedefs in C ? email@example.com (2001-01-19)|
|Re: Recognition of typedefs in C ? firstname.lastname@example.org (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 ? email@example.com (Jos A. Horsmeier) (2001-01-26)|
|From:||Anthony PIRON <firstname.lastname@example.org>|
|Date:||19 Jan 2001 23:27:27 -0500|
|Organization:||VUB/ULB Computing Centre|
|Posted-Date:||19 Jan 2001 23:27:27 EST|
The better will probably be to move this recognition to the parsing
phase. The context concerns are typical things of the parser work -
nevertheless the extensions of lex can help to make some parts of the
work: with states and others concepts.
A hierachical symbol table (in C: a tree rooted by a global table
followed by a local table for each function and next the block
structure) can do the work fine by saving the type of the identifiers.
David Pereira wrote:
> I need to enable the lexer to distinguish
> typedef names from ordinary identifiers. 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. However, this is inadequate since
> *context* matters. How can this context be discerned ?
Anthony PIRON - Researcher
Universite Libre de Bruxelles, Department of Computer Science
CP 212 - Boulevard du Triomphe, B-1050 Bruxelles, Belgium
Tel. +32 2 650 50 55, Fax +32 2 650 56 09, GSM +32 478 530 022
Email: email@example.com Web: http://www.ulb.ac.be/di/ssd/apiron
Return to the
Search the comp.compilers archives again.