Detecting all variables from a class declaration


I’m looking for ways to detect all variable declarations from a class. I’ve started using a recursive AST visitor but that would require me to manually control the state of the the current parsing, which may become complicated for some corner cases, so I’m asking for general directions on how to do this using clang 3.1 or maybe trunk with it’s new tooling.