[antlr-interest] Illegal escape sequence in C#

Johannes Luber jaluber at gmx.de
Wed Jul 30 10:11:25 PDT 2008


rkevinburton at charter.net schrieb:
> I am not sure what I have done but now when I generate code from ANTLRWorks it generates lines containing escape sequences that C# doesn't understand. Like:
> 
>     const string DFA18_eotS =
>         "\1\uffff\2\4\3\uffff\1\4";
>     const string DFA18_eofS =
>         "\7\uffff";
>     const string DFA18_minS =
>         "\3\56\3\uffff\1\56";
>     const string DFA18_maxS =
>         "\1\71\1\56\1\71\3\uffff\1\71";
>     const string DFA18_acceptS =
>         "\3\uffff\1\2\1\3\1\1\1\uffff";
>     const string DFA18_specialS =
>         "\7\uffff}>";
>     static readonly string[] DFA18_transitionS = {
>             "\1\3\1\uffff\1\1\11\2",
>             "\1\5",
>             "\1\5\1\uffff\12\6",
>             "",
>             "",
>             "",
>             "\1\5\1\uffff\12\6"
>     };
> 
> This is just a sample. There are over 400 such errors when C# tries to compile the generated code from the lexer. How do I get ANTLRWorks to generate the "right" code again?
> 
> Thank you.
> 
> Kevin
> 
Could it be that you are using AW 1.2 beta with the CSharp target? That 
was broken in an earlier version of ANTLR. I don't know if the newest 
beta includes ANTLR 3.1b2 but you can also switch to CSharp2 as target.

Johannes


More information about the antlr-interest mailing list