summaryrefslogtreecommitdiff
path: root/tests/java.at
diff options
context:
space:
mode:
authorAkim Demaille <akim@lrde.epita.fr>2012-06-22 11:34:37 +0200
committerAkim Demaille <akim@lrde.epita.fr>2012-06-22 11:34:37 +0200
commit6d55954743c7243ba46680f368c76ee70b1112f8 (patch)
treeff4df1a8de7250fbeed10e8a3a81a98829949345 /tests/java.at
parent7490994123d5cae9ae69547f4e121b24412b2760 (diff)
downloadbison-6d55954743c7243ba46680f368c76ee70b1112f8.tar.gz
tests: handle locations in a more generic way.
* tests/local.at (AT_YYERROR_PROTOTYPE): New. Use it. * tests/cxx-type.at: Extensive revamp to use a more traditional quotation scheme, and to use the generic yyerror implementation. Prefer Autotest macros to CPP macros. * tests/java.at: .
Diffstat (limited to 'tests/java.at')
-rw-r--r--tests/java.at20
1 files changed, 5 insertions, 15 deletions
diff --git a/tests/java.at b/tests/java.at
index b9e9deee..f822ec6e 100644
--- a/tests/java.at
+++ b/tests/java.at
@@ -32,6 +32,7 @@ AT_BANNER([[Java Calculator.]])
m4_define([_AT_DATA_JAVA_CALC_Y],
[m4_if([$1$2$3], $[1]$[2]$[3], [],
[m4_fatal([$0: Invalid arguments: $@])])dnl
+AT_BISON_OPTION_PUSHDEFS([%language "Java" $4])
AT_DATA([Calc.y],
[[/* Infix notation calculator--calc */
%language "Java"
@@ -122,20 +123,8 @@ AT_LOCATION_IF([[
public Position getEndPos() {
return yypos;
}
-
- public void yyerror (Calc.Location l, String s)
- {
- if (l == null)
- System.err.println (s);
- else
- System.err.println (l + ": " + s);
- }
-]], [[
- public void yyerror (String s)
- {
- System.err.println (s);
- }
]])[
+ ]AT_YYERROR_DEFINE[
Integer yylval;
@@ -211,11 +200,12 @@ class Position {
}
]])
+AT_BISON_OPTION_POPDEFS
])# _AT_DATA_JAVA_CALC_Y
# AT_DATA_CALC_Y([BISON-OPTIONS])
-# -------------------------------------------------
+# -------------------------------
# Produce `calc.y'.
m4_define([AT_DATA_JAVA_CALC_Y],
[_AT_DATA_JAVA_CALC_Y($[1], $[2], $[3], [$1])
@@ -224,7 +214,7 @@ m4_define([AT_DATA_JAVA_CALC_Y],
# _AT_CHECK_JAVA_CALC_ERROR(BISON-OPTIONS, INPUT,
# [VERBOSE-AND-LOCATED-ERROR-MESSAGE])
-# ---------------------------------------------------------
+# --------------------------------------------------------------
# Run `calc' on INPUT, and expect a `syntax error' message.
#
# If INPUT starts with a slash, it is used as absolute input file name,