Multi-Dimensional Arrays


I am looking towards writing a AST visitor using the RecursiveASTVisitor class. I am done with the simple variables and operators. However, now I am trying to write visitors for arrays.

The problems I am facing is that how do I figure out the dimensionality of the arrays and the respective size of each dimension ?

In the AST, the declaration is of the DeclStmt . How do I get the size and type information from the Decl object ?
Is that information available in the Type class ? If not, what classes do I need to look at ?


P.S : I know this might be too basic for the experts out here, but still any pointers will be appreciated,

You might want to have a look at how this is implemented in libclang; see CXType.cpp and specifically clang_getArraySize and clang_getArrayElementType.