Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Using ASTParser
Using ASTParser [message #198299] Thu, 10 March 2005 14:52 Go to next message
Eclipse UserFriend
Originally posted by: ori_calvo.hotmail.com

Hello All,

Short
-------
How to convert a source line number to an ATSNode instance?

Long
------
I am using the ASTParser class to parse some java source files. I am trying
to associate a source code comment (not a javadoc comment) to the code
element which apears in the same line. Using the method
CompilationUnit.getCommentList I can get the list of comments in the source
code. Using each comment I can retrieve the char index (and therefore the
line number) of the comment. Now, suppose this line contains not only a
comment but also some kind of source code how can I get the appropriate
ASTNode for this source code?

Thanks, Ori
Re: Using ASTParser [message #198352 is a reply to message #198299] Thu, 10 March 2005 20:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: olivier_thomannNOSPAM.ca.ibm.com

Ori Calvo a écrit :
> I am using the ASTParser class to parse some java source files. I am trying
> to associate a source code comment (not a javadoc comment) to the code
> element which apears in the same line. Using the method
> CompilationUnit.getCommentList I can get the list of comments in the source
> code. Using each comment I can retrieve the char index (and therefore the
> line number) of the comment. Now, suppose this line contains not only a
> comment but also some kind of source code how can I get the appropriate
> ASTNode for this source code?
I would do it with an ASTVisitor.
--
Olivier
Re: Using ASTParser [message #198394 is a reply to message #198352] Fri, 11 March 2005 02:45 Go to previous message
Eclipse UserFriend
Originally posted by: viraj.gs-lab.com

"Olivier Thomann" <olivier_thomannNOSPAM@ca.ibm.com> wrote in message
news:d0qtcb$il0$1@www.eclipse.org...
> Ori Calvo a
Previous Topic:Using JDT outside the eclipse platform
Next Topic:Survey on Understanding Code
Goto Forum:
  


Current Time: Sun Jul 13 06:50:43 EDT 2025

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

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

Back to the top