[antlr-interest] Lexing an atomic section
Loring Craymer
Loring.G.Craymer at jpl.nasa.gov
Fri Feb 25 13:51:37 PST 2005
Something like
section :
"%["
( ~( ']')
| '%] ~('%')
)*
'%'
;
should work.
--Loring
At 11:41 AM 2/25/2005, Braden McDaniel wrote:
>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