Definition/Declaration/Use usage

Andreas Pakulat apaku at gmx.de
Tue Aug 28 14:22:31 UTC 2007


On 28.08.07 15:50:26, David Nolden wrote:
> To the redeclaration:
> The du-chain can contain as many declarations of a name as you wish, it 
> probably just isn't useful.
> 
> As I've written to Aleix, the most logical solution would be:
> - Always test if the variable is already declared by using findDeclarations.
>   - If it is, create a Use.
>   - If it is not, create a Declaration.
> 
> That way foo=myobject1() would be a declaration, and foo=myobject2() would be 
> a use.
> 
> It of course depends on the language whether it's logical.

Well, the reason why I'm thinking about having "re-declaration" is that
this variable may change its type. Now I don't have the API docs at hand
at the moment, but doesn't the declaration carry the type of the
declared entity (i.e. variable)? Or is that completely separated?

Andreas

-- 
You will meet an important person who will help you advance professionally.




More information about the KDevelop-devel mailing list