Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

NEW PLUGIN: Code Browser

<< < (3/4) > >>

rickg22:
GCC is an excellent parser, but remember we're dealing with different compilers. Besides, it can't give out the info. I think the best choice would be using the CTAGS parser.

jaxon:
CTAGS... looked at there page on sourceforge it seems to be a powerfull tool... and they say it's easy to use there parser in software! what is the reason to use another parser? or it is just historical?:)

P.S. we want to move completly to codeblocks it's build system is excelent!!! but we want cc to parse comments and show popup descriptions for symbols under mouse...

Joren7:
Ok...I'll use CTags as Parser. All I want to do (as code flows, function calls, function and type hierarchy...) is not so simple, and my ideas were realized in Eclipse's CDT extension  :(
I don't know it CTags is a good C++ parser, I think I'll have to work also with Lex and Yacc!
Is there in project to release a new parser for codeblocks?

rickg22:
I'm planning to make a new recursive descent parser for CodeCompletion, but I won't start until v1.0 is released.

eranif:
Couple of weeks ago, I re-wrote my CC library (CodeLite), in the following manner:

- ctags is used to create a symbol table
- In addition, and to complete the parser, I wrote 4 yacc grammars to parse the following:
1. scope
2. variables
3. functions
4. expressions

the scope parser:
this parser returns the given scope name at the end of the string, for example:

--- Code: ---namespace a {
class B{

--- End code ---

the above code, given to the scope parser will return a::B

the variable parser:
this parser can locate any member variable in a given scope (needed for the Ctrl+Space functionality), it usuaully used to parse the local scope.

the function parser:
since ctags does not return the function return value, I wrote this parser. It accepts the pattern from ctags (stored in the database) and returns its return value, this in turn can be searched in the symbol table (sqlite based table) for matching tokens.

the expression parser:
the complicated parser of the four, which evaluates expressions.
for example, assuming the following code:

--- Code: ---class MyClass {
wxString m_name;
public:
wxString getName(){return m_name;};
}
--- End code ---

Now, lets say user type the following:

--- Code: ---MyClass cls;
cls.getName().
--- End code ---

the last expression, is evaluated into wxString, which now CodeLite can suggest proper completion based on the symbol table, by performing simple SQL query.

these 4 parsers combined with CTAGS & Sqlite are working very nice together.

Eran

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version