Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » children of org.eclipse.jdt.core.dom.ASTNode
children of org.eclipse.jdt.core.dom.ASTNode [message #900466] Tue, 07 August 2012 08:17 Go to next message
Joel Bobstein is currently offline Joel BobsteinFriend
Messages: 7
Registered: April 2012
Junior Member
Using Eclise JDT, I need to retrieve the children of any AstNode. Is there a utility method somewhere that I could use ?

The only way I can think of right now is to subclass AstVisitor and treat each kind of node manually to find its children. But it's a lot of work to study every node type.
Re: children of org.eclipse.jdt.core.dom.ASTNode [message #900877 is a reply to message #900466] Wed, 08 August 2012 19:19 Go to previous message
Jacek Pospychala is currently offline Jacek PospychalaFriend
Messages: 159
Registered: July 2009
Senior Member
hi you should ask this question on JDT (Java Development Tools) group, not on PDT (PHP Development Tools) group.

Implementing ASTVisitor interface is the way to go. You could have a look at other's implementations of ASTVisitors by finding out that class (Ctrl+Shift+T and enter "ASTVistor) and then searching all it's subtypes (Ctrl+T).
In PDT's ASTVisitor we have convenience method ASTVisitor.visitGeneral(ASTNode) that is being called for every node. Not sure if that's the same for JDT AST though...


Previous Topic:Eclipst PDT on Mountain Lion
Next Topic:Adding Syntax Elements
Goto Forum:

Current Time: Thu Feb 02 22:37:18 GMT 2023

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

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

Back to the top