[C#] Errors shouldn't be written to console error
There are several places in ANTLR runtime that errors are written to console error, like this.
While that looks harmless in most applications (GUI based, or web apps for example), it is annoying in console apps, as those ANTLR errors are written in their own pattern, with no (easy) way to disable or customize.
Any plan to revise the current design?
(Originally posted at https://github.com/tunnelvisionlabs/antlr4cs/issues/368)
Well that particularly one should never happen, it's there to report an unknown exception type... But if it's in the way, it's easy to set your own error strategy on the parser, as follows:
parser.ErrorStrategy = new MyErrorStrategy();
You can achieve the same with error listeners.
Hey @ericvergnaud, do you have an example repo for reference for various things that can be done with ErrorStrategy ? thanks!