[Webkit-unassigned] [Bug 20031] Implement ES 3.1 JSON object

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 17 03:59:29 PDT 2008


https://bugs.webkit.org/show_bug.cgi?id=20031





------- Comment #11 from abarth at webkit.org  2008-07-17 03:59 PDT -------
> I discussed this with Sam, Geoff and Oliver at the office today. Most of us
> agreed that using the existing JavaScriptCore lexer along with a bison grammar
> would be a better approach than an ad-hoc custom parser.

Unfortunately, we can't reuse the existing lexer because JSON has different
lexing rules.  For example, JSON only supports some of JavaScript string escape
sequences.

> Geoff also argued that
> it would be better to use the full JS parser and then study the syntax tree to
> ensure that it has no JSON violations, but the rest of us thought the existing
> lexer plus a custom grammar would work better.

Just looking at the syntax tree is far too late.  There are many requirements
of the JSON RFC that are lost at that point.

I've made some amount of progress with a bison grammar for a new lexer.  I'll
post a patch once I get sufficiently far to be able to handle simple examples. 
It is unclear whether this approach will yield a simpler parser, but the result
may be more maintainable as you folks are already used to maintaining a bison
parser.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list