The question is how do I get list of functions and variables from header file. I know how to populate in list and show whenever dot key is pressed. I was just checking if there is any methodology to parse header file to list its contents.![]()
The question is how do I get list of functions and variables from header file. I know how to populate in list and show whenever dot key is pressed. I was just checking if there is any methodology to parse header file to list its contents.![]()
If you want to have full list, you won't escape writing a kind of C++ preprocessor, because some variables (or even whole classes) can be declared using some of its features, like macro expansion or new line splitting.
Next thing is parse the C++ code itself - you need to be familiar with context free grammars. Parsing C++ code is a really tough task if you ask me.
Try to google for "writing a C++ parser" or something like that, and see for yourself.
In your case it could be easier than a "real" C++ parser, because you don't really have to care about syntax errors in general, as you are only interested in declarations - but a good IDE will warn about syntax errors as well
I don't really know how to help you, try to use google, maybe you can find some code samples or something.
Or maybe you can get inspiration from Qt Creator, since it's open source, here is a link to Qt Creator 2.1 source
Or you can drop your project and instead extend QtCreator. Many people would benefit from that.
What you need to ask yourself is "Does anyone want yet another C++ editor?". There are lots of editors already out there, why do want to put the time and effort into something that has already been done multiple times?
For example, Qt Creator does what you want and is free.
Netbeans does what you want and is free, cross platform, and multi language.
CodeLite does what you want and is free.
Visual Studio Express does what you want and is free.
etc...
If you want specific features that other editors don't have, then implement them via plugins. No need to write yet another editor from scratch.
I second that. Writing yet another text/code editor makes very little sense.why do want to put the time and effort into something that has already been done multiple times?
But if you simply enjoy doing it and/or you feel that you can learn a lot, then just do it.
Correct. And continue with your project if the answer is "Yes, I want it".What you need to ask yourself is "Does anyone want yet another C++ editor?"
Bookmarks