]> git.saurik.com Git - bison.git/blobdiff - tests/javapush.at
package: bump to 2015
[bison.git] / tests / javapush.at
index f50b666cdf755cd9789db3b991cf99801611eb7b..28e694719744eb28b6ce7997ab5037fdd608f80e 100644 (file)
@@ -1,6 +1,6 @@
 # Checking Java Push Parsing.                            -*- Autotest -*-
 
-# Copyright (C) 2013 Free Software Foundation, Inc.
+# Copyright (C) 2013-2015 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -83,7 +83,7 @@ m4_define([AT_TRIVIAL_COMMON],[
   }
 
   static String[[]] teststatename
-    = new String[[]]{"YYACCEPT","YYABORT","YYERROR","UNKNOWN","YYMORE"};
+    = new String[[]]{"YYACCEPT","YYABORT","YYERROR","UNKNOWN","YYPUSH_MORE"};
 
   static void check(int teststate, int expected, String msg)
   {
@@ -110,16 +110,16 @@ m4_define([AT_TRIVIAL_PARSER],[
       setup();
 
       teststate = parser.push_parse('a', null);
-      check(teststate,YYParser.YYMORE,"push_parse('a', null)");
+      check(teststate,YYParser.YYPUSH_MORE,"push_parse('a', null)");
 
       setup();
 
       teststate = parser.push_parse('a', null);
-      check(teststate,YYParser.YYMORE,"push_parse('a', null)");
+      check(teststate,YYParser.YYPUSH_MORE,"push_parse('a', null)");
       teststate = parser.push_parse('b', null);
-      check(teststate,YYParser.YYMORE,"push_parse('b', null)");
+      check(teststate,YYParser.YYPUSH_MORE,"push_parse('b', null)");
       teststate = parser.push_parse('c', null);
-      check(teststate,YYParser.YYMORE,"push_parse('c', null)");
+      check(teststate,YYParser.YYPUSH_MORE,"push_parse('c', null)");
       teststate = parser.push_parse('\0', null);
       check(teststate,YYParser.YYACCEPT,"push_parse('\\0', null)");
 
@@ -147,11 +147,11 @@ m4_define([AT_TRIVIAL_PARSER_INITIAL_ACTION],[
       setup();
 
       teststate = parser.push_parse('a', null);
-      check(teststate,YYParser.YYMORE,"push_parse('a', null)");
+      check(teststate,YYParser.YYPUSH_MORE,"push_parse('a', null)");
       teststate = parser.push_parse('b', null);
-      check(teststate,YYParser.YYMORE,"push_parse('b', null)");
+      check(teststate,YYParser.YYPUSH_MORE,"push_parse('b', null)");
       teststate = parser.push_parse('c', null);
-      check(teststate,YYParser.YYMORE,"push_parse('c', null)");
+      check(teststate,YYParser.YYPUSH_MORE,"push_parse('c', null)");
       teststate = parser.push_parse('\0', null);
       check(teststate,YYParser.YYACCEPT,"push_parse('\\0', null)");
 
@@ -161,21 +161,29 @@ m4_define([AT_TRIVIAL_PARSER_INITIAL_ACTION],[
 }
 ])
 
+## ----------------------------------------------------- ##
+## Trivial Push Parser with api.push-pull verification.  ##
+## ----------------------------------------------------- ##
+
 AT_SETUP([Trivial Push Parser with api.push-pull verification])
 AT_BISON_OPTION_PUSHDEFS
-AT_DATA([[input.y]],[[%language "Java"
+
+AT_DATA([[input.y]],
+[[%language "Java"
 ]AT_TRIVIAL_PARSER[
 ]])
-AT_BISON_OPTION_POPDEFS
 
 # Verify that the proper procedure(s) are generated for each case.
 AT_BISON_CHECK([[-Dapi.push-pull=pull -o Main.java input.y]])
 AT_CHECK_JAVA_GREP([[Main.java]],
                    [[.*public boolean parse ().*]],
                    [1])
+# If BISON_USE_PUSH_FOR_PULL is set, then we have one occurrence of
+# this function, otherwise it should not be there.
 AT_CHECK_JAVA_GREP([[Main.java]],
         [[.*public int push_parse (int yylextoken, Object yylexval).*]],
-        [0])
+        [${BISON_USE_PUSH_FOR_PULL-0}])
+
 AT_BISON_CHECK([[-Dapi.push-pull=both -o Main.java input.y]])
 AT_CHECK_JAVA_GREP([[Main.java]],
                    [[.*public boolean parse ().*]],
@@ -183,6 +191,7 @@ AT_CHECK_JAVA_GREP([[Main.java]],
 AT_CHECK_JAVA_GREP([[Main.java]],
         [[.*public int push_parse (int yylextoken, Object yylexval).*]],
         [1])
+
 AT_BISON_CHECK([[-Dapi.push-pull=push -o Main.java input.y]])
 AT_CHECK_JAVA_GREP([[Main.java]],
                    [[.*public boolean parse ().*]],
@@ -193,8 +202,14 @@ AT_CHECK_JAVA_GREP([[Main.java]],
 
 AT_JAVA_COMPILE([[Main.java]])
 AT_JAVA_PARSER_CHECK([Main], 0, [], [stderr-nolog])
+AT_BISON_OPTION_POPDEFS
 AT_CLEANUP
 
+
+## ------------------------------------------ ##
+## Trivial Push Parser with %initial-action.  ##
+## ------------------------------------------ ##
+
 AT_SETUP([Trivial Push Parser with %initial-action])
 AT_BISON_OPTION_PUSHDEFS
 AT_DATA([[input.y]],[[%language "Java"