}
]])
-AT_BISON_CHECK([[-o input.c input.y]])
-AT_COMPILE([[input]])
+AT_FULL_COMPILE([input])
AT_PARSER_CHECK([[./input]], [[0]],
[[6
]])
$$ = -1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
- fprintf (stderr, "error (@%d-%d) ", RANGE(@2));
+ fprintf (stderr, "error (@%d-%d) ", RANGE (@2));
V(')', $3, @3, "\n");
}
;
# AT_CHECK_PRINTER_AND_DESTRUCTOR([BISON-OPTIONS], [UNION-FLAG], [SKIP_FLAG])
# ---------------------------------------------------------------------------
m4_define([AT_CHECK_PRINTER_AND_DESTRUCTOR],
-[AT_SETUP([Printers and Destructors $2: $1])
+[AT_SETUP([Printers and Destructors$2]m4_ifval([$1], [[: $1]]))
$3
_AT_CHECK_PRINTER_AND_DESTRUCTOR($[1], $[2], $[3], $[4],
AT_CHECK_PRINTER_AND_DESTRUCTOR([])
-AT_CHECK_PRINTER_AND_DESTRUCTOR([], [with union])
+AT_CHECK_PRINTER_AND_DESTRUCTOR([], [ with union])
AT_CHECK_PRINTER_AND_DESTRUCTOR([%defines %skeleton "lalr1.cc"])
-AT_CHECK_PRINTER_AND_DESTRUCTOR([%defines %skeleton "lalr1.cc"], [with union])
+AT_CHECK_PRINTER_AND_DESTRUCTOR([%defines %skeleton "lalr1.cc"], [ with union])
AT_CHECK_PRINTER_AND_DESTRUCTOR([%glr-parser])
-AT_CHECK_PRINTER_AND_DESTRUCTOR([%glr-parser], [with union])
+AT_CHECK_PRINTER_AND_DESTRUCTOR([%glr-parser], [ with union])
[[%error-verbose
%debug
%locations
-%initial-action {
- @$.first_line = @$.last_line = 1;
- @$.first_column = @$.last_column = 1;
-}
%{
# include <stdio.h>
# Check that we can used qualified $$ (v.g., $<type>$) not only in
# rule actions, but also where $$ is valid: %printer and %destructor.
#
-# FIXME: Not actually checking %desctructor, but it's the same code as
+# FIXME: Not actually checking %destructor, but it's the same code as
# %printer...
#
# To do that, use a semantic value that has two fields (sem_type),
%debug
%code requires
{
-# include <stdio.h>
-
typedef struct sem_type
{
int ival;
# define YYSTYPE sem_type
-#ifdef __cplusplus
+]AT_SKEL_CC_IF([[
# include <iostream>
static void
report (std::ostream& yyo, int ival, float fval)
{
yyo << "ival: " << ival << ", fval: " << fval;
}
-#else
+]], [[
+# include <stdio.h>
static void
report (FILE* yyo, int ival, float fval)
{
fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval);
}
-#endif
+]])[
}
%code