[antlr-interest] Catch all characters token

Steve Jones steve at istech.demon.co.uk
Wed Jul 7 12:01:18 PDT 2004


Hi,

The problem is complicated by the fact I need to return three tokens, eg:

BEGIN 
SOME_TEXT
END

If I use greedy then then I will only produce one token that contains the 
terminals BEGIN and END as well as the interposing text.


On Wednesday 07 Jul 2004 17:27, Monty Zukowski wrote:
> Look at the docs for the greedy option for lexer rules.
>
> On Jul 7, 2004, at 4:06 AM, Steve Jones wrote:
> > Hi,
> >
> > I'm having trouble writting a lexer rule that will match all input
> > between two
> > keywords, eg:
> >
> > BEGIN  any character sequence END
> >
> >> From this I'd like to generate and pass the tokens:
> >
> > BEGIN
> > SOME_TEXT
> > END
> >
> > to the parser.
> >
> > Any ideas?
> >
> > Thanks Steve
> >
> >
> >
> >
> > Yahoo! Groups Links
>
> ANTLR & Java Consultant -- http://www.codetransform.com
> ANSI C/GCC transformation toolkit --
> http://www.codetransform.com/gcc.html
> Embrace the Decay -- http://www.codetransform.com/EmbraceDecay.html
>
>
>
>
> Yahoo! Groups Links
>
>
>

-- 
Cheers Steve


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list