[antlr-interest] MismatchedTokenException in C# target

pjura pjura at o2.pl
Sun Jul 18 14:03:19 PDT 2010


Hello everybody, that's my first post on this list.

I've got a problem with C# ANTLR target. I've tried this on every
runtime version from > 3.1. MismatchedTokenException is thrown when
parsing the following input:

'/<link[^>]*rel=(["\'])[ \t]*(?:[^ \t"\']+[ \t]+)*?openid2.provider[
\t]*[^"\']*\\1[^>]*href=(["\'])([^"\']+)\\2[^>]*\/?>/i'

using the rules below:

STRING : STRING1 | STRING2;

fragment STRING1
       :       '"' (~( '\\' | '"') | '\\"' | '\\')* '"' ;

fragment STRING2
       :       '\'' (~( '\\' | '\'') | '\\\'' | '\\')* '\'' ;

The strange thing is in ANTLRWorks everything works fine and debugger
shows no errors. Does anybody got a clue?

Regards,
Piotr


More information about the antlr-interest mailing list