[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying Ignored Tokens Inline With AST



> Evan Easton wrote:
> 
> How might one display an AST with all the ignored tokens
> (comments/whitespace) included without having to implement analysis
> code for each node type?  

Using an analysis, you only need to override the "defaultCase" method. 
It will be called for every token in your AST.  There, you can get the
ignored token list and print it.

Have fun!

Etienne
-- 
----------------------------------------------------------------------
Etienne M. Gagnon, M.Sc.                     e-mail: egagnon@j-meg.com
Author of SableCC:                             http://www.sablecc.org/
and SableVM:                                   http://www.sablevm.org/