tunnelvisionlabs / antlr4cs

The original, highly-optimized C# Target for ANTLR 4
Other
449 stars 103 forks source link

Possible changes on errors written to console error #368

Closed lextm closed 1 year ago

lextm commented 3 years ago

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 way to disable or customize.

Any plan to revise the current design?

lextm commented 3 years ago

For this specific place it is possible to use a class derived from DefaultErrorStrategy and override ReportError method to suppress the error in console.

Not sure if this trick is applicable to other places.