changeset 293:25099a745e1a jdk8-b29

Merge
author katleman
date Wed, 07 Mar 2012 13:46:18 -0800
parents 4e39817737cf ff3ad1d8c057
children 3be30c25a825
files build-defs.xml build-drop-template.xml jaxp.properties patches/jaxp_src/README
diffstat 2091 files changed, 598474 insertions(+), 400 deletions(-) [+]
line wrap: on
line diff
--- a/README	Thu Mar 01 12:23:19 2012 -0800
+++ b/README	Wed Mar 07 13:46:18 2012 -0800
@@ -17,9 +17,3 @@
   "dist" directory.
   Help information is available by running "ant -projecthelp" or "make help".
 
-Drop Repository:
-  This repository builds sources from a created "drop" source directory.
-  These files will normally be copied from a shared directory area or
-  downloaded from a public website.
-  See the ant build script (build.xml) for more details.
-
--- a/build-defs.xml	Thu Mar 01 12:23:19 2012 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code 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
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<project name="jaxp_defs" default="all" basedir=".">
-
-    <!-- Specific build properties. -->
-    <property file="jaxp.properties"/>
-
-    <!-- Where generated xml files will stay. -->
-    <property name="xml.gen.dir" value="${build.dir}/xml_generated"/>
-    <property name="xml.template" value="build-drop-template.xml"/>
-
-    <!--  ############### -->
-    <!--  Begin Macrodefs -->
-
-    <!-- Copies template file, replaces @DROP@ pattern, and imports it. -->
-    <macrodef name="drop-import">
-        <attribute name="name"/>
-        <sequential>
-            <property name="xml.gen.@{name}" value="${xml.gen.dir}/build-drop-@{name}.xml"/>
-            <mkdir dir="${xml.gen.dir}"/>
-            <copy file="${xml.template}" tofile="${xml.gen.@{name}}"/>
-            <replace file="${xml.gen.@{name}}" token="@DROP@" value="@{name}"/>
-            <import file="${xml.gen.@{name}}"/>
-        </sequential>
-    </macrodef>
-
-    <!--  End of Macrodefs -->
-    <!--  ############### -->
-
-    <!-- Create xml file and import it for these drops. -->
-    <drop-import name="jaxp_src"/>
-    <!-- <drop-import name="jaxp_tests"/> -->
-
-    <!-- Fail and print helpful messages if source does not exist. -->
-    <target name="-src-help">
-      <fail message="${failed.url.src.message}">
-	<condition>
-	    <and>
-                <not>
-	            <available file="${jaxp_src.src.dir}" type="dir"/>
-	        </not>
-	        <istrue value="${allow.downloads}"/>
-	    </and>
-	</condition>
-      </fail>
-      <fail message="${failed.nourl.src.message}">
-	<condition>
-            <not>
-	        <available file="${jaxp_src.src.dir}" type="dir"/>
-	    </not>
-	</condition>
-      </fail>
-    </target>
-
-    <!-- Special build area setup. -->
-    <target name="-drop-build-setup" depends="init, -init-src-dirs">
-        <mkdir dir="${build.classes.dir}"/>
-        <copy todir="${build.classes.dir}">
-            <fileset dir="${primary.src.dir}"
-                     includes="**/*.properties"/>
-        </copy>
-        <replaceregexp match="#(.*)$" replace="#" flags="gm">
-            <fileset dir="${build.classes.dir}" includes="**/*.properties"/>
-        </replaceregexp>
-    </target>
-
-    <!-- Try to get drop sources. -->
-    <target name="-set-props"
-	    depends="init,
-                     jaxp_src-update">
-    </target>
-
-    <!-- Set up source to use drop.dir. -->
-    <target name="-use-drop" depends="-set-props">
-        <property name="primary.src.dir" value="${jaxp_src.src.dir}"/>
-        <path id="src.dir.id">
-            <pathelement path="${primary.src.dir}"/>
-        </path>
-    </target>
-
-    <!-- Source directory selection. -->
-    <target name="-init-src-dirs"
-	    depends="init, -use-drop,-src-help">
-        <echo message="Using primary.src.dir=${primary.src.dir}"/>
-        <pathconvert property="src.list.id" refid="src.dir.id"/>
-        <echo message="Using src.dir.id=${src.list.id}"/>
-    </target>
-
-    <!-- Create drop src.zip. -->
-    <target name="-drop-src-zip" depends="init, -set-props">
-        <zip file="${dist.src.zip}" basedir="${primary.src.dir}"/>
-    </target>
-
-    <!-- Create src.zip. -->
-    <target name="-dist-src-zip" depends="init, -drop-src-zip">
-    </target>
-    
-</project>
--- a/build-drop-template.xml	Thu Mar 01 12:23:19 2012 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.  Oracle designates this
- particular file as subject to the "Classpath" exception as provided
- by Oracle in the LICENSE file that accompanied this code.
-
- This code 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
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<project name="@DROP@-drop" default="all" basedir=".">
-
-    <!-- Locations of master drop bundles. -->
-    <property name="@DROP@.master.bundle.copy"
-              value="${@DROP@.master.bundle.dir}/${@DROP@.bundle.name}"/>
-    <property name="@DROP@.master.bundle.url"
-              value="${@DROP@.master.bundle.url.base}/${@DROP@.bundle.name}"/>
-
-    <!-- Location where the copied bundle lands. -->
-    <property name="@DROP@.bundle.copy"
-              value="${drop.expanded.dir}/bundles/${@DROP@.bundle.name}"/>
-
-    <!-- Root of exploded area. -->
-    <property name="@DROP@.root.dir" value="${drop.dir}/@DROP@"/>
-    <property name="@DROP@.src.dir" value="${@DROP@.root.dir}/src"/>
-
-    <!-- To see if the drop areas are ready. (ignoring bundles) -->
-    <target name="-@DROP@-ready">
-        <condition property="@DROP@.ready">
-            <or>
-                <available file="${drop.included.dir}" type="dir"/>
-                <and>
-                    <available file="${@DROP@.root.dir}" type="dir"/>
-                    <available file="${@DROP@.root.dir}/PATCHED" type="file"/>
-                </and>
-            </or>
-        </condition>
-    </target>
-
-    <!-- Copy over bundles from some shared master area. -->
-    <condition property="@DROP@.master.bundle.copy.exists">
-        <available file="${@DROP@.master.bundle.copy}" type="file"/>
-    </condition>
-    <target name="-@DROP@-copy-bundle"
-	    depends="init, -@DROP@-ready"
-            if="@DROP@.master.bundle.copy.exists"
-            unless="@DROP@.ready">
-        <echo message="Copying from ${@DROP@.master.bundle.copy}"/>
-        <dirname property="@DROP@.bundle.dirname" file="${@DROP@.bundle.copy}"/>
-        <mkdir dir="${@DROP@.bundle.dirname}"/>
-        <delete file="${@DROP@.bundle.copy}.temp"/>
-        <delete file="${@DROP@.bundle.copy}"/>
-        <copy file="${@DROP@.master.bundle.copy}" tofile="${@DROP@.bundle.copy}.temp"/>
-        <move file="${@DROP@.bundle.copy}.temp" tofile="${@DROP@.bundle.copy}"/>
-        <property name="@DROP@.master.bundle.found" value="true"/>
-    </target>
-
-    <!-- Determine if the master url download should be used. -->
-    <target name="-@DROP@-url-should-be-used" unless="@DROP@.url.should.be.used">
-        <condition property="@DROP@.url.should.be.used">
-            <and>
-                <istrue value="${allow.downloads}"/>
-                <not>
-                    <isset property="@DROP@.master.bundle.copy.exists"/>
-                </not>
-            </and>
-        </condition>
-    </target>
-
-    <!-- Download bundles from a url. -->
-    <target name="-@DROP@-url-bundle"
-	    depends="init, -@DROP@-ready, -@DROP@-url-should-be-used"
-            if="@DROP@.url.should.be.used"
-            unless="@DROP@.ready">
-        <echo message="Downloading from ${@DROP@.master.bundle.url}"/>
-        <dirname property="@DROP@.bundle.dirname" file="${@DROP@.bundle.copy}"/>
-        <mkdir dir="${@DROP@.bundle.dirname}"/>
-        <delete file="${@DROP@.bundle.copy}.temp"/>
-        <delete file="${@DROP@.bundle.copy}"/>
-        <get src="${@DROP@.master.bundle.url}" dest="${@DROP@.bundle.copy}.temp"/>
-        <move file="${@DROP@.bundle.copy}.temp" tofile="${@DROP@.bundle.copy}"/>
-        <property name="@DROP@.master.bundle.found" value="true"/>
-    </target>
-    
-    <!-- Fill in the drop zones, but just when needed. -->
-    <target name="@DROP@-update"
-            depends="init, 
-		     -@DROP@-copy-bundle,
-		     -@DROP@-url-bundle,
-                     -@DROP@-ready"
-            if="@DROP@.master.bundle.found"
-            unless="@DROP@.ready">
-        <delete dir="${@DROP@.root.dir}"/>
-        <delete dir="${@DROP@.root.dir}-temp"/>
-        <mkdir dir="${@DROP@.root.dir}-temp"/>
-	<checksum file="${@DROP@.bundle.copy}" 
-		  property="@DROP@.bundle.md5.checksum.is"/>
-        <condition property="@DROP@.bundle.md5.checksum.good">
-            <equals arg1="${@DROP@.bundle.md5.checksum}"
-                    arg2="${@DROP@.bundle.md5.checksum.is}"/>
-        </condition>
-        <fail unless="@DROP@.bundle.md5.checksum.good">
-              Checksum on file ${@DROP@.bundle.copy} is 
-              ${@DROP@.bundle.md5.checksum.is}, not ${@DROP@.bundle.md5.checksum}
-        </fail>
-        <unzip src="${@DROP@.bundle.copy}" dest="${@DROP@.root.dir}-temp"/>
-        <move file="${@DROP@.root.dir}-temp" tofile="${@DROP@.root.dir}"/>
-        <touch>
-            <fileset dir="${@DROP@.root.dir}"/>
-        </touch>
-        <condition property="patch.utility" value="gpatch" else="patch">
-            <os name="SunOS"/>
-        </condition>
-        <apply executable="${patch.utility}"
-		   dir="${@DROP@.root.dir}"
-	           parallel="false"
-	           failonerror="true"
-	           verbose="true">
-            <arg value="-l"/>
-            <arg value="-p0"/>
-            <arg value="-i"/>
-            <filelist dir="${patches.dir}/@DROP@" files="${@DROP@.patch.list}"/>
-        </apply>
-        <echo file="${@DROP@.root.dir}/PATCHED"
-	      message="Patches have been applied."/>
-    </target>
-
-</project>
--- a/build.properties	Thu Mar 01 12:23:19 2012 -0800
+++ b/build.properties	Wed Mar 07 13:46:18 2012 -0800
@@ -23,10 +23,6 @@
 # questions.
 #
 
