News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

variable seperated by commas

Started by ollydbg, December 21, 2009, 10:54:05 AM

Previous topic - Next topic

ollydbg

For example:

int *a,b;


In the current CodeCompletion symbol browser, there are two Tokens found.


a, its type is int*
b, its type is int*


I think it is wrong, because the correct Token should be


a, it's type is int*
b, it's type is int


In the code:
wxString ParserThread::GetActualTokenType()

it seems the "*" is binding to the left. So, if you define a variable like below:


const wxString * AAAA;


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:
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;


We only take care of the "semicolon", but how can we deal with commas

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

blueshake

also these test codes don't work .

#include <iostream>

using namespace std;
typedef class qq
{
    int x;
    int y;
}*pp;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}


see the screen shot.

[attachment deleted by admin]
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

blueshake

not work for these codes ethier.

#include <iostream>

using namespace std;
class qq
{
    int x;
    int y;
}tt,*pp;
int main()
{
    cout << "Hello world!" << endl;
    return 0;
}
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?