[antlr-interest] Re: lexer "modes" for XML parsing etc...

Terence Parr parrt at cs.usfca.edu
Sun Nov 20 12:44:18 PST 2005


On Nov 20, 2005, at 12:56 PM, Micheal J wrote:
>> Sounds easy.  Is this what we want?  It is proper for island
>> grammars
>> that feed off the same input stream.  Multiple input streams like
>> include files need to be handled with a multiplexing input buffer.
>
>
> How is this different from using TokenStreamSelectors?. Is this just a
> ANTLR-generates-the-tokenselector-plumbing-and-glue-too scenario.  
> Or is this
> a case where all the switching in done within a single lexer with no
> tokenselector-style switching?

Well you need the multiplexor thing for multiple input streams and  
the same sort of selector thing works for multiple lexers feeding off  
the same input stream.  THis would only be "sugar" to make it  
easier.  currently you have to open a new file, add the new lexer  
bits (possibly having complications due to instance variables/ 
methods), run antlr on it, and add some glue during the parser/lexer  
construction and launching.

Ter


More information about the antlr-interest mailing list