Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » ASTVisitor.visitGeneral
ASTVisitor.visitGeneral [message #25580] Thu, 12 June 2008 16:25 Go to next message
Charles Doucette is currently offline Charles DoucetteFriend
Messages: 125
Registered: July 2009
Senior Member
Might I suggest that your method visitGeneral have the following
implementation:

public boolean visitGeneral(ASTNode node) throws Exception {
node.traverse(this);
return true;
}

This should make sure that every node in the tree is traversed by default,
even if the visitor does nothing with each node.

Thanks,
Chuck
Re: ASTVisitor.visitGeneral [message #25619 is a reply to message #25580] Thu, 12 June 2008 20:53 Go to previous message
Charles Doucette is currently offline Charles DoucetteFriend
Messages: 125
Registered: July 2009
Senior Member
Please ignore this post.
I got confused.

It is now my understanding that ASTNode and its subclasses will implement
the traverse method
to
a) call visitor.visit(this)
b) call traverse(visitor) on any child nodes
c) call visitor.endvisit(this)

Each Visitor class simple operates on each node it is passed in visit and
endvisit.

Chuck

"Chuck Doucette" <cdoucette@vaultus.com> wrote in message
news:g2rint$sae$1@build.eclipse.org...
> Might I suggest that your method visitGeneral have the following
> implementation:
>
> public boolean visitGeneral(ASTNode node) throws Exception {
> node.traverse(this);
> return true;
> }
>
> This should make sure that every node in the tree is traversed by default,
> even if the visitor does nothing with each node.
>
> Thanks,
> Chuck
>
>
Previous Topic:(org.eclipse.dltk.ui.text.completion.)ProposalInfo.getHTMLContentReader:150 - NullPointerException
Next Topic:type hierarchy and code completion
Goto Forum:
  


Current Time: Fri Apr 12 18:53:21 GMT 2024

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

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

Back to the top