Making duchain non-language-dependant

David Nolden zwabel at googlemail.com
Tue Aug 28 13:28:17 UTC 2007


Hi! Sorry that I'm answering late, and out of the thread. My mailing-list 
subscription is broken so I'm answering from the archive.

Aleix:
I don't exactly understand your proposal. :)

I think the declaration/definition system should be enough to cover all 
languages. 

In languages where there is no separate definitions like CMake or python, 
KDevelop::Definition will never be used, and 
KDevelop::Declaration::declarationIsDefinition() should always return true.

In languages where variables are not explicitly declared, like CMake or 
python, you can simply consider the first use of a variable its Declaration.
This means that while building the du-chain you call findDeclarations(..) to 
see whether the variable is already declared, and if it is not, you create a 
Declaration.

For global variables that are always there, like CMAKE_CURRENT_SOURCE_DIR, 
what about statically creating one global DUContext that contains all those 
variables, and then importing that context into every source-file?

greetings, David




More information about the KDevelop-devel mailing list