Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] AST traversal

Not sure what you mean by bottom up. Certainly you can navigate from a child node to its parent by following the getParent links. You can also tell what property you are in the parent by looking at getPropertyInParent. Not sure what else you would need.


Doug Schaefer, QNX Software Systems

Eclipse CDT Project Lead, Tools PMC member


From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Yuan Zhang
Sent: Saturday, July 08, 2006 5:08 PM
To: cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] AST traversal




I noticed that ASTNode.accept() and ASTVisitor.visit() together provide a top-down traversal of the AST. I am wondering whether there is a way to traverse the AST from bottom-up without modifying the current code? I have thought to associate each node a "property", and during the traversal change the parent node's property of the currently visited node. However, I cannot find any appropriate place to store this "property". Anybody can give me some hint?





Back to the top