Mycode(in python):
lexer = VisualBasic6Lexer(antlr4.InputStream(code))
stream = antlr4.CommonTokenStream(lexer)
parser = VisualBasic6Parser(stream)
tree = parser.visitModule() //This visitModule() is not the coreect method.
print(tree)
I followed this link: Parsing some Java code with Python using ANTLR
Here,for Java they have used
tree = parser.compilationUnit()
In VB what is the alternative of this compilationUnit()
Grammar I used- https://github.com/antlr/grammars-v4/blob/master/vb6/VisualBasic6Lexer.g4 https://github.com/antlr/grammars-v4/blob/master/vb6/VisualBasic6Parser.g4
My goal is to export the Abstract Syntax Tree of a VB code using python into a JSON File.
See the output in this link https://github.com/Sdccoding/proleap-vb6-parser
I want my output to be in this beautified fashion.