+# _AT_CHECK_CALC(BISON-OPTIONS, INPUT)
+# ------------------------------------
+# Run `calc' on INPUT and expect no STDOUT nor STDERR.
+# If `--debug' is passed to bison, discard all the debugging traces
+# preserving only the `parse errors'. Note that since there should be
+# none, the `grep' will fail with exit status 1.
+AT_DEFINE([_AT_CHECK_CALC],
+[ifelse(regexp([$1], [--debug]),
+ [-1],
+ [AT_CHECK([echo "$2" | calc],
+ [0], [], [])],
+ [AT_CHECK([echo "$2" | calc 2>&1 >/dev/null | grep 'parse error' >&2],
+ [1], [], [])])])
+
+
+# _AT_CHECK_CALC_ERROR(BISON-OPTIONS, INPUT,
+# [ERROR-LOCATION], [IF-YYERROR-VERBOSE])
+# ------------------------------------------------------------
+# Run `calc' on INPUT, and expect STDERR.
+AT_DEFINE([_AT_CHECK_CALC_ERROR],
+[AT_CHECK([echo "$2" | calc 2>&1 >/dev/null | grep 'parse error' >&2], 0,
+ [],
+[ifelse(regexp([$1], [--location]),
+ [-1], [], [$3: ])[]dnl
+parse error[]dnl
+ifelse(regexp([$1], [--yyerror-verbose]),
+ [-1], [], [$4])[]dnl
+
+])])
+
+
+# AT_CHECK_CALC([BISON-OPTIONS], [PARSER-EXPECTED-STDERR])
+# --------------------------------------------------------
+# Start a testing chunk which compiles `calc' grammar with