C Grammar for Parse::RecDescent

N

necnecnecnec

Hello,

I'm looking for a grammar to help with parsing C programs. Is there
something ready?
(I've seen in perlmonks some regular expression method, but it's a bit
weak to my needs).

Thanks,
Nec
 
T

Ted Zlatanov

On Sun, 6 Jan 2008 21:19:00 -0800 (PST) (e-mail address removed) 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top