Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added Bug Reporting section

...

...

For ANTLR 3.0.x there is no C# target source code available. ANTLR 3.1.x has the files under the runtime/CSharp directory. Binaries are currently (especially for betas) included in the bin directory, but will be moved later to the ANTLR download page as an extra item. Available are the files in the official releases, in daily builds and for the head of the repo on the FishEye site (not reliable) or ask Terence Parr for a Perforce account.

Usage

...

Bug Reporting

Bugs can be reported over the mailing list or directly to the email account of the current maintainer. The mailing list is preferable, because often the cause lies in the grammar and not in the tool itself. Using the list allows others besides the maintainer to exclude this cause, which has the side-effect that the bug report is processed quicker in general.

Bug reports have to include a minimal grammar exposing the bug as well the ANTLR version used. If it is a runtime problem, then the used input as well the driver program are also required. Optionally the reporter can check, if the Java target is affected by the same bug. If yes then one should report the bug to Terence Parr (over the mailing list or over the support form), as the C# target mimics the Java target behavior. Doing so isn't necessary (as the maintainer will compare the behaviors anyway), but speeds up the process. It may be possible that there is already a JIRA bug report. In that, please mention it, too.

Advanced Debugging

In case, you want to go bug hunting yourself (maybe the next ANTLR release too far away), the following procedure should be helpful. First get the source code for both ANTLR and the C# runtime. Make sure that you can rebuild ANTLR yourself first. Then open one of the project files in the runtime directory (the VS 2003 project may be possibly outdated) and compile it in debug mode. Use the generated assemblies instead the pre-compiled ones in your compiler project.

To find the bug, comparing the C# target output to the Java target is helpful. Once you have the Java-equivalent of the grammar (minimal grammar to expose the bug eases the translation) and the behavior of the C# target is different, you can compare the generated files. If you find a difference then the cause lies within a template. The use of the ANTLR option -XdbgST feeds the used templates also into the output, so it's quite easy to find the right template file. Change the template and rebuild ANTLR and your project. Then please report your findings, regardless if you fixed the issue or not.

In case, the generated files are basically the same, you have to debug the runtime. Depending on the type of error, it may take you a while to find the cause. Comparing with the Java runtime can help. Once you have fixed the problem or don't know any further, report your findings. This is done via the ANTLR feedback form, as patches have to be send under the ANTLR Contribution License, or if you have signed up already, directly to the maintainer. A detailed description of the problem, possibly along with a patch (either created by the patch program or described in English) will make the fixing part easier on faster on the maintainer side.

Usage

This section is NOT a tutorial on how to use either C# or ANTLR v3.x. It assumes that you are familiar with the concepts involved in developing ANTLR v3.x grammars and , in building and using C# programs and assemblies.

...