I have written a Python code to obtain the Parse Tree of a given Java source code using ANTLR4. I wish to convert this Parse Tree to AST and following that I wish to apply tree edit distance algorithm to different ASTs. The question is, how can I convert Parse Tree obtained from ANTLR4 to AST?
If the conversion is not possible is there a way to obtain AST directly from ANTLR4?
I believe resources for using ANTLR4 with Python3 are really limited and there are not many. So any help is appreciated. Thanks in advance.