Re: Javascript grammar

Russell Shaw <rjshaw@netspace.net.au>
25 Feb 2007 13:24:54 -0500

          From comp.compilers

Related articles
Javascript grammar rjshaw@netspace.net.au (Russell Shaw) (2007-02-25)
Re: Javascript grammar rjshaw@netspace.net.au (Russell Shaw) (2007-02-25)
| List of all articles for this month |
From: Russell Shaw <rjshaw@netspace.net.au>
Newsgroups: comp.compilers
Date: 25 Feb 2007 13:24:54 -0500
Organization: Compilers Central
References: <45D9DD65.5030500@netspace.net.au>
Keywords: parse
Posted-Date: 25 Feb 2007 13:24:54 EST

Hi,
I have figured it out.


On page 63 of http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf


it says:


    12.4 Expression Statement


      Syntax
      ExpressionStatement :
              [ lookahead not in {{, function} ] Expression ;


      Note that an ExpressionStatement cannot start with an opening curly
      brace because that might make it ambiguous with a Block. Also, an
      ExpressionStatement cannot start with the function keyword because
      that might make it ambiguous with a FunctionDeclaration.




Russell Shaw wrote:
> Hi,
> I downloaded and inspected the Ecmascript-262 grammar on page 157:
>
> http://www.ecma-international.org/publications/standards/Ecma-262.htm
> http://www.ecma-international.org/publications/files/ecma-st/ECMA-262.pdf
>
> I found a reduce-reduce conflict in that the kernels for "FunctionExpression"
> and "FunctionDeclaration" both start from the same LALR state (state 0), and
> can consist of an identical sequence of symbols:...



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.