Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a flex - bison parser for javascript?

Is there a parser available in the open ? Else, i'm planning to write one using the grammar rules in http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf

Thanks.

like image 331
trinity Avatar asked Aug 01 '12 08:08

trinity


1 Answers

I think you can try Jison.

Jison takes a context-free grammar as input and outputs a JavaScript file capable of parsing the language described by that grammar. You can then use the generated script to parse inputs and accept, reject, or perform actions based on the input. If you’re familiar with Bison or Yacc, or other clones, you’re almost ready to roll.

https://gerhobbelt.github.io/jison/docs/

like image 177
Zhe Chen Avatar answered Sep 18 '22 00:09

Zhe Chen