[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-compiler-dev
Subject:    Best way to get com.sun.source.doctree.DocTree?
From:       Harry Terkelsen <het () google ! com>
Date:       2014-09-30 23:06:10
Message-ID: CAPc8kayJgShPXiJT9qAD-BCSd2OeNbdtGPRsAZOJ4Mpqg+1KrQ () mail ! gmail ! com
[Download RAW message or body]

Hi compiler devs,

I would like to use the DocTree API for JavaDoc comments but I don't see
any way to get a DocTree from a JavaDoc comment?

Is there any way to simply parse a JavaDoc comment, given as a String,
along with the start and end positions in the original source, and get back
a DocTree with source positions properly set? In other words, is it
possible to write this method:

DocTree parseDocTree(String comment, int pos, int endPos);

If that is not possible, I see that I can go from TreePath ->
DocCommentTree with DocTrees#getDocCommentTree(TreePath) but I'm assuming
this is only for JavaDoc comments that are attached to top-level program
elements. Is this the only way to get DocTrees?

Thanks!
Harry

[Attachment #3 (text/html)]

<div dir="ltr">Hi compiler devs,
<div><br></div><div>I would like to use the DocTree API for JavaDoc comments but I \
don&#39;t see any way to get a DocTree from a JavaDoc \
comment?</div><div><br></div><div>Is there any way to simply parse a JavaDoc comment, \
given as a String, along with the start and end positions in the original source, and \
get back a DocTree with source positions properly set? In other words, is it possible \
to write this method:</div><div><br></div><div>DocTree parseDocTree(String comment, \
int pos, int endPos);</div><div><br></div><div>If that is not possible, I see that I \
can go from TreePath -&gt; DocCommentTree with DocTrees#getDocCommentTree(TreePath) \
but I&#39;m assuming this is only for JavaDoc comments that are attached to top-level \
program elements. Is this the only way to get \
DocTrees?</div><div><br></div><div>Thanks!<br>Harry</div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic