[antlr-interest] pretty printer

William Lam xeenman at yahoo.com
Thu Mar 10 11:24:33 PST 2005


hi guys,

I'm writing a pretty printer for the grammar that I
wrote.  The grammer file outputs an object
encapsulating the input.  So to pretty print it, I
would just walk my object and print out the keywords.

Unfortunately, this approach fails because all
comments are thrown away by my lexer.  I attempted to
have my lexer put all the comments into a collection
w/ its row and column information so that I could
insert it during pretty printing.  But this falls a
little short, because my objects don't keep track of
every keyword that the lexer returns.

Any ideas?  Should I use a AST to do this instead?

Is there any way to search through the archives on the
new mailing list?


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 


More information about the antlr-interest mailing list