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.
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.
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.
Or you could try Jacob, a lexer and parser generator for JavaScript:
There's plenty of programs that parse JS out there, mainly the many linter programs. JSLINT/JSHINT, etc. Crockford has written a bit about the parser he makes use of in JSLINT http://javascript.crockford.com/tdop/tdop.html
I know it's not bison/grammar generated, but is that a strict requirement?
© 2022 - 2024 — McMap. All rights reserved.