bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

java push parser diffs yet again...


From: Dennis Heimbigner
Subject: java push parser diffs yet again...
Date: Fri, 01 Feb 2013 16:40:57 -0700
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

Next attempt to include java push
parsing functionality.
I think this version includes
all requested changes to date.

=Dennis Heimbigner
From 7a85bd3193b288aee8cfdbb6d3f2667b6d17d455 Mon Sep 17 00:00:00 2001
From: Dennis Heimbigner <address@hidden>
Date: Fri, 1 Feb 2013 16:33:40 -0700
Subject: [PATCH 1/1] skeletons: add java push parsing

Added java push parsing support

* data/lalr1.java

  1. capture the declarations as m4 macros.  This was done to
  avoid duplication.  When push parsing, the declarations
  occur at the class instance level rather than within the
  parse() function.

  2. Initialization of the declarations occurs in a function
  called push_parse_initialize() that is called on the first
  invocation of push_parse().

  3. The body of the parse loop is modified to return values at
  appropriate points when doing push parsing.  In order to
  make push parsing work, it was necessary to divide
  YYNEWSTATE into two states: YYNEWSTATE and YYGETTOKEN. On
  the first call to push_parse, the state is YYNEWSTATE. On
  all later entries, the state is set to YYGETTOKEN. The
  YYNEWSTATE switch arm falls through into
  YYGETTOKEN. YYGETTOKEN indicates that a new token is
  potentially needed. Normally, with a pull parser, this new
  token would be obtained by calling yylex(). In the push
  parser, the value YYMORE is returned to the caller. On the
  next call to push_parse(), the parser will return to the
  YYGETTOKEN state and continue operation.

* tests/javapush.at: new test file for java push parsing

* tests/testsuite.at: add invocation of javapush.at

* tests/local.mk: add javapush.at to distribution

* NEWS: add note about Java push parsing support

* doc/bison.texi: add description of how to use Java push parsing
---
 NEWS               |    3 +
 data/lalr1.java    |  239 +++-
 doc/bison.texi     |   73 +-
 tests/javapush.at  | 4278 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/local.mk     |    1 +
 tests/testsuite.at |   77 +-
 6 files changed, 4552 insertions(+), 119 deletions(-)
 create mode 100755 tests/javapush.at

diff --git a/NEWS b/NEWS
index 20c3100..8fdcbbd 100644
--- a/NEWS
+++ b/NEWS
@@ -221,6 +221,9 @@ GNU Bison NEWS
   is possible to add code to the parser's constructors using "%code init"
   and "%define init_throws".
 
+  Contributed by Dennis Heimbigner
+  The java skeleton, data/lalr1.java, now supports push parsing.
+
 ** C++ skeletons improvements
 
 *** The parser header is no longer mandatory (lalr1.cc, glr.cc)
diff --git a/data/lalr1.java b/data/lalr1.java
index 187580a..b11b90b 100644
--- a/data/lalr1.java
+++ b/data/lalr1.java
@@ -29,6 +29,52 @@ m4_define([b4_symbol_no_destructor_assert],
                         [b4_skeleton],
                         [b4_symbol_action_location([$1], [destructor])])])])
 b4_symbol_foreach([b4_symbol_no_destructor_assert])
+b4_percent_define_default([[api.push-pull]], [[pull]])dnl
+b4_percent_define_check_values([[[[api.push-pull]],
+                                 [[pull]], [[push]], [[both]]]])dnl
+b4_define_flag_if([pull]) m4_define([b4_pull_flag], [[1]])dnl
+b4_define_flag_if([push]) m4_define([b4_push_flag], [[1]])dnl
+m4_case(b4_percent_define_get([[api.push-pull]]),
+        [pull], [m4_define([b4_push_flag], [[0]])],
+        [push], [m4_define([b4_pull_flag], [[0]])])dnl
+
+# Handle BISON_USE_PUSH_FOR_PULL for the test suite.  So that push parsing
+# tests function as written, do not let BISON_USE_PUSH_FOR_PULL modify the
+# behavior of Bison at all when push parsing is already requested.
+b4_define_flag_if([use_push_for_pull])dnl
+b4_use_push_for_pull_if([
+  b4_push_if([m4_define([b4_use_push_for_pull_flag], [[0]])],
+             [m4_define([b4_push_flag], [[1]])])])
+
+# Define a macro to be true when api.push-pull has the value "both"
+m4_define([b4_both_if],[b4_push_if([b4_pull_if([$1],[$2])],[$2])])dnl
+
+# Define a macro to encapsulate the parse state variables.
+# This allows them to be defined either in parse() when doing
+# pull parsing, or as class instance variable when doing push parsing.
+m4_define([b4_define_state],[[
+    /// Lookahead and lookahead in internal form.
+    int yychar = yyempty_;
+    int yytoken = 0;
+
+    /* State.  */
+    int yyn = 0;
+    int yylen = 0;
+    int yystate = 0;
+    YYStack yystack = new YYStack ();
+    int label = YYNEWSTATE;
+
+    /* Error handling.  */
+    int yynerrs_ = 0;
+    ]b4_locations_if([/// The location where the error started.
+    b4_location_type yyerrloc = null;
+
+    /// b4_location_type of the lookahead.
+    b4_location_type yylloc = new b4_location_type (null, null);])[
+
+    /// Semantic value of the lookahead.
+    ]b4_yystype[ yylval = null;
+]])
 
 b4_output_begin([b4_parser_file_name])
 b4_copyright([Skeleton implementation for Bison LALR(1) parsers in Java],
@@ -344,6 +390,12 @@ b4_lexer_if([[
    * return failure (<tt>false</tt>).  */
   public static final int YYABORT = 1;
 
+]b4_push_if([
+  /**
+   * Returned by a Bison action in order to request a new token.
+   */
+  public static final int YYMORE = 4;])[
+
   /**
    * Returned by a Bison action in order to start error recovery without
    * printing an error message.  */
@@ -357,9 +409,12 @@ b4_lexer_if([[
   private static final int YYREDUCE = 6;
   private static final int YYERRLAB1 = 7;
   private static final int YYRETURN = 8;
+]b4_push_if([  private static final int YYGETTOKEN = 9;])[
 
   private int yyerrstatus_ = 0;
 
+]b4_push_if([dnl
+b4_define_state])[
   /**
    * Return whether error recovery is being done.  In this state, the parser
    * reads token until it reaches a known state, and then restarts normal
@@ -463,6 +518,7 @@ b4_lexer_if([[
               + (yyvaluep == null ? "(null)" : yyvaluep.toString ()) + ")");
   }
 
+]b4_push_if([],[
   /**
    * Parse input from the scanner that was specified at object construction
    * time.  Return whether the end of the input was reached successfully.
@@ -470,46 +526,53 @@ b4_lexer_if([[
    * @@return <tt>true</tt> if the parsing succeeds.  Note that this does not
    *          imply that there were no syntax errors.
    */
-  public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], 
[b4_throws])])[
+   public boolean parse () b4_maybe_throws([b4_list2([b4_lex_throws], 
[b4_throws])])])[
+]b4_push_if([
+  /**
+   * Push Parse input from external lexer
+   *
+   * @@param yylextoken current token 
+   * @@param yylexval current lval
+b4_locations_if([   * @@param yylexloc current position])
+   *
+   * @@return <tt>YYACCEPT, YYABORT, YYMORE</tt>
+   */
+  public int push_parse (int yylextoken, b4_yystype 
yylexval[]b4_locations_if([, b4_location_type yylexloc]))
+      b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])])[
   {
-    /// Lookahead and lookahead in internal form.
-    int yychar = yyempty_;
-    int yytoken = 0;
-
-    /* State.  */
-    int yyn = 0;
-    int yylen = 0;
-    int yystate = 0;
-
-    YYStack yystack = new YYStack ();
-
-    /* Error handling.  */
-    int yynerrs_ = 0;
-    ]b4_locations_if([/// The location where the error started.
-    ]b4_location_type[ yyerrloc = null;
-
-    /// ]b4_location_type[ of the lookahead.
-    ]b4_location_type[ yylloc = new ]b4_location_type[ (null, null);
-
-    /// @@$.
-    ]b4_location_type[ yyloc;])
-
-    /// Semantic value of the lookahead.
-    b4_yystype[ yylval = null;
-
+    ]b4_locations_if([/// @@$.
+    b4_location_type yyloc;])[
+]b4_push_if([],[[
+]b4_define_state[
     yycdebug ("Starting parse\n");
     yyerrstatus_ = 0;
 
+    /* Initialize the stack.  */
+    yystack.push (yystate, yylval ]b4_locations_if([, yylloc])[);
 ]m4_ifdef([b4_initial_action], [
 b4_dollar_pushdef([yylval], [], [yylloc])dnl
     /* User initialization code.  */
     b4_user_initial_action
-b4_dollar_popdef])[]dnl
-
-  [  /* Initialize the stack.  */
-    yystack.push (yystate, yylval]b4_locations_if([, yylloc])[);
+b4_dollar_popdef[]dnl
+])[
+]])[
+]b4_push_if([[
+    boolean push_token_consumed = true;
 
-    int label = YYNEWSTATE;
+    if (!push_parse_initialized)
+      {
+        push_parse_initialize ();
+        yycdebug ("Starting parse\n");
+        yyerrstatus_ = 0;
+      } else
+        label = YYGETTOKEN;
+]m4_ifdef([b4_initial_action], [
+b4_dollar_pushdef([yylval], [], [yylloc])dnl
+    /* User initialization code.  */
+    b4_user_initial_action
+b4_dollar_popdef[]dnl
+])[
+]])[
     for (;;)
       switch (label)
       {
@@ -522,7 +585,7 @@ b4_dollar_popdef])[]dnl
 
         /* Accept?  */
         if (yystate == yyfinal_)
-          return true;
+         ]b4_push_if([{label = YYACCEPT; break;}],[return true;])[
 
         /* Take a decision.  First try without lookahead.  */
         yyn = yypact_[yystate];
@@ -531,16 +594,28 @@ b4_dollar_popdef])[]dnl
             label = YYDEFAULT;
             break;
           }
+]b4_push_if([        /* Fall Through */
 
+      case YYGETTOKEN:])[
         /* Read a lookahead token.  */
         if (yychar == yyempty_)
           {
+]b4_push_if([[
+            if (!push_token_consumed)
+              return YYMORE;
             yycdebug ("Reading a token: ");
-            yychar = yylexer.yylex ();]
-            b4_locations_if([[
-            yylloc = new ]b4_location_type[(yylexer.getStartPos (),
-                            yylexer.getEndPos ());]])
-            yylval = yylexer.getLVal ();[
+            yychar = yylextoken;
+            yylval = yylexval;
+            ]b4_locations_if([yylloc = yylexloc;])[
+            push_token_consumed = false;]])[
+]b4_push_if([],[[
+            yycdebug ("Reading a token: ");
+            yychar = yylexer.yylex ();
+            yylval = yylexer.getLVal ();
+            ]b4_locations_if([dnl
+            yylloc = new b4_location_type (yylexer.getStartPos (),
+                            yylexer.getEndPos ());])[
+]])[
           }
 
         /* Convert token to internal form.  */
@@ -637,10 +712,10 @@ b4_dollar_popdef])[]dnl
           {
           /* Return failure if at end of input.  */
           if (yychar == Lexer.EOF)
-            return false;
+            ]b4_push_if([{label = YYABORT; break;}],[return false;])[
           }
         else
-              yychar = yyempty_;
+            yychar = yyempty_;
           }
 
         /* Else will try to reuse lookahead token after shifting the error
@@ -684,7 +759,7 @@ b4_dollar_popdef])[]dnl
 
             /* Pop the current state because it cannot handle the error token. 
 */
             if (yystack.height == 0)
-              return false;
+              ]b4_push_if([{label = YYABORT; break;}],[return false;])[
 
             ]b4_locations_if([yyerrloc = yystack.locationAt (0);])[
             yystack.pop ();
@@ -693,6 +768,10 @@ b4_dollar_popdef])[]dnl
               yystack.print (yyDebugStream);
           }
 
+        if (label == YYABORT)
+            /* leave the switch */
+            break;
+
         ]b4_locations_if([
         /* Muck with the stack to setup for yylloc.  */
         yystack.push (0, null, yylloc);
@@ -711,13 +790,88 @@ b4_dollar_popdef])[]dnl
 
         /* Accept.  */
       case YYACCEPT:
-        return true;
+        ]b4_push_if([push_parse_initialized = false; return YYACCEPT;],
+                    [return true;])[
 
         /* Abort.  */
       case YYABORT:
-        return false;
+        ]b4_push_if([push_parse_initialized = false; return YYABORT;],
+                    [return false;])[
       }
