[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.technology.dltk] Re: ASTVisitor.visitGeneral
|
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@xxxxxxxxxxx> wrote in message
news:g2rint$sae$1@xxxxxxxxxxxxxxxxxxxx
> 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
>
>