Yacc ?
This decision is based on our experience that recursive descent parsers are cheaper to build and maintain than their YACC counterparts. Especially for a language whose syntax is complex and still evolving, as is ES4's. Perhaps you have experience that says otherwise.
BTW, the lexical scanner started out as an ML-LEX definition, but the tool seemed to be unable to handle a program of its size (or at least SML was unable to handle the generated tables). I wonder if we would encounter tooling issues with ML-YACC too. How portable are YACC definitions across ML implementations?
Whether or not we could use it as the primary source of the reference implementation, it would be interesting to implement the current grammar using YACC to see where it is ambiguous.
, Jeff
-----Original Message----- From: es4-discuss-bounces at mozilla.org [mailto:es4-discuss- bounces at mozilla.org] On Behalf Of David Teller Sent: Monday, October 15, 2007 7:32 AM To: JS2 Subject: Yacc ?
Just a simple question about the reference implementation: why is the parser hard-coded rather than written with ml-yacc ? I admit that I'm somewhat tired about converting this parser manually to OCaml with bunches of regexps + human proofreading, so I'm wondering if I
shouldn't
On Mon, 15 Oct 2007, Jeff Dyer wrote:
Whether or not we could use it as the primary source of the reference implementation, it would be interesting to implement the current grammar using YACC to see where it is ambiguous.
All I know is that the ES1-3 grammar was hard to squeeze into Bison/Yacc (think of automatic semicolon insertion!) for the KDE JavaScript interpreter. Next version will work without for greater flexibility and better error reporting.
That being said, there are of course much more advanced parser generators these days that have more sophisticated input languages.
Harri.
Just a simple question about the reference implementation: why is the parser hard-coded rather than written with ml-yacc ? I admit that I'm somewhat tired about converting this parser manually to OCaml with bunches of regexps + human proofreading, so I'm wondering if I shouldn't skip this and go directly to Yacc or equivalent.
Thanks,