"ciju" <ci**********@g mail.com> writes:
Try Lex & Yacc
The question, which you failed to quote, was:
"Nikhil" <n.********@gma il.com> writes:
| I was interested in knowing of there are parsers in C than can parse C
| code in some form of Data Structures and then after some user
| manuplation, write back the code in a file.
|
| A commercial tool which can do that would be the best ...
Please read <http://cfaj.freeshell. org/google/>.
As it turns out, typedefs make C very difficult to parse with just the
usual tools. (I speak from painful experience.) The preprocessor
makes it nearly impossible, unless you parse the code *after* it's
been preprocessed (or implement your own preprocessor as part of your
parser).
A Google search for "C parser" is undoubtedly the best first step.
You can reinvent this particular wheel if you like, but making it
round is going to be harder than you think.
--
Keith Thompson (The_Other_Keit h)
ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.