[antlr-interest] Parsing with inverse matches
vipul.delwadia at gmail.com
Sun Nov 22 14:20:59 PST 2009
Suppose I have a very simple grammar:
x : STRING+;
NOTA: BACKSLASH A;
A : 'a';
Now I want x to be able to match any sequence which doesn't have "a"
in it, including sequences which have "\a". This works for the most
part except when I try and match just "\a", at which point I get a
MismatchTokenException (or sometimes a NoViableAltException). However,
in the ANTLRWorks IDE if I parse it using the interpreter starting
from the STRING rule, it seems to match it just fine.
More information about the antlr-interest