Re: parsing ".h subset" of c (Derek M Jones)
29 Apr 1999 00:36:27 -0400

          From comp.compilers

Related articles
parsing ".h subset" of c (1999-04-26)
Re: parsing ".h subset" of c (Norman Ramsey) (1999-04-29)
Re: parsing ".h subset" of c (1999-04-29)
Re: parsing ".h subset" of c (Jerry Pendergraft) (1999-04-30)
| List of all articles for this month |

From: (Derek M Jones)
Newsgroups: comp.compilers
Date: 29 Apr 1999 00:36:27 -0400
Organization: Knowledge Software Ltd
References: 99-04-083
Keywords: C, parse


> I need a c-parser which parses ".h subset of c", namely
> c-files containing usual header declarations such as
> type definitions (typedef etc), macros (#define with or
> without parameters) and procedure signatures. (No problem if
> whole c is parsed).

Statements are easy to parse. It's the declarations that are hard.
You might as well use a parser for the full language.

Having said that:

void f(void)
int i;
typedef int T_AND_L;

T_AND_L: i++;

is not always handled correctly.

> I guess there are pd-tools which can be used to get this information.
> Any suggestions, what tool(s) and how could be used ?

gcc springs to mind (lcc does not include a preprocessor).

Derek M Jones tel: +44 (0) 1252 520 667
Knowledge Software Ltd
Applications Standards Conformance Testing
[lcc didn't have a preprocessor originally, but they added one several years
ago -John]

Post a followup to this message

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