Ohm: a user-friendly parsing toolkit for JavaScript and Typescript

submited by
Style Pass
2022-06-21 20:30:10

Ohm is a parsing toolkit consisting of a library and a domain-specific language. You can use it to parse custom file formats or quickly build parsers, interpreters, and compilers for programming languages.

The Ohm language is based on parsing expression grammars (PEGs), which are a formal way of describing syntax, similar to regular expressions and context-free grammars. The Ohm library provides a JavaScript interface for creating parsers, interpreters, and more from the grammars you write.

Unlike many similar tools, Ohm completely separates grammars from semantic actions. This improves modularity and extensibility, and makes both grammars and semantic actions easier to read and understand.

The Ohm Editor provides instant feedback and an interactive visualization makes the entire execution of the parser visible and tangible. It'll make you feel like you have superpowers.

Leave a Comment