[webkit-dev] What is the reason for changing JavaScript parser from bison parser(LR) to Top-To-Down Recursion parser?

Oliver Hunt oliver at apple.com
Tue Nov 29 23:47:43 PST 2011

The handwritten parser has numerous benefits over the old bison generated one, the most basic being:
 * It's more than 2 times faster than the bison parser
 * It doesn't require complete duplication of the grammar to support strict mode (and can identify strict mode in the first place)
 * It fixes a number of bugs inherent in the bison parser due to the way automatic semicolon insertion was implemented.

There are a number of other benefits, but those are the most obvious.


On Nov 29, 2011, at 11:38 PM, PandaCanFly wrote:

> Hello everyone,
>     I am researching WEBKIT and coming up against difficulty about Javascript parser。As I Know, WEBKIT of old version uses the bison parser to interpret javascript code. But WEBKIT of recently version doesn't uses bison parser. Instead, WEBKIT of recently version uses Top-To-Down Recursion parser.
>     I have some details to add. 1) WEBKIT using bison parser has a source file named "Grammar.cpp". 2) I know WEBKIT with 38688 version number uses bison parser.
>     I hope someone can give me some explanation, thanks.
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20111129/50be50df/attachment.html>

More information about the webkit-dev mailing list