Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Nested For Looy
Nested For Looy [message #201721] Fri, 22 April 2005 06:04 Go to next message
Eclipse UserFriend
Originally posted by: hmcbride.curamsoftware.com

I am extending the ASTVistor trying to detect nested for loops


public boolean visit(ForStatement forst)
{
System.out.println("In for loop");

}


I am trying to figure out if that has a block statement
that itself has a for statement but examples of the api
are kind of sparse and I am looking at examples on this newsgroup
to get an idea how it works. Any examples/pointers on how one
would do this would be greatly appreciated.
Re: Nested For Looy [message #202095 is a reply to message #201721] Wed, 27 April 2005 12:58 Go to previous message
Eclipse UserFriend
You can maintain a reference count to check the nesting level inside the
visit(ForStatement) method. If you need the exact location of the inner for
statement in the outer for statement, use ASTNode#getParent or
ASTNode#getLocationInParent to find the block statement which contains the
nested for statement.

Tobias

"Hugh McBride" <hmcbride@curamsoftware.com> wrote in message
news:1ae495268648c4b4402438ba7b9733c7$1@www.eclipse.org...
>
> I am extending the ASTVistor trying to detect nested for loops
>
> public boolean visit(ForStatement forst)
> {
> System.out.println("In for loop");
>
> }
>
>
> I am trying to figure out if that has a block statement that itself has a
> for statement but examples of the api are kind of sparse and I am looking
> at examples on this newsgroup
> to get an idea how it works. Any examples/pointers on how one
> would do this would be greatly appreciated.
>
Previous Topic:Odd behavior when attempting to extend AbstractDebugView
Next Topic:Debugger showing incorrect line numbers
Goto Forum:
  


Current Time: Sun Jul 20 16:30:22 EDT 2025

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

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

Back to the top