On Sun, 6 Jan 2008 21:19:00 -0800 (PST)
wrote:
n> I'm looking for a grammar to help with parsing C programs. Is there
n> something ready? (I've seen in perlmonks some regular expression
n> method, but it's a bit weak to my needs).
AFAIK this is a hard problem that hasn't been solved yet. P::RD could
do it, in theory, but what I've seen are only partial implementations.
If you or anyone else have an actual functioning lexer and parser or the
equivalent P::RD grammar, I'd be very interested in taking a look. I've
wished for something like that myself but never had the time to work on
it.
Florian's answer is a good starting point, but actually implementing the
BNF is the hard part.
Ted