[antlr-interest] C# line endings

Benjamin Niemann pink at odahoda.de
Fri Oct 26 19:56:46 PDT 2007


de Jong, Ron wrote:

> I'm using 3.0b5 with a C# target. The source code generation by Antlr
> doesn't have CR/LF line endings
> 
> so whenever I try and view them I'm prompted to fix them up. Can setting
> the line ending in the generated code be made an option.

Use an editor that does not complain about correct line endings ;)

ANTLR uses StringTemplate for code generation and I don't know of an option
to make ST do line ending conversion. Mmmm, it might be just a matter of
using fopen(..., 'r') instead of fopen(..., 'rb') - or whatever the Java
equivalent for this is.

Thinking about it, ANTLR should probably always write it's output using the
local conventions.
(Although I'd prefer, if everybody just uses plain LFs and we could simply
forget this issue...)




More information about the antlr-interest mailing list