[webkit-dev] Problems with JavaScript bison parser
Javed Rabbani
jrabbani at gmail.com
Thu Feb 19 05:41:10 PST 2009
Hello everyone,
I am working on a WebKit port for some platform and facing an issue with
working of JavaScript bison parser in "Grammar.cpp". If I execute the
following HTML file, everything is parsed without error:
*<html>*
*<body>*
*<img src=" webkit_small.jpg" ALT=" " onclick="document.write('Hello
World');" >*
*</body>*
*</html>*
However, as soon I specify the same functionality through a separate
function; I run into trouble as the parser inside Grammar.cpp fails with
return value of 1. Here is the source for the HTML file:
*<html>*
*<body>*
*<script language="JavaScript">*
*function OnClickHandler()*
*{*
* document.write('Hello World');*
*}*
*</script>*
*<img src=" webkit_small.jpg" ALT=" " onclick=OnClickHandler()>*
*</body>*
*</html>*
* *
I have figured out so far that parsing fails as it does not get all the
tokens. It only retrieves the first token and interprets it as "FUNCTION
(269)". Afterwards, the execution terminates and no further tokens are read
by the parser. Ideally it should continue with tokens for OPENBRACE (314),
IDENT(317), STRING(318), CLOSEBRACE(315) etc. I am not sure what is going
wrong to this bison parser? If anyone has faced somewhat similar issues; any
help or suggestion is greatly appreciated Thanks.
Regards,
J R Shah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090219/4ea8926a/attachment.html>
More information about the webkit-dev
mailing list