Author Topic: Intergrate the nativeparser_base to our parsertest project  (Read 32276 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5229
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Intergrate the nativeparser_base to our parsertest project
« Reply #30 on: July 12, 2012, 08:45:00 am »
You may not understand my idea.
...maybe I need to rre-phrase. As you see:
Code: [Select]
<Unit filename="cc_test\test.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
...although the file is in the project, it belongs to a the special target "{~None~}" which means in no target it is checked. I was under the impression hat only those files are parsed, that belong to a real target (like "default") and this file only in case it is being opened (which you don't need to do). How does CC collect its list of files to parse precisely? I'll have a look...
I think CC just add all the files belong to the project, you can see below:
Code: [Select]
void NativeParser::AddProjectToParser(cbProject* project)
{
....



    if (project)
    {
        size_t fileCount = 0;
        for (FilesList::iterator it = project->GetFilesList().begin(); it != project->GetFilesList().end(); ++it)
        {
            ProjectFile* pf = *it;
            if (pf && FileTypeOf(pf->relativeFilename) == ftHeader)
            {
                if (AddFileToParser(project, pf->file.GetFullPath(), parser))
                    ++fileCount;
            }
        }
        for (FilesList::iterator it = project->GetFilesList().begin(); it != project->GetFilesList().end(); ++it)
        {
            ProjectFile* pf = *it;
            if (pf && FileTypeOf(pf->relativeFilename) == ftSource)
            {
                if (AddFileToParser(project, pf->file.GetFullPath(), parser))
                    fileCount++;
            }
        }

        wxString log(F(_("Done adding %d files of project (%s) to parser."), fileCount, prj.wx_str()));
        CCLogger::Get()->DebugLog(log);
    }

...

BTW: I noticed that in our codeblocks.cbp, there are different targets which have the save class name "Token", CodeCompletion plugin target and debugger plugin target. Click on the "Token" and context menu select goto declaration will bring me to:
Code: [Select]
plugins\debuggergdb\parsewatchvalue.cpp
This is pretty annoying...... :(
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9580
Re: Intergrate the nativeparser_base to our parsertest project
« Reply #31 on: July 13, 2012, 09:37:28 am »
I think CC just add all the files belong to the project, you can see below:
[...]
Hmmm... seems you are right. But if that is a good idea... I don't know. At least we should skip files not related to any target. This would avoid the freeze you are mentioning.

BTW: I've done the directory layout changes in trunk. I merged them from the xml_compiler branch which was actually an error. I meant these 4 commits to be applied in trunk had not switched back to trunk before the first commit. ::) :-[

However - we have the history.... although its in a branch. And as it doesn't do any functional change its OK I'd say...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12316
    • Travis build status
Re: Intergrate the nativeparser_base to our parsertest project
« Reply #32 on: July 13, 2012, 10:41:21 am »
BTW: I've done the directory layout changes in trunk. I merged them from the xml_compiler branch which was actually an error. I meant these 4 commits to be applied in trunk had not switched back to trunk before the first commit.
Wow, you're using single working copy for all the branches? You're a brave man:)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9580
Re: Intergrate the nativeparser_base to our parsertest project
« Reply #33 on: July 13, 2012, 10:54:22 am »
Wow, you're using single working copy for all the branches? You're a brave man:)
You can switch only partially to a branch, like I did for the CC plugin. This is nice if the changes are related to a single directory, only. Unfortunately here, I forgot to switch this folder back to trunk before. After the first commit I realised that I had even clicked away the warning of the SVN software... maybe it was too early today. ::)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