-# Base locations where bundles are located
-slashjava=/java
-drops.dir=${slashjava}/devtools/share/jdk8-drops
-
 # This is the JDK used to build and run the bootstrap version of javac.
 # The bootstrap javac is used to compile both boostrap versions of the
 # other tools, and product versions of all the tools.
@@ -68,15 +64,6 @@
 dist.classes.jar=${dist.lib.dir}/classes.jar
 dist.src.zip=${dist.lib.dir}/src.zip
 
-# Where all drop sources get placed when downloaded and unzipped
-drop.expanded.dir=${output.dir}/drop
-
-# Location if the sources were included already
-drop.included.dir=./drop_included
-
-# Where patches to drop bundle sources live
-patches.dir=patches
-
 # Sanity information
 sanity.info= Sanity Settings:${line.separator}\
   ant.home=${ant.home}${line.separator}\
@@ -100,28 +87,6 @@
   output.dir=${output.dir}${line.separator}\
   build.dir=${build.dir}${line.separator}\
   dist.dir=${dist.dir}${line.separator}\
-  drop.dir=${drop.dir}${line.separator}\
-  drops.dir=${drops.dir}${line.separator}\
-${line.separator}
-
-# Failure messages when source cannot be found on the file system
-failed.nourl.src.message=\
-ERROR: Cannot find source for project ${ant.project.name}.\
-${line.separator}${line.separator}\
-HINT: Try setting drops.dir to indicate where the bundles can be found, \
-or try setting the ant property allow.downloads=true to download the bundle from the URL.\
-${line.separator}\
-e.g. ant -Dallow.downloads=true -OR- ant -Ddrops.dir=some_directory \
-${line.separator}
-
-# Failure message when source cannot be downloaded
-failed.url.src.message=\
-ERROR: Cannot find source for project ${ant.project.name}.\
-${line.separator}${line.separator}\
-HINT: Try setting drops.dir to indicate where the bundles can be found, \
-or try checking the URL with your browser.\
-${line.separator}\
-e.g. ant -Ddrops.dir=some_directory \
 ${line.separator}
 
 #------------------------------------------------------------
--- a/build.xml	Thu Mar 01 12:23:19 2012 -0800
+++ b/build.xml	Wed Mar 07 13:46:18 2012 -0800
@@ -36,9 +36,6 @@
       javac.debug          - true or false for debug classfiles
       javac.target         - classfile version target
       javac.source         - source version
-      drops.dir            - directory that holds source drop bundles
-      allow.download       - permit downloads from public url (default is false)
-                             (used if bundles not found in drops.dir)
 
       Run 'make help' for help using the Makefile.
     </description>
@@ -46,15 +43,11 @@
     <!-- Project build properties. -->
     <property file="build.properties"/>
 
-    <!-- See if drop sources were included. -->
-    <condition property="drop.dir" 
-               value="${drop.included.dir}" 
-               else="${drop.expanded.dir}">
-        <available file="${drop.included.dir}" type="dir"/>
-    </condition>
-
-    <!-- Get shared targets. -->
-    <import file="build-defs.xml"/>
+    <!-- Source dir def -->
+    <property name="jaxp.src.dir" value="src/share/classes"/>
+    <path id="src.dir.id">
+      <pathelement path="${jaxp.src.dir}"/>
+    </path>
 
     <!-- Initialization of directories needed for build. -->
     <target name="init">
@@ -82,11 +75,11 @@
 
     <!-- Creation of distribution files to jdk build process. -->
     <target name="dist"
-	    depends="init, -init-src-dirs, build, -dist-classes-jar, -dist-src-zip"
+	    depends="init, build, -dist-classes-jar, -dist-src-zip"
             description="Create all built distribution files.">
     </target>
     <target name="-dist-classes-jar-uptodate"
-	    depends="init, -init-src-dirs">
+	    depends="init">
         <condition property="dist.classes.jar.uptodate">
             <and>
                 <available file="${dist.classes.jar}" type="file"/>
@@ -97,22 +90,35 @@
         </condition>
     </target>
     <target name="-dist-classes-jar"
-	    depends="init, -init-src-dirs, -dist-classes-jar-uptodate"
+	    depends="init, -dist-classes-jar-uptodate"
             unless="dist.classes.jar.uptodate">
         <delete file="${dist.classes.jar}"/>
         <jar file="${dist.classes.jar}" basedir="${build.classes.dir}"/>
     </target>
 
-    <target name="-build-setup"
-	    depends="init, -init-src-dirs, -drop-build-setup">
+    <!-- Special build area setup. -->
+    <target name="-build-setup" depends="init">
+        <mkdir dir="${build.classes.dir}"/>
+        <copy todir="${build.classes.dir}">
+            <fileset dir="${jaxp.src.dir}"
+                     includes="**/*.properties"/>
+        </copy>
+        <replaceregexp match="#(.*)$" replace="#" flags="gm">
+            <fileset dir="${build.classes.dir}" includes="**/*.properties"/>
+        </replaceregexp>
     </target>
 
+    <!-- Create src.zip. -->
+    <target name="-dist-src-zip" depends="init">
+        <zip file="${dist.src.zip}" basedir="${jaxp.src.dir}"/>
+    </target>
+    
     <!-- Build (compilation) of sources to class files. -->
     <target name="build"
 	    depends="compile, -build-setup">
     </target>
     <target name="compile"
-	    depends="init, -init-src-dirs">
+	    depends="init">
         <mkdir dir="${build.classes.dir}"/>
         <javac 
 	     includeAntRuntime="false" 
@@ -132,26 +138,16 @@
 
     <!-- Test. (FIXME: Need to know how to run tests.) -->
     <target name="test"
