Locational attributes of ASTNodes. [message #249867] |
Wed, 28 November 2007 08:22  |
Eclipse User |
|
|
|
Dear friends,
I had posted a similar query sometime back but didnt get any reply.
How do we know the location of the various ASTNodes in the corresponding
source code? Here location would incorporate
1. Line number
2. Starting Column Position and,
3. Ending Column Position
Also, Is it possible to get the number of lines in a block, method, class,
etc. ?
Regards,
Rahul Mishra
|
|
|
Re: Locational attributes of ASTNodes. [message #249882 is a reply to message #249867] |
Thu, 29 November 2007 09:42  |
Eclipse User |
|
|
|
Originally posted by: jacek.pospychala.pl.ibm.com
Rahul,
you should get the offset and length of ASTNode pretty easily. To
convert them to line/column number values use IDocument API. Be sure to
use exactly the same IDocument from which AST was built, or you may get
wrong values or even BadLocationExceptions.
Rahul Mishra wrote:
> Dear friends,
>
> I had posted a similar query sometime back but didnt get any reply.
> How do we know the location of the various ASTNodes in the
> corresponding source code? Here location would incorporate
> 1. Line number
> 2. Starting Column Position and,
> 3. Ending Column Position
>
> Also, Is it possible to get the number of lines in a block, method,
> class, etc. ?
>
> Regards,
> Rahul Mishra
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02613 seconds