[antlr-interest] C# Target Poll

Manu manunews at gmail.com
Sat May 17 16:45:10 PDT 2008


>> What I'd suggest for the C# target is:
>>
>> - distribute .xml files, .pdb files and .chm files with the assembly
>
> I get the .xml file, but why the .pdb one? And how should I generate .chm, not to mention what to include there?

The PDB file is really usefull for a release time build. When an
exception is thrown inside an assembly, the Exception members
(ToString, StackTrace, etc) check if there is an associated PDB file
present for the assembly containing the method that thrown the
exception. If the PDB file is present, the stack trace will contain
the source file and line number of where the exception was thrown so
you can easily know where the program failed. If the PDF is not
present, you will only get the method name where the exception was
generated and you will not know in which line it failed.

The .chm will have all the documentation for ANTLR classes in a MSDN
style format. You can use docproject (www.codeplex.com/DocProject) to
generate it. docproject is just another kind of project, that depends
on other projects and generates the chm for all dependent projects, so
having the chm updated is just a matter to enable the docproject
project.

>> - make consistent CR/LF line endings (visual studio is always
>> complaining about that in the generated files)
>
> Looking through the files, I see that ASTParser.stg uses Windows line endings, and the others don't. Does this problem occur for non-AST parsers, too? In that case the reason is StringTemplate and changing the templates would result in a mixture for Linux users, as ST uses different line endings for the platforms.

I haven't tried non AST parsers. I don't care if the line endings are
LF, CR or CR/LF, but it would be nice if they are all the same always.
Anyway, if that can't be done for some technical reason, I can live
with it.

Another thing that I forgot to mention is to add a pragma to disable
the warnings that generate ANTLR for the lexer, parser and tree
parser. It is really annoying to have those warnings reported and
ceirtainly nobody wants them to be reported for those files.

Thanks,
Manu


More information about the antlr-interest mailing list