+## ----------------- ##
+## YYSTYPE typedef. ##
+## ----------------- ##
+
+AT_SETUP([YYSTYPE typedef])
+
+AT_DATA_GRAMMAR([input.y],
+[[%{
+void yyerror (char const *);
+int yylex (void);
+typedef union { char const *val; } YYSTYPE;
+%}
+
+%type <val> program
+
+%%
+
+program: { $$ = ""; };
+]])
+
+AT_CHECK([bison -o input.c input.y])
+AT_COMPILE([input.o], [-c input.c])
+
+AT_CLEANUP
+
+
+
## ------------------------------------- ##
## Early token definitions with --yacc. ##
## ------------------------------------- ##
input.y:6.1: invalid character: `%'
input.y:6.2: invalid character: `-'
input.y:7.1-8.0: missing `%}' at end of file
+input.y:7.1-8.0: syntax error, unexpected %{...%}
]])
AT_CLEANUP
AT_DATA_GRAMMAR([input.y],
[[%{
#include <stdio.h>
-void yyerror (char const *msg);
-int yylex (void);
+static void yyerror (char const *msg);
+static int yylex (void);
%}
%error-verbose
%%
-void
+static void
yyerror (char const *msg)
{
fprintf (stderr, "%s\n", msg);
}
-int
+static int
yylex (void)
{
return 'a';