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

2008-11-17 Thread Hans Aberg
On 17 Nov 2008, at 20:48, Marcel Laverdet wrote: So I ended up solving this by basically copy and pasting my expression grammar sans the expressions that begin with t_LCURLY. Then an expression_statement must be an expression_no_statement t_SEMICOLON, where expression_no_statement is the co

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

2008-11-17 Thread Marcel Laverdet
So I ended up solving this by basically copy and pasting my expression grammar sans the expressions that begin with t_LCURLY. Then an expression_statement must be an expression_no_statement t_SEMICOLON, where expression_no_statement is the copy and pasted grammar. ES-262 recommends a simi

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

2008-11-14 Thread Hans Aberg
On 14 Nov 2008, at 19:35, Marcel Laverdet wrote: This is a pretty good idea, but I'm not sure if it's possible. For instance in the case of an if statement I modified my grammar as such: if_statement: t_IF t_LPAREN expression t_RPAREN {yyexpect_statement;} statement t_ELSE statement <.

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

2008-11-14 Thread Marcel Laverdet
This is a pretty good idea, but I'm not sure if it's possible. For instance in the case of an if statement I modified my grammar as such: if_statement: t_IF t_LPAREN expression t_RPAREN {yyexpect_statement;} statement t_ELSE statement <...> | t_IF t_LPAREN expression t_RPAREN {yyexpe

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

2008-11-11 Thread Hans Aberg
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 mig