[antlr-interest] catching the rest

Monty Zukowski monty at codetransform.com
Tue Apr 20 13:28:03 PDT 2004


On Apr 20, 2004, at 1:05 PM, Rolf Schumacher wrote:
> My solution leads to nondeterminism:
> -------
> class T5aParser extends Parser;
> all: ( AC | REST )*;
>
> class T5aLexer extends Lexer;
> options { k = 2;
>    charVocabulary = 
> '\u0009'|'\u000a'|'\u0020'..'\u007e'|'\u00a0'..'\u00ff'; }
> AC: ( 'a' 'c' );
> REST: ( ~'a' | {LA(2)!='c'}? 'a' )+;
> -------
>
> I'm sure you'll see at a glance how to get back to the right track: 
> determinism.
> Please let me know.
>
Take a look at http://www.antlr.org/article/1055549604509/index.html 
"ANTLR meets Sed"

Monty



 
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