[antlr-interest] Transforming input

Miguel Ping miguel.ping at gmail.com
Sat May 5 16:41:46 PDT 2007


Hi all,

It seems that I can parse a reasonable subset of sql selects now, and my
problem now is finding a nice way of generating output. I thought of string
template, but I think it would be a bit overkill since the difference
between the input and output is small, and I do not want to target multiple
languages, which I believe one of ST strong point. Because I need to retain
original formatting including whitespaces, what is the best way of storing
and outputing the result? I tried setting the token text within a visitor
class, and after that using a custom token stream to output token texts +
whitespaces. It didn't work, I guess antlr internally copies/clones the
tokens when creating the the AST tree. Can anyone give me a good hint on
this?

Thanks,
Miguel Ping
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070506/fc5b4dd0/attachment.html 


More information about the antlr-interest mailing list