I am using javac from tools.jar (i.e. JavaCompiler) for parsing java files. I parse the sources using the implementation of TreePathScanner. So far, everything seems fine, as I can parse imports, package name, class name, method name, instructions...
But i do have problem with inline comments - I can not simply make them appear in the created AST tree, or visited them. I am able, however, to read javadoc comments for classes, methods etc, but no inline comments.
How to read inline comments in the best way? I am looking at the netbeans source code (as it is using javac for parsing, too), but i can not find easily anything about it.
My desperate solution would be using statements position of the source file, and then manually parse for comment everything whats between two statement. Or similar thing, but between two tree nodes.
Does anyone know better solution? Thank you!