[antlr-interest] Illegal escape sequence in C#
Johannes Luber
jaluber at gmx.de
Wed Jul 30 10:56:46 PDT 2008
rkevinburton at charter.net schrieb:
> I changed the "language" to be CSharp2 and that fixed the illegal escape equence (thank youl) but now the following will not compile:
>
> public ECMAScriptParser(ITokenStream input)
> : this(input, new RecognizerSharedState()) {
> }
>
> public ECMAScriptParser(ITokenStream input, RecognizerSharedState state)
> : base(input, state) {
> InitializeCyclicDFAs();
> }
>
> It seems that RecognizerSharedState is no longer recognized. Any substitutes?
>
> Thanks again.
>
> Kevin
Did you use the correct assemblies? Each beta has it own version.
Johannes
> ---- rkevinburton at charter.net wrote:
>> I did a quick check and it seems that 1.2b5 is the latest version of ANTLRWorks that is offered on the web site. Should I go back to 1.1.7? What about the version of ANTLR itselft (but I thought ANTLRWorks included ANTLR).
>>
>> Now I am confused.
>>
>> Thank you for the tips.
>>
>> Kevin
>>
>> ---- Johannes Luber <jaluber at gmx.de> wrote:
>>> 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