Re:Ohm: Parsing Made Easy
by bd82 on Tuesday October 17, 2017 @01:09PM
(#15492648)
One option would be to use a Parser that supports
fault tolerance and error recovery.
In hand crafted parsers this error recovery may be added
manually (but resulting in a-lot of work...)
For example: search for the word "recovery" in the TypeScript parser which is used to provide Language Services for the VSCode IDE.
https://github.com/Microsoft/TypeScript/blob/master/src/comp...
Automatic Error Recovery using heuristics can also be implemented
by parsing Libraries. In the world of JavaScript I'm familiar with two libraries that support Error Recovery:
In hand crafted parsers this error recovery may be added manually (but resulting in a-lot of work...) For example: search for the word "recovery" in the TypeScript parser which is used to provide Language Services for the VSCode IDE. https://github.com/Microsoft/TypeScript/blob/master/src/comp...
Automatic Error Recovery using heuristics can also be implemented by parsing Libraries. In the world of JavaScript I'm familiar with two libraries that support Error Recovery:
Antlr4 - https://github.com/antlr/antlr4
Chevrotain - https://github.com/SAP/chevrotain (disclaimer - I'm the author of Chevrotain)