[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] Allow specification of semantic predicates.
From: |
Paul Hilfinger |
Subject: |
Re: [RFC] Allow specification of semantic predicates. |
Date: |
Fri, 23 Jul 2010 16:03:15 -0700 |
> > +For example, trying to rewrite the previous example as
> > +
> > address@hidden
> > +widget :
> > + @{ if (!new_syntax) YYERROR; @} "widget" id new_args @{ $$ =
> > f($3, $4); @}
> > + | @{ if (new_syntax) YYERROR; @} "widget" id old_args @{ $$ =
> > f($3, $4); @}
> > + ;
> > address@hidden smallexample
>
> The "(!new_syntax)" and "(new_syntax)" should be swapped here.
>
Actually, no: the example is supposed to be an attempt to get the effect
of %? with ordinary actions.
{ if (!new_syntax) YYERROR; }
is in fact what %?{new_syntax} expands to (except that it is immediate
rather than deferred).
Paul H.