Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » how to find a sibling node in Eclipse AST
how to find a sibling node in Eclipse AST [message #770643] Sat, 24 December 2011 18:12 Go to next message
Eclipse UserFriend
Given an AST node, I can use getParent()
to get its parent AST node. But, how can
I get its previous closest AST sibling node?
Thanks.
wws
Re: how to find a sibling node in Eclipse AST [message #773632 is a reply to message #770643] Mon, 02 January 2012 01:05 Go to previous message
Eclipse UserFriend
It could be simpler if you know the type of the ASTNode.
If you want to do it generically, look at org.eclipse.jdt.core.dom.NodeFinder and org.eclipse.jdt.core.dom.NodeFinder.NodeFinderVisitor. You could either use this or have your visitor do something like this.
Previous Topic:Eclipse editor, highlight based on brackets
Next Topic:Classpath entry will not be exported or published. Runtime ClassNotFoundExceptions may result.
Goto Forum:
  


Current Time: Sat May 17 21:46:59 EDT 2025

Powered by FUDForum. Page generated in 0.03349 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top