0

I already have a parser for Some language like Oracle with parse tree. My need to convert it from parse tree to AST (abstract syntax tree). But after spending a few hours reviewing the examples at some sites, I stil can't get a clear understanding of the grammar to Java process.

Is there some simple example, something like implemented with ANTLR going through the parser definition with AST result and all the way to the Java source code?

note: I learned antlr from https://theendian.com/blog/antlr-4-lexer-parser-and-listener-with-example-grammar/

Joe
  • 9
  • 3
  • Such broad questions are not a good fit for SO (see: https://stackoverflow.com/help/how-to-ask). If after reading the duplicate Q&A you still have problems, please create a new question and post your own code and ask a specific question about it. Good luck! – Bart Kiers Apr 13 '18 at 07:55
  • I wonder why someone would even need an AST, if the parse tree is so much better (especially in conjunction with a listener). – Mike Lischke Apr 14 '18 at 12:00

0 Answers0