Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

Some parser-related questions

(1/2) > >>

junior07:
Hi all !
I am playing a little with C::B as I am looking for a free C++ IDE (free means no money of course, but open source is even better  :D)

Well, back to technical stuff.
I was testing the code completion feature as it is a key functionality for me. I find it useful as a reminder, in particular for structure and class members.
But I notice a few problems :
- structures defined with the "typedef" keyword are not handled properly
- classes with several "public" areas are not handled properly.

So I went to the SVN source codes and have a look at the ParserThread code.
I noticed that "typedef" was voluntarily not taken into account. Why does this behavior have been designed ? When I comment out references to "typedef" (in fact "kw_typedef" so that the parser ignore it), the parser seems to run better. What's wrong with this ?

Concerning classes, I have not looked at it yet, but it seems there are problems when handling nested public/protected/private portions in class definitions. Any remarks on it ?

Have a nice WE
Junior

rickg22:
it's not that typedef was taken out. It's that it was NEVER implemented :P

About public / private etc., I really don't know... could you post an example?

Game_Ender:
If you want to spend time on the codecompletion plugin you might want to take a stab at integrating the CTags based parser here: Eranfs CTags Based Parser.  It supports templates, typedefs, and hopefully is a little more stable on Linux, but that will have to be tested.

Rickg22-  Thanks for all the work on the CodeCompletion plugin, it has proved much in the last month.

junior07:

--- Quote from: rickg22 on February 04, 2006, 04:52:00 pm ---it's not that typedef was taken out. It's that it was NEVER implemented :P

About public / private etc., I really don't know... could you post an example?

--- End quote ---

I don't understand why you say it has never been implemented because it appears in the file parserthread.cpp used for parsing :


--- Code: ---const wxString kw_typedef(_T("typedef"));
--- End code ---


--- Code: ---else if (token==ParserConsts::kw_typedef
||
token==ParserConsts::colon)
{
SkipToOneOfChars(ParserConsts::semicolonclbrace, true);
m_Str.Clear();
}
--- End code ---


--- Code: ---else if (token==ParserConsts::kw_typedef ||
token==ParserConsts::kw_return ||
token==ParserConsts::colon)
{
SkipToOneOfChars(ParserConsts::semicolonclbrace, true);
m_Str.Clear();
}
--- End code ---

So, to my mind, typedef seems to be taken into account. But I wonder how those who originally wrote this code were thinking they should deal with this statement. It seems they ignore it.

For the second point (public/protected/private sections handling), I'm trying to reproduce the behavior I noticed this morning, but can't get it yet. Maybe was dreaming. I have experimented lots of code tuning.

Anyway, keep on this wonderful work guys, I learn to be able to help in a near future !

thomas:

--- Quote ---I don't understand why you say it has never been implemented because it appears in the file parserthread.cpp used for parsing
--- End quote ---
It is parsed like all keywords, but its semantics are not implemented.

Navigation

[0] Message Index

[#] Next page

Go to full version