]> git.saurik.com Git - bison.git/blobdiff - data/lalr1.java
maint: run "make update-copyright".
[bison.git] / data / lalr1.java
index 309fc956869cfc1c88065c64628a88c6171a0edc..43e9b9705c694fc7f5ef0c748c0b45b44f7f062c 100644 (file)
@@ -1,6 +1,6 @@
 # Java skeleton for Bison -*- autoconf -*-
 
-# Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# Copyright (C) 2007-2012 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
@@ -33,7 +33,7 @@ b4_symbol_foreach([b4_symbol_no_destructor_assert])
 m4_divert_push(0)dnl
 @output(b4_parser_file_name@)@
 b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
-             [2007-2011])
+             [2007-2012])
 
 b4_percent_define_ifdef([package], [package b4_percent_define_get([package]);
 ])[/* First part of user declarations.  */
@@ -297,14 +297,14 @@ b4_lexer_if([[
     }
 
     public final void pop () {
-      height--;
+      pop (1);
     }
 
     public final void pop (int num) {
       // Avoid memory leaks... garbage collection is a white lie!
       if (num > 0) {
-        java.util.Arrays.fill (valueStack, height - num + 1, height, null);
-        ]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height, null);]])[
+        java.util.Arrays.fill (valueStack, height - num + 1, height + 1, null);
+        ]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height + 1, null);]])[
       }
       height -= num;
     }
@@ -326,7 +326,7 @@ b4_lexer_if([[
     {
       out.print ("Stack now");
 
-      for (int i = 0; i < height; i++)
+      for (int i = 0; i <= height; i++)
         {
           out.print (' ');
           out.print (stateStack[i]);
@@ -498,8 +498,6 @@ b4_lexer_if([[
     /// Semantic value of the lookahead.
     b4_yystype[ yylval = null;
 
-    int yyresult;
-
     yycdebug ("Starting parse\n");
     yyerrstatus_ = 0;