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

vector<int> is OK, but string or wstring no-work.

<< < (3/23) > >>

blueshake:

--- Quote from: MortenMacFly on January 06, 2010, 01:01:49 pm ---
--- Quote from: blueshake on January 06, 2010, 12:23:31 pm ---
--- Quote ---Parsing stage done (141 total parsed files, 28885 tokens in 0 minute(s), 1.781 seconds).
--- End quote ---

--- Quote ---Parsing stage done (164 total parsed files, 30028 tokens in 0 minute(s), 1.985 seconds).
--- End quote ---

--- End quote ---
Hmmm... could you do me a favour and try r6044 versus r6045? r6044 should still work. The modifications between r5986 and r6044 should not matter.

--- End quote ---

It is a shame to say that I don't know how to do it.

and I turn the real-time parse off in latest svn with nothing changed.

the issue still exist.so I think there is something wrong with parserthread.


I found a big problem.
try these codes.


--- Code: ---#include <iostream>

using namespace std;
class qq
{
    int x;
    int y;
};
typedef qq pp;
typedef pp tt;
tt cc;//



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


follow the steps below:
-save the codes in cb
-close the cb application.
-restart the cb ----------------at this point .the parser work fine.
-add any codes below tt cc;//-----------------then the variable can not be parsed correctly.there is no any variable in the symboltree.

MortenMacFly:

--- Quote from: blueshake on January 06, 2010, 01:19:01 pm ---the issue still exist.so I think there is something wrong with parserthread.

--- End quote ---
OK - after some tests it's definitely related to:
http://forums.codeblocks.org/index.php/topic,11754.msg79756.html#msg79756

Stage management is not working as before. OllyDbg?!

ollydbg:

--- Quote from: MortenMacFly on January 06, 2010, 02:27:20 pm ---
--- Quote from: blueshake on January 06, 2010, 01:19:01 pm ---the issue still exist.so I think there is something wrong with parserthread.

--- End quote ---
OK - after some tests it's definitely related to:
http://forums.codeblocks.org/index.php/topic,11754.msg79756.html#msg79756

--- End quote ---

I will check this bug. It seems the preprocessor of "include" statement is not correct.


--- Quote ---Stage management is not working as before. OllyDbg?!

--- End quote ---
what does "stage management" means???

MortenMacFly:

--- Quote from: ollydbg on January 06, 2010, 02:34:09 pm ---
--- Quote ---Stage management is not working as before. OllyDbg?!
--- End quote ---
what does "stage management" means???

--- End quote ---
It meant the modifications you did with Tokenizer state (introducing the enum TokenizerState).
For example (void ParserThread::DoParse()):
Before:

--- Code: ---        else if (token==ParserConsts::kw_operator)
        {
            bool oldState = m_Tokenizer.IsSkippingUnwantedTokens();
            m_Tokenizer.SetSkipUnwantedTokens(false);
            m_Tokenizer.SetOperatorState(true);

--- End code ---
After:

--- Code: ---            TokenizerState oldState = m_Tokenizer.GetState();
            m_Tokenizer.SetState(tsSkipNone);

--- End code ---

...or (void ParserThread::HandleClass(EClassType ct, const wxString& templateArgs)):
Before:

--- Code: ---    // don't forget to reset that if you add any early exit condition!
    bool oldState = m_Tokenizer.IsSkippingUnwantedTokens();
    m_Tokenizer.SetSkipUnwantedTokens(false);

--- End code ---
After:

--- Code: ---    // don't forget to reset that if you add any early exit condition!
    TokenizerState oldState = m_Tokenizer.GetState();
    m_Tokenizer.SetState(tsSkipUnWanted);

--- End code ---

This might be a mistake...?!

ollydbg:
Ok, let's explain some thing about introduce a "state" variable in the Tokenizer.
There are several reasons:

1, Before that, Tokenizer use a bool variable SkipUnWanted to determine where the Tokenizer need to skip some statement like  assignment "=" or array subscirpt "[]".

2, Angle Brace is a single token return from the Tokenizer::GetToken or Tokenizer::PeekToken.
But when we want to read the template argument. like the code below:

--- Code: ---template < XXXX >
class AAA{
...
}

--- End code ---

I would perfer the Tokenizer return the whole string < XXXX >

3,When we are entering some context, we should save the context state.
Before:

--- Code: ---bool oldState = m_Tokenizer.IsSkippingUnwantedTokens();
            m_Tokenizer.SetSkipUnwantedTokens(false);
            m_Tokenizer.SetOperatorState(true);
            

Do some parsing..


            m_Tokenizer.SetSkipUnwantedTokens(oldState);


--- End code ---
But I think a bool variable is not enough to describe all the context, so ,I use a more flexiable enum variable.

The benifit is that Currently, CC is only a partily parser, which means some statements are skiped( currently, the member function body is skiped, the statement in the right side of an assignment is skiped too). But for the long run, I think add a state is convient :D

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version