]AT_YYLEX_DECLARE_EXTERN[
}
-]AT_SKEL_CC_IF([AT_LOCATION_TYPE_IF([], [
+]AT_SKEL_CC_IF([AT_LOCATION_TYPE_IF([], [[
/* The lalr1.cc skeleton, for backward compatibility, defines
a constructor for position that initializes the filename. The
glr.cc skeleton does not (and in fact cannot: location/position
are stored in a union, from which objects with constructors are
- excluded in C++. */
+ excluded in C++). */
%initial-action {
@$.initialize ();
}
-])])[
+]])])[
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
fprintf (stderr, ": ");])
fprintf (stderr, "%s\n", s);
}])[
-
]AT_DEFINES_IF([],
[AT_CALC_LEX
-AT_CALC_MAIN])[
-]])
+AT_CALC_MAIN])])
AT_DEFINES_IF([AT_DATA_SOURCE([[calc-lex.c]AT_SKEL_CC_IF([[c]])],
[[#include "calc.h]AT_SKEL_CC_IF([[h]])["
])
+# AT_CHECK_SPACES([FILE])
+# -----------------------
+# Make sure we did not introduce bad spaces. Checked here because all
+# the skeletons are (or should be) exercized here.
+m4_define([AT_CHECK_SPACES],
+[AT_CHECK([$PERL -ne '
+ chomp;
+ print "$.: {$_}\n"
+ if (# No starting/ending empty lines.
+ (eof || $. == 1) && /^\s*$/
+ # No trailing space. FIXME: not ready for "maint".
+ # || /\s$/
+ )' $1
+])dnl
+])
+
+
# AT_CHECK_CALC([BISON-OPTIONS])
# ------------------------------
# Start a testing chunk which compiles `calc' grammar with
AT_DATA_CALC_Y([$1])
AT_FULL_COMPILE([calc], AT_DEFINES_IF([[lex], [main]]))
+AT_CHECK_SPACES([calc.AT_SKEL_CC_IF([cc], [c])])
+AT_DEFINES_IF([AT_CHECK_SPACES([calc.AT_SKEL_CC_IF([hh], [h])])])
# Test the priorities.
_AT_CHECK_CALC([$1],
[AT_CHECK_CALC([%language "C++" %defines %locations] $@)])
AT_CHECK_CALC_LALR1_CC([])
-AT_CHECK_CALC_LALR1_CC([%define location_type Span])
+AT_CHECK_CALC_LALR1_CC([%define api.location.type Span])
AT_CHECK_CALC_LALR1_CC([%error-verbose %name-prefix "calc" %verbose %yacc])
AT_CHECK_CALC_LALR1_CC([%error-verbose %define api.prefix "calc" %verbose %yacc])
AT_CHECK_CALC_LALR1_CC([%error-verbose %debug %name-prefix "calc" %verbose %yacc])
[AT_CHECK_CALC([%language "C++" %glr-parser %defines %locations] $@)])
AT_CHECK_CALC_GLR_CC([])
-AT_CHECK_CALC_GLR_CC([%define location_type Span])
+AT_CHECK_CALC_GLR_CC([%define api.location.type Span])
AT_CHECK_CALC_GLR_CC([%error-verbose %name-prefix "calc" %verbose %yacc])
AT_CHECK_CALC_GLR_CC([%error-verbose %define api.prefix "calc" %verbose %yacc])