Re: [webkit-dev] What is the reason for changing JavaScript parser from bison parser(LR) to Top-To-Down Recursion parser?
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. --Oliver 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@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] What is the reason for changing JavaScript parser from bison parser(LR) to Top-To-Down Recursion parser?
In my opinion, the bison parser implements LR analyzer, handwritten parser implements Top-To-Down analyzer. I remember some compiling book says LR analyzer is better and faster than Top-To-Down analyzer. So, your opinon confuses me. Could you give me more information about speed of handwritten parser? At 2011-11-30 15:47:43,Oliver Hunt oli...@apple.com wrote: 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. --Oliver 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@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] What is the reason for changing JavaScript parser from bison parser(LR) to Top-To-Down Recursion parser?
30.11.2011, 12:00, PandaCanFly zp...@126.com: In my opinion, the bison parser implements LR analyzer, handwritten parser implements Top-To-Down analyzer. I remember some compiling book says LR analyzer is better and faster than Top-To-Down analyzer. IMHO, this phrase doesn't mean that *any* LR analyzer is better and faster than *any* Top-To-Down analyzer. -- Regards, Konstantin ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] What is the reason for changing JavaScript parser from bison parser(LR) to Top-To-Down Recursion parser?
Thanks for your advice. Do you mean that auto-generated bison parser is implemented more complex than handwritten parser. So, although LR parser is faster than Top-To-Down parser, handwritten which implements Top-To-Down parser is faster than bison parser. At 2011-11-30 16:04:15,Konstantin Tokarev annu...@yandex.ru wrote: 30.11.2011, 12:00, PandaCanFly zp...@126.com: In my opinion, the bison parser implements LR analyzer, handwritten parser implements Top-To-Down analyzer. I remember some compiling book says LR analyzer is better and faster than Top-To-Down analyzer. IMHO, this phrase doesn't mean that *any* LR analyzer is better and faster than *any* Top-To-Down analyzer. -- Regards, Konstantin ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] What is the reason for changing JavaScript parser from bison parser(LR) to Top-To-Down Recursion parser?
I'm sorry, but this thread is somewhat off-topic for this mailing list. If you have a patch that implements an LR parser that is faster than our current parser, please feel encouraged to upload it to bugs.webkit.org together with benchmark scores. Discussion of the theoretical advantages or disadvantages of various parsing algorithms is off-topic for this list. Adam 2011/11/30 PandaCanFly zp...@126.com: Thanks for your advice. Do you mean that auto-generated bison parser is implemented more complex than handwritten parser. So, although LR parser is faster than Top-To-Down parser, handwritten which implements Top-To-Down parser is faster than bison parser. At 2011-11-30 16:04:15,Konstantin Tokarev annu...@yandex.ru wrote: 30.11.2011, 12:00, PandaCanFly zp...@126.com: In my opinion, the bison parser implements LR analyzer, handwritten parser implements Top-To-Down analyzer. I remember some compiling book says LR analyzer is better and faster than Top-To-Down analyzer. IMHO, this phrase doesn't mean that *any* LR analyzer is better and faster than *any* Top-To-Down analyzer. -- Regards, Konstantin ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
[webkit-dev] What is the reason for changing JavaScript parser from bison parser(LR) to Top-To-Down Recursion parser?
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@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev