help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When %dprec and %merge aren't enough...


From: Hans Aberg
Subject: Re: When %dprec and %merge aren't enough...
Date: Tue, 11 Nov 2008 20:08:27 +0100

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]