I should explain my question better, I have a C++ header file, I would like to write a parser which parse this files and genrate a text file for all struct enum etc ... even if there is instances. Any idea ? | [reply] |
| [reply] |
Hah, somebody does read my blog sometimes. :}
| [reply] |
I'm working on this right now.
hparse at http://gist.github.com/395160
c++ would need some more love, certainly. This is just the first simple start. But funcs and structs are correctly dumped.
| [reply] |
Have you looked at the ctags docs to see what it can do, or better
yet, tried to run it on one of your header files to see what output it
produces, and how far that is away from what you need?
From your current description, ctags still sounds like a good fit: it
can parse C++ header files, and can create a text output file with info
about the structs, enums, etc. found in the header files. The only
problem is that you don't have to write it yourself ;) —
But if you ask me, I'd rather avoid having to write a parser for
anything as complex as C++...
If the ctags output isn't exactly what you need, you can still
postprocess it using Perl, but in this case the hard work has already been done.
To give people a clearer idea of what you need, it almost always
helps to supply some sample in- and output, i.e. post a sample header
file together with the output that you expect to be created from that input.
| [reply] |