-	    depends="init, -init-src-dirs, dist">
+	    depends="init, dist">
         <echo message="FIXME: How do you run the tests"/>
     </target>
     
     <!-- Populate source area if needed. -->
     <target name="source"
-            depends="init, -init-src-dirs"
+            depends="init"
             description="Populate all source file directories">
     </target>
 
-    <!-- Populate drop_included area. -->
-    <target name="drop_included"
-            depends="clobber"
-            description="Populate all source file directories">
-        <delete dir="${drop.included.dir}"/>
-        <antcall target="source"/>
-        <move file="${drop.expanded.dir}" tofile="${drop.included.dir}"/>
-        <delete dir="${drop.included.dir}/bundles"/>
-    </target>
-
     <!-- Clean up compiled files. -->
     <target name="clean"
             description="Delete all generated files">
@@ -163,7 +159,6 @@
     <target name="clobber"
 	    depends="clean"
             description="Delete all generated files, including imported sources">
-        <delete dir="${drop.expanded.dir}"/>
     </target>
 
     <target name="-banner">
--- a/jaxp.properties	Thu Mar 01 12:23:19 2012 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-#
-# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code 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
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-drops.master.copy.base=${drops.dir}
-
-jaxp_src.bundle.name=jaxp145_01.zip
-jaxp_src.bundle.md5.checksum=32394c780c8fb5e29775f623525993c0
-jaxp_src.master.bundle.dir=${drops.master.copy.base}
-jaxp_src.master.bundle.url.base=http://download.java.net/jaxp/1.4.5
-
-jaxp_tests.bundle.name=jaxp-1_4_5-unittests.zip
-jaxp_tests.bundle.md5.checksum=fda9b9ad17c459880c077df6ecc7df80
-jaxp_tests.master.bundle.dir=${drops.master.copy.base}
-jaxp_tests.master.bundle.url.base=http://download.java.net/jaxp/1.4.5
-
--- a/make/Makefile	Thu Mar 01 12:23:19 2012 -0800
+++ b/make/Makefile	Wed Mar 07 13:46:18 2012 -0800
@@ -91,23 +91,6 @@
   endif
 endif
 
-# Do we have the drops already downloaded?
-# Check ALT_DROPS_DIR for a full path first,
-# before trying to use the devtools path,
-# either via ALT_JDK_DEVTOOLS_DIR or /java/devtools.
-ifdef ALT_DROPS_DIR
-  DROPS_DIR = $(ALT_DROPS_DIR)
-else
-  ifdef ALT_JDK_DEVTOOLS_DIR
-    DROPS_DIR = $(ALT_JDK_DEVTOOLS_DIR)/share/jdk8-drops
-  else
-    DROPS_DIR = $(_SLASHJAVA)/devtools/share/jdk8-drops
-  endif
-endif
-
-# Add in path to drops already downloaded
-ANT_OPTIONS += -Ddrops.dir=$(DROPS_DIR)
-
 ifdef ALT_OUTPUTDIR
   OUTPUTDIR = $(ALT_OUTPUTDIR)
   ANT_OPTIONS += -Doutput.dir=$(ALT_OUTPUTDIR)
@@ -144,13 +127,17 @@
 default: all
 
 # All ant targets of interest
-ANT_TARGETS = all source drop_included build dist clobber clean sanity
+ANT_TARGETS = all build dist clobber clean sanity
 
 # Create a make target for each
 $(ANT_TARGETS):
 	cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) -version
 	cd .. && $(ANT_JAVA_HOME) $(ANT) $(ANT_OPTIONS) $@
 
+# Just for compat reasons, delete in future.
+drop_included:
+source:
+
 # Help target
 define helpenvline
 @echo "    $1";echo "        $2"
@@ -164,8 +151,6 @@
 	@echo "    $(ANT_TARGETS)"
 	@echo " "
 	@echo "  Environment or command line variables (all optional):"
