# Torturing Bison. -*- Autotest -*-
-# Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2009 Free Software
+
+# Copyright (C) 2001-2002, 2004-2007, 2009-2012 Free Software
# Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
#include <stdio.h>
#include <stdlib.h>
-static int yylex (void);
-static void yyerror (const char *msg);
+]AT_YYLEX_DECLARE[
+]AT_YYERROR_DECLARE[
%}
%union
{
#include <stdio.h>
#include <stdlib.h>
-static int yylex (void);
-static void yyerror (const char *msg);
+]AT_YYLEX_DECLARE[
+]AT_YYERROR_DECLARE[
%}
%token
# include <stdlib.h>
# include <assert.h>
-static int yylex (void);
-static void yyerror (const char *msg);
+]AT_YYLEX_DECLARE[
+]AT_YYERROR_DECLARE[
%}
%union
{
# ------------------------------------------------
# A parser specialized in torturing the stack size.
m4_define([AT_DATA_STACK_TORTURE],
-[# A grammar of parens growing the stack thanks to right recursion.
+[AT_BISON_OPTION_PUSHDEFS([$2])
+# A grammar of parens growing the stack thanks to right recursion.
# exp:
AT_DATA([input.y],
[[%{
#include <stdio.h>
#include <stdlib.h>
]$1[
- static int yylex (void);
- static void yyerror (const char *msg);
+ ]AT_YYLEX_DECLARE[
+ ]AT_YYERROR_DECLARE[
%}
]$2[
%error-verbose
%%
exp: WAIT_FOR_EOF exp | ;
%%
-static void
-yyerror (const char *msg)
-{
- fprintf (stderr, "%s\n", msg);
-}
-
+]AT_YYERROR_DEFINE[
static int
yylex (void)
{
}
}
]])
+AT_BISON_OPTION_POPDEFS([$2])
AT_BISON_CHECK([-o input.c input.y])
AT_COMPILE([input])
])