[antlr-interest] Adding imaginary tokens to the TokenStream in the PARSER?

Susan Jolly easjolly at ix.netcom.com
Mon Jul 30 07:19:15 PDT 2007


I did mean parser. I'm referring to inserting additional tokens into the
previously generated TokenStream passed from the lexer to the parser. These
tokens are "imaginary" in the sense that they don't reference any of the
input text tokenized by the lexer.

This is somewhat the opposite of using a StringTemplate.  A StringTemplate
is essentially text with holes in it where you stick pieces of the input. In
my case I'm using the parser to find occasional virtual holes in the input
where I need to insert additional text. Doing this directly to the
TokenStream turns out to the most useful approach for this application.

Susan




More information about the antlr-interest mailing list