[antlr-interest] Line wrapping in generated lexer/parser

Christopher L Conway cconway at cs.nyu.edu
Tue May 4 05:26:26 PDT 2010


Richard,

It's generally not a good idea to check generated code into source
control. This is a good example of why.

Regards,
Chris

On Tue, May 4, 2010 at 7:14 AM, Richard Gildea <rgildea at googlemail.com> wrote:
> Hi,
>
> I am using Antlr-3.1.2 to generate a Python target for my grammar.  I am
> observing slight discrepancies in the generated code between different
> platforms, which shows up as differences when committing to svn.
> I suspect it is an issue with the different line endings for the different
> platforms, which is causing the lines to be wrapped differently.
>
> e.g.
> (on Windows)
>        DFA.unpack(u"\2\144\2\uffff\1\144\22\uffff\20\144\12\u00da\105"
>        u"\144"),
> vs
> (on Mac)
>
>  DFA.unpack(u"\2\144\2\uffff\1\144\22\uffff\20\144\12\u00dc\105\144"),
>
> In all cases it seems to be where one character is pushed to the next line.
>  Is this an issue with CR+LF counting as two characters on Windows, and
> causing the line to creep over the character limit? If so, is there a
> possible way round this behaviour so that I can get a clean diff between
> generated code on different platforms?
>
> Thanks,
>
> Richard
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>


More information about the antlr-interest mailing list