[webkit-dev] about parse javascript function

Javed Rabbani jrabbani at gmail.com
Thu Feb 26 11:51:13 PST 2009


You can have a look at source file: JavaScriptCore/parser/Parser.cpp. Inside
this file, you will come across the function:

*parse**(JSGlobalData* globalData, int* errLine, UString* errMsg)
*
This function in turn invokes the routines of *Lexer.cpp* and *grammar.cpp*.
Lexer.cpp resides in JavaScriptCore/parser directory. However, grammar.cpp
is generated during build and in generally placed inside DerivedSources. The
parsing of JavaScript code is initiated by call to function: *jscyyparse**()
* that is available inside grammar.cpp. I hope this gives you a starting
point. (I am using WebKit revision: *41242*)

Regards,
J R Shah


On Thu, Feb 26, 2009 at 5:45 AM, zhenghe zhang <zhenghe.zhang at gmail.com>wrote:

> Hi all
>        I am learning the kjs of webkit, now I encounter some questions,
> could you help me?
>        As followed:
> If I define a js function, for example:
>
> Function fun()
> {
>        Var a = 5;
>        Var b = 6;
>        Var c = a+b;
> }
> I would like to know how to parse the js code through the function of
> webkit.
> Could you tell me the main functions and the files?
> Thank you
> Best Regards
>
>
> _______________________________________________
> 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/20090227/30bad41f/attachment.html>


More information about the webkit-dev mailing list