Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign
variable seperated by commas
(1/1)
ollydbg:
For example:
--- Code: ---int *a,b;
--- End code ---
In the current CodeCompletion symbol browser, there are two Tokens found.
--- Code: ---a, its type is int*
b, its type is int*
--- End code ---
I think it is wrong, because the correct Token should be
--- Code: ---a, it's type is int*
b, it's type is int
--- End code ---
In the code:
wxString ParserThread::GetActualTokenType()
it seems the "*" is binding to the left. So, if you define a variable like below:
--- Code: ---const wxString * AAAA;
--- End code ---
AAAA is firstly regarded as a Token name.
Then we will analysis the const wxString * .
The currently CC didn't parser the pointer list definition well.
This also happens in handling typedefs.
Also, you can see the code in:
--- Code: ---void ParserThread::HandleTypedef()
{
size_t lineNr = m_Tokenizer.GetLineNumber();
bool is_function_pointer = false;
wxString typ;
std::queue<wxString> components;
// get everything on the same line
TRACE(_T("HandleTypedef() : Typedef start"));
wxString args;
wxString token;
wxString peek;
m_ParsingTypedef = true;
while (true)
{
token = m_Tokenizer.GetToken();
peek = m_Tokenizer.PeekToken();
TRACE(_T("HandleTypedef() : token=%s, peek=%s"), token.wx_str(), peek.wx_str());
if (token.IsEmpty() || token == ParserConsts::semicolon)
break;
--- End code ---
We only take care of the "semicolon", but how can we deal with commas
blueshake:
also these test codes don't work .
--- Code: ---#include <iostream>
using namespace std;
typedef class qq
{
int x;
int y;
}*pp;
int main()
{
cout << "Hello world!" << endl;
return 0;
}
--- End code ---
see the screen shot.
[attachment deleted by admin]
blueshake:
not work for these codes ethier.
--- Code: ---#include <iostream>
using namespace std;
class qq
{
int x;
int y;
}tt,*pp;
int main()
{
cout << "Hello world!" << endl;
return 0;
}
--- End code ---
Navigation
[0] Message Index
Go to full version