]> git.saurik.com Git - bison.git/blobdiff - tests/javapush.at
gnulib: update
[bison.git] / tests / javapush.at
index 2f71053366b3c152b05b41456f5e40938fc25f72..dcac4f96510bc1d0c99d3d35eabc8c2d55e8db60 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
@@ -241,10 +241,13 @@ m4_define([AT_CALC_BODY],[
   static StringReader
   getinput(String filename) throws IOException
   {
-    StringBuilder buf = new StringBuilder();
+    // Yes, there are better alternatives to StringBuffer.  But we
+    // don't really care about performances here, while portability
+    // to older Java matters.
+    StringBuffer buf = new StringBuffer();
     FileReader file = new FileReader(filename);
     int c;
-    while ((c=file.read()) > 0)
+    while (0 < (c = file.read()))
       buf.append((char)c);
     file.close();
     return new StringReader(buf.toString());
@@ -302,6 +305,13 @@ exp:
 ;
 ])
 
+
+
+## ------------------------------------- ##
+## Calc parser with api.push-pull both.  ##
+## ------------------------------------- ##
+
+
 # Test that the states transitioned by the push parser are the
 # same as for the pull parser.  This test is assumed to work
 # if it produces the same partial trace of stack states as is
@@ -577,8 +587,9 @@ Stack now 0 7 15
 ]])
 
 AT_BISON_CHECK([PUSHPULLFLAG [-o Calc.java Calc.y]])
+
 AT_JAVA_COMPILE([[Calc.java]])
-#Verify that this is a push parser.
+# Verify that this is a push parser.
 AT_CHECK_JAVA_GREP([[Calc.java]],
                    [[.*public void push_parse_initialize().*]])
 # Capture stderr output for comparison purposes.
@@ -593,6 +604,13 @@ AT_CHECK([[sed -e '/^Stack now.*$/p' -e d ./stderr]],
 AT_BISON_OPTION_POPDEFS
 AT_CLEANUP
 
+
+
+## ---------------------------------------------------------------- ##
+## Calc parser with %locations %code lexer and api.push-pull both.  ##
+## ---------------------------------------------------------------- ##
+
+
 # This test looks for location reporting by looking
 # at the lexer output with locations enabled.
 # It defines a lexer that reports location info.