Code checking with the Narcissus parser

Discussion in 'Javascript' started by glathoud, Mar 26, 2010.

  1. glathoud

    glathoud Guest

    Hello, I ported the SpiderMonkey Narcissus parser to other
    "Javascript" engines and wanted to share the resulting code [1]. As an
    example, I wrote a code checker [2] that uses the parser.

    Best regards,

    Guillaume Lathoud

    [1] cross-engine Narcissus parser for ECMAScript 3:
    http://glathoud.easypagez.com/publications/jscheck/narcissus.jsdef.js
    http://glathoud.easypagez.com/publications/jscheck/narcissus.parse.js
    ..
    The parser works correctly on Firefox 3.6, Safari 4, Google Chrome 4
    and the Google V8 Engine. Sadly, the parser breaks on Opera 10.10 -
    help is appreciated.

    [2] http://glathoud.easypagez.com/publications/jscheck/jscheck.xhtml
     
    glathoud, Mar 26, 2010
    #1
    1. Advertising

  2. glathoud

    glathoud Guest

    glathoud, Mar 26, 2010
    #2
    1. Advertising

  3. glathoud

    glathoud Guest

    On Mar 27, 7:02 pm, kangax <> wrote:
    > How exactly does it break in Opera?


    On parsing the original jsparse.js implementation. In more details:

    * Open with Opera 10.10:
    http://glathoud.easypagez.com/publications/jscheck/test-narcissus-xengine.html

    * Open the Dragonfly developer tools.

    * Click on the button "Start the test"

    * You can then see the crash, somewhere deep in the parser:
    | // Always use push to add operands to an expression, to update start
    and end.
    | Np.push = function (kid) {
    | if (kid.start < this.start) // <<<< kid === undefined
    | this.start = kid.start;

    The `operands` array in the `Expression` seems to be somewhat
    mismanaged under Opera. Curiously, there was no such problem in
    Firefox 3.6, Safari 4, Google Chrome 4 and the Google V8 Engine (and
    even Rhino).

    > Also, how ES3-compliant is your
    > port? Have you tried running it through, say, SputnikTests
    > (<http://code.google.com/p/sputniktests/>,
    > <http://kangax.github.com/sputniktests-webrunner/>)?


    Thanks for the links. That would certainly be perfect to test the full
    Narcissus implementation (parser + interpreter).
    However, so far I only ported the parser. If you'd like to port the
    interpreter as well, you are welcome!

    In any case, I'll keep the Sputnik tests in mind.

    Guillaume
     
    glathoud, Mar 30, 2010
    #3
  4. glathoud

    glathoud Guest

    Opera 10.10 is now supported by the Narcissus parser and the code
    checker.
     
    glathoud, Apr 15, 2010
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bernd Oninger
    Replies:
    0
    Views:
    772
    Bernd Oninger
    Jun 9, 2004
  2. ZOCOR

    XML Parser VS HTML Parser

    ZOCOR, Oct 3, 2004, in forum: Java
    Replies:
    11
    Views:
    832
    Paul King
    Oct 5, 2004
  3. Bernd Oninger
    Replies:
    0
    Views:
    829
    Bernd Oninger
    Jun 9, 2004
  4. Joel Hedlund
    Replies:
    2
    Views:
    523
    Joel Hedlund
    Nov 11, 2006
  5. Joel Hedlund
    Replies:
    0
    Views:
    316
    Joel Hedlund
    Nov 11, 2006
Loading...

Share This Page