javalang
javalang copied to clipboard
Can we use javalang to remove comments form java files?
I need just code, no inline or multiline comments, javadoc comments or copyright notices. How can I remove them? Tried regex but not very helpful since I have incomplete code / partial code.
This framework does not provide opportunity to generate code from AST. A comment is a kind of AST node, it can be also a statement/expression, etc. I see that you need to remove/insert AST nodes () from/to AST tree and then generate the source code from it. It is not possible, this framework is too weak. It can only search for smth (for AST node). You need to find another framework, it's better to use java framework like JDT