Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
NEW PLUGIN: Code Browser
rickg22:
OK here are some hints.
Function (and method) tokens have the starting and ending line, so you know where to search.
Also, you might need to use regular expressions to find calls to existing functions. Anything which has ( ... ) will do. Or perhaps [A-Za-z_][A-Za-z_0-9]+\( or something. Also try to search for full words for "word1 word2;" or "word1 word2 = " or "word1 word2," where word1 is the type (class, typedef, etc) you're looking for. (That's without taking into account the pointers).
After that, search if your existing tokens match one of those words. Then start making a dependency tree. But be careful, if you do it wrong you might end up making an endless loop.
eckard_klotz:
Hello Everybody.
Perhaps it is easier to implement it as a doxygen plug-in. Doxygen itself (http://www.stack.nl/~dimitri/doxygen/) is a terminal-application for win32, linux and some other systems to generate the diagrams you need out of the original source. It is also possible to generate a xml-output that is a good database for other statistics and diagrams. I use it to generate nassi-shneiderman diagrams (http://sourceforge.net/projects/moritz).
The idea is to save the function that should be analysed in a single file by the plug-in. This single file will be analysed by doxygen. And than the plug-in shows the result.
Kind Regards,
Eckard Klotz.
dje:
Hi !
If you use this one
--- Quote ---[A-Za-z_][A-Za-z_0-9]+\(
--- End quote ---
, don't forget to add unnecessary blanks before parenthesis.
Dje
szczepan:
--- Quote from: rickg22 on July 12, 2007, 09:01:58 pm ---Now, the HARD PART would be to add / edit methods from UML and generate the C++ code, because our parser isn't C++ complete.
--- End quote ---
I've been playing with Eclipse CDT recently and I must say that, contrary to my prior intuition, a complete C++ parser seems feasible. CDT's full parser, which is written in Java, achieves parsing times that would be just about acceptable when divided by Java's "honey factor" :)
jaxon:
Hi all! I want to ask a really stuped question... I understand.
gcc/g++ is open source and it has a complete c++ parser... I think. So, why not to use in in code completion? it seems fast enuogh being able to use precompiled headers...
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version