[antlr-interest] newbie question, escaped characters
Rob Shields
rob at cmsnet.org.uk
Tue Mar 11 13:15:33 PDT 2008
Gavin Lambert wrote:
> At 07:57 12/03/2008, Rob Shields wrote:
> >protected TERM_CHAR: SIMPLE_TERM_CHAR | ESCAPED_TERM_CHAR |
> >WILDCARD_TERM_CHAR;
> >
> >protected SIMPLE_TERM_CHAR: ~( ' ' | '\t' | '!' | '(' | ')' | ':'
> >| '^' |
> > '[' | ']' | '\\' | '\"' | '{' | '}' | '~'
> >| '/' |
> > '\r' | '\n' );
> >
> >protected ESCAPED_TERM_CHAR: '\\'! ( '\\' | '+' | '-' | '!' | '('
> >|
> >')' | ':' | '^' |
> > '[' | ']' | '\"' | '{' | '}' | '~' |
> >'/');
> >
> >protected WILDCARD_TERM_CHAR: '\\' ( '*' | '?' );
> >
> >This gives a warning about lexical nondeterminism
> >(ESCAPED_TERM_CHAR and WILDCARD_TERM_CHAR both start with \)
> >and WILDCARD_TERM_CHAR doesn't work. If I swap around
> >ESCAPED_TERM_CHAR and WILDCARD_TERM_CHAR, then
> >ESCAPED_TERM_CHAR doesn't work.
>
> What's the value of k? Is it at least 2?
Sorry, I'm not sure what k is.
More information about the antlr-interest
mailing list