[Top][All Lists]

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

Re: %destructor feedback

From: Joel E. Denny
Subject: Re: %destructor feedback
Date: Fri, 2 Dec 2005 18:58:17 -0500 (EST)

On Fri, 18 Nov 2005, Akim Demaille wrote:

"Paul" == Paul Eggert <address@hidden> writes:

> "Joel E. Denny" <address@hidden> writes:
>> However, I just noticed the current YYUSE definition doesn't allow the
>> argument to be a struct instance.  Paul, Akim, is this intentional?

> Yes and no.  If we could easily implement it with struct instances we
> would.  But so far we haven't needed it, and doing it would be a pain.

I've needed it in C++, so there it uses the traditional cast to void.

Because of the new b4_parse_param_use, I'm now finding that some of my existing bison specs need it for C or I get a compile error. Below is a test case demonstrating the problem. What was wrong with the cast to void?


  #include <stdio.h>
  struct ParseParam { int i; };
  static void yyerror (struct ParseParam, char const *);
  static int yylex (void);

%parse-param { struct ParseParam parse_param }


start: ;


static void
yyerror (struct ParseParam parse_param, char const *msg)
  fprintf (stderr, "%s\n", msg);

static int
yylex (void)
  return 0;

main (void)
  struct ParseParam parse_param;
  return yyparse (parse_param);

reply via email to

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