[antlr-interest] [v3.1b1:] Is unparsing to textual representation of rewritten AST possible?

Ralf Cremerius ralf_c at web.de
Tue Mar 4 08:10:27 PST 2008


Hello,

I'd like to ask, if it is possible to generate an AST, to modify that AST and to automatically unparse that modified AST to it's textual representation afterwards? I thought of something like this:

( textual input ) -> ANTLR lexer+parser grammar constructing AST -> ( AST ) -> ANTLR tree grammar rewriting AST (using v3.1b1 ...) -> ANTLR tree grammar with options output=template and rewrite=true -> (modifiet textual input [according to operations on the AST])

My question is only about the last step, if unparsing from an AST to modified input is possible. Or do I have to define a StringTemplate-template to get the modifications from the rewritten AST into textual output again?

Thanks in advance,
  Ralf
_____________________________________________________________________
Unbegrenzter Speicherplatz für Ihr E-Mail Postfach? Jetzt aktivieren!
http://freemail.web.de/club/landingpage.htm/?mc=025555



More information about the antlr-interest mailing list