-	$(call helpenvline, ALT_DROPS_DIR,\
-	       "Directory that contains the drop source bundles i.e. drops.dir")
 	$(call helpenvline, ALT_BOOTDIR,\
 	       "JAVA_HOME to use when running ant")
 	$(call helpenvline, ALT_LANGTOOLS_DIST,\
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/scripts/update_src.sh	Wed Mar 07 13:46:18 2012 -0800
@@ -0,0 +1,86 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code 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
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# This script was used to copy the former drop source bundle source into
+#   the repository. Exists as a form of documentation.
+
+curdir="`(cd . && pwd)`"
+
+# Whitespace normalizer script is in the top repository.
+normalizer="perl ${curdir}/../make/scripts/normalizer.pl"
+
+# Locations for bundle and root of source tree
+tmp=/tmp
+srcroot=${curdir}/src
+mkdir -p ${srcroot}
+
+# Bundle information
+drops_dir="/java/devtools/share/jdk8-drops"
+url1="http://download.java.net/jaxp/1.4.5"
+bundle1="jaxp145_01.zip"
+srcdir1="${srcroot}/share/classes"
+
+# Function to get a bundle and explode it and normalize the source files.
+getBundle() # drops_dir url bundlename bundledestdir srcrootdir
+{
+  # Get the bundle from drops_dir or downloaded
+  mkdir -p $4
+  rm -f $4/$3
+  if [ -f $1/$3 ] ; then
+    echo "Copy over bundle: $1/$3"
+    cp $1/$3 $4
+  else
+    echo "Downloading bundle: $2/$3"
+    (cd $4 && wget $2/$3)
+  fi
+  # Fail if it does not exist
+  if [ ! -f $4/$3 ] ; then
+    echo "ERROR: Could not get $3"
+    exit 1
+  fi
+  # Wipe it out completely
+  echo "Cleaning up $5"
+  rm -f -r $5
+  mkdir -p $5
+  echo "Unzipping $4/$3"
+  ( cd $5 && unzip -q $4/$3 && mv src/* . && rmdir src && rm LICENSE )
+  # Run whitespace normalizer
+  echo "Normalizing the sources in $5"
+  ( cd $5 && ${normalizer} . )
+  # Delete the bundle and leftover files
+  rm -f $4/$3 $5/filelist
+}
+
+# Process the bundles.
+getBundle "${drops_dir}" "${url1}" "${bundle1}" ${tmp} ${srcdir1}
+echo "Completed bundle extraction."
+echo " "
+
+# Appropriate Mercurial commands needed to run: 
+echo "Run: hg addremove src"
+echo "Run: ksh ../make/scripts/webrev.ksh -N -o ${HOME}/webrev"
+echo "Get reviewer, get CR, then..."
+echo "Run:  hg commit"
+
--- a/patches/jaxp_src/README	Thu Mar 01 12:23:19 2012 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-
-This directory will hold any patches that need to be applied to the drop files.
-
-The patch order is defined in the ant build script properties.
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/java_cup/internal/runtime/Scanner.java	Wed Mar 07 13:46:18 2012 -0800
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java_cup.internal.runtime;
+
+/**
+ * Defines the Scanner interface, which CUP uses in the default
+ * implementation of <code>lr_parser.scan()</code>.  Integration
+ * of scanners implementing <code>Scanner</code> is facilitated.
+ *
+ * @author David MacMahon <davidm@smartsc.com>
+ */
+
+/* *************************************************
+  Interface Scanner
+
+  Declares the next_token() method that should be
+  implemented by scanners.  This method is typically
+  called by lr_parser.scan().
+ ***************************************************/
+public interface Scanner {
+    public Symbol next_token() throws java.lang.Exception;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/java_cup/internal/runtime/Symbol.java	Wed Mar 07 13:46:18 2012 -0800
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.java_cup.internal.runtime;
+
+/**
+ * Defines the Symbol class, which is used to represent all terminals
+ * and nonterminals while parsing.  The lexer should pass CUP Symbols
+ * and CUP returns a Symbol.
+ *
+ * @author  Frank Flannery
+ */
+
+/* ****************************************************************
+  Class Symbol
+  what the parser expects to receive from the lexer.
+  the token is identified as follows:
+  sym:    the symbol type
+  parse_state: the parse state.
+  value:  is the lexical value of type Object
+  left :  is the left position in the original input file
+  right:  is the right position in the original input file
+******************************************************************/
+
+public class Symbol {
+
+/*******************************
+  Constructor for l,r values
+ *******************************/
+
+  public Symbol(int id, int l, int r, Object o) {
+    this(id);
+    left = l;
+    right = r;
+    value = o;
+  }
+
+/*******************************
+  Constructor for no l,r values
+********************************/
+
+  public Symbol(int id, Object o) {
+    this(id);
+    left = -1;
+    right = -1;
+    value = o;
+  }
+
+/*****************************
+  Constructor for no value
+  ***************************/
+
+  public Symbol(int sym_num, int l, int r) {
+    sym = sym_num;
+    left = l;
+    right = r;
+    value = null;
+  }
+
+/***********************************
+  Constructor for no value or l,r
+***********************************/
+
+  public Symbol(int sym_num) {
+    this(sym_num, -1);
+    left = -1;
+    right = -1;
+    value = null;
+  }
+
+/***********************************
+  Constructor to give a start state
+***********************************/
+  public Symbol(int sym_num, int state)
+    {
+      sym = sym_num;
+      parse_state = state;
+    }
+
+/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** The symbol number of the terminal or non terminal being represented */
+  public int sym;
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** The parse state to be recorded on the parse stack with this symbol.
+   *  This field is for the convenience of the parser and shouldn't be
+   *  modified except by the parser.
+   */
+  public int parse_state;
+  /** This allows us to catch some errors caused by scanners recycling
+   *  symbols.  For the use of the parser only. [CSA, 23-Jul-1999] */
+  boolean used_by_parser = false;
+
+/*******************************
+  The data passed to parser
+ *******************************/
+
+  public int left, right;
+  public Object value;
+
+  /*****************************
+    Printing this token out. (Override for pretty-print).
+    ****************************/
+  public String toString() { return "#"+sym; }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/java_cup/internal/runtime/lr_parser.java	Wed Mar 07 13:46:18 2012 -0800
@@ -0,0 +1,1251 @@
+/*
+ * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+
+package com.sun.java_cup.internal.runtime;
+
+import java.util.Stack;
+
+/** This class implements a skeleton table driven LR parser.  In general,
+ *  LR parsers are a form of bottom up shift-reduce parsers.  Shift-reduce
+ *  parsers act by shifting input onto a parse stack until the Symbols
+ *  matching the right hand side of a production appear on the top of the
+ *  stack.  Once this occurs, a reduce is performed.  This involves removing
+ *  the Symbols corresponding to the right hand side of the production
+ *  (the so called "handle") and replacing them with the non-terminal from
+ *  the left hand side of the production.  <p>
+ *
+ *  To control the decision of whether to shift or reduce at any given point,
+ *  the parser uses a state machine (the "viable prefix recognition machine"
+ *  built by the parser generator).  The current state of the machine is placed
+ *  on top of the parse stack (stored as part of a Symbol object representing
+ *  a terminal or non terminal).  The parse action table is consulted
+ *  (using the current state and the current lookahead Symbol as indexes) to
+ *  determine whether to shift or to reduce.  When the parser shifts, it
+ *  changes to a new state by pushing a new Symbol (containing a new state)
+ *  onto the stack.  When the parser reduces, it pops the handle (right hand
+ *  side of a production) off the stack.  This leaves the parser in the state
+ *  it was in before any of those Symbols were matched.  Next the reduce-goto
+ *  table is consulted (using the new state and current lookahead Symbol as
+ *  indexes) to determine a new state to go to.  The parser then shifts to
+ *  this goto state by pushing the left hand side Symbol of the production
+ *  (also containing the new state) onto the stack.<p>
+ *
+ *  This class actually provides four LR parsers.  The methods parse() and
+ *  debug_parse() provide two versions of the main parser (the only difference
+ *  being that debug_parse() emits debugging trace messages as it parses).
+ *  In addition to these main parsers, the error recovery mechanism uses two
+ *  more.  One of these is used to simulate "parsing ahead" in the input
+ *  without carrying out actions (to verify that a potential error recovery
+ *  has worked), and the other is used to parse through buffered "parse ahead"
+ *  input in order to execute all actions and re-synchronize the actual parser
+ *  configuration.<p>
+ *
+ *  This is an abstract class which is normally filled out by a subclass
+ *  generated by the JavaCup parser generator.  In addition to supplying
+ *  the actual parse tables, generated code also supplies methods which
+ *  invoke various pieces of user supplied code, provide access to certain
+ *  special Symbols (e.g., EOF and error), etc.  Specifically, the following
+ *  abstract methods are normally supplied by generated code:
+ *  <dl compact>
+ *  <dt> short[][] production_table()
+ *  <dd> Provides a reference to the production table (indicating the index of
+ *       the left hand side non terminal and the length of the right hand side
+ *       for each production in the grammar).
+ *  <dt> short[][] action_table()
+ *  <dd> Provides a reference to the parse action table.
+ *  <dt> short[][] reduce_table()
+ *  <dd> Provides a reference to the reduce-goto table.
+ *  <dt> int start_state()
+ *  <dd> Indicates the index of the start state.
+ *  <dt> int start_production()
+ *  <dd> Indicates the index of the starting production.
+ *  <dt> int EOF_sym()
+ *  <dd> Indicates the index of the EOF Symbol.
+ *  <dt> int error_sym()
+ *  <dd> Indicates the index of the error Symbol.
+ *  <dt> Symbol do_action()
+ *  <dd> Executes a piece of user supplied action code.  This always comes at
+ *       the point of a reduce in the parse, so this code also allocates and
+ *       fills in the left hand side non terminal Symbol object that is to be
+ *       pushed onto the stack for the reduce.
+ *  <dt> void init_actions()
+ *  <dd> Code to initialize a special object that encapsulates user supplied
+ *       actions (this object is used by do_action() to actually carry out the
+ *       actions).
+ *  </dl>
+ *
+ *  In addition to these routines that <i>must</i> be supplied by the
+ *  generated subclass there are also a series of routines that <i>may</i>
+ *  be supplied.  These include:
+ *  <dl>
+ *  <dt> Symbol scan()
+ *  <dd> Used to get the next input Symbol from the scanner.
+ *  <dt> Scanner getScanner()
+ *  <dd> Used to provide a scanner for the default implementation of
+ *       scan().
+ *  <dt> int error_sync_size()
+ *  <dd> This determines how many Symbols past the point of an error
+ *       must be parsed without error in order to consider a recovery to
+ *       be valid.  This defaults to 3.  Values less than 2 are not
+ *       recommended.
+ *  <dt> void report_error(String message, Object info)
+ *  <dd> This method is called to report an error.  The default implementation
+ *       simply prints a message to System.err and where the error occurred.
+ *       This method is often replaced in order to provide a more sophisticated
+ *       error reporting mechanism.
+ *  <dt> void report_fatal_error(String message, Object info)
+ *  <dd> This method is called when a fatal error that cannot be recovered from
+ *       is encountered.  In the default implementation, it calls
+ *       report_error() to emit a message, then throws an exception.
+ *  <dt> void syntax_error(Symbol cur_token)
+ *  <dd> This method is called as soon as syntax error is detected (but
+ *       before recovery is attempted).  In the default implementation it
+ *       invokes: report_error("Syntax error", null);
+ *  <dt> void unrecovered_syntax_error(Symbol cur_token)
+ *  <dd> This method is called if syntax error recovery fails.  In the default
+ *       implementation it invokes:<br>
+ *         report_fatal_error("Couldn't repair and continue parse", null);
+ *  </dl>
+ *
+ * @see     com.sun.java_cup.internal.runtime.Symbol
+ * @see     com.sun.java_cup.internal.runtime.Symbol
+ * @see     com.sun.java_cup.internal.runtime.virtual_parse_stack
+ * @author  Frank Flannery
+ */
+
+public abstract class lr_parser {
+
+  /*-----------------------------------------------------------*/
+  /*--- Constructor(s) ----------------------------------------*/
+  /*-----------------------------------------------------------*/
+
+  /** Simple constructor. */
+  public lr_parser()
+    {
+      /* nothing to do here */
+    }
+
+  /** Constructor that sets the default scanner. [CSA/davidm] */
+  public lr_parser(Scanner s) {
+    this(); /* in case default constructor someday does something */
+    setScanner(s);
+  }
+
+  /*-----------------------------------------------------------*/
+  /*--- (Access to) Static (Class) Variables ------------------*/
+  /*-----------------------------------------------------------*/
+
+  /** The default number of Symbols after an error we much match to consider
+   *  it recovered from.
+   */
+  protected final static int _error_sync_size = 3;
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** The number of Symbols after an error we much match to consider it
+   *  recovered from.
+   */
+  protected int error_sync_size() {return _error_sync_size; }
+
+  /*-----------------------------------------------------------*/
+  /*--- (Access to) Instance Variables ------------------------*/
+  /*-----------------------------------------------------------*/
+
+  /** Table of production information (supplied by generated subclass).
+   *  This table contains one entry per production and is indexed by
+   *  the negative-encoded values (reduce actions) in the action_table.
+   *  Each entry has two parts, the index of the non-terminal on the
+   *  left hand side of the production, and the number of Symbols
+   *  on the right hand side.
+   */
+  public abstract short[][] production_table();
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** The action table (supplied by generated subclass).  This table is
+   *  indexed by state and terminal number indicating what action is to
+   *  be taken when the parser is in the given state (i.e., the given state
+   *  is on top of the stack) and the given terminal is next on the input.
+   *  States are indexed using the first dimension, however, the entries for
+   *  a given state are compacted and stored in adjacent index, value pairs
+   *  which are searched for rather than accessed directly (see get_action()).
+   *  The actions stored in the table will be either shifts, reduces, or
+   *  errors.  Shifts are encoded as positive values (one greater than the
+   *  state shifted to).  Reduces are encoded as negative values (one less
+   *  than the production reduced by).  Error entries are denoted by zero.
+   *
+   * @see com.sun.java_cup.internal.runtime.lr_parser#get_action
+   */
+  public abstract short[][] action_table();
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** The reduce-goto table (supplied by generated subclass).  This
+   *  table is indexed by state and non-terminal number and contains
+   *  state numbers.  States are indexed using the first dimension, however,
+   *  the entries for a given state are compacted and stored in adjacent
+   *  index, value pairs which are searched for rather than accessed
+   *  directly (see get_reduce()).  When a reduce occurs, the handle
+   *  (corresponding to the RHS of the matched production) is popped off
+   *  the stack.  The new top of stack indicates a state.  This table is
+   *  then indexed by that state and the LHS of the reducing production to
+   *  indicate where to "shift" to.
+   *
+   * @see com.sun.java_cup.internal.runtime.lr_parser#get_reduce
+   */
+  public abstract short[][] reduce_table();
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** The index of the start state (supplied by generated subclass). */
+  public abstract int start_state();
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** The index of the start production (supplied by generated subclass). */
+  public abstract int start_production();
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** The index of the end of file terminal Symbol (supplied by generated
+   *  subclass).
+   */
+  public abstract int EOF_sym();
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** The index of the special error Symbol (supplied by generated subclass). */
+  public abstract int error_sym();
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Internal flag to indicate when parser should quit. */
+  protected boolean _done_parsing = false;
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** This method is called to indicate that the parser should quit.  This is
+   *  normally called by an accept action, but can be used to cancel parsing
+   *  early in other circumstances if desired.
+   */
+  public void done_parsing()
+    {
+      _done_parsing = true;
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+  /* Global parse state shared by parse(), error recovery, and
+   * debugging routines */
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Indication of the index for top of stack (for use by actions). */
+  protected int tos;
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** The current lookahead Symbol. */
+  protected Symbol cur_token;
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** The parse stack itself. */
+  protected Stack stack = new Stack();
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Direct reference to the production table. */
+  protected short[][] production_tab;
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Direct reference to the action table. */
+  protected short[][] action_tab;
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Direct reference to the reduce-goto table. */
+  protected short[][] reduce_tab;
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** This is the scanner object used by the default implementation
+   *  of scan() to get Symbols.  To avoid name conflicts with existing
+   *  code, this field is private. [CSA/davidm] */
+  private Scanner _scanner;
+
+  /**
+   * Simple accessor method to set the default scanner.
+   */
+  public void setScanner(Scanner s) { _scanner = s; }
+
+  /**
+   * Simple accessor method to get the default scanner.
+   */
+  public Scanner getScanner() { return _scanner; }
+
+  /*-----------------------------------------------------------*/
+  /*--- General Methods ---------------------------------------*/
+  /*-----------------------------------------------------------*/
+
+  /** Perform a bit of user supplied action code (supplied by generated
+   *  subclass).  Actions are indexed by an internal action number assigned
+   *  at parser generation time.
+   *
+   * @param act_num   the internal index of the action to be performed.
+   * @param parser    the parser object we are acting for.
+   * @param stack     the parse stack of that object.
+   * @param top       the index of the top element of the parse stack.
+   */
+  public abstract Symbol do_action(
+    int       act_num,
+    lr_parser parser,
+    Stack     stack,
+    int       top)
+    throws java.lang.Exception;
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** User code for initialization inside the parser.  Typically this
+   *  initializes the scanner.  This is called before the parser requests
+   *  the first Symbol.  Here this is just a placeholder for subclasses that
+   *  might need this and we perform no action.   This method is normally
+   *  overridden by the generated code using this contents of the "init with"
+   *  clause as its body.
+   */
+  public void user_init() throws java.lang.Exception { }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Initialize the action object.  This is called before the parser does
+   *  any parse actions. This is filled in by generated code to create
+   *  an object that encapsulates all action code.
+   */
+  protected abstract void init_actions() throws java.lang.Exception;
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Get the next Symbol from the input (supplied by generated subclass).
+   *  Once end of file has been reached, all subsequent calls to scan
+   *  should return an EOF Symbol (which is Symbol number 0).  By default
+   *  this method returns getScanner().next_token(); this implementation
+   *  can be overriden by the generated parser using the code declared in
+   *  the "scan with" clause.  Do not recycle objects; every call to
+   *  scan() should return a fresh object.
+   */
+  public Symbol scan() throws java.lang.Exception {
+    return getScanner().next_token();
+  }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Report a fatal error.  This method takes a  message string and an
+   *  additional object (to be used by specializations implemented in
+   *  subclasses).  Here in the base class a very simple implementation
+   *  is provided which reports the error then throws an exception.
+   *
+   * @param message an error message.
+   * @param info    an extra object reserved for use by specialized subclasses.
+   */
+  public void report_fatal_error(
+    String   message,
+    Object   info)
+    throws java.lang.Exception
+    {
+      /* stop parsing (not really necessary since we throw an exception, but) */
+      done_parsing();
+
+      /* use the normal error message reporting to put out the message */
+      report_error(message, info);
+
+      /* throw an exception */
+      throw new Exception("Can't recover from previous error(s)");
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Report a non fatal error (or warning).  This method takes a message
+   *  string and an additional object (to be used by specializations
+   *  implemented in subclasses).  Here in the base class a very simple
+   *  implementation is provided which simply prints the message to
+   *  System.err.
+   *
+   * @param message an error message.
+   * @param info    an extra object reserved for use by specialized subclasses.
+   */
+  public void report_error(String message, Object info)
+    {
+      System.err.print(message);
+      if (info instanceof Symbol)
+        if (((Symbol)info).left != -1)
+        System.err.println(" at character " + ((Symbol)info).left +
+                           " of input");
+        else System.err.println("");
+      else System.err.println("");
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** This method is called when a syntax error has been detected and recovery
+   *  is about to be invoked.  Here in the base class we just emit a
+   *  "Syntax error" error message.
+   *
+   * @param cur_token the current lookahead Symbol.
+   */
+  public void syntax_error(Symbol cur_token)
+    {
+      report_error("Syntax error", cur_token);
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** This method is called if it is determined that syntax error recovery
+   *  has been unsuccessful.  Here in the base class we report a fatal error.
+   *
+   * @param cur_token the current lookahead Symbol.
+   */
+  public void unrecovered_syntax_error(Symbol cur_token)
+    throws java.lang.Exception
+    {
+      report_fatal_error("Couldn't repair and continue parse", cur_token);
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Fetch an action from the action table.  The table is broken up into
+   *  rows, one per state (rows are indexed directly by state number).
+   *  Within each row, a list of index, value pairs are given (as sequential
+   *  entries in the table), and the list is terminated by a default entry
+   *  (denoted with a Symbol index of -1).  To find the proper entry in a row
+   *  we do a linear or binary search (depending on the size of the row).
+   *
+   * @param state the state index of the action being accessed.
+   * @param sym   the Symbol index of the action being accessed.
+   */
+  protected final short get_action(int state, int sym)
+    {
+      short tag;
+      int first, last, probe;
+      short[] row = action_tab[state];
+
+      /* linear search if we are < 10 entries */
+      if (row.length < 20)
+        for (probe = 0; probe < row.length; probe++)
+          {
+            /* is this entry labeled with our Symbol or the default? */
+            tag = row[probe++];
+            if (tag == sym || tag == -1)
+              {
+                /* return the next entry */
+                return row[probe];
+              }
+          }
+      /* otherwise binary search */
+      else
+        {
+          first = 0;
+          last = (row.length-1)/2 - 1;  /* leave out trailing default entry */
+          while (first <= last)
+            {
+              probe = (first+last)/2;
+              if (sym == row[probe*2])
+                return row[probe*2+1];
+              else if (sym > row[probe*2])
+                first = probe+1;
+              else
+                last = probe-1;
+            }
+
+          /* not found, use the default at the end */
+          return row[row.length-1];
+        }
+
+      /* shouldn't happened, but if we run off the end we return the
+         default (error == 0) */
+      return 0;
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Fetch a state from the reduce-goto table.  The table is broken up into
+   *  rows, one per state (rows are indexed directly by state number).
+   *  Within each row, a list of index, value pairs are given (as sequential
+   *  entries in the table), and the list is terminated by a default entry
+   *  (denoted with a Symbol index of -1).  To find the proper entry in a row
+   *  we do a linear search.
+   *
+   * @param state the state index of the entry being accessed.
+   * @param sym   the Symbol index of the entry being accessed.
+   */
+  protected final short get_reduce(int state, int sym)
+    {
+      short tag;
+      short[] row = reduce_tab[state];
+
+      /* if we have a null row we go with the default */
+      if (row == null)
+        return -1;
+
+      for (int probe = 0; probe < row.length; probe++)
+        {
+          /* is this entry labeled with our Symbol or the default? */
+          tag = row[probe++];
+          if (tag == sym || tag == -1)
+            {
+              /* return the next entry */
+              return row[probe];
+            }
+        }
+      /* if we run off the end we return the default (error == -1) */
+      return -1;
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** This method provides the main parsing routine.  It returns only when
+   *  done_parsing() has been called (typically because the parser has
+   *  accepted, or a fatal error has been reported).  See the header
+   *  documentation for the class regarding how shift/reduce parsers operate
+   *  and how the various tables are used.
+   */
+  public Symbol parse() throws java.lang.Exception
+    {
+      /* the current action code */
+      int act;
+
+      /* the Symbol/stack element returned by a reduce */
+      Symbol lhs_sym = null;
+
+      /* information about production being reduced with */
+      short handle_size, lhs_sym_num;
+
+      /* set up direct reference to tables to drive the parser */
+
+      production_tab = production_table();
+      action_tab     = action_table();
+      reduce_tab     = reduce_table();
+
+      /* initialize the action encapsulation object */
+      init_actions();
+
+      /* do user initialization */
+      user_init();
+
+      /* get the first token */
+      cur_token = scan();
+
+      /* push dummy Symbol with start state to get us underway */
+      stack.removeAllElements();
+      stack.push(new Symbol(0, start_state()));
+      tos = 0;
+
+      /* continue until we are told to stop */
+      for (_done_parsing = false; !_done_parsing; )
+        {
+          /* Check current token for freshness. */
+          if (cur_token.used_by_parser)
+            throw new Error("Symbol recycling detected (fix your scanner).");
+
+          /* current state is always on the top of the stack */
+
+          /* look up action out of the current state with the current input */
+          act = get_action(((Symbol)stack.peek()).parse_state, cur_token.sym);
+
+          /* decode the action -- > 0 encodes shift */
+          if (act > 0)
+            {
+              /* shift to the encoded state by pushing it on the stack */
+              cur_token.parse_state = act-1;
+              cur_token.used_by_parser = true;
+              stack.push(cur_token);
+              tos++;
+
+              /* advance to the next Symbol */
+              cur_token = scan();
+            }
+          /* if its less than zero, then it encodes a reduce action */
+          else if (act < 0)
+            {
+              /* perform the action for the reduce */
+              lhs_sym = do_action((-act)-1, this, stack, tos);
+
+              /* look up information about the production */
+              lhs_sym_num = production_tab[(-act)-1][0];
+              handle_size = production_tab[(-act)-1][1];
+
+              /* pop the handle off the stack */
+              for (int i = 0; i < handle_size; i++)
+                {
+                  stack.pop();
+                  tos--;
+                }
+
+              /* look up the state to go to from the one popped back to */
+              act = get_reduce(((Symbol)stack.peek()).parse_state, lhs_sym_num);
+
+              /* shift to that state */
+              lhs_sym.parse_state = act;
+              lhs_sym.used_by_parser = true;
+              stack.push(lhs_sym);
+              tos++;
+            }
+          /* finally if the entry is zero, we have an error */
+          else if (act == 0)
+            {
+              /* call user syntax error reporting routine */
+              syntax_error(cur_token);
+
+              /* try to error recover */
+              if (!error_recovery(false))
+                {
+                  /* if that fails give up with a fatal syntax error */
+                  unrecovered_syntax_error(cur_token);
+
+                  /* just in case that wasn't fatal enough, end parse */
+                  done_parsing();
+                } else {
+                  lhs_sym = (Symbol)stack.peek();
+                }
+            }
+        }
+      return lhs_sym;
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Write a debugging message to System.err for the debugging version
+   *  of the parser.
+   *
+   * @param mess the text of the debugging message.
+   */
+  public void debug_message(String mess)
+    {
+      System.err.println(mess);
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Dump the parse stack for debugging purposes. */
+  public void dump_stack()
+    {
+      if (stack == null)
+        {
+          debug_message("# Stack dump requested, but stack is null");
+          return;
+        }
+
+      debug_message("============ Parse Stack Dump ============");
+
+      /* dump the stack */
+      for (int i=0; i<stack.size(); i++)
+        {
+          debug_message("Symbol: " + ((Symbol)stack.elementAt(i)).sym +
+                        " State: " + ((Symbol)stack.elementAt(i)).parse_state);
+        }
+      debug_message("==========================================");
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Do debug output for a reduce.
+   *
+   * @param prod_num  the production we are reducing with.
+   * @param nt_num    the index of the LHS non terminal.
+   * @param rhs_size  the size of the RHS.
+   */
+  public void debug_reduce(int prod_num, int nt_num, int rhs_size)
+    {
+      debug_message("# Reduce with prod #" + prod_num + " [NT=" + nt_num +
+                    ", " + "SZ=" + rhs_size + "]");
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Do debug output for shift.
+   *
+   * @param shift_tkn the Symbol being shifted onto the stack.
+   */
+  public void debug_shift(Symbol shift_tkn)
+    {
+      debug_message("# Shift under term #" + shift_tkn.sym +
+                    " to state #" + shift_tkn.parse_state);
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Do debug output for stack state. [CSA]
+   */
+  public void debug_stack() {
+      StringBuffer sb=new StringBuffer("## STACK:");
+      for (int i=0; i<stack.size(); i++) {
+          Symbol s = (Symbol) stack.elementAt(i);
+          sb.append(" <state "+s.parse_state+", sym "+s.sym+">");
+          if ((i%3)==2 || (i==(stack.size()-1))) {
+              debug_message(sb.toString());
+              sb = new StringBuffer("         ");
+          }
+      }
+  }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Perform a parse with debugging output.  This does exactly the
+   *  same things as parse(), except that it calls debug_shift() and
+   *  debug_reduce() when shift and reduce moves are taken by the parser
+   *  and produces various other debugging messages.
+   */
+  public Symbol debug_parse()
+    throws java.lang.Exception
+    {
+      /* the current action code */
+      int act;
+
+      /* the Symbol/stack element returned by a reduce */
+      Symbol lhs_sym = null;
+
+      /* information about production being reduced with */
+      short handle_size, lhs_sym_num;
+
+      /* set up direct reference to tables to drive the parser */
+      production_tab = production_table();
+      action_tab     = action_table();
+      reduce_tab     = reduce_table();
+
+      debug_message("# Initializing parser");
+
+      /* initialize the action encapsulation object */
+      init_actions();
+
+      /* do user initialization */
+      user_init();
+
+      /* the current Symbol */
+      cur_token = scan();
+
+      debug_message("# Current Symbol is #" + cur_token.sym);
+
+      /* push dummy Symbol with start state to get us underway */
+      stack.removeAllElements();
+      stack.push(new Symbol(0, start_state()));
+      tos = 0;
+
+      /* continue until we are told to stop */
+      for (_done_parsing = false; !_done_parsing; )
+        {
+          /* Check current token for freshness. */
+          if (cur_token.used_by_parser)
+            throw new Error("Symbol recycling detected (fix your scanner).");
+
+          /* current state is always on the top of the stack */
+          //debug_stack();
+
+          /* look up action out of the current state with the current input */
+          act = get_action(((Symbol)stack.peek()).parse_state, cur_token.sym);
+
+          /* decode the action -- > 0 encodes shift */
+          if (act > 0)
+            {
+              /* shift to the encoded state by pushing it on the stack */
+              cur_token.parse_state = act-1;
+              cur_token.used_by_parser = true;
+              debug_shift(cur_token);
+              stack.push(cur_token);
+              tos++;
+
+              /* advance to the next Symbol */
+              cur_token = scan();
+              debug_message("# Current token is " + cur_token);
+            }
+          /* if its less than zero, then it encodes a reduce action */
+          else if (act < 0)
+            {
+              /* perform the action for the reduce */
+              lhs_sym = do_action((-act)-1, this, stack, tos);
+
+              /* look up information about the production */
+              lhs_sym_num = production_tab[(-act)-1][0];
+              handle_size = production_tab[(-act)-1][1];
+
+              debug_reduce((-act)-1, lhs_sym_num, handle_size);
+
+              /* pop the handle off the stack */
+              for (int i = 0; i < handle_size; i++)
+                {
+                  stack.pop();
+                  tos--;
+                }
+
+              /* look up the state to go to from the one popped back to */
+              act = get_reduce(((Symbol)stack.peek()).parse_state, lhs_sym_num);
+              debug_message("# Reduce rule: top state " +
+                             ((Symbol)stack.peek()).parse_state +
+                             ", lhs sym " + lhs_sym_num + " -> state " + act);
+
+              /* shift to that state */
+              lhs_sym.parse_state = act;
+              lhs_sym.used_by_parser = true;
+              stack.push(lhs_sym);
+              tos++;
+
+              debug_message("# Goto state #" + act);
+            }
+          /* finally if the entry is zero, we have an error */
+          else if (act == 0)
+            {
+              /* call user syntax error reporting routine */
+              syntax_error(cur_token);
+
+              /* try to error recover */
+              if (!error_recovery(true))
+                {
+                  /* if that fails give up with a fatal syntax error */
+                  unrecovered_syntax_error(cur_token);
+
+                  /* just in case that wasn't fatal enough, end parse */
+                  done_parsing();
+                } else {
+                  lhs_sym = (Symbol)stack.peek();
+                }
+            }
+        }
+      return lhs_sym;
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+  /* Error recovery code */
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Attempt to recover from a syntax error.  This returns false if recovery
+   *  fails, true if it succeeds.  Recovery happens in 4 steps.  First we
+   *  pop the parse stack down to a point at which we have a shift out
+   *  of the top-most state on the error Symbol.  This represents the
+   *  initial error recovery configuration.  If no such configuration is
+   *  found, then we fail.  Next a small number of "lookahead" or "parse
+   *  ahead" Symbols are read into a buffer.  The size of this buffer is
+   *  determined by error_sync_size() and determines how many Symbols beyond
+   *  the error must be matched to consider the recovery a success.  Next,
+   *  we begin to discard Symbols in attempt to get past the point of error
+   *  to a point where we can continue parsing.  After each Symbol, we attempt
+   *  to "parse ahead" though the buffered lookahead Symbols.  The "parse ahead"
+   *  process simulates that actual parse, but does not modify the real
+   *  parser's configuration, nor execute any actions. If we can  parse all
+   *  the stored Symbols without error, then the recovery is considered a
+   *  success.  Once a successful recovery point is determined, we do an
+   *  actual parse over the stored input -- modifying the real parse
+   *  configuration and executing all actions.  Finally, we return the the
+   *  normal parser to continue with the overall parse.
+   *
+   * @param debug should we produce debugging messages as we parse.
+   */
+  protected boolean error_recovery(boolean debug)
+    throws java.lang.Exception
+    {
+      if (debug) debug_message("# Attempting error recovery");
+
+      /* first pop the stack back into a state that can shift on error and
+         do that shift (if that fails, we fail) */
+      if (!find_recovery_config(debug))
+        {
+          if (debug) debug_message("# Error recovery fails");
+          return false;
+        }
+
+      /* read ahead to create lookahead we can parse multiple times */
+      read_lookahead();
+
+      /* repeatedly try to parse forward until we make it the required dist */
+      for (;;)
+        {
+          /* try to parse forward, if it makes it, bail out of loop */
+          if (debug) debug_message("# Trying to parse ahead");
+          if (try_parse_ahead(debug))
+            {
+              break;
+            }
+
+          /* if we are now at EOF, we have failed */
+          if (lookahead[0].sym == EOF_sym())
+            {
+              if (debug) debug_message("# Error recovery fails at EOF");
+              return false;
+            }
+
+          /* otherwise, we consume another Symbol and try again */
+          if (debug)
+          debug_message("# Consuming Symbol #" + cur_err_token().sym);
+          restart_lookahead();
+        }
+
+      /* we have consumed to a point where we can parse forward */
+      if (debug) debug_message("# Parse-ahead ok, going back to normal parse");
+
+      /* do the real parse (including actions) across the lookahead */
+      parse_lookahead(debug);
+
+      /* we have success */
+      return true;
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Determine if we can shift under the special error Symbol out of the
+   *  state currently on the top of the (real) parse stack.
+   */
+  protected boolean shift_under_error()
+    {
+      /* is there a shift under error Symbol */
+      return get_action(((Symbol)stack.peek()).parse_state, error_sym()) > 0;
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Put the (real) parse stack into error recovery configuration by
+   *  popping the stack down to a state that can shift on the special
+   *  error Symbol, then doing the shift.  If no suitable state exists on
+   *  the stack we return false
+   *
+   * @param debug should we produce debugging messages as we parse.
+   */
+  protected boolean find_recovery_config(boolean debug)
+    {
+      Symbol error_token;
+      int act;
+
+      if (debug) debug_message("# Finding recovery state on stack");
+
+      /* Remember the right-position of the top symbol on the stack */
+      int right_pos = ((Symbol)stack.peek()).right;
+      int left_pos  = ((Symbol)stack.peek()).left;
+
+      /* pop down until we can shift under error Symbol */
+      while (!shift_under_error())
+        {
+          /* pop the stack */
+          if (debug)
+            debug_message("# Pop stack by one, state was # " +
+                          ((Symbol)stack.peek()).parse_state);
+          left_pos = ((Symbol)stack.pop()).left;
+          tos--;
+
+          /* if we have hit bottom, we fail */
+          if (stack.empty())
+            {
+              if (debug) debug_message("# No recovery state found on stack");
+              return false;
+            }
+        }
+
+      /* state on top of the stack can shift under error, find the shift */
+      act = get_action(((Symbol)stack.peek()).parse_state, error_sym());
+      if (debug)
+        {
+          debug_message("# Recover state found (#" +
+                        ((Symbol)stack.peek()).parse_state + ")");
+          debug_message("# Shifting on error to state #" + (act-1));
+        }
+
+      /* build and shift a special error Symbol */
+      error_token = new Symbol(error_sym(), left_pos, right_pos);
+      error_token.parse_state = act-1;
+      error_token.used_by_parser = true;
+      stack.push(error_token);
+      tos++;
+
+      return true;
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Lookahead Symbols used for attempting error recovery "parse aheads". */
+  protected Symbol lookahead[];
+
+  /** Position in lookahead input buffer used for "parse ahead". */
+  protected int lookahead_pos;
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Read from input to establish our buffer of "parse ahead" lookahead
+   *  Symbols.
+   */
+  protected void read_lookahead() throws java.lang.Exception
+    {
+      /* create the lookahead array */
+      lookahead = new Symbol[error_sync_size()];
+
+      /* fill in the array */
+      for (int i = 0; i < error_sync_size(); i++)
+        {
+          lookahead[i] = cur_token;
+          cur_token = scan();
+        }
+
+      /* start at the beginning */
+      lookahead_pos = 0;
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Return the current lookahead in our error "parse ahead" buffer. */
+  protected Symbol cur_err_token() { return lookahead[lookahead_pos]; }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Advance to next "parse ahead" input Symbol. Return true if we have
+   *  input to advance to, false otherwise.
+   */
+  protected boolean advance_lookahead()
+    {
+      /* advance the input location */
+      lookahead_pos++;
+
+      /* return true if we didn't go off the end */
+      return lookahead_pos < error_sync_size();
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Reset the parse ahead input to one Symbol past where we started error
+   *  recovery (this consumes one new Symbol from the real input).
+   */
+  protected void restart_lookahead() throws java.lang.Exception
+    {
+      /* move all the existing input over */
+      for (int i = 1; i < error_sync_size(); i++)
+        lookahead[i-1] = lookahead[i];
+
+      /* read a new Symbol into the last spot */
+      cur_token = scan();
+      lookahead[error_sync_size()-1] = cur_token;
+
+      /* reset our internal position marker */
+      lookahead_pos = 0;
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Do a simulated parse forward (a "parse ahead") from the current
+   *  stack configuration using stored lookahead input and a virtual parse
+   *  stack.  Return true if we make it all the way through the stored
+   *  lookahead input without error. This basically simulates the action of
+   *  parse() using only our saved "parse ahead" input, and not executing any
+   *  actions.
+   *
+   * @param debug should we produce debugging messages as we parse.
+   */
+  protected boolean try_parse_ahead(boolean debug)
+    throws java.lang.Exception
+    {
+      int act;
+      short lhs, rhs_size;
+
+      /* create a virtual stack from the real parse stack */
+      virtual_parse_stack vstack = new virtual_parse_stack(stack);
+
+      /* parse until we fail or get past the lookahead input */
+      for (;;)
+        {
+          /* look up the action from the current state (on top of stack) */
+          act = get_action(vstack.top(), cur_err_token().sym);
+
+          /* if its an error, we fail */
+          if (act == 0) return false;
+
+          /* > 0 encodes a shift */
+          if (act > 0)
+            {
+              /* push the new state on the stack */
+              vstack.push(act-1);
+
+              if (debug) debug_message("# Parse-ahead shifts Symbol #" +
+                       cur_err_token().sym + " into state #" + (act-1));
+
+              /* advance simulated input, if we run off the end, we are done */
+              if (!advance_lookahead()) return true;
+            }
+          /* < 0 encodes a reduce */
+          else
+            {
+              /* if this is a reduce with the start production we are done */
+              if ((-act)-1 == start_production())
+                {
+                  if (debug) debug_message("# Parse-ahead accepts");
+                  return true;
+                }
+
+              /* get the lhs Symbol and the rhs size */
+              lhs = production_tab[(-act)-1][0];
+              rhs_size = production_tab[(-act)-1][1];
+
+              /* pop handle off the stack */
+              for (int i = 0; i < rhs_size; i++)
+                vstack.pop();
+
+              if (debug)
+                debug_message("# Parse-ahead reduces: handle size = " +
+                  rhs_size + " lhs = #" + lhs + " from state #" + vstack.top());
+
+              /* look up goto and push it onto the stack */
+              vstack.push(get_reduce(vstack.top(), lhs));
+              if (debug)
+                debug_message("# Goto state #" + vstack.top());
+            }
+        }
+    }
+
+  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
+
+  /** Parse forward using stored lookahead Symbols.  In this case we have
+   *  already verified that parsing will make it through the stored lookahead
+   *  Symbols and we are now getting back to the point at which we can hand
+   *  control back to the normal parser.  Consequently, this version of the
+   *  parser performs all actions and modifies the real parse configuration.
+   *  This returns once we have consumed all the stored input or we accept.
+   *
+   * @param debug should we produce debugging messages as we parse.
+   */
+  protected void parse_lookahead(boolean debug)
+    throws java.lang.Exception
+    {
+      /* the current action code */
+      int act;
+
+      /* the Symbol/stack element returned by a reduce */
+      Symbol lhs_sym = null;
+
+      /* information about production being reduced with */
+      short handle_size, lhs_sym_num;
+
+      /* restart the saved input at the beginning */
+      lookahead_pos = 0;
+
+      if (debug)
+        {
+          debug_message("# Reparsing saved input with actions");
+          debug_message("# Current Symbol is #" + cur_err_token().sym);
+          debug_message("# Current state is #" +
+                        ((Symbol)stack.peek()).parse_state);
+        }
+
+      /* continue until we accept or have read all lookahead input */
+      while(!_done_parsing)
+        {
+          /* current state is always on the top of the stack */
+
+          /* look up action out of the current state with the current input */
+          act =
+            get_action(((Symbol)stack.peek()).parse_state, cur_err_token().sym);
+
+          /* decode the action -- > 0 encodes shift */
+          if (act > 0)
+            {
+              /* shift to the encoded state by pushing it on the stack */
+              cur_err_token().parse_state = act-1;
+              cur_err_token().used_by_parser = true;
+              if (debug) debug_shift(cur_err_token());
+              stack.push(cur_err_token());
+              tos++;
+
+              /* advance to the next Symbol, if there is none, we are done */
+              if (!advance_lookahead())
+                {
+                  if (debug) debug_message("# Completed reparse");
+
+                  /* scan next Symbol so we can continue parse */
+                  // BUGFIX by Chris Harris <ckharris@ucsd.edu>:
+                  //   correct a one-off error by commenting out
+                  //   this next line.
+                  /*cur_token = scan();*/
+
+                  /* go back to normal parser */
+                  return;
+                }
+
+              if (debug)
+                debug_message("# Current Symbol is #" + cur_err_token().sym);
+            }
+          /* if its less than zero, then it encodes a reduce action */
+          else if (act < 0)
+            {
+              /* perform the action for the reduce */
+              lhs_sym = do_action((-act)-1, this, stack, tos);
+
+              /* look up information about the production */
+              lhs_sym_num = production_tab[(-act)-1][0];
+              handle_size = production_tab[(-act)-1][1];
+
+              if (debug) debug_reduce((-act)-1, lhs_sym_num, handle_size);
+
+              /* pop the handle off the stack */
+              for (int i = 0; i < handle_size; i++)
+                {
+                  stack.pop();
+                  tos--;
+                }
+
+              /* look up the state to go to from the one popped back to */
+              act = get_reduce(((Symbol)stack.peek()).parse_state, lhs_sym_num);
+
+              /* shift to that state */
+              lhs_sym.parse_state = act;
+              lhs_sym.used_by_parser = true;
+              stack.push(lhs_sym);
+              tos++;
+
+              if (debug) debug_message("# Goto state #" + act);
+
+            }
+          /* finally if the entry is zero, we have an error
+             (shouldn't happen here, but...)*/
+          else if (act == 0)
+            {
+              report_fatal_error("Syntax error", lhs_sym);
+              return;
+            }
+        }
+
+
+    }
+
+  /*-----------------------------------------------------------*/
+
+  /** Utility function: unpacks parse tables from strings */
+  protected static short[][] unpackFromStrings(String[] sa)
+    {
+      // Concatanate initialization strings.
+      StringBuffer sb = new StringBuffer(sa[0]);
+      for (int i=1; i<sa.length; i++)
+        sb.append(sa[i]);
+      int n=0; // location in initialization string
+      int size1 = (((int)sb.charAt(n))<<16) | ((int)sb.charAt(n+1)); n+=2;
+      short[][] result = new short[size1][];
+      for (int i=0; i<size1; i++) {
+        int size2 = (((int)sb.charAt(n))<<16) | ((int)sb.charAt(n+1)); n+=2;
+        result[i] = new short[size2];
+        for (int j=0; j<size2; j++)
+          result[i][j] = (short) (sb.charAt(n++)-2);
+      }
+      return result;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/java_cup/internal/runtime/virtual_parse_stack.java	Wed Mar 07 13:46:18 2012 -0800
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code 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
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+