By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,227 Members | 1,290 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,227 IT Pros & Developers. It's quick & easy.

parsing C code

P: n/a
hello,

I would like to parse C code with a (Gnu)Bison program. Can I find the
Bison definition of C somewhere, or do I have to start from scratch ?

thank you
jf
Nov 13 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
MENON Jean-Francois wrote:
hello,

I would like to parse C code with a (Gnu)Bison program. Can I find the
Bison definition of C somewhere, or do I have to start from scratch ?


K&R2 includes a C grammar which is almost Bison-ready.

--
Richard Heathfield : bi****@eton.powernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 13 '05 #2

P: n/a
Richard Heathfield wrote:

MENON Jean-Francois wrote:
hello,

I would like to parse C code with a (Gnu)Bison program. Can I find the
Bison definition of C somewhere, or do I have to start from scratch ?


K&R2 includes a C grammar which is almost Bison-ready.

--
Richard Heathfield : bi****@eton.powernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton


Thank you,
can I find this C grammar on the net ?
Nov 13 '05 #3

P: n/a
MENON Jean-Francois wrote:
Richard Heathfield wrote:

MENON Jean-Francois wrote:
> hello,
>
> I would like to parse C code with a (Gnu)Bison program. Can I find the
> Bison definition of C somewhere, or do I have to start from scratch ?


K&R2 includes a C grammar which is almost Bison-ready.

Thank you,
can I find this C grammar on the net ?


Did you try googling for C grammar?

The very first hit looked pretty useful to me.

--
Richard Heathfield : bi****@eton.powernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 13 '05 #4

P: n/a
Richard Heathfield wrote:

MENON Jean-Francois wrote:
Richard Heathfield wrote:

MENON Jean-Francois wrote:

> hello,
>
> I would like to parse C code with a (Gnu)Bison program. Can I find the
> Bison definition of C somewhere, or do I have to start from scratch ?

K&R2 includes a C grammar which is almost Bison-ready.

Thank you,
can I find this C grammar on the net ?


Did you try googling for C grammar?

The very first hit looked pretty useful to me.

--
Richard Heathfield : bi****@eton.powernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton


yes,
but did not find the Bison-ready file.
My first thought was to not re-invent the wheel :->
jf
Nov 13 '05 #5

P: n/a
MENON Jean-Francois wrote:
Richard Heathfield wrote:

Did you try googling for C grammar?

The very first hit looked pretty useful to me.
yes,
but did not find the Bison-ready file.


Well, the very first hit looked pretty Bison-ready to me.
My first thought was to not re-invent the wheel :->


My first thought is to get you to find the URL yourself, rather than
spoonfeed it to you.

Still, we could back-and-forth like this all day and get nowhere. Here:

http://www.lysator.liu.se/c/ANSI-C-grammar-y.html

--
Richard Heathfield : bi****@eton.powernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 13 '05 #6

P: n/a
Richard Heathfield wrote:

MENON Jean-Francois wrote:
Richard Heathfield wrote:

Did you try googling for C grammar?

The very first hit looked pretty useful to me.

yes,
but did not find the Bison-ready file.


Well, the very first hit looked pretty Bison-ready to me.
My first thought was to not re-invent the wheel :->


My first thought is to get you to find the URL yourself, rather than
spoonfeed it to you.

Still, we could back-and-forth like this all day and get nowhere. Here:

http://www.lysator.liu.se/c/ANSI-C-grammar-y.html

--
Richard Heathfield : bi****@eton.powernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton


thank you
Nov 13 '05 #7

P: n/a
Why reinvent the wheel. Did you look at doxygen and cc-doc type
tools. They parse C and C++ code.

Sandeep
--
http://www.EventHelix.com/EventStudio
EventStudio 2.0 - Distributed System Design CASE Tool
Nov 13 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.