[antlr-interest] AntlrWorks - Interpreter fails for ! and ~

Steve Flasby steve at flasby.org
Mon Feb 9 01:32:18 PST 2009


Chaps,
     My first post here, I hope someone can help.

I have updated to AntlrWorks 1.2.2 from 1.2.1 but find I have problems
both with using the interpreter and parsing.

I have the classic String rule:

STRING_LITERAL
   : '"'!
     ( '"' '"'!
     | ~('"'|'\n'|'\r')
     )*
     ( '"'!
     | // nothing -- write error message
     )
    ;

The presence of the '!' in this code causes the grammar checking to fail
with the message 'Illegal output option' is there an alternative I
should be using instead?

Also (but I am less sure about this) I think the '~' is not being
correctly recognized as any string in my test input which I expect to
match this fails. Has this been reported by anyone else?


Hope someone can offer me a hint.

Regards - Steve


More information about the antlr-interest mailing list