[Top][All Lists]

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

Re: FYI: Missing \n

From: Joel E. Denny
Subject: Re: FYI: Missing \n
Date: Fri, 19 Jan 2007 12:46:14 -0500 (EST)

On Fri, 19 Jan 2007, Akim Demaille wrote:

> I was thinking about something like
> %use token1 token2
> etc.
> We do need a flag for the warning, but it is not enough: one would
> like to have the warning, and declare symbols used externally.

Yes, I still agree with that.

Now, we also wanted a way to "use" semantic values.  You had proposed 
something like:

  %destructor { free ($$); } sym
  sym(foo): sym(bar) sym() sym(baz) { $foo = sym_new ($bar, $baz); }

That is, the 2nd RHS sym has no semantic value, so no unused warning 
should be issued.

While I liked this, I struggled to get others on this list to see it, so 
maybe it's not intuitive enough.  Besides, it is a little cumbersome when 
you want to name the location (maybe sym(@bam) or something?) but still 
declare the value unused.

Perhaps we should reuse the %use notation rather than combine unused value 
declarations with the value name notation:

  %destructor { free ($$); } sym
  sym: sym sym sym %use $2 { $$ = sym_new ($1, $3); }

With named values:

  %destructor { free ($$); } sym
  sym(foo): sym(bar) sym(bam) sym(baz) %use $bam {
    $foo = sym_new ($bar, $baz);

Just an idea....

reply via email to

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