[antlr-interest] Transforming Comments along with trees

dsfsdf fdsfdsf eddie_antlr at yahoo.co.uk
Thu Nov 11 03:13:16 PST 2004


ya i have seen the TokenStreamRewriteEngine doc on the website, i feel it would be a bit complicated to implement as the input could be huge, and it doesn't show how to handle comments, besides i'm not too comfortable with it.As for the latter question, after each pass i generate a new tree.
Should these passes automatically bring across the hidden tokens?
how? why not?
And how do i output these hidden tokens after all my transformations are complete?
thanks
ed 

Terence Parr <parrt at cs.usfca.edu> wrote:


On Nov 10, 2004, at 4:22 AM, dsfsdf fdsfdsf wrote:

> Hi
> I am building a parser that will convert a piece of t-slq to the 
> corresponding p-sql. I am using a TokenStreamHiddenTokenFilter to 
> ignore but preserve comments and builld up my source ast tree!
> I than plan to do maybe one or to pass transformations to the tree!
> However i am stuck on how to bring across my comments after each 
> transformations!
> I would greatly appreciate any ideas on how this can be done!

Hi. First, given the similarity of source / target languages, you 
might want to use TokenStreamRewriteEngine instead. have you seen that 
article on the site?

For the above, are you saying that the auto construction of trees in 
the tree walker doesn't carry along the hidden stream stuff?

Ter
--
CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
Cofounder, http://www.knowspam.net enjoy email again!






Yahoo! Groups Links








		
---------------------------------
 ALL-NEW Yahoo! Messenger - all new features - even more fun!  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20041111/804cfbd4/attachment.html


More information about the antlr-interest mailing list