Skip to main content



      Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » ASTVisitor.visitGeneral
ASTVisitor.visitGeneral [message #25580] Thu, 12 June 2008 12:25 Go to next message
Eclipse UserFriend
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 16:53 Go to previous message
Eclipse UserFriend
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: Wed Apr 16 14:09:25 EDT 2025

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

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

Back to the top