On 11 Nov 2008, at 08:10, Marcel Laverdet wrote:

It's unclear here whether the child of the if statement should be an empty Block or an empty ObjectLiteral. The ECMAScript spec addresses this simply: "Note that an ExpressionStatement cannot start with an opening curly brace because that might make it ambiguous with a Block."

You might try defining two pairs of braces, one for the blocks, an one for the statements. This should disambiguate the grammar. Then set a context switch that tells the lexer which type to return; the switch is changed from the parser.

  Hans




_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to