+}
+]b4_push_if([[
+  boolean push_parse_initialized = false;
+
+  public void push_parse_initialize()
+  {
+    // (Re-)Initialize the state
+    /// Lookahead and lookahead in internal form.
+    this.yychar = yyempty_;
+    this.yytoken = 0;
+
+    /* State.  */
+    this.yyn = 0;
+    this.yylen = 0;
+    this.yystate = 0;
+    this.yystack = new YYStack ();
+    this.label = YYNEWSTATE;
+
+    /* Error handling.  */
+    this.yynerrs_ = 0;
+    ]b4_locations_if([/// The location where the error started.
+    this.yyerrloc = null;
+    this.yylloc = new b4_location_type (null, null);])[
+
+    /// Semantic value of the lookahead.
+    this.yylval = null;
+
+    yystack.push (this.yystate, this.yylval]b4_locations_if([, this.yylloc])[);
+    push_parse_initialized = true;
   }
+]b4_locations_if([
+  /**
+   * Push Parse input from external lexer
+   *
+   * @@param yylextoken current token 
+   * @@param yylexval current lval
+   * @@param yyylexpos current position
+   *
+   * @@return <tt>YYACCEPT, YYABORT, YYMORE</tt>
+   */
+  public int push_parse (int yylextoken, b4_yystype yylexval, b4_position_type 
yylexpos)
+      b4_maybe_throws([b4_list2([b4_lex_throws], [b4_throws])])
+  {
+    return push_parse (yylextoken, yylexval, new b4_location_type (yylexpos));
+  }
+])[]])
+
+b4_both_if([[
+  /**
+   * Parse input from the scanner that was specified at object construction
+   * time.  Return whether the end of the input was reached successfully.
+   * This version of parse () is defined only when api.push-push=both
+   *
+   * @@return <tt>true</tt> if the parsing succeeds.  Note that this does not
+   *          imply that there were no syntax errors.
+   */
+   public boolean parse () ]b4_maybe_throws([b4_list2([b4_lex_throws], 
[b4_throws])])[
+   {
+      if (yylexer == null)
+        throw new NullPointerException("Null Lexer");
+      int status;
+      do {
+        int token = yylexer.yylex();
+        ]b4_yystype[ lval = yylexer.getLVal();    
+]b4_locations_if([dnl
+        b4_location_type yyloc = new b4_location_type (yylexer.getStartPos (),
+                                              yylexer.getEndPos ());])[
+        this.yyerrstatus_ = 0;
+        ]b4_locations_if([status = push_parse(token,lval,yyloc);],[
+        status = push_parse(token,lval);])[
+      } while (status == YYMORE);
+      return (status == YYACCEPT);
+  }
+]])[
 
   // Generate an error message.
   private String yysyntax_error (int yystate, int tok)
@@ -825,6 +979,7 @@ b4_dollar_popdef])[]dnl
   ]b4_integral_parser_table_define([rline], [b4_rline],
   [[YYRLINE[YYN] -- Source line where rule number YYN was defined.]])[
 
+
   // Report on the debug stream that the rule yyrule is going to be reduced.
   private void yy_reduce_print (int yyrule, YYStack yystack)
   {
diff --git a/doc/bison.texi b/doc/bison.texi
index 1218b58..ca09ae0 100644
--- a/doc/bison.texi
+++ b/doc/bison.texi
@@ -358,6 +358,7 @@ Java Parsers
 * Java Parser Interface::       Instantiating and running the parser
 * Java Scanner Interface::      Specifying the scanner for the parser
 * Java Action Features::        Special features for use in actions
+* Java Push Parser Interface::  Instantiating and running the a push parser
 * Java Differences::            Differences between C/C++ and Java Grammars
 * Java Declarations Summary::   List of Bison declarations used with Java
 
@@ -11228,6 +11229,7 @@ main (int argc, char *argv[])
 * Java Parser Interface::       Instantiating and running the parser
 * Java Scanner Interface::      Specifying the scanner for the parser
 * Java Action Features::        Special features for use in actions
+* Java Push Parser Interface::  Instantiating and running the a push parser
 * Java Differences::            Differences between C/C++ and Java Grammars
 * Java Declarations Summary::   List of Bison declarations used with Java
 @end menu
@@ -11539,7 +11541,6 @@ The return type can be changed using @samp{%define 
api.value.type
 "@var{class-name}".}
 @end deftypemethod
 
-
 @node Java Action Features
 @subsection Special Features for Use in Java Actions
 
@@ -11618,6 +11619,76 @@ instance in use. The @code{Location} and 
@code{Position} parameters are
 available only if location tracking is active.
 @end deftypefn
 
address@hidden Java Push Parser Interface
address@hidden Java Push Parser Interface
address@hidden - define push_parse
address@hidden %define api.push-pull
+
+(The current push parsing interface is experimental and may evolve. More user 
feedback will help to stabilize it.)
+
+Normally, Bison generates a pull parser for Java.
+The following Bison declaration says that you want the parser to be a push
+parser (@pxref{%define Summary,,api.push-pull}):
+
address@hidden
+%define api.push-pull push
address@hidden example
+
+Most of the discussion about the
+Java pull Parser Interface,
+(@pxref{Java Parser Interface})
+applies to the push parser interface as well.
+
+When generating a push parser, the method @code{push_parse} is
+created with the following signature (depending on if locations are
+enabled).
+
address@hidden {YYParser} {void} push_parse ({int} @var{token}, {Object} 
@var{yylval})
address@hidden {YYParser} {void} push_parse ({int} @var{token}, {Object} 
@var{yylval}, {Location} @var{yyloc})
address@hidden {YYParser} {void} push_parse ({int} @var{token}, {Object} 
@var{yylval}, {Position} @var{yypos})
address@hidden deftypemethod
+
+The primary difference with respect to 
+a pull parser is that the parser method
address@hidden is invoked repeatedly to parse each token.
+This function is available if either the
+"%define api.push-pull push" or "%define api.push-pull both"
+declaration is used (@pxref{%define Summary,,api.push-pull}).
+The @code{Location} and @code{Position} parameters are
+available only if location tracking is active.
+
+The value returned by the @code{push_parse} method
+is one of the following four constants:
address@hidden, @code{YYACCEPT}, @code{YYERROR}, or @code{YYMORE}.
+This new value,
address@hidden, may be returned if more input is required to finish
+parsing the grammar.
+
+If api.push-pull is declared as @code{both}, then the generated parser
+class will also implement the @code{parse} method. This method's
+body is a loop that repeatedly invokes the scanner and then
+passes the values obtained from the scanner to the @code{push_parse}
+method.
+
+There is one additional complication.
+Technically, the push parser does not need to know about the scanner
+(i.e. an object implementing the @code{YYParser.Lexer} interface),
+but it does need access to the @code{yyerror} method.
+The current approach (and subject to change) is to require
+the @code{YYParser} constructor to be given an object implementing
+the @code{YYParser.Lexer} interface. This object need only
+implement the @code{yyerror} method; the other methods can be stubbed
+since they will never be invoked.
+The simplest way to do this is to add code like this to your
+.y file.
+
address@hidden
+%code lexer @{
+public Object getLVal() @{return null;@}
+public int yylex() @{return 0;@}
+public void yyerror(String s) @{System.err.println(s);@}
address@hidden
address@hidden example
 
 @node Java Differences
 @subsection Differences between C/C++ and Java Grammars
diff --git a/tests/javapush.at b/tests/javapush.at
new file mode 100755
index 0000000..80f7bef
--- /dev/null
+++ b/tests/javapush.at
@@ -0,0 +1,4278 @@
+# Checking Java Push Parsing.                            -*- Autotest -*-
+
+# Copyright (C) 2007, 2009-2013 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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# The Java push parser tests are intended primarily
+# to verify that the sequence of states that the parser
+# traverses is the same as a pull parser would traverse.
+
+##################################################
+# Provide a way to generate data with and without push parsing
+# so we can capture the output for comparison (except test 1).
+# Use both rather than push so we can also set it to pull to
+# get the experr data.
+
+m4_define([PUSHPULLFLAGS],[-Dapi.push-pull=both])
+
+# Bring in the grep tester from java.at
+# AT_CHECK_JAVA_GREP([PARSERFILE], [LINE], [COUNT=1])
+# -------------------------------------
+# Check that PARSERFILEcontains exactly COUNT lines matching ^LINE$
+# with grep.
+
+# Modify to ignore status so we can test for zero matching lines
+m4_define([AT_CHECK_JAVA_GREP],
+        [AT_CHECK([grep -c '^$2$' $1], [ignore], [m4_default([$3], [1])
+])
+])
+
+##################################################
+
+AT_BANNER([[Java Push Parsing Tests]])
+
+# Define a single copy of the trivial parser
+m4_define([AT_TRIVIAL_PARSER],[
+%define parser_class_name "YYParser"
+%error-verbose
+
+%code imports {
+import java.io.*;
+import java.util.*;
+}
+
+%%
+
+start: 'a' 'b' 'c' ;
+
+%%
+
+public class Main
+{
+
+  static class YYerror implements YYParser.Lexer
+  {
+    public Object getLVal() {return null;}
+    public int yylex () throws java.io.IOException {return 0;}
+    public void yyerror (String msg)
+    {
+        System.err.println(msg);
+    }
+  }
+
+
+  static public void main (String[[]] argv) throws IOException
+  {
+      YYerror yyerror = new YYerror();
+      YYParser parser;
+      int state = -1;
+
+      parser = new YYParser(yyerror);
+      parser.setDebugLevel(1);
+
+      state = parser.push_parse('a', null);
+      check(state,YYParser.YYMORE,"push_parse('a', null)");
+
+      parser = new YYParser(yyerror);
+
+      state = parser.push_parse('a', null);
+      check(state,YYParser.YYMORE,"push_parse('a', null)");
+      state = parser.push_parse('b', null);
+      check(state,YYParser.YYMORE,"push_parse('b', null)");
+      state = parser.push_parse('c', null);
+      check(state,YYParser.YYMORE,"push_parse('c', null)");
+      state = parser.push_parse('\0', null);
+      check(state,YYParser.YYACCEPT,"push_parse('\\0', null)");
+
+      /* Reuse the parser instance and cause a failure */
+      state = parser.push_parse('b', null);
+      check(state,YYParser.YYABORT,"push_parse('b', null)");
+      System.exit(0);
+  }
+
+  static String[[]] statename = new 
String[[]]{"YYACCEPT","YYABORT","YYERROR","UNKNOWN","YYMORE"};
+
+  static void check(int state, int expected, String msg)
+  {
+    System.err.println("state="+statename[[state]]+"; 
expected="+statename[[expected]]);
+    if (state == expected)
+       return;
+    System.err.println("unexpected state: "+msg);
+    System.exit(1);
+  }
+
+}
+])
+
+AT_SETUP([Trivial Push Parser with api.push-pull verification])
+AT_BISON_OPTION_PUSHDEFS
+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])
+AT_CHECK_JAVA_GREP([[Main.java]],[[.*public int push_parse (int yylextoken, 
Object yylexval).*]],[0])
+AT_BISON_CHECK([[-Dapi.push-pull=both -o Main.java input.y]])
+AT_CHECK_JAVA_GREP([[Main.java]],[[.*public boolean parse ().*]],[1])
+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 ().*]],[0])
+AT_CHECK_JAVA_GREP([[Main.java]],[[.*public int push_parse (int yylextoken, 
Object yylexval).*]],[1])
+
+AT_JAVA_COMPILE([[Main.java]])
+AT_JAVA_PARSER_CHECK([Main], 0, [], [stderr-nolog])
+AT_CLEANUP
+
+AT_SETUP([Trivial Push Parser with %initial-action])
+AT_BISON_OPTION_PUSHDEFS
+AT_DATA([[input.y]],[[%language "Java"
+%initial-action {
+final int INITIAL_ACTION_DECLARED = 1;
+}
+]AT_TRIVIAL_PARSER[
+]])
+AT_BISON_OPTION_POPDEFS
+AT_BISON_CHECK([[-Dapi.push-pull=push -o Main.java input.y]])
+AT_CHECK_JAVA_GREP([[Main.java]],[[final int INITIAL_ACTION_DECLARED = 1;]])
+AT_JAVA_COMPILE([[Main.java]])
+AT_JAVA_PARSER_CHECK([Main], 0, [], [stderr-nolog])
+AT_CLEANUP
+
+# Define a single copy of the Calculator
+m4_define([AT_CALC_BODY1],[
+/* Bison Declarations */
+%token <Integer> NUM "number"
+%type  <Integer> exp
+
+%nonassoc '=' /* comparison            */
+%left '-' '+'
+%left '*' '/'
+%left NEG     /* negation--unary minus */
+%right '^'    /* exponentiation        */
+
+/* Grammar follows */
+%%
+input:
+  line
+| input line
+;
+
+line:
+  '\n'
+| exp '\n'
+| error '\n'
+;
+
+exp:
+  NUM                { $[]$ = $[]1;}
+| exp '=' exp
+  {
+    if ($[]1.intValue() != $[]3.intValue())
+      yyerror (]AT_LOCATION_IF(address@hidden,]])[ "calc: error: " + $[]1 + " 
!= " + $[]3);
+  }
+| exp '+' exp        { $[]$ = new Integer ($[]1.intValue () + $[]3.intValue 
());  }
+| exp '-' exp        { $[]$ = new Integer ($[]1.intValue () - $[]3.intValue 
());  }
+| exp '*' exp        { $[]$ = new Integer ($[]1.intValue () * $[]3.intValue 
());  }
+| exp '/' exp        { $[]$ = new Integer ($[]1.intValue () / $[]3.intValue 
());  }
+| '-' exp  %prec NEG { $[]$ = new Integer (-$[]2.intValue ());                 
 }
+| exp '^' exp        { $[]$ = new Integer ((int)
+                                         Math.pow ($[]1.intValue (),
+                                                   $[]3.intValue ()));        }
+| '(' exp ')'        { $[]$ = $[]2;                                            
 }
+| '(' error ')'      { $[]$ = new Integer (1111);}
+| '!'                { $[]$ = new Integer (0); return YYERROR;}
+| '-' error          { $[]$ = new Integer (0); return YYERROR;}
+;
+])
+
+AT_SETUP([Calc parser with api.push-pull both])
+AT_BISON_OPTION_PUSHDEFS
+AT_DATA([Calc.y],[[/* Infix notation calculator--calc */
+%language "Java"
+%name-prefix "Calc"
+%define parser_class_name "Calc"
+
+%code imports {
+  import java.io.*;
+}
+
+%code {
+
+  public static void main (String[] argv)
+        throws IOException
+  {
+    StringReader reader = getinput(argv[0]);
+    UserLexer lexer = new UserLexer(reader);
+    Calc calc = new Calc(lexer);
+    calc.setDebugLevel(1);
+    calc.parse();
+  }
+
+
+  static StringReader
+  getinput(String filename) throws IOException
+  {
+    StringBuilder buf = new StringBuilder();
+    FileReader file = new FileReader(filename);
+    int c;
+    while((c=file.read()) > 0) {
+      buf.append((char)c);
+    }
+    file.close();
+    return new StringReader(buf.toString());
+  }
+
+static class UserLexer implements Calc.Lexer
+{
+  StreamTokenizer st;
+  StringReader rdr;
+
+  public UserLexer(StringReader reader)
+  {
+    rdr = reader;
+    st = new StreamTokenizer(rdr);
+    st.resetSyntax();
+    st.eolIsSignificant(true);
+    st.whitespaceChars(9, 9);
+    st.whitespaceChars(32, 32);
+    st.wordChars(48, 57);
+  }
+
+  Integer yylval;
+
+  public Object getLVal() {
+    return yylval;
+  }
+
+  public void yyerror(String msg)
+  {
+    System.err.println(msg);
+  }
+
+  public int yylex () throws IOException {
+    int ttype = st.nextToken ();
+    if (ttype == st.TT_EOF)
+      return EOF;
+
+    else if (ttype == st.TT_EOL)
+      {
+        return (int) '\n';
+      }
+
+    else if (ttype == st.TT_WORD)
+      {
+        yylval = new Integer (st.sval);
+        return NUM;
+      }
+
+    else
+      return st.ttype;
+  }
+}
+
+}
+
+]AT_CALC_BODY1[
+
+]])
+
+AT_DATA([[input]],[[1 + 2 * 3 = 7
+1 + 2 * -3 = -5
+
+-1^2 = -1
+(-1)^2 = 1
+
+---1 = -1
+
+1 - 2 - 3 = -4
+1 - (2 - 3) = 2
+
+2^2^3 = 256
+(2^2)^3 = 64
+]])
+
+AT_DATA([[expout]],[[Starting parse
+
+Entering state 0
+
+Stack now 0
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 9
+
+Stack now 0 9
+Reading a token: @&t@
+Next token is token '+' (1)
+Shifting token '+' (1)
+Entering state 19
+
+Stack now 0 9 19
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 9 19 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 28
+
+Stack now 0 9 19 28
+Reading a token: @&t@
+Next token is token '*' (2)
+Shifting token '*' (2)
+Entering state 20
+
+Stack now 0 9 19 28 20
+Reading a token: @&t@
+Next token is token "number" (3)
+Shifting token "number" (3)
+Entering state 2
+
+Stack now 0 9 19 28 20 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (3)
+-> $$ = nterm exp (3)
+Entering state 29
+
+Stack now 0 9 19 28 20 29
+Reading a token: @&t@
+Next token is token '=' (3)
+Reducing stack by rule 10 , @&t@
+   $1 = nterm exp (2)
+   $2 = token '*' (2)
+   $3 = nterm exp (3)
+-> $$ = nterm exp (6)
+Entering state 28
+
+Stack now 0 9 19 28
+Next token is token '=' (3)
+Reducing stack by rule 8 , @&t@
+   $1 = nterm exp (1)
+   $2 = token '+' (1)
+   $3 = nterm exp (6)
+-> $$ = nterm exp (7)
+Entering state 9
+
+Stack now 0 9
+Next token is token '=' (3)
+Shifting token '=' (3)
+Entering state 17
+
+Stack now 0 9 17
+Reading a token: @&t@
+Next token is token "number" (7)
+Shifting token "number" (7)
+Entering state 2
+
+Stack now 0 9 17 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (7)
+-> $$ = nterm exp (7)
+Entering state 26
+
+Stack now 0 9 17 26
+Reading a token: @&t@
+Next token is token '\n' (7)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (7)
+   $2 = token '=' (3)
+   $3 = nterm exp (7)
+-> $$ = nterm exp (7)
+Entering state 9
+
+Stack now 0 9
+Next token is token '\n' (7)
+Shifting token '\n' (7)
+Entering state 23
+
+Stack now 0 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (7)
+   $2 = token '\n' (7)
+-> $$ = nterm line (7)
+Entering state 8
+
+Stack now 0 8
+Reducing stack by rule 1 , @&t@
+   $1 = nterm line (7)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 7 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 9
+
+Stack now 0 7 9
+Reading a token: @&t@
+Next token is token '+' (1)
+Shifting token '+' (1)
+Entering state 19
+
+Stack now 0 7 9 19
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 9 19 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 28
+
+Stack now 0 7 9 19 28
+Reading a token: @&t@
+Next token is token '*' (2)
+Shifting token '*' (2)
+Entering state 20
+
+Stack now 0 7 9 19 28 20
+Reading a token: @&t@
+Next token is token '-' (2)
+Shifting token '-' (2)
+Entering state 3
+
+Stack now 0 7 9 19 28 20 3
+Reading a token: @&t@
+Next token is token "number" (3)
+Shifting token "number" (3)
+Entering state 2
+
+Stack now 0 7 9 19 28 20 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (3)
+-> $$ = nterm exp (3)
+Entering state 12
+
+Stack now 0 7 9 19 28 20 3 12
+Reading a token: @&t@
+Next token is token '=' (3)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (2)
+   $2 = nterm exp (3)
+-> $$ = nterm exp (-3)
+Entering state 29
+
+Stack now 0 7 9 19 28 20 29
+Next token is token '=' (3)
+Reducing stack by rule 10 , @&t@
+   $1 = nterm exp (2)
+   $2 = token '*' (2)
+   $3 = nterm exp (-3)
+-> $$ = nterm exp (-6)
+Entering state 28
+
+Stack now 0 7 9 19 28
+Next token is token '=' (3)
+Reducing stack by rule 8 , @&t@
+   $1 = nterm exp (1)
+   $2 = token '+' (1)
+   $3 = nterm exp (-6)
+-> $$ = nterm exp (-5)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (3)
+Shifting token '=' (3)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token '-' (3)
+Shifting token '-' (3)
+Entering state 3
+
+Stack now 0 7 9 17 3
+Reading a token: @&t@
+Next token is token "number" (5)
+Shifting token "number" (5)
+Entering state 2
+
+Stack now 0 7 9 17 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (5)
+-> $$ = nterm exp (5)
+Entering state 12
+
+Stack now 0 7 9 17 3 12
+Reading a token: @&t@
+Next token is token '\n' (5)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (3)
+   $2 = nterm exp (5)
+-> $$ = nterm exp (-5)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Next token is token '\n' (5)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (-5)
+   $2 = token '=' (3)
+   $3 = nterm exp (-5)
+-> $$ = nterm exp (-5)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (5)
+Shifting token '\n' (5)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (-5)
+   $2 = token '\n' (5)
+-> $$ = nterm line (-5)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (-5)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '\n' (5)
+Shifting token '\n' (5)
+Entering state 4
+
+Stack now 0 7 4
+Reducing stack by rule 3 , @&t@
+   $1 = token '\n' (5)
+-> $$ = nterm line (5)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (5)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '-' (5)
+Shifting token '-' (5)
+Entering state 3
+
+Stack now 0 7 3
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 7 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 12
+
+Stack now 0 7 3 12
+Reading a token: @&t@
+Next token is token '^' (1)
+Shifting token '^' (1)
+Entering state 22
+
+Stack now 0 7 3 12 22
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 3 12 22 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 31
+
+Stack now 0 7 3 12 22 31
+Reading a token: @&t@
+Next token is token '=' (2)
+Reducing stack by rule 13 , @&t@
+   $1 = nterm exp (1)
+   $2 = token '^' (1)
+   $3 = nterm exp (2)
+-> $$ = nterm exp (1)
+Entering state 12
+
+Stack now 0 7 3 12
+Next token is token '=' (2)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (5)
+   $2 = nterm exp (1)
+-> $$ = nterm exp (-1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (2)
+Shifting token '=' (2)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token '-' (2)
+Shifting token '-' (2)
+Entering state 3
+
+Stack now 0 7 9 17 3
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 7 9 17 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 12
+
+Stack now 0 7 9 17 3 12
+Reading a token: @&t@
+Next token is token '\n' (1)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (2)
+   $2 = nterm exp (1)
+-> $$ = nterm exp (-1)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Next token is token '\n' (1)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (-1)
+   $2 = token '=' (2)
+   $3 = nterm exp (-1)
+-> $$ = nterm exp (-1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (1)
+Shifting token '\n' (1)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (-1)
+   $2 = token '\n' (1)
+-> $$ = nterm line (-1)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (-1)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '(' (1)
+Shifting token '(' (1)
+Entering state 5
+
+Stack now 0 7 5
+Reading a token: @&t@
+Next token is token '-' (1)
+Shifting token '-' (1)
+Entering state 3
+
+Stack now 0 7 5 3
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 7 5 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 12
+
+Stack now 0 7 5 3 12
+Reading a token: @&t@
+Next token is token ')' (1)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (1)
+   $2 = nterm exp (1)
+-> $$ = nterm exp (-1)
+Entering state 14
+
+Stack now 0 7 5 14
+Next token is token ')' (1)
+Shifting token ')' (1)
+Entering state 25
+
+Stack now 0 7 5 14 25
+Reducing stack by rule 14 , @&t@
+   $1 = token '(' (1)
+   $2 = nterm exp (-1)
+   $3 = token ')' (1)
+-> $$ = nterm exp (-1)
+Entering state 9
+
+Stack now 0 7 9
+Reading a token: @&t@
+Next token is token '^' (1)
+Shifting token '^' (1)
+Entering state 22
+
+Stack now 0 7 9 22
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 9 22 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 31
+
+Stack now 0 7 9 22 31
+Reading a token: @&t@
+Next token is token '=' (2)
+Reducing stack by rule 13 , @&t@
+   $1 = nterm exp (-1)
+   $2 = token '^' (1)
+   $3 = nterm exp (2)
+-> $$ = nterm exp (1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (2)
+Shifting token '=' (2)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 7 9 17 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Reading a token: @&t@
+Next token is token '\n' (1)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (1)
+   $2 = token '=' (2)
+   $3 = nterm exp (1)
+-> $$ = nterm exp (1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (1)
+Shifting token '\n' (1)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (1)
+   $2 = token '\n' (1)
+-> $$ = nterm line (1)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (1)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '\n' (1)
+Shifting token '\n' (1)
+Entering state 4
+
+Stack now 0 7 4
+Reducing stack by rule 3 , @&t@
+   $1 = token '\n' (1)
+-> $$ = nterm line (1)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (1)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '-' (1)
+Shifting token '-' (1)
+Entering state 3
+
+Stack now 0 7 3
+Reading a token: @&t@
+Next token is token '-' (1)
+Shifting token '-' (1)
+Entering state 3
+
+Stack now 0 7 3 3
+Reading a token: @&t@
+Next token is token '-' (1)
+Shifting token '-' (1)
+Entering state 3
+
+Stack now 0 7 3 3 3
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 7 3 3 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 12
+
+Stack now 0 7 3 3 3 12
+Reading a token: @&t@
+Next token is token '=' (1)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (1)
+   $2 = nterm exp (1)
+-> $$ = nterm exp (-1)
+Entering state 12
+
+Stack now 0 7 3 3 12
+Next token is token '=' (1)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (1)
+   $2 = nterm exp (-1)
+-> $$ = nterm exp (1)
+Entering state 12
+
+Stack now 0 7 3 12
+Next token is token '=' (1)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (1)
+   $2 = nterm exp (1)
+-> $$ = nterm exp (-1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (1)
+Shifting token '=' (1)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token '-' (1)
+Shifting token '-' (1)
+Entering state 3
+
+Stack now 0 7 9 17 3
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 7 9 17 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 12
+
+Stack now 0 7 9 17 3 12
+Reading a token: @&t@
+Next token is token '\n' (1)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (1)
+   $2 = nterm exp (1)
+-> $$ = nterm exp (-1)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Next token is token '\n' (1)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (-1)
+   $2 = token '=' (1)
+   $3 = nterm exp (-1)
+-> $$ = nterm exp (-1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (1)
+Shifting token '\n' (1)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (-1)
+   $2 = token '\n' (1)
+-> $$ = nterm line (-1)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (-1)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '\n' (1)
+Shifting token '\n' (1)
+Entering state 4
+
+Stack now 0 7 4
+Reducing stack by rule 3 , @&t@
+   $1 = token '\n' (1)
+-> $$ = nterm line (1)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (1)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 7 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 9
+
+Stack now 0 7 9
+Reading a token: @&t@
+Next token is token '-' (1)
+Shifting token '-' (1)
+Entering state 18
+
+Stack now 0 7 9 18
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 9 18 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 27
+
+Stack now 0 7 9 18 27
+Reading a token: @&t@
+Next token is token '-' (2)
+Reducing stack by rule 9 , @&t@
+   $1 = nterm exp (1)
+   $2 = token '-' (1)
+   $3 = nterm exp (2)
+-> $$ = nterm exp (-1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '-' (2)
+Shifting token '-' (2)
+Entering state 18
+
+Stack now 0 7 9 18
+Reading a token: @&t@
+Next token is token "number" (3)
+Shifting token "number" (3)
+Entering state 2
+
+Stack now 0 7 9 18 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (3)
+-> $$ = nterm exp (3)
+Entering state 27
+
+Stack now 0 7 9 18 27
+Reading a token: @&t@
+Next token is token '=' (3)
+Reducing stack by rule 9 , @&t@
+   $1 = nterm exp (-1)
+   $2 = token '-' (2)
+   $3 = nterm exp (3)
+-> $$ = nterm exp (-4)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (3)
+Shifting token '=' (3)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token '-' (3)
+Shifting token '-' (3)
+Entering state 3
+
+Stack now 0 7 9 17 3
+Reading a token: @&t@
+Next token is token "number" (4)
+Shifting token "number" (4)
+Entering state 2
+
+Stack now 0 7 9 17 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (4)
+-> $$ = nterm exp (4)
+Entering state 12
+
+Stack now 0 7 9 17 3 12
+Reading a token: @&t@
+Next token is token '\n' (4)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (3)
+   $2 = nterm exp (4)
+-> $$ = nterm exp (-4)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Next token is token '\n' (4)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (-4)
+   $2 = token '=' (3)
+   $3 = nterm exp (-4)
+-> $$ = nterm exp (-4)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (4)
+Shifting token '\n' (4)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (-4)
+   $2 = token '\n' (4)
+-> $$ = nterm line (-4)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (-4)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 7 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 9
+
+Stack now 0 7 9
+Reading a token: @&t@
+Next token is token '-' (1)
+Shifting token '-' (1)
+Entering state 18
+
+Stack now 0 7 9 18
+Reading a token: @&t@
+Next token is token '(' (1)
+Shifting token '(' (1)
+Entering state 5
+
+Stack now 0 7 9 18 5
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 9 18 5 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 14
+
+Stack now 0 7 9 18 5 14
+Reading a token: @&t@
+Next token is token '-' (2)
+Shifting token '-' (2)
+Entering state 18
+
+Stack now 0 7 9 18 5 14 18
+Reading a token: @&t@
+Next token is token "number" (3)
+Shifting token "number" (3)
+Entering state 2
+
+Stack now 0 7 9 18 5 14 18 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (3)
+-> $$ = nterm exp (3)
+Entering state 27
+
+Stack now 0 7 9 18 5 14 18 27
+Reading a token: @&t@
+Next token is token ')' (3)
+Reducing stack by rule 9 , @&t@
+   $1 = nterm exp (2)
+   $2 = token '-' (2)
+   $3 = nterm exp (3)
+-> $$ = nterm exp (-1)
+Entering state 14
+
+Stack now 0 7 9 18 5 14
+Next token is token ')' (3)
+Shifting token ')' (3)
+Entering state 25
+
+Stack now 0 7 9 18 5 14 25
+Reducing stack by rule 14 , @&t@
+   $1 = token '(' (1)
+   $2 = nterm exp (-1)
+   $3 = token ')' (3)
+-> $$ = nterm exp (-1)
+Entering state 27
+
+Stack now 0 7 9 18 27
+Reading a token: @&t@
+Next token is token '=' (3)
+Reducing stack by rule 9 , @&t@
+   $1 = nterm exp (1)
+   $2 = token '-' (1)
+   $3 = nterm exp (-1)
+-> $$ = nterm exp (2)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (3)
+Shifting token '=' (3)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 9 17 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Reading a token: @&t@
+Next token is token '\n' (2)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (2)
+   $2 = token '=' (3)
+   $3 = nterm exp (2)
+-> $$ = nterm exp (2)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (2)
+Shifting token '\n' (2)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (2)
+   $2 = token '\n' (2)
+-> $$ = nterm line (2)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (2)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '\n' (2)
+Shifting token '\n' (2)
+Entering state 4
+
+Stack now 0 7 4
+Reducing stack by rule 3 , @&t@
+   $1 = token '\n' (2)
+-> $$ = nterm line (2)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (2)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 9
+
+Stack now 0 7 9
+Reading a token: @&t@
+Next token is token '^' (2)
+Shifting token '^' (2)
+Entering state 22
+
+Stack now 0 7 9 22
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 9 22 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 31
+
+Stack now 0 7 9 22 31
+Reading a token: @&t@
+Next token is token '^' (2)
+Shifting token '^' (2)
+Entering state 22
+
+Stack now 0 7 9 22 31 22
+Reading a token: @&t@
+Next token is token "number" (3)
+Shifting token "number" (3)
+Entering state 2
+
+Stack now 0 7 9 22 31 22 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (3)
+-> $$ = nterm exp (3)
+Entering state 31
+
+Stack now 0 7 9 22 31 22 31
+Reading a token: @&t@
+Next token is token '=' (3)
+Reducing stack by rule 13 , @&t@
+   $1 = nterm exp (2)
+   $2 = token '^' (2)
+   $3 = nterm exp (3)
+-> $$ = nterm exp (8)
+Entering state 31
+
+Stack now 0 7 9 22 31
+Next token is token '=' (3)
+Reducing stack by rule 13 , @&t@
+   $1 = nterm exp (2)
+   $2 = token '^' (2)
+   $3 = nterm exp (8)
+-> $$ = nterm exp (256)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (3)
+Shifting token '=' (3)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token "number" (256)
+Shifting token "number" (256)
+Entering state 2
+
+Stack now 0 7 9 17 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (256)
+-> $$ = nterm exp (256)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Reading a token: @&t@
+Next token is token '\n' (256)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (256)
+   $2 = token '=' (3)
+   $3 = nterm exp (256)
+-> $$ = nterm exp (256)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (256)
+Shifting token '\n' (256)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (256)
+   $2 = token '\n' (256)
+-> $$ = nterm line (256)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (256)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '(' (256)
+Shifting token '(' (256)
+Entering state 5
+
+Stack now 0 7 5
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 5 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 14
+
+Stack now 0 7 5 14
+Reading a token: @&t@
+Next token is token '^' (2)
+Shifting token '^' (2)
+Entering state 22
+
+Stack now 0 7 5 14 22
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 5 14 22 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 31
+
+Stack now 0 7 5 14 22 31
+Reading a token: @&t@
+Next token is token ')' (2)
+Reducing stack by rule 13 , @&t@
+   $1 = nterm exp (2)
+   $2 = token '^' (2)
+   $3 = nterm exp (2)
+-> $$ = nterm exp (4)
+Entering state 14
+
+Stack now 0 7 5 14
+Next token is token ')' (2)
+Shifting token ')' (2)
+Entering state 25
+
+Stack now 0 7 5 14 25
+Reducing stack by rule 14 , @&t@
+   $1 = token '(' (256)
+   $2 = nterm exp (4)
+   $3 = token ')' (2)
+-> $$ = nterm exp (4)
+Entering state 9
+
+Stack now 0 7 9
+Reading a token: @&t@
+Next token is token '^' (2)
+Shifting token '^' (2)
+Entering state 22
+
+Stack now 0 7 9 22
+Reading a token: @&t@
+Next token is token "number" (3)
+Shifting token "number" (3)
+Entering state 2
+
+Stack now 0 7 9 22 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (3)
+-> $$ = nterm exp (3)
+Entering state 31
+
+Stack now 0 7 9 22 31
+Reading a token: @&t@
+Next token is token '=' (3)
+Reducing stack by rule 13 , @&t@
+   $1 = nterm exp (4)
+   $2 = token '^' (2)
+   $3 = nterm exp (3)
+-> $$ = nterm exp (64)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (3)
+Shifting token '=' (3)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token "number" (64)
+Shifting token "number" (64)
+Entering state 2
+
+Stack now 0 7 9 17 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (64)
+-> $$ = nterm exp (64)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Reading a token: @&t@
+Next token is token '\n' (64)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (64)
+   $2 = token '=' (3)
+   $3 = nterm exp (64)
+-> $$ = nterm exp (64)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (64)
+Shifting token '\n' (64)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (64)
+   $2 = token '\n' (64)
+-> $$ = nterm line (64)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (64)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Now at end of input.
+
+Shifting token $end (64)
+Entering state 15
+
+Stack now 0 7 15
+]])
+
+AT_BISON_OPTION_POPDEFS
+
+AT_BISON_CHECK([PUSHPULLFLAGS [-o Calc.java Calc.y]])
+AT_JAVA_COMPILE([[Calc.java]])
+# Verify that this is a push parser
+AT_CHECK_JAVA_GREP([[Calc.java]],[[.*public void push_parse_initialize().*]])
+# Capture the output so we can edit out the (line nnnn) occurrences
+AT_JAVA_PARSER_CHECK([Calc input], 0, [], [stderr-nolog])
+AT_CHECK([[sed -e 's/(line[ ][0-9][0-9]*)[,]/,/' stderr]],[ignore],[expout])
+
+AT_CLEANUP
+
+AT_SETUP([Calc parser with %locations %code lexer and api.push-pull both])
+AT_BISON_OPTION_PUSHDEFS
+AT_DATA([[Calc.y]],[[/* Infix notation calculator--calc */
+%language "Java"
+%name-prefix "Calc"
+%define parser_class_name "Calc"
+%lex-param { Reader rdr}
+%locations
+
+%code imports {
+  import java.io.*;
+}
+
+%code lexer {
+  StreamTokenizer st;
+
+  public YYLexer(Reader rdr)
+  {
+    st = new StreamTokenizer(rdr);
+    st.resetSyntax();
+    st.eolIsSignificant(true);
+    st.whitespaceChars(9, 9);
+    st.whitespaceChars(32, 32);
+    st.wordChars(48, 57);
+  }
+
+  Position yypos = new Position (1, 0);
+
+  public Position getStartPos() {
+    return yypos;
+  }
+
+  public Position getEndPos() {
+    return yypos;
+  }
+
+  Integer yylval;
+
+  public Object getLVal() {
+    return yylval;
+  }
+
+  public void yyerror(Location loc, String msg)
+  {
+    System.err.println(loc+":"+msg);
+  }
+
+  public int yylex () throws IOException {
+    int ttype = st.nextToken ();
+    yypos = new Position (yypos.lineno (),yypos.token () + 1);
+    if (ttype == st.TT_EOF)
+      return EOF;
+
+    else if (ttype == st.TT_EOL)
+      {
+        yypos = new Position (yypos.lineno () + 1, 0);
+        return (int) '\n';
+      }
+
+    else if (ttype == st.TT_WORD)
+      {
+        yylval = new Integer (st.sval);
+        return NUM;
+      }
+
+    else
+      return st.ttype;
+  }
+}
+
+%code {
+class Position {
+  public int line;
+  public int token;
+
+  public Position ()
+  {
+    line = 0;
+    token = 0;
+  }
+
+  public Position (int l, int t)
+  {
+    line = l;
+    token = t;
+  }
+
+  public boolean equals (Position l)
+  {
+    return l.line == line && l.token == token;
+  }
+
+  public String toString ()
+  {
+    return Integer.toString(line)  + "." + Integer.toString(token);
+  }
+
+  public int lineno ()
+  {
+    return line;
+  }
+
+  public int token ()
+  {
+    return token;
+  }
+}
+
+public static void main (String[] argv)
+        throws IOException
+{
+  StringReader reader = getinput(argv[0]);
+  Calc calc = new Calc(reader);
+  calc.setDebugLevel(1);
+  calc.parse();
+}
+
+static StringReader
+getinput(String filename)
+    throws IOException
+{
+  StringBuilder buf = new StringBuilder();
+  FileReader file = new FileReader(filename);
+  int c;
+  while((c=file.read()) > 0) {
+    buf.append((char)c);
+  }
+  file.close();
+  return new StringReader(buf.toString());
+}
+}
+
+]AT_CALC_BODY1[
+
+]])
+AT_BISON_OPTION_POPDEFS
+
+AT_DATA([[input]],[[1 + 2 * 3 = 7
+1 + 2 * -3 = -5
+
+-1^2 = -1
+(-1)^2 = 1
+
+---1 = -1
+
+1 - 2 - 3 = -4
+1 - (2 - 3) = 2
+
+2^2^3 = 256
+(2^2)^3 = 64
+]])
+
+AT_DATA([[expout]],[[Starting parse
+
+Entering state 0
+
+Stack now 0
+Reading a token: @&t@
+Next token is token "number" (1.1: 1)
+Shifting token "number" (1.1: 1)
+Entering state 2
+
+Stack now 0 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1.1: 1)
+-> $$ = nterm exp (1.1: 1)
+Entering state 9
+
+Stack now 0 9
+Reading a token: @&t@
+Next token is token '+' (1.2: 1)
+Shifting token '+' (1.2: 1)
+Entering state 19
+
+Stack now 0 9 19
+Reading a token: @&t@
+Next token is token "number" (1.3: 2)
+Shifting token "number" (1.3: 2)
+Entering state 2
+
+Stack now 0 9 19 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1.3: 2)
+-> $$ = nterm exp (1.3: 2)
+Entering state 28
+
+Stack now 0 9 19 28
+Reading a token: @&t@
+Next token is token '*' (1.4: 2)
+Shifting token '*' (1.4: 2)
+Entering state 20
+
+Stack now 0 9 19 28 20
+Reading a token: @&t@
+Next token is token "number" (1.5: 3)
+Shifting token "number" (1.5: 3)
+Entering state 2
+
+Stack now 0 9 19 28 20 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1.5: 3)
+-> $$ = nterm exp (1.5: 3)
+Entering state 29
+
+Stack now 0 9 19 28 20 29
+Reading a token: @&t@
+Next token is token '=' (1.6: 3)
+Reducing stack by rule 10 , @&t@
+   $1 = nterm exp (1.3: 2)
+   $2 = token '*' (1.4: 2)
+   $3 = nterm exp (1.5: 3)
+-> $$ = nterm exp (1.3-1.5: 6)
+Entering state 28
+
+Stack now 0 9 19 28
+Next token is token '=' (1.6: 3)
+Reducing stack by rule 8 , @&t@
+   $1 = nterm exp (1.1: 1)
+   $2 = token '+' (1.2: 1)
+   $3 = nterm exp (1.3-1.5: 6)
+-> $$ = nterm exp (1.1-1.5: 7)
+Entering state 9
+
+Stack now 0 9
+Next token is token '=' (1.6: 3)
+Shifting token '=' (1.6: 3)
+Entering state 17
+
+Stack now 0 9 17
+Reading a token: @&t@
+Next token is token "number" (1.7: 7)
+Shifting token "number" (1.7: 7)
+Entering state 2
+
+Stack now 0 9 17 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1.7: 7)
+-> $$ = nterm exp (1.7: 7)
+Entering state 26
+
+Stack now 0 9 17 26
+Reading a token: @&t@
+Next token is token '\n' (2.0: 7)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (1.1-1.5: 7)
+   $2 = token '=' (1.6: 3)
+   $3 = nterm exp (1.7: 7)
+-> $$ = nterm exp (1.1-1.7: 7)
+Entering state 9
+
+Stack now 0 9
+Next token is token '\n' (2.0: 7)
+Shifting token '\n' (2.0: 7)
+Entering state 23
+
+Stack now 0 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (1.1-1.7: 7)
+   $2 = token '\n' (2.0: 7)
+-> $$ = nterm line (1.1-2.0: 7)
+Entering state 8
+
+Stack now 0 8
+Reducing stack by rule 1 , @&t@
+   $1 = nterm line (1.1-2.0: 7)
+-> $$ = nterm input (1.1-2.0: 7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token "number" (2.1: 1)
+Shifting token "number" (2.1: 1)
+Entering state 2
+
+Stack now 0 7 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2.1: 1)
+-> $$ = nterm exp (2.1: 1)
+Entering state 9
+
+Stack now 0 7 9
+Reading a token: @&t@
+Next token is token '+' (2.2: 1)
+Shifting token '+' (2.2: 1)
+Entering state 19
+
+Stack now 0 7 9 19
+Reading a token: @&t@
+Next token is token "number" (2.3: 2)
+Shifting token "number" (2.3: 2)
+Entering state 2
+
+Stack now 0 7 9 19 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2.3: 2)
+-> $$ = nterm exp (2.3: 2)
+Entering state 28
+
+Stack now 0 7 9 19 28
+Reading a token: @&t@
+Next token is token '*' (2.4: 2)
+Shifting token '*' (2.4: 2)
+Entering state 20
+
+Stack now 0 7 9 19 28 20
+Reading a token: @&t@
+Next token is token '-' (2.5: 2)
+Shifting token '-' (2.5: 2)
+Entering state 3
+
+Stack now 0 7 9 19 28 20 3
+Reading a token: @&t@
+Next token is token "number" (2.6: 3)
+Shifting token "number" (2.6: 3)
+Entering state 2
+
+Stack now 0 7 9 19 28 20 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2.6: 3)
+-> $$ = nterm exp (2.6: 3)
+Entering state 12
+
+Stack now 0 7 9 19 28 20 3 12
+Reading a token: @&t@
+Next token is token '=' (2.7: 3)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (2.5: 2)
+   $2 = nterm exp (2.6: 3)
+-> $$ = nterm exp (2.5-2.6: -3)
+Entering state 29
+
+Stack now 0 7 9 19 28 20 29
+Next token is token '=' (2.7: 3)
+Reducing stack by rule 10 , @&t@
+   $1 = nterm exp (2.3: 2)
+   $2 = token '*' (2.4: 2)
+   $3 = nterm exp (2.5-2.6: -3)
+-> $$ = nterm exp (2.3-2.6: -6)
+Entering state 28
+
+Stack now 0 7 9 19 28
+Next token is token '=' (2.7: 3)
+Reducing stack by rule 8 , @&t@
+   $1 = nterm exp (2.1: 1)
+   $2 = token '+' (2.2: 1)
+   $3 = nterm exp (2.3-2.6: -6)
+-> $$ = nterm exp (2.1-2.6: -5)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (2.7: 3)
+Shifting token '=' (2.7: 3)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token '-' (2.8: 3)
+Shifting token '-' (2.8: 3)
+Entering state 3
+
+Stack now 0 7 9 17 3
+Reading a token: @&t@
+Next token is token "number" (2.9: 5)
+Shifting token "number" (2.9: 5)
+Entering state 2
+
+Stack now 0 7 9 17 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2.9: 5)
+-> $$ = nterm exp (2.9: 5)
+Entering state 12
+
+Stack now 0 7 9 17 3 12
+Reading a token: @&t@
+Next token is token '\n' (3.0: 5)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (2.8: 3)
+   $2 = nterm exp (2.9: 5)
+-> $$ = nterm exp (2.8-2.9: -5)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Next token is token '\n' (3.0: 5)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (2.1-2.6: -5)
+   $2 = token '=' (2.7: 3)
+   $3 = nterm exp (2.8-2.9: -5)
+-> $$ = nterm exp (2.1-2.9: -5)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (3.0: 5)
+Shifting token '\n' (3.0: 5)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (2.1-2.9: -5)
+   $2 = token '\n' (3.0: 5)
+-> $$ = nterm line (2.1-3.0: -5)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (1.1-2.0: 7)
+   $2 = nterm line (2.1-3.0: -5)
+-> $$ = nterm input (1.1-3.0: 7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '\n' (4.0: 5)
+Shifting token '\n' (4.0: 5)
+Entering state 4
+
+Stack now 0 7 4
+Reducing stack by rule 3 , @&t@
+   $1 = token '\n' (4.0: 5)
+-> $$ = nterm line (4.0: 5)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (1.1-3.0: 7)
+   $2 = nterm line (4.0: 5)
+-> $$ = nterm input (1.1-4.0: 7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '-' (4.1: 5)
+Shifting token '-' (4.1: 5)
+Entering state 3
+
+Stack now 0 7 3
+Reading a token: @&t@
+Next token is token "number" (4.2: 1)
+Shifting token "number" (4.2: 1)
+Entering state 2
+
+Stack now 0 7 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (4.2: 1)
+-> $$ = nterm exp (4.2: 1)
+Entering state 12
+
+Stack now 0 7 3 12
+Reading a token: @&t@
+Next token is token '^' (4.3: 1)
+Shifting token '^' (4.3: 1)
+Entering state 22
+
+Stack now 0 7 3 12 22
+Reading a token: @&t@
+Next token is token "number" (4.4: 2)
+Shifting token "number" (4.4: 2)
+Entering state 2
+
+Stack now 0 7 3 12 22 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (4.4: 2)
+-> $$ = nterm exp (4.4: 2)
+Entering state 31
+
+Stack now 0 7 3 12 22 31
+Reading a token: @&t@
+Next token is token '=' (4.5: 2)
+Reducing stack by rule 13 , @&t@
+   $1 = nterm exp (4.2: 1)
+   $2 = token '^' (4.3: 1)
+   $3 = nterm exp (4.4: 2)
+-> $$ = nterm exp (4.2-4.4: 1)
+Entering state 12
+
+Stack now 0 7 3 12
+Next token is token '=' (4.5: 2)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (4.1: 5)
+   $2 = nterm exp (4.2-4.4: 1)
+-> $$ = nterm exp (4.1-4.4: -1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (4.5: 2)
+Shifting token '=' (4.5: 2)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token '-' (4.6: 2)
+Shifting token '-' (4.6: 2)
+Entering state 3
+
+Stack now 0 7 9 17 3
+Reading a token: @&t@
+Next token is token "number" (4.7: 1)
+Shifting token "number" (4.7: 1)
+Entering state 2
+
+Stack now 0 7 9 17 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (4.7: 1)
+-> $$ = nterm exp (4.7: 1)
+Entering state 12
+
+Stack now 0 7 9 17 3 12
+Reading a token: @&t@
+Next token is token '\n' (5.0: 1)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (4.6: 2)
+   $2 = nterm exp (4.7: 1)
+-> $$ = nterm exp (4.6-4.7: -1)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Next token is token '\n' (5.0: 1)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (4.1-4.4: -1)
+   $2 = token '=' (4.5: 2)
+   $3 = nterm exp (4.6-4.7: -1)
+-> $$ = nterm exp (4.1-4.7: -1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (5.0: 1)
+Shifting token '\n' (5.0: 1)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (4.1-4.7: -1)
+   $2 = token '\n' (5.0: 1)
+-> $$ = nterm line (4.1-5.0: -1)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (1.1-4.0: 7)
+   $2 = nterm line (4.1-5.0: -1)
+-> $$ = nterm input (1.1-5.0: 7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '(' (5.1: 1)
+Shifting token '(' (5.1: 1)
+Entering state 5
+
+Stack now 0 7 5
+Reading a token: @&t@
+Next token is token '-' (5.2: 1)
+Shifting token '-' (5.2: 1)
+Entering state 3
+
+Stack now 0 7 5 3
+Reading a token: @&t@
+Next token is token "number" (5.3: 1)
+Shifting token "number" (5.3: 1)
+Entering state 2
+
+Stack now 0 7 5 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (5.3: 1)
+-> $$ = nterm exp (5.3: 1)
+Entering state 12
+
+Stack now 0 7 5 3 12
+Reading a token: @&t@
+Next token is token ')' (5.4: 1)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (5.2: 1)
+   $2 = nterm exp (5.3: 1)
+-> $$ = nterm exp (5.2-5.3: -1)
+Entering state 14
+
+Stack now 0 7 5 14
+Next token is token ')' (5.4: 1)
+Shifting token ')' (5.4: 1)
+Entering state 25
+
+Stack now 0 7 5 14 25
+Reducing stack by rule 14 , @&t@
+   $1 = token '(' (5.1: 1)
+   $2 = nterm exp (5.2-5.3: -1)
+   $3 = token ')' (5.4: 1)
+-> $$ = nterm exp (5.1-5.4: -1)
+Entering state 9
+
+Stack now 0 7 9
+Reading a token: @&t@
+Next token is token '^' (5.5: 1)
+Shifting token '^' (5.5: 1)
+Entering state 22
+
+Stack now 0 7 9 22
+Reading a token: @&t@
+Next token is token "number" (5.6: 2)
+Shifting token "number" (5.6: 2)
+Entering state 2
+
+Stack now 0 7 9 22 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (5.6: 2)
+-> $$ = nterm exp (5.6: 2)
+Entering state 31
+
+Stack now 0 7 9 22 31
+Reading a token: @&t@
+Next token is token '=' (5.7: 2)
+Reducing stack by rule 13 , @&t@
+   $1 = nterm exp (5.1-5.4: -1)
+   $2 = token '^' (5.5: 1)
+   $3 = nterm exp (5.6: 2)
+-> $$ = nterm exp (5.1-5.6: 1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (5.7: 2)
+Shifting token '=' (5.7: 2)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token "number" (5.8: 1)
+Shifting token "number" (5.8: 1)
+Entering state 2
+
+Stack now 0 7 9 17 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (5.8: 1)
+-> $$ = nterm exp (5.8: 1)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Reading a token: @&t@
+Next token is token '\n' (6.0: 1)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (5.1-5.6: 1)
+   $2 = token '=' (5.7: 2)
+   $3 = nterm exp (5.8: 1)
+-> $$ = nterm exp (5.1-5.8: 1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (6.0: 1)
+Shifting token '\n' (6.0: 1)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (5.1-5.8: 1)
+   $2 = token '\n' (6.0: 1)
+-> $$ = nterm line (5.1-6.0: 1)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (1.1-5.0: 7)
+   $2 = nterm line (5.1-6.0: 1)
+-> $$ = nterm input (1.1-6.0: 7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '\n' (7.0: 1)
+Shifting token '\n' (7.0: 1)
+Entering state 4
+
+Stack now 0 7 4
+Reducing stack by rule 3 , @&t@
+   $1 = token '\n' (7.0: 1)
+-> $$ = nterm line (7.0: 1)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (1.1-6.0: 7)
+   $2 = nterm line (7.0: 1)
+-> $$ = nterm input (1.1-7.0: 7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '-' (7.1: 1)
+Shifting token '-' (7.1: 1)
+Entering state 3
+
+Stack now 0 7 3
+Reading a token: @&t@
+Next token is token '-' (7.2: 1)
+Shifting token '-' (7.2: 1)
+Entering state 3
+
+Stack now 0 7 3 3
+Reading a token: @&t@
+Next token is token '-' (7.3: 1)
+Shifting token '-' (7.3: 1)
+Entering state 3
+
+Stack now 0 7 3 3 3
+Reading a token: @&t@
+Next token is token "number" (7.4: 1)
+Shifting token "number" (7.4: 1)
+Entering state 2
+
+Stack now 0 7 3 3 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (7.4: 1)
+-> $$ = nterm exp (7.4: 1)
+Entering state 12
+
+Stack now 0 7 3 3 3 12
+Reading a token: @&t@
+Next token is token '=' (7.5: 1)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (7.3: 1)
+   $2 = nterm exp (7.4: 1)
+-> $$ = nterm exp (7.3-7.4: -1)
+Entering state 12
+
+Stack now 0 7 3 3 12
+Next token is token '=' (7.5: 1)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (7.2: 1)
+   $2 = nterm exp (7.3-7.4: -1)
+-> $$ = nterm exp (7.2-7.4: 1)
+Entering state 12
+
+Stack now 0 7 3 12
+Next token is token '=' (7.5: 1)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (7.1: 1)
+   $2 = nterm exp (7.2-7.4: 1)
+-> $$ = nterm exp (7.1-7.4: -1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (7.5: 1)
+Shifting token '=' (7.5: 1)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token '-' (7.6: 1)
+Shifting token '-' (7.6: 1)
+Entering state 3
+
+Stack now 0 7 9 17 3
+Reading a token: @&t@
+Next token is token "number" (7.7: 1)
+Shifting token "number" (7.7: 1)
+Entering state 2
+
+Stack now 0 7 9 17 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (7.7: 1)
+-> $$ = nterm exp (7.7: 1)
+Entering state 12
+
+Stack now 0 7 9 17 3 12
+Reading a token: @&t@
+Next token is token '\n' (8.0: 1)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (7.6: 1)
+   $2 = nterm exp (7.7: 1)
+-> $$ = nterm exp (7.6-7.7: -1)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Next token is token '\n' (8.0: 1)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (7.1-7.4: -1)
+   $2 = token '=' (7.5: 1)
+   $3 = nterm exp (7.6-7.7: -1)
+-> $$ = nterm exp (7.1-7.7: -1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (8.0: 1)
+Shifting token '\n' (8.0: 1)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (7.1-7.7: -1)
+   $2 = token '\n' (8.0: 1)
+-> $$ = nterm line (7.1-8.0: -1)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (1.1-7.0: 7)
+   $2 = nterm line (7.1-8.0: -1)
+-> $$ = nterm input (1.1-8.0: 7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '\n' (9.0: 1)
+Shifting token '\n' (9.0: 1)
+Entering state 4
+
+Stack now 0 7 4
+Reducing stack by rule 3 , @&t@
+   $1 = token '\n' (9.0: 1)
+-> $$ = nterm line (9.0: 1)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (1.1-8.0: 7)
+   $2 = nterm line (9.0: 1)
+-> $$ = nterm input (1.1-9.0: 7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token "number" (9.1: 1)
+Shifting token "number" (9.1: 1)
+Entering state 2
+
+Stack now 0 7 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (9.1: 1)
+-> $$ = nterm exp (9.1: 1)
+Entering state 9
+
+Stack now 0 7 9
+Reading a token: @&t@
+Next token is token '-' (9.2: 1)
+Shifting token '-' (9.2: 1)
+Entering state 18
+
+Stack now 0 7 9 18
+Reading a token: @&t@
+Next token is token "number" (9.3: 2)
+Shifting token "number" (9.3: 2)
+Entering state 2
+
+Stack now 0 7 9 18 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (9.3: 2)
+-> $$ = nterm exp (9.3: 2)
+Entering state 27
+
+Stack now 0 7 9 18 27
+Reading a token: @&t@
+Next token is token '-' (9.4: 2)
+Reducing stack by rule 9 , @&t@
+   $1 = nterm exp (9.1: 1)
+   $2 = token '-' (9.2: 1)
+   $3 = nterm exp (9.3: 2)
+-> $$ = nterm exp (9.1-9.3: -1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '-' (9.4: 2)
+Shifting token '-' (9.4: 2)
+Entering state 18
+
+Stack now 0 7 9 18
+Reading a token: @&t@
+Next token is token "number" (9.5: 3)
+Shifting token "number" (9.5: 3)
+Entering state 2
+
+Stack now 0 7 9 18 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (9.5: 3)
+-> $$ = nterm exp (9.5: 3)
+Entering state 27
+
+Stack now 0 7 9 18 27
+Reading a token: @&t@
+Next token is token '=' (9.6: 3)
+Reducing stack by rule 9 , @&t@
+   $1 = nterm exp (9.1-9.3: -1)
+   $2 = token '-' (9.4: 2)
+   $3 = nterm exp (9.5: 3)
+-> $$ = nterm exp (9.1-9.5: -4)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (9.6: 3)
+Shifting token '=' (9.6: 3)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token '-' (9.7: 3)
+Shifting token '-' (9.7: 3)
+Entering state 3
+
+Stack now 0 7 9 17 3
+Reading a token: @&t@
+Next token is token "number" (9.8: 4)
+Shifting token "number" (9.8: 4)
+Entering state 2
+
+Stack now 0 7 9 17 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (9.8: 4)
+-> $$ = nterm exp (9.8: 4)
+Entering state 12
+
+Stack now 0 7 9 17 3 12
+Reading a token: @&t@
+Next token is token '\n' (10.0: 4)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (9.7: 3)
+   $2 = nterm exp (9.8: 4)
+-> $$ = nterm exp (9.7-9.8: -4)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Next token is token '\n' (10.0: 4)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (9.1-9.5: -4)
+   $2 = token '=' (9.6: 3)
+   $3 = nterm exp (9.7-9.8: -4)
+-> $$ = nterm exp (9.1-9.8: -4)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (10.0: 4)
+Shifting token '\n' (10.0: 4)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (9.1-9.8: -4)
+   $2 = token '\n' (10.0: 4)
+-> $$ = nterm line (9.1-10.0: -4)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (1.1-9.0: 7)
+   $2 = nterm line (9.1-10.0: -4)
+-> $$ = nterm input (1.1-10.0: 7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token "number" (10.1: 1)
+Shifting token "number" (10.1: 1)
+Entering state 2
+
+Stack now 0 7 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (10.1: 1)
+-> $$ = nterm exp (10.1: 1)
+Entering state 9
+
+Stack now 0 7 9
+Reading a token: @&t@
+Next token is token '-' (10.2: 1)
+Shifting token '-' (10.2: 1)
+Entering state 18
+
+Stack now 0 7 9 18
+Reading a token: @&t@
+Next token is token '(' (10.3: 1)
+Shifting token '(' (10.3: 1)
+Entering state 5
+
+Stack now 0 7 9 18 5
+Reading a token: @&t@
+Next token is token "number" (10.4: 2)
+Shifting token "number" (10.4: 2)
+Entering state 2
+
+Stack now 0 7 9 18 5 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (10.4: 2)
+-> $$ = nterm exp (10.4: 2)
+Entering state 14
+
+Stack now 0 7 9 18 5 14
+Reading a token: @&t@
+Next token is token '-' (10.5: 2)
+Shifting token '-' (10.5: 2)
+Entering state 18
+
+Stack now 0 7 9 18 5 14 18
+Reading a token: @&t@
+Next token is token "number" (10.6: 3)
+Shifting token "number" (10.6: 3)
+Entering state 2
+
+Stack now 0 7 9 18 5 14 18 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (10.6: 3)
+-> $$ = nterm exp (10.6: 3)
+Entering state 27
+
+Stack now 0 7 9 18 5 14 18 27
+Reading a token: @&t@
+Next token is token ')' (10.7: 3)
+Reducing stack by rule 9 , @&t@
+   $1 = nterm exp (10.4: 2)
+   $2 = token '-' (10.5: 2)
+   $3 = nterm exp (10.6: 3)
+-> $$ = nterm exp (10.4-10.6: -1)
+Entering state 14
+
+Stack now 0 7 9 18 5 14
+Next token is token ')' (10.7: 3)
+Shifting token ')' (10.7: 3)
+Entering state 25
+
+Stack now 0 7 9 18 5 14 25
+Reducing stack by rule 14 , @&t@
+   $1 = token '(' (10.3: 1)
+   $2 = nterm exp (10.4-10.6: -1)
+   $3 = token ')' (10.7: 3)
+-> $$ = nterm exp (10.3-10.7: -1)
+Entering state 27
+
+Stack now 0 7 9 18 27
+Reading a token: @&t@
+Next token is token '=' (10.8: 3)
+Reducing stack by rule 9 , @&t@
+   $1 = nterm exp (10.1: 1)
+   $2 = token '-' (10.2: 1)
+   $3 = nterm exp (10.3-10.7: -1)
+-> $$ = nterm exp (10.1-10.7: 2)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (10.8: 3)
+Shifting token '=' (10.8: 3)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token "number" (10.9: 2)
+Shifting token "number" (10.9: 2)
+Entering state 2
+
+Stack now 0 7 9 17 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (10.9: 2)
+-> $$ = nterm exp (10.9: 2)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Reading a token: @&t@
+Next token is token '\n' (11.0: 2)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (10.1-10.7: 2)
+   $2 = token '=' (10.8: 3)
+   $3 = nterm exp (10.9: 2)
+-> $$ = nterm exp (10.1-10.9: 2)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (11.0: 2)
+Shifting token '\n' (11.0: 2)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (10.1-10.9: 2)
+   $2 = token '\n' (11.0: 2)
+-> $$ = nterm line (10.1-11.0: 2)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (1.1-10.0: 7)
+   $2 = nterm line (10.1-11.0: 2)
+-> $$ = nterm input (1.1-11.0: 7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '\n' (12.0: 2)
+Shifting token '\n' (12.0: 2)
+Entering state 4
+
+Stack now 0 7 4
+Reducing stack by rule 3 , @&t@
+   $1 = token '\n' (12.0: 2)
+-> $$ = nterm line (12.0: 2)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (1.1-11.0: 7)
+   $2 = nterm line (12.0: 2)
+-> $$ = nterm input (1.1-12.0: 7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token "number" (12.1: 2)
+Shifting token "number" (12.1: 2)
+Entering state 2
+
+Stack now 0 7 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (12.1: 2)
+-> $$ = nterm exp (12.1: 2)
+Entering state 9
+
+Stack now 0 7 9
+Reading a token: @&t@
+Next token is token '^' (12.2: 2)
+Shifting token '^' (12.2: 2)
+Entering state 22
+
+Stack now 0 7 9 22
+Reading a token: @&t@
+Next token is token "number" (12.3: 2)
+Shifting token "number" (12.3: 2)
+Entering state 2
+
+Stack now 0 7 9 22 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (12.3: 2)
+-> $$ = nterm exp (12.3: 2)
+Entering state 31
+
+Stack now 0 7 9 22 31
+Reading a token: @&t@
+Next token is token '^' (12.4: 2)
+Shifting token '^' (12.4: 2)
+Entering state 22
+
+Stack now 0 7 9 22 31 22
+Reading a token: @&t@
+Next token is token "number" (12.5: 3)
+Shifting token "number" (12.5: 3)
+Entering state 2
+
+Stack now 0 7 9 22 31 22 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (12.5: 3)
+-> $$ = nterm exp (12.5: 3)
+Entering state 31
+
+Stack now 0 7 9 22 31 22 31
+Reading a token: @&t@
+Next token is token '=' (12.6: 3)
+Reducing stack by rule 13 , @&t@
+   $1 = nterm exp (12.3: 2)
+   $2 = token '^' (12.4: 2)
+   $3 = nterm exp (12.5: 3)
+-> $$ = nterm exp (12.3-12.5: 8)
+Entering state 31
+
+Stack now 0 7 9 22 31
+Next token is token '=' (12.6: 3)
+Reducing stack by rule 13 , @&t@
+   $1 = nterm exp (12.1: 2)
+   $2 = token '^' (12.2: 2)
+   $3 = nterm exp (12.3-12.5: 8)
+-> $$ = nterm exp (12.1-12.5: 256)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (12.6: 3)
+Shifting token '=' (12.6: 3)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token "number" (12.7: 256)
+Shifting token "number" (12.7: 256)
+Entering state 2
+
+Stack now 0 7 9 17 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (12.7: 256)
+-> $$ = nterm exp (12.7: 256)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Reading a token: @&t@
+Next token is token '\n' (13.0: 256)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (12.1-12.5: 256)
+   $2 = token '=' (12.6: 3)
+   $3 = nterm exp (12.7: 256)
+-> $$ = nterm exp (12.1-12.7: 256)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (13.0: 256)
+Shifting token '\n' (13.0: 256)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (12.1-12.7: 256)
+   $2 = token '\n' (13.0: 256)
+-> $$ = nterm line (12.1-13.0: 256)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (1.1-12.0: 7)
+   $2 = nterm line (12.1-13.0: 256)
+-> $$ = nterm input (1.1-13.0: 7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '(' (13.1: 256)
+Shifting token '(' (13.1: 256)
+Entering state 5
+
+Stack now 0 7 5
+Reading a token: @&t@
+Next token is token "number" (13.2: 2)
+Shifting token "number" (13.2: 2)
+Entering state 2
+
+Stack now 0 7 5 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (13.2: 2)
+-> $$ = nterm exp (13.2: 2)
+Entering state 14
+
+Stack now 0 7 5 14
+Reading a token: @&t@
+Next token is token '^' (13.3: 2)
+Shifting token '^' (13.3: 2)
+Entering state 22
+
+Stack now 0 7 5 14 22
+Reading a token: @&t@
+Next token is token "number" (13.4: 2)
+Shifting token "number" (13.4: 2)
+Entering state 2
+
+Stack now 0 7 5 14 22 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (13.4: 2)
+-> $$ = nterm exp (13.4: 2)
+Entering state 31
+
+Stack now 0 7 5 14 22 31
+Reading a token: @&t@
+Next token is token ')' (13.5: 2)
+Reducing stack by rule 13 , @&t@
+   $1 = nterm exp (13.2: 2)
+   $2 = token '^' (13.3: 2)
+   $3 = nterm exp (13.4: 2)
+-> $$ = nterm exp (13.2-13.4: 4)
+Entering state 14
+
+Stack now 0 7 5 14
+Next token is token ')' (13.5: 2)
+Shifting token ')' (13.5: 2)
+Entering state 25
+
+Stack now 0 7 5 14 25
+Reducing stack by rule 14 , @&t@
+   $1 = token '(' (13.1: 256)
+   $2 = nterm exp (13.2-13.4: 4)
+   $3 = token ')' (13.5: 2)
+-> $$ = nterm exp (13.1-13.5: 4)
+Entering state 9
+
+Stack now 0 7 9
+Reading a token: @&t@
+Next token is token '^' (13.6: 2)
+Shifting token '^' (13.6: 2)
+Entering state 22
+
+Stack now 0 7 9 22
+Reading a token: @&t@
+Next token is token "number" (13.7: 3)
+Shifting token "number" (13.7: 3)
+Entering state 2
+
+Stack now 0 7 9 22 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (13.7: 3)
+-> $$ = nterm exp (13.7: 3)
+Entering state 31
+
+Stack now 0 7 9 22 31
+Reading a token: @&t@
+Next token is token '=' (13.8: 3)
+Reducing stack by rule 13 , @&t@
+   $1 = nterm exp (13.1-13.5: 4)
+   $2 = token '^' (13.6: 2)
+   $3 = nterm exp (13.7: 3)
+-> $$ = nterm exp (13.1-13.7: 64)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (13.8: 3)
+Shifting token '=' (13.8: 3)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token "number" (13.9: 64)
+Shifting token "number" (13.9: 64)
+Entering state 2
+
+Stack now 0 7 9 17 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (13.9: 64)
+-> $$ = nterm exp (13.9: 64)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Reading a token: @&t@
+Next token is token '\n' (14.0: 64)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (13.1-13.7: 64)
+   $2 = token '=' (13.8: 3)
+   $3 = nterm exp (13.9: 64)
+-> $$ = nterm exp (13.1-13.9: 64)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (14.0: 64)
+Shifting token '\n' (14.0: 64)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (13.1-13.9: 64)
+   $2 = token '\n' (14.0: 64)
+-> $$ = nterm line (13.1-14.0: 64)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (1.1-13.0: 7)
+   $2 = nterm line (13.1-14.0: 64)
+-> $$ = nterm input (1.1-14.0: 7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Now at end of input.
+
+Shifting token $end (14.1: 64)
+Entering state 15
+
+Stack now 0 7 15
+]])
+
+AT_BISON_CHECK([PUSHPULLFLAGS [-o Calc.java Calc.y]])
+AT_JAVA_COMPILE([[Calc.java]])
+# Verify that this is a push parser
+AT_CHECK_JAVA_GREP([[Calc.java]],[[.*public void push_parse_initialize().*]])
+# Capture the output so we can edit out the (line nnnn) occurrences
+AT_JAVA_PARSER_CHECK([Calc input], 0, [], [stderr-nolog])
+AT_CHECK([[sed -e 's/(line[ ][0-9][0-9]*)[,]/,/' stderr]],[ignore],[expout])
+AT_CLEANUP
+
+AT_SETUP([Calc parser with api.push-pull both and %define extends])
+AT_BISON_OPTION_PUSHDEFS
+AT_DATA([[Calc.y]],[[/* Infix notation calculator--calc */
+%language "Java"
+%name-prefix "Calc"
+%define parser_class_name "Calc"
+%define extends "CalcActions"
+
+%code init {
+    super();
+}
+
+%code imports {
+  import java.io.*;
+}
+
+%code {
+
+  /* Make yylexer visible */
+  Lexer getLexer() {return yylexer;}
+
+  public static void main (String[] argv)
+        throws IOException
+  {
+    StringReader reader = getinput(argv[0]);
+    UserLexer lexer = new UserLexer(reader);
+    Calc calc = new Calc(lexer);
+    calc.setDebugLevel(1);
+    calc.parse();
+  }
+
+
+  static StringReader
+  getinput(String filename) throws IOException
+  {
+    StringBuilder buf = new StringBuilder();
+    FileReader file = new FileReader(filename);
+    int c;
+    while((c=file.read()) > 0) {
+      buf.append((char)c);
+    }
+    file.close();
+    return new StringReader(buf.toString());
+  }
+}
+
+/* Bison Declarations */
+%token <Integer> NUM "number"
+%type  <Integer> exp
+
+%nonassoc '=' /* comparison            */
+%left '-' '+'
+%left '*' '/'
+%left NEG     /* negation--unary minus */
+%right '^'    /* exponentiation        */
+
+/* Grammar follows */
+%%
+input:
+  line
+| input line
+;
+
+line:
+  '\n'
+| exp '\n'
+| error '\n'
+;
+
+exp:
+  NUM                { $$ = $1;}
+| exp '=' exp {$$ = action_eq($1,$3);}
+| exp '+' exp {$$ = action_add($1,$3);}
+| exp '-' exp {$$ = action_sub($1,$3);}
+| exp '*' exp {$$ = action_mult($1,$3);}
+| exp '/' exp {$$ = action_div($1,$3);}
+| '-' exp  %prec NEG {$$ = action_minus($2);}
+| exp '^' exp {$$ = action_exp($1,$3);}
+| '(' exp ')'   {$$ = action_ident($2);}
+| '(' error ')' {$$ = action_error1();}
+| '!'            {$$ = action_fail(); return YYERROR;}
+| '-' error     {$$ = action_error2(); return YYERROR;}
+;
+
+%%
+
+class UserLexer implements Calc.Lexer
+{
+  StreamTokenizer st;
+  StringReader rdr;
+
+  public UserLexer(StringReader reader)
+  {
+    rdr = reader;
+    st = new StreamTokenizer(rdr);
+    st.resetSyntax();
+    st.eolIsSignificant(true);
+    st.whitespaceChars(9, 9);
+    st.whitespaceChars(32, 32);
+    st.wordChars(48, 57);
+  }
+
+  Integer yylval;
+
+  public Object getLVal() {return yylval;}
+
+  public void yyerror(String msg) {System.err.println(msg);}
+
+  public int yylex () throws IOException
+  {
+    int ttype = st.nextToken ();
+    if (ttype == st.TT_EOF) {return EOF;}
+    else if (ttype == st.TT_EOL) {
+        return (int) '\n';
+    } else if (ttype == st.TT_WORD) {
+        yylval = new Integer (st.sval);
+        return NUM;
+    } else
+      return st.ttype;
+  }
+}
+
+abstract class CalcActions
+{
+  CalcActions() {};
+
+  abstract Calc.Lexer getLexer();
+
+  Integer
+  action_eq(Integer i1, Integer i2)
+  {
+    if (i1.intValue() != i2.intValue())
+      getLexer().yyerror (]AT_LOCATION_IF(address@hidden,])[ "calc: error: " + 
i1 + " != " + i2);
+    return i1; /* default */
+  }
+
+  Integer
+  action_sub(Integer i1, Integer i2)
+      {return new Integer (i1.intValue () - i2.intValue ());}
+
+  Integer
+  action_add(Integer i1, Integer i2)
+      {return new Integer (i1.intValue () + i2.intValue ());}
+
+  Integer
+  action_mult(Integer i1, Integer i2)
+      {return new Integer (i1.intValue () * i2.intValue ());}
+
+  Integer
+  action_div(Integer i1, Integer i2)
+      {return new Integer (i1.intValue () / i2.intValue ());}
+
+  Integer
+  action_minus(Integer i1)
+      {return new Integer (- i1.intValue ());}
+
+  Integer
+  action_exp(Integer i1, Integer i2)
+      {return new Integer ((int)Math.pow(i1.intValue(),i2.intValue ()));}
+
+  Integer
+  action_ident(Integer i1)
+      {return i1;}
+
+  Integer
+  action_error1()
+      {return new Integer(1111);}
+
+  Integer
+  action_fail()
+      {return new Integer(0);}
+
+  Integer
+  action_error2()
+      {return new Integer(0);}
+}
+]])
+
+AT_BISON_OPTION_POPDEFS
+
+AT_DATA([[input]],[[1 + 2 * 3 = 7
+1 + 2 * -3 = -5
+
+-1^2 = -1
+(-1)^2 = 1
+
+---1 = -1
+
+1 - 2 - 3 = -4
+1 - (2 - 3) = 2
+
+2^2^3 = 256
+(2^2)^3 = 64
+]])
+
+AT_DATA([[expout]],[[Starting parse
+
+Entering state 0
+
+Stack now 0
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 9
+
+Stack now 0 9
+Reading a token: @&t@
+Next token is token '+' (1)
+Shifting token '+' (1)
+Entering state 19
+
+Stack now 0 9 19
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 9 19 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 28
+
+Stack now 0 9 19 28
+Reading a token: @&t@
+Next token is token '*' (2)
+Shifting token '*' (2)
+Entering state 20
+
+Stack now 0 9 19 28 20
+Reading a token: @&t@
+Next token is token "number" (3)
+Shifting token "number" (3)
+Entering state 2
+
+Stack now 0 9 19 28 20 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (3)
+-> $$ = nterm exp (3)
+Entering state 29
+
+Stack now 0 9 19 28 20 29
+Reading a token: @&t@
+Next token is token '=' (3)
+Reducing stack by rule 10 , @&t@
+   $1 = nterm exp (2)
+   $2 = token '*' (2)
+   $3 = nterm exp (3)
+-> $$ = nterm exp (6)
+Entering state 28
+
+Stack now 0 9 19 28
+Next token is token '=' (3)
+Reducing stack by rule 8 , @&t@
+   $1 = nterm exp (1)
+   $2 = token '+' (1)
+   $3 = nterm exp (6)
+-> $$ = nterm exp (7)
+Entering state 9
+
+Stack now 0 9
+Next token is token '=' (3)
+Shifting token '=' (3)
+Entering state 17
+
+Stack now 0 9 17
+Reading a token: @&t@
+Next token is token "number" (7)
+Shifting token "number" (7)
+Entering state 2
+
+Stack now 0 9 17 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (7)
+-> $$ = nterm exp (7)
+Entering state 26
+
+Stack now 0 9 17 26
+Reading a token: @&t@
+Next token is token '\n' (7)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (7)
+   $2 = token '=' (3)
+   $3 = nterm exp (7)
+-> $$ = nterm exp (7)
+Entering state 9
+
+Stack now 0 9
+Next token is token '\n' (7)
+Shifting token '\n' (7)
+Entering state 23
+
+Stack now 0 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (7)
+   $2 = token '\n' (7)
+-> $$ = nterm line (7)
+Entering state 8
+
+Stack now 0 8
+Reducing stack by rule 1 , @&t@
+   $1 = nterm line (7)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 7 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 9
+
+Stack now 0 7 9
+Reading a token: @&t@
+Next token is token '+' (1)
+Shifting token '+' (1)
+Entering state 19
+
+Stack now 0 7 9 19
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 9 19 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 28
+
+Stack now 0 7 9 19 28
+Reading a token: @&t@
+Next token is token '*' (2)
+Shifting token '*' (2)
+Entering state 20
+
+Stack now 0 7 9 19 28 20
+Reading a token: @&t@
+Next token is token '-' (2)
+Shifting token '-' (2)
+Entering state 3
+
+Stack now 0 7 9 19 28 20 3
+Reading a token: @&t@
+Next token is token "number" (3)
+Shifting token "number" (3)
+Entering state 2
+
+Stack now 0 7 9 19 28 20 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (3)
+-> $$ = nterm exp (3)
+Entering state 12
+
+Stack now 0 7 9 19 28 20 3 12
+Reading a token: @&t@
+Next token is token '=' (3)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (2)
+   $2 = nterm exp (3)
+-> $$ = nterm exp (-3)
+Entering state 29
+
+Stack now 0 7 9 19 28 20 29
+Next token is token '=' (3)
+Reducing stack by rule 10 , @&t@
+   $1 = nterm exp (2)
+   $2 = token '*' (2)
+   $3 = nterm exp (-3)
+-> $$ = nterm exp (-6)
+Entering state 28
+
+Stack now 0 7 9 19 28
+Next token is token '=' (3)
+Reducing stack by rule 8 , @&t@
+   $1 = nterm exp (1)
+   $2 = token '+' (1)
+   $3 = nterm exp (-6)
+-> $$ = nterm exp (-5)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (3)
+Shifting token '=' (3)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token '-' (3)
+Shifting token '-' (3)
+Entering state 3
+
+Stack now 0 7 9 17 3
+Reading a token: @&t@
+Next token is token "number" (5)
+Shifting token "number" (5)
+Entering state 2
+
+Stack now 0 7 9 17 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (5)
+-> $$ = nterm exp (5)
+Entering state 12
+
+Stack now 0 7 9 17 3 12
+Reading a token: @&t@
+Next token is token '\n' (5)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (3)
+   $2 = nterm exp (5)
+-> $$ = nterm exp (-5)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Next token is token '\n' (5)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (-5)
+   $2 = token '=' (3)
+   $3 = nterm exp (-5)
+-> $$ = nterm exp (-5)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (5)
+Shifting token '\n' (5)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (-5)
+   $2 = token '\n' (5)
+-> $$ = nterm line (-5)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (-5)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '\n' (5)
+Shifting token '\n' (5)
+Entering state 4
+
+Stack now 0 7 4
+Reducing stack by rule 3 , @&t@
+   $1 = token '\n' (5)
+-> $$ = nterm line (5)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (5)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '-' (5)
+Shifting token '-' (5)
+Entering state 3
+
+Stack now 0 7 3
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 7 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 12
+
+Stack now 0 7 3 12
+Reading a token: @&t@
+Next token is token '^' (1)
+Shifting token '^' (1)
+Entering state 22
+
+Stack now 0 7 3 12 22
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 3 12 22 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 31
+
+Stack now 0 7 3 12 22 31
+Reading a token: @&t@
+Next token is token '=' (2)
+Reducing stack by rule 13 , @&t@
+   $1 = nterm exp (1)
+   $2 = token '^' (1)
+   $3 = nterm exp (2)
+-> $$ = nterm exp (1)
+Entering state 12
+
+Stack now 0 7 3 12
+Next token is token '=' (2)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (5)
+   $2 = nterm exp (1)
+-> $$ = nterm exp (-1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (2)
+Shifting token '=' (2)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token '-' (2)
+Shifting token '-' (2)
+Entering state 3
+
+Stack now 0 7 9 17 3
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 7 9 17 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 12
+
+Stack now 0 7 9 17 3 12
+Reading a token: @&t@
+Next token is token '\n' (1)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (2)
+   $2 = nterm exp (1)
+-> $$ = nterm exp (-1)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Next token is token '\n' (1)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (-1)
+   $2 = token '=' (2)
+   $3 = nterm exp (-1)
+-> $$ = nterm exp (-1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (1)
+Shifting token '\n' (1)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (-1)
+   $2 = token '\n' (1)
+-> $$ = nterm line (-1)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (-1)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '(' (1)
+Shifting token '(' (1)
+Entering state 5
+
+Stack now 0 7 5
+Reading a token: @&t@
+Next token is token '-' (1)
+Shifting token '-' (1)
+Entering state 3
+
+Stack now 0 7 5 3
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 7 5 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 12
+
+Stack now 0 7 5 3 12
+Reading a token: @&t@
+Next token is token ')' (1)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (1)
+   $2 = nterm exp (1)
+-> $$ = nterm exp (-1)
+Entering state 14
+
+Stack now 0 7 5 14
+Next token is token ')' (1)
+Shifting token ')' (1)
+Entering state 25
+
+Stack now 0 7 5 14 25
+Reducing stack by rule 14 , @&t@
+   $1 = token '(' (1)
+   $2 = nterm exp (-1)
+   $3 = token ')' (1)
+-> $$ = nterm exp (-1)
+Entering state 9
+
+Stack now 0 7 9
+Reading a token: @&t@
+Next token is token '^' (1)
+Shifting token '^' (1)
+Entering state 22
+
+Stack now 0 7 9 22
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 9 22 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 31
+
+Stack now 0 7 9 22 31
+Reading a token: @&t@
+Next token is token '=' (2)
+Reducing stack by rule 13 , @&t@
+   $1 = nterm exp (-1)
+   $2 = token '^' (1)
+   $3 = nterm exp (2)
+-> $$ = nterm exp (1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (2)
+Shifting token '=' (2)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 7 9 17 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Reading a token: @&t@
+Next token is token '\n' (1)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (1)
+   $2 = token '=' (2)
+   $3 = nterm exp (1)
+-> $$ = nterm exp (1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (1)
+Shifting token '\n' (1)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (1)
+   $2 = token '\n' (1)
+-> $$ = nterm line (1)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (1)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '\n' (1)
+Shifting token '\n' (1)
+Entering state 4
+
+Stack now 0 7 4
+Reducing stack by rule 3 , @&t@
+   $1 = token '\n' (1)
+-> $$ = nterm line (1)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (1)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '-' (1)
+Shifting token '-' (1)
+Entering state 3
+
+Stack now 0 7 3
+Reading a token: @&t@
+Next token is token '-' (1)
+Shifting token '-' (1)
+Entering state 3
+
+Stack now 0 7 3 3
+Reading a token: @&t@
+Next token is token '-' (1)
+Shifting token '-' (1)
+Entering state 3
+
+Stack now 0 7 3 3 3
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 7 3 3 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 12
+
+Stack now 0 7 3 3 3 12
+Reading a token: @&t@
+Next token is token '=' (1)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (1)
+   $2 = nterm exp (1)
+-> $$ = nterm exp (-1)
+Entering state 12
+
+Stack now 0 7 3 3 12
+Next token is token '=' (1)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (1)
+   $2 = nterm exp (-1)
+-> $$ = nterm exp (1)
+Entering state 12
+
+Stack now 0 7 3 12
+Next token is token '=' (1)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (1)
+   $2 = nterm exp (1)
+-> $$ = nterm exp (-1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (1)
+Shifting token '=' (1)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token '-' (1)
+Shifting token '-' (1)
+Entering state 3
+
+Stack now 0 7 9 17 3
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 7 9 17 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 12
+
+Stack now 0 7 9 17 3 12
+Reading a token: @&t@
+Next token is token '\n' (1)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (1)
+   $2 = nterm exp (1)
+-> $$ = nterm exp (-1)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Next token is token '\n' (1)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (-1)
+   $2 = token '=' (1)
+   $3 = nterm exp (-1)
+-> $$ = nterm exp (-1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (1)
+Shifting token '\n' (1)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (-1)
+   $2 = token '\n' (1)
+-> $$ = nterm line (-1)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (-1)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '\n' (1)
+Shifting token '\n' (1)
+Entering state 4
+
+Stack now 0 7 4
+Reducing stack by rule 3 , @&t@
+   $1 = token '\n' (1)
+-> $$ = nterm line (1)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (1)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 7 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 9
+
+Stack now 0 7 9
+Reading a token: @&t@
+Next token is token '-' (1)
+Shifting token '-' (1)
+Entering state 18
+
+Stack now 0 7 9 18
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 9 18 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 27
+
+Stack now 0 7 9 18 27
+Reading a token: @&t@
+Next token is token '-' (2)
+Reducing stack by rule 9 , @&t@
+   $1 = nterm exp (1)
+   $2 = token '-' (1)
+   $3 = nterm exp (2)
+-> $$ = nterm exp (-1)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '-' (2)
+Shifting token '-' (2)
+Entering state 18
+
+Stack now 0 7 9 18
+Reading a token: @&t@
+Next token is token "number" (3)
+Shifting token "number" (3)
+Entering state 2
+
+Stack now 0 7 9 18 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (3)
+-> $$ = nterm exp (3)
+Entering state 27
+
+Stack now 0 7 9 18 27
+Reading a token: @&t@
+Next token is token '=' (3)
+Reducing stack by rule 9 , @&t@
+   $1 = nterm exp (-1)
+   $2 = token '-' (2)
+   $3 = nterm exp (3)
+-> $$ = nterm exp (-4)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (3)
+Shifting token '=' (3)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token '-' (3)
+Shifting token '-' (3)
+Entering state 3
+
+Stack now 0 7 9 17 3
+Reading a token: @&t@
+Next token is token "number" (4)
+Shifting token "number" (4)
+Entering state 2
+
+Stack now 0 7 9 17 3 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (4)
+-> $$ = nterm exp (4)
+Entering state 12
+
+Stack now 0 7 9 17 3 12
+Reading a token: @&t@
+Next token is token '\n' (4)
+Reducing stack by rule 12 , @&t@
+   $1 = token '-' (3)
+   $2 = nterm exp (4)
+-> $$ = nterm exp (-4)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Next token is token '\n' (4)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (-4)
+   $2 = token '=' (3)
+   $3 = nterm exp (-4)
+-> $$ = nterm exp (-4)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (4)
+Shifting token '\n' (4)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (-4)
+   $2 = token '\n' (4)
+-> $$ = nterm line (-4)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (-4)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token "number" (1)
+Shifting token "number" (1)
+Entering state 2
+
+Stack now 0 7 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (1)
+-> $$ = nterm exp (1)
+Entering state 9
+
+Stack now 0 7 9
+Reading a token: @&t@
+Next token is token '-' (1)
+Shifting token '-' (1)
+Entering state 18
+
+Stack now 0 7 9 18
+Reading a token: @&t@
+Next token is token '(' (1)
+Shifting token '(' (1)
+Entering state 5
+
+Stack now 0 7 9 18 5
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 9 18 5 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 14
+
+Stack now 0 7 9 18 5 14
+Reading a token: @&t@
+Next token is token '-' (2)
+Shifting token '-' (2)
+Entering state 18
+
+Stack now 0 7 9 18 5 14 18
+Reading a token: @&t@
+Next token is token "number" (3)
+Shifting token "number" (3)
+Entering state 2
+
+Stack now 0 7 9 18 5 14 18 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (3)
+-> $$ = nterm exp (3)
+Entering state 27
+
+Stack now 0 7 9 18 5 14 18 27
+Reading a token: @&t@
+Next token is token ')' (3)
+Reducing stack by rule 9 , @&t@
+   $1 = nterm exp (2)
+   $2 = token '-' (2)
+   $3 = nterm exp (3)
+-> $$ = nterm exp (-1)
+Entering state 14
+
+Stack now 0 7 9 18 5 14
+Next token is token ')' (3)
+Shifting token ')' (3)
+Entering state 25
+
+Stack now 0 7 9 18 5 14 25
+Reducing stack by rule 14 , @&t@
+   $1 = token '(' (1)
+   $2 = nterm exp (-1)
+   $3 = token ')' (3)
+-> $$ = nterm exp (-1)
+Entering state 27
+
+Stack now 0 7 9 18 27
+Reading a token: @&t@
+Next token is token '=' (3)
+Reducing stack by rule 9 , @&t@
+   $1 = nterm exp (1)
+   $2 = token '-' (1)
+   $3 = nterm exp (-1)
+-> $$ = nterm exp (2)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (3)
+Shifting token '=' (3)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 9 17 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Reading a token: @&t@
+Next token is token '\n' (2)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (2)
+   $2 = token '=' (3)
+   $3 = nterm exp (2)
+-> $$ = nterm exp (2)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (2)
+Shifting token '\n' (2)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (2)
+   $2 = token '\n' (2)
+-> $$ = nterm line (2)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (2)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '\n' (2)
+Shifting token '\n' (2)
+Entering state 4
+
+Stack now 0 7 4
+Reducing stack by rule 3 , @&t@
+   $1 = token '\n' (2)
+-> $$ = nterm line (2)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (2)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 9
+
+Stack now 0 7 9
+Reading a token: @&t@
+Next token is token '^' (2)
+Shifting token '^' (2)
+Entering state 22
+
+Stack now 0 7 9 22
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 9 22 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 31
+
+Stack now 0 7 9 22 31
+Reading a token: @&t@
+Next token is token '^' (2)
+Shifting token '^' (2)
+Entering state 22
+
+Stack now 0 7 9 22 31 22
+Reading a token: @&t@
+Next token is token "number" (3)
+Shifting token "number" (3)
+Entering state 2
+
+Stack now 0 7 9 22 31 22 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (3)
+-> $$ = nterm exp (3)
+Entering state 31
+
+Stack now 0 7 9 22 31 22 31
+Reading a token: @&t@
+Next token is token '=' (3)
+Reducing stack by rule 13 , @&t@
+   $1 = nterm exp (2)
+   $2 = token '^' (2)
+   $3 = nterm exp (3)
+-> $$ = nterm exp (8)
+Entering state 31
+
+Stack now 0 7 9 22 31
+Next token is token '=' (3)
+Reducing stack by rule 13 , @&t@
+   $1 = nterm exp (2)
+   $2 = token '^' (2)
+   $3 = nterm exp (8)
+-> $$ = nterm exp (256)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (3)
+Shifting token '=' (3)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token "number" (256)
+Shifting token "number" (256)
+Entering state 2
+
+Stack now 0 7 9 17 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (256)
+-> $$ = nterm exp (256)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Reading a token: @&t@
+Next token is token '\n' (256)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (256)
+   $2 = token '=' (3)
+   $3 = nterm exp (256)
+-> $$ = nterm exp (256)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (256)
+Shifting token '\n' (256)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (256)
+   $2 = token '\n' (256)
+-> $$ = nterm line (256)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (256)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Next token is token '(' (256)
+Shifting token '(' (256)
+Entering state 5
+
+Stack now 0 7 5
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 5 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 14
+
+Stack now 0 7 5 14
+Reading a token: @&t@
+Next token is token '^' (2)
+Shifting token '^' (2)
+Entering state 22
+
+Stack now 0 7 5 14 22
+Reading a token: @&t@
+Next token is token "number" (2)
+Shifting token "number" (2)
+Entering state 2
+
+Stack now 0 7 5 14 22 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (2)
+-> $$ = nterm exp (2)
+Entering state 31
+
+Stack now 0 7 5 14 22 31
+Reading a token: @&t@
+Next token is token ')' (2)
+Reducing stack by rule 13 , @&t@
+   $1 = nterm exp (2)
+   $2 = token '^' (2)
+   $3 = nterm exp (2)
+-> $$ = nterm exp (4)
+Entering state 14
+
+Stack now 0 7 5 14
+Next token is token ')' (2)
+Shifting token ')' (2)
+Entering state 25
+
+Stack now 0 7 5 14 25
+Reducing stack by rule 14 , @&t@
+   $1 = token '(' (256)
+   $2 = nterm exp (4)
+   $3 = token ')' (2)
+-> $$ = nterm exp (4)
+Entering state 9
+
+Stack now 0 7 9
+Reading a token: @&t@
+Next token is token '^' (2)
+Shifting token '^' (2)
+Entering state 22
+
+Stack now 0 7 9 22
+Reading a token: @&t@
+Next token is token "number" (3)
+Shifting token "number" (3)
+Entering state 2
+
+Stack now 0 7 9 22 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (3)
+-> $$ = nterm exp (3)
+Entering state 31
+
+Stack now 0 7 9 22 31
+Reading a token: @&t@
+Next token is token '=' (3)
+Reducing stack by rule 13 , @&t@
+   $1 = nterm exp (4)
+   $2 = token '^' (2)
+   $3 = nterm exp (3)
+-> $$ = nterm exp (64)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '=' (3)
+Shifting token '=' (3)
+Entering state 17
+
+Stack now 0 7 9 17
+Reading a token: @&t@
+Next token is token "number" (64)
+Shifting token "number" (64)
+Entering state 2
+
+Stack now 0 7 9 17 2
+Reducing stack by rule 6 , @&t@
+   $1 = token "number" (64)
+-> $$ = nterm exp (64)
+Entering state 26
+
+Stack now 0 7 9 17 26
+Reading a token: @&t@
+Next token is token '\n' (64)
+Reducing stack by rule 7 , @&t@
+   $1 = nterm exp (64)
+   $2 = token '=' (3)
+   $3 = nterm exp (64)
+-> $$ = nterm exp (64)
+Entering state 9
+
+Stack now 0 7 9
+Next token is token '\n' (64)
+Shifting token '\n' (64)
+Entering state 23
+
+Stack now 0 7 9 23
+Reducing stack by rule 4 , @&t@
+   $1 = nterm exp (64)
+   $2 = token '\n' (64)
+-> $$ = nterm line (64)
+Entering state 16
+
+Stack now 0 7 16
+Reducing stack by rule 2 , @&t@
+   $1 = nterm input (7)
+   $2 = nterm line (64)
+-> $$ = nterm input (7)
+Entering state 7
+
+Stack now 0 7
+Reading a token: @&t@
+Now at end of input.
+
+Shifting token $end (64)
+Entering state 15
+
+Stack now 0 7 15
+]])
+
+AT_BISON_CHECK([PUSHPULLFLAGS [-o Calc.java Calc.y]])
+AT_JAVA_COMPILE([[Calc.java]])
+# Verify that this is a push parser
+AT_CHECK_JAVA_GREP([[Calc.java]],[[.*public void push_parse_initialize().*]])
+# Capture the output so we can edit out the (line nnnn) occurrences
+AT_JAVA_PARSER_CHECK([Calc input], 0, [], [stderr-nolog])
+AT_CHECK([[sed -e 's/(line[ ][0-9][0-9]*)[,]/,/' stderr]],[ignore],[expout])
+AT_CLEANUP
diff --git a/tests/local.mk b/tests/local.mk
index 7bc8b78..b27b96c 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -53,6 +53,7 @@ TESTSUITE_AT =                                  \
   tests/headers.at                              \
   tests/input.at                                \
   tests/java.at                                 \
+  tests/javapush.at                             \
   tests/local.at                                \
   tests/named-refs.at                           \
   tests/output.at                               \
diff --git a/tests/testsuite.at b/tests/testsuite.at
index f11866b..7f56578 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -1,76 +1 @@
-# Test suite for GNU Bison.                             -*- Autotest -*-
-
-# Copyright (C) 2000-2004, 2006-2007, 2009-2013 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
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-
-# Testing resistance to user bugs.
-m4_include([input.at])
-
-# Testing named references.
-m4_include([named-refs.at])
-
-# Testing output file names.
-m4_include([output.at])
-
-# Testing skeleton support.
-m4_include([skeletons.at])
-
-# Testing the part of the engine that computes FOLLOW etc.
-m4_include([sets.at])
-
-# Testing grammar reduction.
-m4_include([reduce.at])
-
-# Testing that #lines are correct.
-m4_include([synclines.at])
-
-# Testing that headers are sane.
-m4_include([headers.at])
-
-# Testing that user actions are properly performed.
-m4_include([actions.at])
-
-# Testing conflicts detection and resolution.
-m4_include([conflicts.at])
-
-# Fulling testing (compilation and execution of the parser) on calc.
-m4_include([calc.at])
-
-# Huge artificial grammars.
-# Torturing the stack expansion at runtime.
-m4_include([torture.at])
-
-# Checking big, real world grammars.
-m4_include([existing.at])
-
-# Some old bugs.
-m4_include([regression.at])
-
-# Some C++ specific tests.
-m4_include([c++.at])
-
-# And some Java specific tests.
-m4_include([java.at])
-
-# GLR tests:
-# C++ types, simplified
-m4_include([cxx-type.at])
-# Regression tests
-m4_include([glr-regression.at])
-
-# Push parsing specific tests.
-m4_include([push.at])
+m4_include([javapush.at])
-- 
1.7.4.4


reply via email to

[Prev in Thread] Current Thread [Next in Thread]