Hi, I have briefly review the code
global-5.9.6\libparser\Cpp.c

It seems the parser was quite limited on parsing c++ language.

Here are my suggestions:

take some reference:
1, ctags
2, codeblocks' parser
3, clang/qtcreater...

I have a collecting on
Code Completion Design - CodeBlocks - http://wiki.codeblocks.org/index.php?title=Code_Completion_Design See its last chapter, I have list a lot of parser reference. (most of them were GPLed project)

About the full stage:
lexer
preprocessor
parser

I think a full preprocessor is not necessory, but a lexer is necessory, I have try to rewrite the code::blocks' parser by using Quex lexer, this will make your parser code clean and easy to learn.

See my personal parser project:
http://code.google.com/p/quexparser/

Mostly, I think you need to use the "recursive decent parser", so you create a lot of functions like:
HandleClass();
HandleNamespace();
HandleWhile();

You can see my code:
http://code.google.com/p/quexparser/source/browse/trunk/cppparser/parserthread_test.cpp

The code should be easy to read.

For this kind of bug:
http://lists.gnu.org/archive/html/bug-global/2011-05/msg00000.html
I think you can add some simple replacement rule to skip Some user defined words in the lexer/preprocessor stage.
This is much like the ctags -I option.


Finally, I'm grad to see the gtags project and hope it will becomes mature in the future.

asmwarrior
ollydbg from code::blocks' forum

_______________________________________________
Bug-global mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-global

Reply via email to