Is there a JavaScript framework that allows to define a parsing grammar using JavaScript syntax, similar to the way Irony does it for C#?
I have built a JavaScript Parsing DSL called Chevrotain.
Source: https://github.com/SAP/chevrotain
Online Playground: http://sap.github.io/chevrotain/playground/
It is not a Parser combinator like Irony, but it is very similar as it allows you to "define a parsing grammar using JavaScript syntax" without any code generation phase.
Using it is similar to "hand building" a recursive decent parser, only without most of the headache such as:
as Chevrotain handles that automatically.
I don't know much about how Irony works, but Chris Double has a library that lets you define grammars in JavaScript here: http://www.bluishcoder.co.nz/2007/10/javascript-parser-combinators.html. The code is available on GitHub.
It's a "parser combinator" library which means you combine parsers for each production in your grammar into a larger parser that parses the whole thing. Each "sub-grammar" is a just a function that you create by calling the library functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With