Distinguishing between "variable" and "type" declaration

Hey,

I am using the python interface for libclang.
I am getting the cursor for a translation unit and work through all
childrens.

Than I am testing with cursor.kind.is_declaration if something is a
delcaration.
But now I want to distinguish between variable delcaration and
declaration for functions, classes (and other types).
How can I do this?

Thanks!
Nathan

Nathan,

cfe-dev list would be better suited for this question.

Anna.

Hey,

I am using the python interface for libclang.
I am getting the cursor for a translation unit and work through all
childrens.

Than I am testing with cursor.kind.is_declaration if something is a
delcaration.
But now I want to distinguish between variable delcaration and
declaration for functions, classes (and other types).
How can I do this?

Thanks!
Nathan

You can check `cursor.kind`. It will have a value like
`CursorKind.CLASS_DECL`, etc.

BTW are you using ipython? I find ipython's tab-completion is an
excellent way of discovering the libclang API. See for example
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-August/023449.html