Parsing C typedefs using yacc

Andrew Dunbar <>
9 Dec 1995 19:18:06 -0500

          From comp.compilers

Related articles
Parsing C typedefs using yacc (Andrew Dunbar) (1995-12-09)
Re: Parsing C typedefs using yacc (1995-12-10)
Re: Parsing C typedefs using yacc (1995-12-17)
Re: Parsing typedefs with C (2) (1995-12-18)
| List of all articles for this month |

From: Andrew Dunbar <>
Newsgroups: comp.compilers
Date: 9 Dec 1995 19:18:06 -0500
Organization: Compilers Central
Keywords: C, parse, yacc, question

I'm trying to parse C using yacc but I've hit a problem with
typedefs. Normally the lexer checks each identifier to see if it
is in the symbol table as a typedef-name. However I do not wish
to process the include files so I do not know which identifiers
are typedef-names. How can I make the yacc grammar cope with
declarations such as this:

FILE *fp;

I'm only trying to make some tools to manipulate indenting, alter
the names of global variables and such. It does not have to be
100% accurate.

Can anybody help?

Andrew Dunbar

Post a followup to this message

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