On Fri, 18 Nov 2005, Akim Demaille wrote:

"Paul" == Paul Eggert <[EMAIL PROTECTED]> writes:

> "Joel E. Denny" <[EMAIL PROTECTED]> 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?

Joel

%{
  #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;
}

int
main (void)
{
  struct ParseParam parse_param;
  return yyparse (parse_param);
}


_______________________________________________
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to