Is there any environment for defining parsers in JavaScript?

Is there a JavaScript environment that allows you to define parsing grammar using JavaScript syntax, similar to how Irony does it for C #?

+5
source share
4 answers

I donโ€™t know much about how Irony works, but Chris Double has a library that allows you to define grammar in JavaScript here: http://www.bluishcoder.co.nz/2007/10/javascript-parser-combinators.html . The code is available on GitHub .

This is a parser-combinator library, which means that you combine the parsers for each piece in your grammar into a stronger parser that parses it all. Each โ€œsubgramโ€ is simply a function that you create by calling library functions.

+3
source

I created a JavaScript syntax DSL called Chevrotain .

Source: https://github.com/SAP/chevrotain

Online Playground: http://sap.imtqy.com/chevrotain/playground/

Parser, , " JavaScript" - .

" " , , :

  • Lookahead ( )
  • .
  • .
  • .
  • ...

Chevrotain .

+3

, , javascript javascript.

0

PEG.js .

PEG.js - JavaScript, . , , .

, - , LL (k) LR (k) , JavaScript API

0

All Articles