[antlr-interest] inconsistent line endings in generated parser and lexer

Jim Idle jimi at temporal-wave.com
Thu Apr 24 07:56:12 PDT 2008


We know about this, and know it needs to be fixed. What is probably needed is a custom writer for the templates used in the code generation.

 

Jim

 

From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Adam Connelly
Sent: Thursday, April 24, 2008 7:33 AM
To: Doucette, Charles
Cc: antlr-interest at antlr.org
Subject: Re: [antlr-interest] inconsistent line endings in generated parser and lexer

 

I'm guessing this is a problem with the templates that are used to generate the lexer and parser.  I've also noticed it when debugging grammars in Visual Studio because any time you generate your parser it pops up a box asking if you want to normalise the line endings - a bit annoying.  I'd second that request.

 

Adam

2008/4/22 Doucette, Charles <cdoucette at vaultus.com>:

I have a grammar file which I have been editing in Antlrworks on Windows.

Apparently, every one of those lines ends with CR-LF.

Every other line automatically generated by ANTLR ends with LF.

When you combine those two streams into the automatically generated parser and lexer, the line endings are inconsistent.

When I try to add those files to my source control tool (and perhaps I shouldn't try since it is generated), Subversion,

I get an error that the line endings are inconsistent.

It can handle all CRs (Mac?), all LFs (Unix) or all CR-LFs (Windows) - but it apparently doesn't like a mixture.

Is it possible to configure ANTLR to generate consistent line endings?

If not, I'd like to request that as a feature.

Today, perhaps I must just remove CRs from my grammar input file before processing it.

 

Thanks,

Chuck

 


  _____  


Charles E. Doucette *  617-399-1122 *  Vaultus Mobile Technologies, 263 Summer St., Boston, MA 02210 *  http://www.vaultus.com <http://www.vaultus.com/>  

 

 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080424/3c45d789/attachment.html 


More information about the antlr-interest mailing list