Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-core-dev] CDT Indexing


Comments below...

cdt-core-dev-admin@xxxxxxxxxxx wrote on 05/26/2004 05:45:02 AM:

> I have come to know that the index has a store of all the symbols
> parsed by the parser in the form of AST nodes. But when the size of


Not exactly - the index is used as a "top level" guiding mechanism to help
clients confine their searches to a smaller scope. As such, it does not actually
persist the entire AST node, just the node type and name.

> the index goes beyond a set limit the index is merged into a file onthe disk.

> I have a few questions on this issue:
> firstly, is this file created for the sole purpose of limiting
> memory usage or it is reused whenever the CDT is restarted or a
> project is reopened.  In the former case, is the index recreated at


Index updates/modifications are triggered by resource changes - if a file changes, that
file gets reparsed and the results get merged into the index. The index is not recreated
every time upon startup (way too expensive!)

> startup by parsing all the projects or at least the currently opened files.

> secondly, does this index maintain a list of identifiers and their
> offsets in their files only. Or does it also store information
> regarding their type and symantics in the file they exist.. When we


Currently, the index maintains the identifiers and element type.
 
> say that the file has a record of relationships between different
> C/C++ elements. What kind of relationships are we talking about. I
> mean is it that its a variable, class definition, function or a member etc.


Yes - we keep track of whether an element is a declaration, definition or
reference as well as what its type is: class, struct, method etc.

> thirdly, when is the first COMPLETE_PARSE done, at startup or first
> content assist, etc. When a content assist is required does the CDT


Depends on the scenario - both the indexer and content assist use the parser
in complete parse mode (albeit different forms of complete parse). All parses are
requested by clients - so if the indexer is triggered it will do a complete parse.

> parses all the included files (all of the project in case "search
> entire project" is selected from user preferences) again or does it
> loads their symbol tables from hard disk or has it already parsed
> them at some previous instance etc.


If "search current file and included files" is selected, then content assist will
do a new parse of the current files + included ones. If "search current project" is
selected, then content assist will still do a new parse of the current file + included
files but will also use the search engine to find other completions.

> I would be grateful if you take your time in answering my questions.
> Thankyou for all the help I got so far.

>
> --

> __________________________________________________________
> Sign-up for Ads Free at Mail.com
> http://www.mail.com/?sr=signup

> _______________________________________________ cdt-core-dev mailing
> list cdt-core-dev@xxxxxxxxxxx http://dev.eclipse.
> org/mailman/listinfo/cdt-core-dev

Back to the top