Awesome, sounds very promising! Thanks a lot!
because the "x" in interrupt(x) changes, can i do something like strip all strings starting with "__attribute__"?
As for the * rule, it is able to strip parentheses and such, but can it also strip what is inside the ()?
Hi, those rules were added years ago, it was mainly in the code completion's source code:
void Tokenizer::MacroReplace(wxString& str)
Which is under:
svn.berlios.de/svnroot/repos/codeblocks/trunk/src/plugins/codecompletion/parser/tokenizer.cpp
So, if you need any improvement, patches were welcome.
In-fact, I would like to implement these rules just like we define a real macro, such as:
#define _GLIBCXX_BEGIN_NESTED_NAMESPACE(a,b) namespace a {
So, it will be more clean then the currently way:
Current replace ruleor is it possible to see to the parser output somehow so I can try different rules?
If you can build c::b yourself, there is a cc_test project(cbp), then you can enable the TRACE, and see what the parser do when parsing the file.
EDIT:
One more question..
Does the parser read the code "as is", or does it run the preprocessor first?
There is no "preprocessor" stage in our parser, this takes a lot of time, we even don't expand the #include directive, the parser only parse each file(header file or source file) once, and it did some macro replacement in its tokenizer, also it guess whether it hit some macros in some heuristic way. Also, our parser is only a very simple c++ parser, we don't use semantic check or other complex things.
EDIT 2:
I managed to achieve wanted result by adding rules
"wakeup -> "
and
"interrupt -> void"
because the token created from interrupt(USCIAB0RX_VECTOR) is apparently only "interrupt", it got replaced nicely!
Thanks for your help!
Grad to see you solved the problem.