[antlr-interest] Lexing an atomic section

Braden McDaniel braden at endoframe.com
Fri Feb 25 11:41:14 PST 2005


How best to have antlr process something like this?

   %{
   // Code that should go untouched into generated output here.
   %}

This is, in a sense, just a string with multiple-character delimiters. 
But the antlr lexer seems not to be able to perform the same operations 
on strings (e.g., "\n%{\n") that it can on single characters; so the 
typical pattern for processing a string literal seems not to apply.

Braden


More information about the antlr-interest mailing list