How does C++ support create class declarations?

Andreas Pakulat apaku at gmx.de
Sun Feb 17 22:18:17 UTC 2008


Hi,

seems I'm still missing a piece here. Looking at C++ highlighting code I
see this:

if( dec->context()->scopeIdentifier().isEmpty() )
{
   type = GlobalVariableType;
}...

and I'm wondering why that isn't empty. For Python scopeIdentifier is
empty, although qualifiedIdentifier of the declaration returns something
meaningful. I really must be missing something here. Currently what I do
is:

openContext( astnode, DUContext::Class, identifierForName(
astnode->className ) );
addImportedContext();
openDefinition( astnode->className, astnode );
...

which gives me a context with scopeIdentifier "Bar" (using the
includeClasses option) and a declaration with qualifiedIdentifier
"Bar::". 

So what am I doing wrong, that my declarations context returns "" for
scopeIdentifier() while obviously that from C++ doesn't. Or is it
correct in C++ to get a GlobalVariableType for a class Foo {};?

Andreas

-- 
Your own qualities will help prevent your advancement in the world.




More information about the KDevelop-devel mailing list