[antlr-interest] Lexer rule for strings with quoted strings within

John B. Brodie jbb at acm.org
Thu Mar 25 07:22:43 PDT 2010


On Thu, 2010-03-25 at 14:52 +0100, Bart Kiers wrote:
> > On Thu, Mar 25, 2010 at 2:01 PM, Anders Sollander <
> > Anders.Sollander at mathworks.de> wrote:
> >
> >> Hi,
> >>
> >> I've been trying to write a lexer rule for strings with strings in
> them,
> >> like
> >>
> >>        "This has a ""quoted string"" within"
> >>
> >> Is there a simple lexer rule for this, or do I need some kind of
> look
> >> ahead? 

fragment PART : '"' (options{ greedy=false; }: .)* '"' ;
STRING : PART+ ;




More information about the antlr-interest mailing list