[antlr-interest] Re: Wrapping input files to process multiple sources

Bill Canfield canfield at zocalo-tech.com
Tue May 30 08:01:05 PDT 2006


> I didnt tried the includeFile example itself, I just adapted the grammar
> from my compiler to support the inclusion of files. I dont understand the
> reason that retry() method throws TokenStreamRetryException nevertheless it
> works fine, but I still want to clean up my code.
> 

Rodrigo:

If you want to get rid of the double retry()s, subclass
TokenStreamSelector and override nextToken() to handle stream switches
yourself.  I gave a sketch of this at ANTLR2005, see the
TokenStreamSelector section of this presentation:

http://www.antlr.org/workshop/ANTLR2005/presentations/Verilog.ppt

Bill
-- 
Bill Canfield
Lead Software Developer
Zocalo Tech, Inc.
http://www.zocalo-tech.com/



More information about the antlr-interest mailing list