Dear Clang Dev:
I have a RecursiveASTVisitor. I'd like to know the relative relationship
between a node I'm currently visiting with the previous node visited.
Basically, I'm trying to write a visitor which gives back an array of
the depths of each node during the traversal. So, if a node is a child
of the previously visited node, then its depth is 1 more than the depth
of the previous node, and if it is a sibling it is the same. If it is a
cousin of some sort, it's more difficult, and I would need to know just
how far away that node is from the previous.
Another approach would be to just determine this depth directly given a
node and walk up it's parent chain to the root. I'm find with doing this
as well, but I can't seem to find something that gives me the parent of
a node.
Yours truly,
Aaron W. Hsu