[ragel-users] Bad code generation for C# ?

Adrian Thurston thurston at complang.org
Wed Apr 6 22:27:56 UTC 2011


Also a bug. Thanks again. The C# code generator was contributed by a 
user and I never really had the chance to go over it in detail, which is 
why it hasn't yet been listed on the homepage as a supported language.

http://www.complang.org/redmine/issues/251

-Adrian


On 03/24/2011 09:47 AM, Denis Naumov wrote:
> Hi Adrian,
>
> I found that Alphtype Statement probably not work for C#.
>
> By default type is 'char'
>
> and ragel generate
>      static readonly char[] _test_trans_keys =  new ushort [] { '\u0022' .... }
>
> for -T0 mode and
>
>     switch( data[(      _ctx.current)] )
>         {  case '\u0009': goto tr0;  ...  }
>
> for -G0 mode
>
> it's ok.
>
> but if i use "alphtype byte;" ragel generate
>
>      static readonly byte[] _test_trans_keys =  new ushort [] { '\u0022' .... }
>
> for -T0 mode and
>
>     switch( data[(      _ctx.current)] )
>         {  case '\u0009': goto tr0;  ...  }
>
> for -G0 mode
>
> it's wrong. It must be
>      static readonly byte[] _test_trans_keys =  new ushort [] { 22, .... }
> and
>     switch( data[(      _ctx.current)] )
>         {  case 9: goto tr0;  ...  }
>
> it seems to be that ragel generate '\u****' constants for all alphtypes.
>
>
> Best regards,
> Denis Naumov.
>
> _______________________________________________
> ragel-users mailing list
> ragel-users at complang.org
> http://www.complang.org/mailman/listinfo/ragel-users

-- 
Adrian D. Thurston
http://www.complang.org/thurston/

_______________________________________________
ragel-users mailing list
ragel-users at complang.org
http://www.complang.org/mailman/listinfo/ragel-users



More information about the ragel-users mailing list