antlr / antlr4

ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.
http://antlr.org
BSD 3-Clause "New" or "Revised" License
16.68k stars 3.23k forks source link

setErrorHandler method is missing from Parser class in TypeScript target #4633

Open SuraiyaBegumK opened 1 month ago

SuraiyaBegumK commented 1 month ago

I extended DefaultErrorStratergy class to customize the ANTLR error messages

The Java implementation (and the documentation for the BailErrorStrategy) suggest that such a method should exist. image

After staring at the source, the only way I've found to change the error strategy is to modify the _errHandler field of the parser directly which is also not working as expected to customize the error messages

image

image