[Git][java-team/antlr3][upstream] New upstream version 3.5.3

Emmanuel Bourg (@ebourg) gitlab at salsa.debian.org
Mon Dec 12 23:54:54 GMT 2022



Emmanuel Bourg pushed to branch upstream at Debian Java Maintainers / antlr3


Commits:
26a0bd29 by Emmanuel Bourg at 2022-12-12T21:53:20+01:00
New upstream version 3.5.3
- - - - -


24 changed files:

- + .github/workflows/main.yml
- + BUILD.bazel
- README.txt
- + WORKSPACE.bazel
- antlr-complete/pom.xml
- antlr3-maven-archetype/pom.xml
- antlr3-maven-plugin/pom.xml
- antlr3-maven-plugin/src/main/java/org/antlr/mojo/antlr3/Antlr3Mojo.java
- contributors.txt
- gunit-maven-plugin/pom.xml
- gunit-maven-plugin/src/main/java/org/antlr/mojo/antlr3/GUnitExecuteMojo.java
- gunit/pom.xml
- pom.xml
- runtime/Java/pom.xml
- runtime/Java/src/main/java/org/antlr/runtime/debug/DebugTreeAdaptor.java
- tool/CHANGES.txt
- tool/pom.xml
- + tool/src/BUILD.bazel
- tool/src/main/resources/org/antlr/codegen/templates/Cpp/Cpp.stg
- tool/src/test/java/org/antlr/test/TestAutoAST.java
- tool/src/test/java/org/antlr/test/TestCharDFAConversion.java
- tool/src/test/java/org/antlr/test/TestDFAConversion.java
- tool/src/test/java/org/antlr/test/TestSemanticPredicateEvaluation.java
- tool/src/test/java/org/antlr/test/TestSemanticPredicates.java


Changes:

=====================================
.github/workflows/main.yml
=====================================
@@ -0,0 +1,24 @@
+name: CI
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+jobs:
+  build:
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ubuntu-latest, macos-latest, windows-latest]
+      fail-fast: false
+
+    steps:
+    - uses: actions/checkout at v2
+
+    - name: Set up JDK
+      uses: actions/setup-java at v1
+      with:
+        java-version: 12
+    - name: Build with Maven
+      run: mvn -B -DskipTests package verify --file pom.xml


=====================================
BUILD.bazel
=====================================
@@ -0,0 +1,29 @@
+"""BUILD.bazel file for ANTLR 3."""
+
+load("@rules_java//java:defs.bzl", "java_library")
+
+package(default_visibility = ["//visibility:private"])
+
+java_library(
+    name = "java_runtime",
+    srcs = glob(
+        ["runtime/Java/src/main/java/**/*.java"],
+        # Avoid pulling in org.antlr.stringtemplate.
+        exclude = ["runtime/Java/src/main/java/org/antlr/runtime/tree/DOTTreeGenerator.java"],
+    ),
+    javacopts = [
+        "-Xep:EqualsHashCode:OFF",
+    ],
+    visibility = ["//visibility:public"],
+)
+
+alias(
+    name = "tool",
+    actual = "//tool/src:tool",
+    visibility = ["//visibility:public"],
+)
+
+test_suite(
+    name = "tests",
+    tests = ["//tool/src:tests"],
+)


=====================================
README.txt
=====================================
@@ -1,7 +1,7 @@
-ANTLR v3.5
-January 4, 2013
+ANTLR v3.5.3
+April 9, 2022
 
-Terence Parr, parrt at cs usfca edu
+Terence Parr
 ANTLR project lead and supreme dictator for life
 University of San Francisco
 
@@ -18,11 +18,11 @@ version of ANTLR for 9 years.
 
 You should use v3 in conjunction with ANTLRWorks:
 
-    http://www.antlr.org/works/index.html
+    http://www.antlr3.org/works/
 
 and gUnit (grammar unit testing tool included in distribution):
 
-    http://www.antlr.org/wiki/display/ANTLR3/gUnit+-+Grammar+Unit+Testing
+    http://theantlrguy.atlassian.net/wiki/display/ANTLR3/gUnit+-+Grammar+Unit+Testing
 
 The book will also help you a great deal (printed May 15, 2007); you
 can also buy the PDF:
@@ -35,17 +35,17 @@ can also buy the PDF:
 
 See the getting started document:
 
-    http://www.antlr.org/wiki/display/ANTLR3/FAQ+-+Getting+Started
+    http://theantlrguy.atlassian.net/wiki/display/ANTLR3/FAQ+-+Getting+Started
 
 You also have the examples plus the source to guide you.
 
 See the wiki FAQ:
 
-    http://www.antlr.org/wiki/display/ANTLR3/ANTLR+v3+FAQ
+    http://theantlrguy.atlassian.net/wiki/display/ANTLR3/ANTLR+v3+FAQ
 
 and general doc root:
 
-    http://www.antlr.org/wiki/display/ANTLR3/ANTLR+3+Wiki+Home
+    http://theantlrguy.atlassian.net/wiki/display/ANTLR3/ANTLR+3+Wiki+Home
 
 Please help add/update FAQ entries.
 
@@ -90,7 +90,7 @@ that provides a framework for constructing recognizers, compilers, and
 translators from grammatical descriptions containing actions.
 Target language list:
 
-http://www.antlr.org/wiki/display/ANTLR3/Code+Generation+Targets
+http://theantlrguy.atlassian.net/wiki/display/ANTLR3/Code+Generation+Targets
 
 ----------------------------------------------------------------------
 
@@ -98,11 +98,11 @@ How is ANTLR v3 different than ANTLR v2?
 
 See "What is the difference between ANTLR v2 and v3?"
 
-    http://www.antlr.org/wiki/pages/viewpage.action?pageId=719
+    http://theantlrguy.atlassian.net/wiki/pages/viewpage.action?pageId=2687279
 
 See migration guide:
 
-    http://www.antlr.org/wiki/display/ANTLR3/Migrating+from+ANTLR+2+to+ANTLR+3
+    http://theantlrguy.atlassian.net/wiki/display/ANTLR3/Migrating+from+ANTLR+2+to+ANTLR+3
 
 ----------------------------------------------------------------------
 
@@ -110,33 +110,33 @@ How do I install this damn thing?
 
 You will have grabbed either of these:
 
-	http://antlr.org/download/antlr-3.5-complete-no-st3.jar
-	http://antlr.org/download/antlr-3.5-complete.jar
+    http://www.antlr3.org/download/antlr-3.5.3-complete-no-st3.jar
+    http://www.antlr3.org/download/antlr-3.5.3-complete.jar
 
 It has all of the jars you need combined into one. Then you need to
-add antlr-3.5-complete.jar to your CLASSPATH or add to arg list; e.g., on unix:
+add antlr-3.5.3-complete.jar to your CLASSPATH or add to arg list; e.g., on unix:
 
-$ java -cp "/usr/local/lib/antlr-3.5-complete.jar:$CLASSPATH" org.antlr.Tool Test.g
+$ java -cp "/usr/local/lib/antlr-3.5.3-complete.jar:$CLASSPATH" org.antlr.Tool Test.g
 
-Source + java binaries: Just untar antlr-3.5.tar.gz and you'll get:
+Source + java binaries: Just untar antlr-3.5.3.tar.gz and you'll get:
 
-antlr-3.5/BUILD.txt
-antlr-3.5/antlr3-maven-plugin
-antlr-3.5/antlrjar.xml
-antlr-3.5/antlrsources.xml
-antlr-3.5/gunit
-antlr-3.5/gunit-maven-plugin
-antlr-3.5/pom.xml
+antlr-3.5.3/BUILD.txt
+antlr-3.5.3/antlr3-maven-plugin
+antlr-3.5.3/antlrjar.xml
+antlr-3.5.3/antlrsources.xml
+antlr-3.5.3/gunit
+antlr-3.5.3/gunit-maven-plugin
+antlr-3.5.3/pom.xml
 antlr-3.5/runtime
-antlr-3.5/tool
-antlr-3.5/lib
+antlr-3.5.3/tool
+antlr-3.5.3/lib
 
 Please see the FAQ
 
-    http://www.antlr.org/wiki/display/ANTLR3/ANTLR+v3+FAQ
+    http://theantlrguy.atlassian.net/wiki/display/ANTLR3/ANTLR+v3+FAQ
 
 -------------------------
 
 How can I contribute to ANTLR v3?
 
-http://www.antlr.org/wiki/pages/viewpage.action?pageId=33947666
+http://theantlrguy.atlassian.net/wiki/pages/viewpage.action?pageId=2687297


=====================================
WORKSPACE.bazel
=====================================
@@ -0,0 +1,29 @@
+workspace(name = "antlr3")
+
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_jar")
+
+# This needs to be identical to the one used inhttps://github.com/antlr/stringtemplate4/blob/master/WORKSPACE.bazel.
+http_jar(
+    name = "antlr3_bootstrap",
+    sha256 = "46531814ba9739cdf20c6c1789c252d3d95b68932813d79fb8bbfdf8d5840417",
+    url = "http://www.antlr3.org/download/antlr-3.5.2-complete-no-st3.jar",
+)
+
+http_jar(
+    name = "junit",
+    sha256 = "8e495b634469d64fb8acfa3495a065cbacc8a0fff55ce1e31007be4c16dc57d3",
+    url = "https://repo1.maven.org/maven2/junit/junit/4.13.2/junit-4.13.2.jar",
+)
+
+http_jar(
+    name = "hamcrest_core",
+    sha256 = "66fdef91e9739348df7a096aa384a5685f4e875584cce89386a7a47251c4d8e9",
+    url = "https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar",
+)
+
+http_archive(
+    name = "stringtemplate4",
+    sha256 = "a91974e67013c1e68ef80794151dd66f04fc034cd3a9cf68af78867cd3067520",
+    strip_prefix = "stringtemplate4-139f34243e516fc9d2cc4db8eeaa825014d631cc",
+    url = "https://github.com/antlr/stringtemplate4/archive/139f34243e516fc9d2cc4db8eeaa825014d631cc.zip",
+)


=====================================
antlr-complete/pom.xml
=====================================
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.antlr</groupId>
         <artifactId>antlr-master</artifactId>
-        <version>3.5.2</version>
+        <version>3.5.3</version>
     </parent>
 
     <url>http://antlr.org/</url>
@@ -57,9 +57,7 @@
     </dependencies>
 
     <build>
-
         <plugins>
-
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-shade-plugin</artifactId>
@@ -123,12 +121,22 @@
                 </executions>
             </plugin>
 
-            <plugin>
+            <plugin> <!-- create javadoc jar -->
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-javadoc-plugin</artifactId>
+                <version>3.3.1</version>
                 <configuration>
-                    <includeDependencySources>true</includeDependencySources>
+                    <javadocVersion>1.8</javadocVersion>
+                    <failOnError>false</failOnError>
                 </configuration>
+                <executions>
+                    <execution>
+                        <phase>deploy</phase>
+                        <goals>
+                            <goal>javadoc</goal>
+                        </goals>
+                    </execution>
+                </executions>
             </plugin>
         </plugins>
 


=====================================
antlr3-maven-archetype/pom.xml
=====================================
@@ -19,7 +19,7 @@
     <parent>
         <groupId>org.antlr</groupId>
         <artifactId>antlr-master</artifactId>
-        <version>3.5.2</version>
+        <version>3.5.3</version>
     </parent>
 
   <build>
@@ -35,13 +35,11 @@
     </extensions>
 
         <plugins>
-
             <plugin>
                 <artifactId>maven-archetype-plugin</artifactId>
                 <version>2.2</version>
                 <extensions>true</extensions>
             </plugin>
-
         </plugins>
 
   </build>


=====================================
antlr3-maven-plugin/pom.xml
=====================================
@@ -34,53 +34,27 @@
 
 
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <!-- Maven model we are inheriting from
-      -->
     <modelVersion>4.0.0</modelVersion>
-
-    <!--
-
-     Now that the ANTLR project has adopted Maven with a vengence,
-     all ANTLR tools will be grouped under org.antlr and will be
-     controlled by a project member.
-     -->
-    <groupId>org.antlr</groupId>
-
-
-    <!--
-
-     This is the ANTLR plugin for ANTLR version 3.1.3 and above. It might
-     have been best to change the name of the plugin as the 3.1.2 plugins
-     behave a little differently, however for the sake of one transitional
-     phase to a much better plugin, it was decided that the name should
-     remain the same.
-      -->
-    <artifactId>antlr3-maven-plugin</artifactId>
-    <packaging>maven-plugin</packaging>
-
     <parent>
         <groupId>org.antlr</groupId>
         <artifactId>antlr-master</artifactId>
-        <version>3.5.2</version>
+        <version>3.5.3</version>
     </parent>
-
+    <artifactId>antlr3-maven-plugin</artifactId>
+    <packaging>maven-plugin</packaging>
     <name>ANTLR 3 Maven plugin</name>
-    <prerequisites>
-        <maven>2.0</maven>
-    </prerequisites>
+
+    <properties>
+        <mavenVersion>3.8.4</mavenVersion>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
 
     <!--
      Where does our actual project live on the interwebs.
       -->
     <url>http://antlr.org</url>
 
-    <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    </properties>
-
     <description>
-
 This is the brand new, re-written from scratch plugin for ANTLR v3.
 
 Previous valiant efforts all suffered from being unable to modify the ANTLR Tool
@@ -106,11 +80,9 @@ to death. Hence even this pom has more comments than funcitonal elements,
 in case I get run over by a bus or fall off a cliff while skiing.
 
 Jim Idle - March 2009
-
     </description>
 
     <developers>
-
         <developer>
             <name>Jim Idle</name>
             <url>http://www.temporal-wave.com</url>
@@ -159,25 +131,78 @@ Jim Idle - March 2009
         <!--
           The things we need to build the target language recognizer
           -->
+        <!-- The things we need to build the target language recognizer -->
         <dependency>
             <groupId>org.apache.maven</groupId>
             <artifactId>maven-plugin-api</artifactId>
-            <version>2.0</version>
-            <scope>compile</scope>
+            <version>3.8.4</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.plexus</groupId>
+            <artifactId>plexus-compiler-api</artifactId>
+            <version>2.9.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.sonatype.plexus</groupId>
+            <artifactId>plexus-build-api</artifactId>
+            <version>0.0.7</version>
+        </dependency>
+        <!-- The version of ANTLR tool that this version of the plugin controls.
+          We have decided that this should be in lockstep with ANTLR itself, other
+          than -1 -2 -3 etc patch releases. -->
+        <dependency>
+            <groupId>org.antlr</groupId>
+            <artifactId>antlr</artifactId>
+            <version>3.5.3</version>
+        </dependency>
+        <!-- Testing requirements... -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.13.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven.plugin-tools</groupId>
+            <artifactId>maven-plugin-annotations</artifactId>
+            <version>3.6.2</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>io.takari.maven.plugins</groupId>
+            <artifactId>takari-plugin-testing</artifactId>
+            <version>3.0.0</version>
+            <scope>test</scope>
         </dependency>
-
         <dependency>
             <groupId>org.apache.maven</groupId>
-            <artifactId>maven-project</artifactId>
-            <version>2.0</version>
+            <artifactId>maven-core</artifactId>
+            <version>3.8.4</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-compat</artifactId>
+            <version>3.8.4</version>
+            <scope>test</scope>
         </dependency>
-
         <dependency>
             <groupId>org.codehaus.plexus</groupId>
-            <artifactId>plexus-compiler-api</artifactId>
-            <version>2.0</version>
+            <artifactId>plexus-utils</artifactId>
+            <version>3.4.1</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>1.7.32</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+            <version>1.7.32</version>
         </dependency>
-
         <!--
          The version of ANTLR tool that this version of the plugin controls.
          We have decided that this should be in lockstep with ANTLR itself, other
@@ -201,7 +226,6 @@ Jim Idle - March 2009
     <build>
 
         <plugins>
-
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-site-plugin</artifactId>
@@ -223,6 +247,15 @@ Jim Idle - March 2009
 
     <reporting>
         <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <version>3.3.1</version>
+                <configuration>
+                    <failOnError>false</failOnError>
+                    <quiet>true</quiet>
+                </configuration>
+            </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-plugin-plugin</artifactId>


=====================================
antlr3-maven-plugin/src/main/java/org/antlr/mojo/antlr3/Antlr3Mojo.java
=====================================
@@ -51,20 +51,25 @@ import org.codehaus.plexus.compiler.util.scan.SimpleSourceInclusionScanner;
 import org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner;
 import org.codehaus.plexus.compiler.util.scan.mapping.SourceMapping;
 import org.codehaus.plexus.compiler.util.scan.mapping.SuffixMapping;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.project.MavenProject;
 
 /**
  * Parses ANTLR grammar files {@code *.g} and transforms them into Java source
  * files.
  *
- * @goal antlr
- * @phase generate-sources
- * @requiresDependencyResolution compile
- * @requiresProject true
- * 
  * @author <a href="mailto:jimi at temporal-wave.com">Jim Idle</a>
  */
-public class Antlr3Mojo
-        extends AbstractMojo {
+ at Mojo(
+        name = "antlr",
+        defaultPhase = LifecyclePhase.GENERATE_SOURCES,
+        requiresDependencyResolution = ResolutionScope.COMPILE,
+        requiresProject = true, threadSafe = true)
+public class Antlr3Mojo extends AbstractMojo {
 
     // First, let's deal with the options that the ANTLR tool itself
     // can be configured by.
@@ -73,88 +78,77 @@ public class Antlr3Mojo
      * If set to true, then after the tool has processed an input grammar file
      * it will report various statistics about the parser, such as information
      * on cyclic DFAs, which rules may use backtracking, and so on.
-     *
-     * @parameter default-value="false"
      */
+    @Parameter(property = "report", defaultValue = "false")
     protected boolean report;
     /**
      * If set to true, then the ANTLR tool will print a version of the input
      * grammar(s) which are stripped of any embedded actions.
-     *
-     * @parameter default-value="false"
      */
+    @Parameter(property = "printGrammar", defaultValue = "false")
     protected boolean printGrammar;
     /**
      * If set to true, then the code generated by the ANTLR code generator will
      * be set to debug mode. This means that when run, the code will 'hang' and
      * wait for a debug connection on a TCP port (49100 by default).
-     *
-     * @parameter default-value="false"
      */
+    @Parameter(property = "debug", defaultValue = "false")
     protected boolean debug;
     /**
      * If set to true, then the generated parser will compute and report profile
      * information at runtime.
-     *
-     * @parameter default-value="false"
      */
+    @Parameter(property = "profile", defaultValue = "false")
     protected boolean profile;
     /**
      * If set to true, then the ANTLR tool will generate a description of the
      * NFA for each rule in <a href="http://www.graphviz.org">Dot format</a>
-     *
-     * @parameter default-value="false"
      */
+    @Parameter(property = "nfa", defaultValue = "false")
     protected boolean nfa;
     /**
      * If set to true, then the ANTLR tool will generate a description of the
      * DFA for each decision in the grammar in
      * <a href="http://www.graphviz.org">Dot format</a>.
-     *
-     * @parameter default-value="false"
      */
+    @Parameter(property = "dfa", defaultValue = "false")
     protected boolean dfa;
     /**
      * If set to true, the generated parser code will log rule entry and exit
      * points to stdout ({@link System#out} for the Java target) as an aid to
      * debugging.
-     *
-     * @parameter default-value="false"
      */
+    @Parameter(property = "trace", defaultValue = "false")
     protected boolean trace;
     /**
      * If this parameter is set, it indicates that any warning or error messages
      * returned by ANLTR, should be formatted in the specified way. Currently,
      * ANTLR supports the built-in formats {@code antlr}, {@code gnu} and
      * {@code vs2005}.
-     *
-     * @parameter default-value="antlr"
      */
+    @Parameter(property = "messageFormat", defaultValue = "antlr")
     protected String messageFormat;
     /**
      * If set to true, then ANTLR will report verbose messages during the code
      * generation process. This includes the names of files, the version of
      * ANTLR, and more.
-     *
-     * @parameter default-value="true"
      */
+    @Parameter(property = "verbose", defaultValue = "true")
     protected boolean verbose;
 
     /**
      * The maximum number of alternatives allowed in an inline switch statement.
      * Beyond this, ANTLR will not generate a switch statement for the DFA.
-     *
-     * @parameter default-value="300"
      */
+    @Parameter(property = "maxSwitchCaseLabels", defaultValue = "300")
     private int maxSwitchCaseLabels;
 
     /**
      * The minimum number of alternatives for ANTLR to generate a switch
      * statement. For decisions with fewer alternatives, an if/else if/else
      * statement will be used instead.
-     *
-     * @parameter default-value="3"
      */
+    @Parameter(property = "minSwitchAlts", defaultValue = "3")
     private int minSwitchAlts;
 
     /* --------------------------------------------------------------------
@@ -171,49 +165,40 @@ public class Antlr3Mojo
      * A set of Ant-like inclusion patterns used to select files from the source
      * directory for processing. By default, the pattern <code>**/*.g</code>
      * is used to select grammar files.</p>
-     *
-     * @parameter
      */
+    @Parameter
     protected Set<String> includes = new HashSet<String>();
     /**
      * A set of Ant-like exclusion patterns used to prevent certain files from
      * being processed. By default, this set is empty such that no files are
      * excluded.
-     *
-     * @parameter
      */
+    @Parameter
     protected Set<String> excludes = new HashSet<String>();
     /**
      * The current Maven project.
-     *
-     * @parameter expression="${project}"
-     * @required
-     * @readonly
      */
+    @Parameter(property = "project", required = true, readonly = true)
     protected MavenProject project;
     /**
      * The directory where the ANTLR grammar files ({@code *.g}) are located.
-     *
-     * @parameter default-value="${basedir}/src/main/antlr3"
      */
+    @Parameter(defaultValue = "${basedir}/src/main/antlr3")
     private File sourceDirectory;
     /**
      * The directory where the parser files generated by ANTLR will be stored.
      * The directory will be registered as a compile source root of the project
      * such that the generated files will participate in later build phases like
      * compiling and packaging.
-     *
-     * @parameter default-value="${project.build.directory}/generated-sources/antlr3"
-     * @required
      */
+    @Parameter(defaultValue = "${project.build.directory}/generated-sources/antlr3", required = true)
     private File outputDirectory;
     /**
      * Location for imported token files, e.g. {@code *.tokens} and imported
      * grammars. Note that ANTLR will not try to process grammars that it finds
      * to be imported into other grammars (in the same processing session).
-     *
-     * @parameter default-value="${basedir}/src/main/antlr3/imports"
      */
+    @Parameter(defaultValue = "${basedir}/src/main/antlr3/imports")
     private File libDirectory;
 
     public File getSourceDirectory() {


=====================================
contributors.txt
=====================================
@@ -48,6 +48,7 @@ the end of the following contributors list.
 CONTRIBUTORS:
 
 YYYY/MM/DD, github id, Full name, email
+2014/05/15, robstoll, Robert Stoll, rstoll at tutteli.ch
 2013/04/17, ibre5041, Ivan Brezina, ibre5041 at ibrezina.net
 2013/02/19, murrayju, Justin Murray, murrayju at addpcs.com
 2012/07/12, parrt, Terence Parr, parrt at antlr.org
@@ -57,3 +58,4 @@ YYYY/MM/DD, github id, Full name, email
 2012/09/17, ksgokul, Gokulakannan Somasundaram, gokul007 at gmail.com
 2012/11/22, sharwell, Sam Harwell, sam at tunnelvisionlabs.com
 2012/09/24, mike-lischke, Mike Lischke, mike at lischke-online.de
+2022/04/04, jcking, Justin King, jcking at google.com


=====================================
gunit-maven-plugin/pom.xml
=====================================
@@ -32,34 +32,20 @@
   -->
 
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
     <modelVersion>4.0.0</modelVersion>
-
-    <prerequisites>
-        <maven>2.0</maven>
-    </prerequisites>
-
-    <groupId>org.antlr</groupId>
-    <artifactId>maven-gunit-plugin</artifactId>
-    <packaging>maven-plugin</packaging>
-
-    <name>ANTLR 3 gUnit Maven plugin</name>
-	<description>A Maven plugin for incorporating gUnit testing of grammars</description>
-    <url>http://antlr.org</url>
-
-    <!--
-
-    Inherit from the ANTLR master pom, which tells us what
-    version we are and allows us to inherit dependencies
-    and so on.
-    -->
     <parent>
         <groupId>org.antlr</groupId>
         <artifactId>antlr-master</artifactId>
-        <version>3.5.2</version>
+        <version>3.5.3</version>
     </parent>
+    <artifactId>maven-gunit-plugin</artifactId>
+    <packaging>maven-plugin</packaging>
+    <name>ANTLR 3 gUnit Maven plugin</name>
+    <description>A Maven plugin for incorporating gUnit testing of grammars</description>
+    <url>http://antlr.org</url>
 
     <properties>
+        <mavenVersion>3.8.4</mavenVersion>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
 
@@ -75,25 +61,68 @@
         <!--
           The things we need to build the target language recognizer
           -->
+        <!-- The things we need to build the target language recognizer -->
         <dependency>
             <groupId>org.apache.maven</groupId>
             <artifactId>maven-plugin-api</artifactId>
-            <version>2.0</version>
-            <scope>compile</scope>
+            <version>3.8.4</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.plexus</groupId>
+            <artifactId>plexus-compiler-api</artifactId>
+            <version>2.9.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.sonatype.plexus</groupId>
+            <artifactId>plexus-build-api</artifactId>
+            <version>0.0.7</version>
+        </dependency>
+        <!-- The version of ANTLR tool that this version of the plugin controls.
+          We have decided that this should be in lockstep with ANTLR itself, other
+          than -1 -2 -3 etc patch releases. -->
+        <!-- Testing requirements... -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.13.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven.plugin-tools</groupId>
+            <artifactId>maven-plugin-annotations</artifactId>
+            <version>3.6.2</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>io.takari.maven.plugins</groupId>
+            <artifactId>takari-plugin-testing</artifactId>
+            <version>3.0.0</version>
+            <scope>test</scope>
         </dependency>
-
         <dependency>
             <groupId>org.apache.maven</groupId>
-            <artifactId>maven-project</artifactId>
-            <version>2.0</version>
+            <artifactId>maven-core</artifactId>
+            <version>3.8.4</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-compat</artifactId>
+            <version>3.8.4</version>
+            <scope>test</scope>
         </dependency>
-
         <dependency>
             <groupId>org.codehaus.plexus</groupId>
-            <artifactId>plexus-compiler-api</artifactId>
-            <version>2.0</version>
+            <artifactId>plexus-utils</artifactId>
+            <version>3.4.1</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>1.7.32</version>
         </dependency>
-
         <!--
          The version of ANTLR tool that this version of the plugin controls.
          We have decided that this should be in lockstep with ANTLR itself, other
@@ -104,10 +133,6 @@
             <artifactId>antlr</artifactId>
             <version>${project.version}</version>
         </dependency>
-
-        <!--
-         Dependency on the gUnit artifact.
-        -->
         <dependency>
             <groupId>org.antlr</groupId>
             <artifactId>gunit</artifactId>
@@ -120,12 +145,20 @@
             <version>1.1</version>
             <scope>test</scope>
         </dependency>
-        
     </dependencies>
     
     <build>
 
         <plugins>
+            <plugin> <!-- create javadoc jar -->
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <version>3.3.1</version>
+                <configuration>
+                    <javadocVersion>1.8</javadocVersion>
+                    <failOnError>false</failOnError>
+                </configuration>
+            </plugin>
 
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>


=====================================
gunit-maven-plugin/src/main/java/org/antlr/mojo/antlr3/GUnitExecuteMojo.java
=====================================
@@ -36,18 +36,22 @@ import org.antlr.gunit.GrammarInfo;
 import org.antlr.gunit.gUnitExecutor;
 import org.antlr.gunit.AbstractTest;
 import org.antlr.gunit.Interp;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 
 /**
  * Takes gUnit scripts and directly performs testing.
- *
- * @goal gunit
- *
- * @phase test
- * @requiresDependencyResolution test
- * @requiresProject true
- *
  * @author Steve Ebersole
  */
+ at Mojo(
+		name = "gunit",
+		defaultPhase = LifecyclePhase.TEST,
+		requiresDependencyResolution = ResolutionScope.TEST,
+		requiresProject = true)
 public class GUnitExecuteMojo extends AbstractMojo {
 	public static final String ANTLR_GROUP_ID = "org.antlr";
 	public static final String ANTLR_ARTIFACT_NAME = "antlr";
@@ -55,60 +59,48 @@ public class GUnitExecuteMojo extends AbstractMojo {
 
 	/**
      * INTERNAL : The Maven Project to which we are attached
-     *
-     * @parameter expression="${project}"
-     * @required
      */
+	@Parameter(defaultValue = "${project}", required = true)
     private MavenProject project;
 
 	/**
 	 * INTERNAL : The artifacts associated to the dependencies defined as part
 	 * of our configuration within the project to which we are being attached.
-	 *
-	 * @parameter expression="${plugin.artifacts}"
-     * @required
-     * @readonly
 	 */
+	@Parameter(defaultValue = "${plugin.artifacts}", required = true, readonly = true)
 	private List<Artifact> pluginArtifacts;
 
 	/**
      * Specifies the directory containing the gUnit testing files.
-     *
-     * @parameter expression="${basedir}/src/test/gunit"
-     * @required
      */
+	@Parameter(defaultValue = "${basedir}/src/test/gunit", required = true)
     private File sourceDirectory;
 
     /**
      * A set of patterns for matching files from the sourceDirectory that
      * should be included as gUnit source files.
-     *
-     * @parameter
      */
+	@Parameter
     private Set<String> includes;
 
     /**
      * A set of exclude patterns.
-     *
-     * @parameter
      */
+	@Parameter
     private Set<String> excludes;
 
 	/**
      * Specifies directory to which gUnit reports should get written.
-     *
-     * @parameter expression="${basedir}/target/gunit-report"
-     * @required
      */
-    private File reportDirectory;
+	@Parameter(defaultValue = "${basedir}/target/gunit-report", required = true)
+	private File reportDirectory;
 
 	/**
 	 * Should gUnit functionality be completely by-passed?
 	 * <p>
 	 * By default we skip gUnit tests if the user requested that all testing be skipped using 'maven.test.skip'</p>
-	 *
-	 * @parameter expression="${maven.test.skip}"
 	 */
+	@Parameter(defaultValue = "${maven.test.skip}")
 	private boolean skip;
 
 	public Set<String> getIncludePatterns() {


=====================================
gunit/pom.xml
=====================================
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.antlr</groupId>
         <artifactId>antlr-master</artifactId>
-        <version>3.5.2</version>
+        <version>3.5.3</version>
     </parent>
 
     <url>http://www.antlr.org/wiki/display/ANTLR3/gUnit+-+Grammar+Unit+Testing</url>


=====================================
pom.xml
=====================================
@@ -7,11 +7,15 @@
         <version>9</version>
     </parent>
 
+    <prerequisites>
+        <maven>3.8</maven>
+    </prerequisites>
+
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.antlr</groupId>
     <artifactId>antlr-master</artifactId>
     <packaging>pom</packaging>
-    <version>3.5.2</version>
+    <version>3.5.3</version>
     <name>ANTLR 3 Master build control POM</name>
     <description>Master build POM for ANTLR 3</description>
     <url>http://antlr.org</url>
@@ -52,12 +56,13 @@
     -->
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <java5.home>${env.JAVA5_HOME}</java5.home>
-        <java6.home>${env.JAVA6_HOME}</java6.home>
-        <bootclasspath.java5>${java5.home}/lib/rt.jar</bootclasspath.java5>
-        <bootclasspath.java6>${java6.home}/lib/rt.jar</bootclasspath.java6>
-        <bootclasspath.compile>${bootclasspath.java5}</bootclasspath.compile>
-        <bootclasspath.testCompile>${bootclasspath.java6}</bootclasspath.testCompile>
+        <jdk>1.8</jdk>
+        <junit.version>4.13</junit.version>
+        <st4.version>4.3.1</st4.version>
+        <antlr.version>2.7.7</antlr.version>
+        <stringtemplate.version>3.2.1</stringtemplate.version>
+        <required-maven-version>3.3.1</required-maven-version>
+        <mavenVersion>3.8.4</mavenVersion>
     </properties>
 
     <licenses>
@@ -84,7 +89,7 @@
         <url>https://github.com/antlr/antlr3/tree/master</url>
         <connection>scm:git:git://github.com/antlr/antlr3.git</connection>
         <developerConnection>scm:git:git at github.com:antlr/antlr3.git</developerConnection>
-      <tag>3.5.2</tag>
+      <tag>HEAD</tag>
   </scm>
   <!--
 
@@ -101,28 +106,28 @@
             <dependency>
                 <groupId>junit</groupId>
                 <artifactId>junit</artifactId>
-                <version>4.10</version>
+                <version>${junit.version}</version>
                 <scope>test</scope>
             </dependency>
 
             <dependency>
                 <groupId>antlr</groupId>
                 <artifactId>antlr</artifactId>
-                <version>2.7.7</version>
+                <version>${antlr.version}</version>
                 <scope>compile</scope>
             </dependency>
 
             <dependency>
               <groupId>org.antlr</groupId>
               <artifactId>stringtemplate</artifactId>
-              <version>3.2.1</version>
+              <version>${stringtemplate.version}</version>
               <scope>compile</scope>
             </dependency>
 
             <dependency>
                 <groupId>org.antlr</groupId>
                 <artifactId>ST4</artifactId>
-                <version>4.0.8</version>
+                <version>${st4.version}</version>
                 <scope>compile</scope>
             </dependency>
 
@@ -138,6 +143,16 @@
             </modules>
             <build>
                 <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-compiler-plugin</artifactId>
+                        <version>3.8.1</version>
+                        <configuration>
+                            <source>${jdk}</source>
+                            <target>${jdk}</target>
+                        </configuration>
+                    </plugin>
+                    <!--
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-compiler-plugin</artifactId>
@@ -145,8 +160,8 @@
                             <execution>
                                 <id>default-compile</id>
                                 <configuration>
-                                    <source>1.5</source>
-                                    <target>1.5</target>
+                                    <source>${jdk}</source>
+                                    <target>${jdk}</target>
                                     <compilerArgs>
                                         <arg>-Xlint</arg>
                                         <arg>-Xlint:-serial</arg>
@@ -158,8 +173,8 @@
                             <execution>
                                 <id>default-testCompile</id>
                                 <configuration>
-                                    <source>1.6</source>
-                                    <target>1.6</target>
+                                    <source>${jdk}</source>
+                                    <target>${jdk}</target>
                                     <compilerArgs>
                                         <arg>-Xlint</arg>
                                         <arg>-Xlint:-serial</arg>
@@ -170,6 +185,7 @@
                             </execution>
                         </executions>
                     </plugin>
+                    -->
                 </plugins>
             </build>
         </profile>
@@ -220,50 +236,18 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.1</version>
+                <version>3.8.1</version>
                 <configuration>
-                    <sourceDirectory>src</sourceDirectory>
-                    <showWarnings>true</showWarnings>
-                    <showDeprecation>true</showDeprecation>
-                    <compilerArgs>
-                        <arg>-Xlint</arg>
-                        <arg>-Xlint:-serial</arg>
-                    </compilerArgs>
+                    <source>${jdk}</source>
+                    <target>${jdk}</target>
                 </configuration>
-
-                <executions>
-                    <execution>
-                        <id>default-compile</id>
-                        <configuration>
-                            <source>1.5</source>
-                            <target>1.5</target>
-                        </configuration>
-                    </execution>
-                    <execution>
-                        <id>default-testCompile</id>
-                        <configuration>
-                            <source>1.6</source>
-                            <target>1.6</target>
-                        </configuration>
-                    </execution>
-                </executions>
             </plugin>
 
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-release-plugin</artifactId>
-                <!-- override the version inherited from the parent -->
-                <version>2.5</version>
-                <configuration>
-                    <arguments>-Psonatype-oss-release ${release.arguments}</arguments>
-                </configuration>
-            </plugin>
 
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <!-- override the version inherited from the parent -->
-                <version>2.17</version>
+                <version>2.12.4</version>
             </plugin>
 
             <plugin>
@@ -284,16 +268,6 @@
                 <version>2.2.1</version>
             </plugin>
 
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-javadoc-plugin</artifactId>
-                <!-- override the version inherited from the parent -->
-                <version>2.9.1</version>
-                <configuration>
-                    <quiet>true</quiet>
-                </configuration>
-            </plugin>
-
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-gpg-plugin</artifactId>
@@ -301,24 +275,36 @@
                 <version>1.5</version>
             </plugin>
 
-        </plugins>
-
-    </build>
-
-    <reporting>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-javadoc-plugin</artifactId>
-                <version>2.9.1</version>
-            </plugin>
-
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jxr-plugin</artifactId>
-                <version>2.3</version>
+                <artifactId>maven-enforcer-plugin</artifactId>
+                <version>3.0.0-M2</version>
+                <executions>
+                    <execution>
+                        <id>enforce-maven</id>
+                        <goals>
+                            <goal>enforce</goal>
+                        </goals>
+                        <configuration>
+                            <rules>
+                                <requireMavenVersion>
+                                    <version>${required-maven-version}</version>
+                                </requireMavenVersion>
+                            </rules>
+                        </configuration>
+                    </execution>
+                </executions>
             </plugin>
         </plugins>
-    </reporting>
+
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-javadoc-plugin</artifactId>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
 
 </project>


=====================================
runtime/Java/pom.xml
=====================================
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
-  <groupId>org.antlr</groupId>
   <artifactId>antlr-runtime</artifactId>
   <packaging>jar</packaging>
   
@@ -15,8 +14,8 @@
   <parent>
       <groupId>org.antlr</groupId>
       <artifactId>antlr-master</artifactId>
-      <version>3.5.2</version>
-      <relativePath>../..</relativePath>
+      <version>3.5.3</version>
+      <relativePath>../../pom.xml</relativePath>
   </parent>
   
   <name>ANTLR 3 Runtime</name>
@@ -64,4 +63,24 @@
 
   </dependencies>
 
+    <build>
+        <plugins>
+            <plugin> <!-- create javadoc jar -->
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <version>3.3.1</version>
+                <configuration>
+                    <javadocVersion>1.8</javadocVersion>
+                    <failOnError>false</failOnError>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>javadoc</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>


=====================================
runtime/Java/src/main/java/org/antlr/runtime/debug/DebugTreeAdaptor.java
=====================================
@@ -227,7 +227,7 @@ public class DebugTreeAdaptor implements TreeAdaptor {
 
 	@Override
 	public Object deleteChild(Object t, int i) {
-		return deleteChild(t, i);
+		return adaptor.deleteChild(t, i);
 	}
 
 	@Override


=====================================
tool/CHANGES.txt
=====================================
@@ -1,3 +1,11 @@
+****************************************************************************
+As of ANTLR 3.5.2, March 25 2014, we are no longer updating this file. Instead,
+we are using the github release mechanism. For example, here is
+3.5.2 release notes:
+
+https://github.com/antlr/antlr3/releases/tag/3.5.2
+****************************************************************************
+
 ANTLR 3.5 Release
 January 4, 2012
 


=====================================
tool/pom.xml
=====================================
@@ -16,7 +16,7 @@
     <parent>
         <groupId>org.antlr</groupId>
         <artifactId>antlr-master</artifactId>
-        <version>3.5.2</version>
+        <version>3.5.3</version>
     </parent>
 
     <dependencies>
@@ -63,14 +63,10 @@
     <build>
 
         <plugins>
-
             <plugin>
                 <groupId>org.antlr</groupId>
                 <artifactId>antlr3-maven-plugin</artifactId>
-                <version>3.5</version>
-                <configuration>
-                    <libDirectory>target/generated-sources/antlr/org/antlr/grammar/v3</libDirectory>
-                </configuration>
+                <version>3.5.2</version>
                 <executions>
                     <execution>
                         <goals>


=====================================
tool/src/BUILD.bazel
=====================================
@@ -0,0 +1,145 @@
+"""BUILD.bazel file for ANTLR 3."""
+
+load("@rules_java//java:defs.bzl", "java_binary", "java_library", "java_test")
+
+package(default_visibility = ["//visibility:private"])
+
+java_binary(
+    name = "tool",
+    main_class = "org.antlr.Tool",
+    visibility = ["//:__pkg__"],
+    runtime_deps = [":tool_lib"],
+)
+
+java_library(
+    name = "tool_lib",
+    srcs = glob(["main/java/**/*.java"]) + [
+        "main/java/org/antlr/grammar/v3/ANTLRLexer.java",
+        "main/java/org/antlr/grammar/v3/ANTLRParser.java",
+        "main/java/org/antlr/grammar/v3/ANTLRTreePrinter.java",
+        "main/java/org/antlr/grammar/v3/ANTLRv3Lexer.java",
+        "main/java/org/antlr/grammar/v3/ANTLRv3Parser.java",
+        "main/java/org/antlr/grammar/v3/ANTLRv3Tree.java",
+        "main/java/org/antlr/grammar/v3/ActionAnalysis.java",
+        "main/java/org/antlr/grammar/v3/ActionTranslator.java",
+        "main/java/org/antlr/grammar/v3/AssignTokenTypesWalker.java",
+        "main/java/org/antlr/grammar/v3/CodeGenTreeWalker.java",
+        "main/java/org/antlr/grammar/v3/DefineGrammarItemsWalker.java",
+        "main/java/org/antlr/grammar/v3/LeftRecursiveRuleWalker.java",
+        "main/java/org/antlr/grammar/v3/TreeToNFAConverter.java",
+    ],
+    javacopts = [
+        "-Xep:EqualsHashCode:OFF",
+    ],
+    resource_strip_prefix = "tool/src/main/resources",
+    resources = glob(["main/resources/**/*.stg"]),
+    visibility = ["//visibility:public"],
+    deps = [
+        ":tool_bootstrap",
+        "//:java_runtime",
+        "@stringtemplate4",
+    ],
+)
+
+genrule(
+    name = "tool_bootstrap",
+    srcs = [
+        "main/antlr3/org/antlr/grammar/v3/ANTLR.g",
+        "main/antlr3/org/antlr/grammar/v3/ANTLRTreePrinter.g",
+        "main/antlr3/org/antlr/grammar/v3/ANTLRv3.g",
+        "main/antlr3/org/antlr/grammar/v3/ANTLRv3Tree.g",
+        "main/antlr3/org/antlr/grammar/v3/ActionAnalysis.g",
+        "main/antlr3/org/antlr/grammar/v3/ActionTranslator.g",
+        "main/antlr3/org/antlr/grammar/v3/AssignTokenTypesWalker.g",
+        "main/antlr3/org/antlr/grammar/v3/CodeGenTreeWalker.g",
+        "main/antlr3/org/antlr/grammar/v3/DefineGrammarItemsWalker.g",
+        "main/antlr3/org/antlr/grammar/v3/LeftRecursiveRuleWalker.g",
+        "main/antlr3/org/antlr/grammar/v3/TreeToNFAConverter.g",
+    ],
+    outs = [
+        "main/java/org/antlr/grammar/v3/ANTLRLexer.java",
+        "main/java/org/antlr/grammar/v3/ANTLRParser.java",
+        "main/java/org/antlr/grammar/v3/ANTLRTreePrinter.java",
+        "main/java/org/antlr/grammar/v3/ANTLRv3Lexer.java",
+        "main/java/org/antlr/grammar/v3/ANTLRv3Parser.java",
+        "main/java/org/antlr/grammar/v3/ANTLRv3Tree.java",
+        "main/java/org/antlr/grammar/v3/ActionAnalysis.java",
+        "main/java/org/antlr/grammar/v3/ActionTranslator.java",
+        "main/java/org/antlr/grammar/v3/AssignTokenTypesWalker.java",
+        "main/java/org/antlr/grammar/v3/CodeGenTreeWalker.java",
+        "main/java/org/antlr/grammar/v3/DefineGrammarItemsWalker.java",
+        "main/java/org/antlr/grammar/v3/LeftRecursiveRuleWalker.java",
+        "main/java/org/antlr/grammar/v3/TreeToNFAConverter.java",
+    ],
+    cmd = """
+      $(JAVA) -cp $(location @antlr3_bootstrap//jar) org.antlr.Tool -fo $(RULEDIR)/main/java/org/antlr/grammar/v3 $(location :main/antlr3/org/antlr/grammar/v3/ANTLR.g)
+      $(JAVA) -cp $(location @antlr3_bootstrap//jar) org.antlr.Tool -fo $(RULEDIR)/main/java/org/antlr/grammar/v3 $(location :main/antlr3/org/antlr/grammar/v3/ANTLRTreePrinter.g)
+      $(JAVA) -cp $(location @antlr3_bootstrap//jar) org.antlr.Tool -fo $(RULEDIR)/main/java/org/antlr/grammar/v3 $(location :main/antlr3/org/antlr/grammar/v3/ANTLRv3.g)
+      $(JAVA) -cp $(location @antlr3_bootstrap//jar) org.antlr.Tool -fo $(RULEDIR)/main/java/org/antlr/grammar/v3 $(location :main/antlr3/org/antlr/grammar/v3/ANTLRv3Tree.g)
+      $(JAVA) -cp $(location @antlr3_bootstrap//jar) org.antlr.Tool -fo $(RULEDIR)/main/java/org/antlr/grammar/v3 $(location :main/antlr3/org/antlr/grammar/v3/ActionAnalysis.g)
+      $(JAVA) -cp $(location @antlr3_bootstrap//jar) org.antlr.Tool -fo $(RULEDIR)/main/java/org/antlr/grammar/v3 $(location :main/antlr3/org/antlr/grammar/v3/ActionTranslator.g)
+      $(JAVA) -cp $(location @antlr3_bootstrap//jar) org.antlr.Tool -fo $(RULEDIR)/main/java/org/antlr/grammar/v3 $(location :main/antlr3/org/antlr/grammar/v3/AssignTokenTypesWalker.g)
+      $(JAVA) -cp $(location @antlr3_bootstrap//jar) org.antlr.Tool -fo $(RULEDIR)/main/java/org/antlr/grammar/v3 $(location :main/antlr3/org/antlr/grammar/v3/CodeGenTreeWalker.g)
+      $(JAVA) -cp $(location @antlr3_bootstrap//jar) org.antlr.Tool -fo $(RULEDIR)/main/java/org/antlr/grammar/v3 $(location :main/antlr3/org/antlr/grammar/v3/DefineGrammarItemsWalker.g)
+      $(JAVA) -cp $(location @antlr3_bootstrap//jar) org.antlr.Tool -fo $(RULEDIR)/main/java/org/antlr/grammar/v3 $(location :main/antlr3/org/antlr/grammar/v3/LeftRecursiveRuleWalker.g)
+      $(JAVA) -cp $(location @antlr3_bootstrap//jar) org.antlr.Tool -fo $(RULEDIR)/main/java/org/antlr/grammar/v3 $(location :main/antlr3/org/antlr/grammar/v3/TreeToNFAConverter.g)
+    """,
+    toolchains = ["@bazel_tools//tools/jdk:current_host_java_runtime"],
+    tools = ["@antlr3_bootstrap//jar"],
+)
+
+java_test(
+    name = "tests",
+    srcs = glob(["test/java/**/*.java"]),
+    args = [
+        "org.antlr.test.TestASTConstruction",
+        "org.antlr.test.TestAttributes",
+        "org.antlr.test.TestAutoAST",
+        "org.antlr.test.TestBufferedTreeNodeStream",
+        "org.antlr.test.TestCharDFAConversion",
+        "org.antlr.test.TestCommonTokenStream",
+        "org.antlr.test.TestCompositeGrammars",
+        "org.antlr.test.TestDFAConversion",
+        "org.antlr.test.TestDFAMatching",
+        "org.antlr.test.TestFastQueue",
+        "org.antlr.test.TestHeteroAST",
+        "org.antlr.test.TestInterpretedLexing",
+        "org.antlr.test.TestInterpretedParsing",
+        "org.antlr.test.TestIntervalSet",
+        "org.antlr.test.TestJavaCodeGeneration",
+        "org.antlr.test.TestLeftRecursion",
+        "org.antlr.test.TestLexer",
+        "org.antlr.test.TestMessages",
+        "org.antlr.test.TestNFAConstruction",
+        "org.antlr.test.TestRewriteAST",
+        "org.antlr.test.TestRewriteTemplates",
+        "org.antlr.test.TestSemanticPredicateEvaluation",
+        "org.antlr.test.TestSemanticPredicates",
+        "org.antlr.test.TestSets",
+        "org.antlr.test.TestSymbolDefinitions",
+        "org.antlr.test.TestSyntacticPredicateEvaluation",
+        "org.antlr.test.TestSyntaxErrors",
+        "org.antlr.test.TestTemplates",
+        "org.antlr.test.TestTokenRewriteStream",
+        "org.antlr.test.TestTopologicalSort",
+        "org.antlr.test.TestTreeGrammarRewriteAST",
+        "org.antlr.test.TestTreeIterator",
+        "org.antlr.test.TestTreeNodeStream",
+        "org.antlr.test.TestTreeParsing",
+        "org.antlr.test.TestTrees",
+        "org.antlr.test.TestTreeWizard",
+    ],
+    javacopts = [
+        "-Xep:JUnit4RunWithMissing:OFF",
+    ],
+    main_class = "org.junit.runner.JUnitCore",
+    use_testrunner = False,
+    visibility = ["//:__pkg__"],
+    deps = [
+        ":tool_lib",
+        "//:java_runtime",
+        "@hamcrest_core//jar",
+        "@junit//jar",
+        "@stringtemplate4",
+    ],
+)


=====================================
tool/src/main/resources/org/antlr/codegen/templates/Cpp/Cpp.stg
=====================================
@@ -1007,7 +1007,7 @@ parser(	grammar,
 		bitsets,
 		ASTLabelType,
 		superClass="Parser",
-		labelType="ImplTraits::CommonTokenType*",
+		labelType="const ImplTraits::CommonTokenType*",
 		members={<actions.parser.members>}
 		) ::= <<
 <beginNamespace(actions)>


=====================================
tool/src/test/java/org/antlr/test/TestAutoAST.java
=====================================
@@ -369,7 +369,7 @@ public class TestAutoAST extends BaseTest {
 
 	@Test
     public void testSetRootWithLabel() throws Exception {
-		
+
 		String grammar =
 			"grammar T;\n" +
 			"options {output=AST;}\n" +
@@ -807,7 +807,7 @@ public class TestAutoAST extends BaseTest {
 
 	// S U P P O R T
 
-	public void _test() throws Exception {
+	private void _test() throws Exception {
 		String grammar =
 			"grammar T;\n" +
 			"options {output=AST;}\n" +


=====================================
tool/src/test/java/org/antlr/test/TestCharDFAConversion.java
=====================================
@@ -499,7 +499,7 @@ public class TestCharDFAConversion extends BaseTest {
 
 	// S U P P O R T
 
-	public void _template() throws Exception {
+	private void _template() throws Exception {
 		Grammar g = new Grammar(
 			"grammar T;\n"+
 			"a : A | B;");


=====================================
tool/src/test/java/org/antlr/test/TestDFAConversion.java
=====================================
@@ -1524,7 +1524,7 @@ As a result, alternative(s) 2 were disabled for that input
 
 	// S U P P O R T
 
-	public void _template() throws Exception {
+	private void _template() throws Exception {
 		Grammar g = new Grammar(
 			"parser grammar t;\n"+
 			"a : A | B;");


=====================================
tool/src/test/java/org/antlr/test/TestSemanticPredicateEvaluation.java
=====================================
@@ -225,7 +225,7 @@ public class TestSemanticPredicateEvaluation extends BaseTest {
 
 	// S U P P O R T
 
-	public void _test() throws Exception {
+	private void _test() throws Exception {
 		String grammar =
 			"grammar T;\n" +
 			"options {output=AST;}\n" +


=====================================
tool/src/test/java/org/antlr/test/TestSemanticPredicates.java
=====================================
@@ -185,7 +185,7 @@ public class TestSemanticPredicates extends BaseTest {
 			".s1-B->:s2=>1\n";
 		checkDecision(g, 1, expecting, new int[] {2},
 					  new int[] {1,2}, "A B", new int[] {1}, null, 3);
-	}	
+	}
 	 */
 
 	@Test public void testHoist2() throws Exception {
@@ -768,7 +768,7 @@ public class TestSemanticPredicates extends BaseTest {
 
 	// S U P P O R T
 
-	public void _template() throws Exception {
+	private void _template() throws Exception {
 		Grammar g = new Grammar(
 			"parser grammar t;\n"+
 			"a : A | B;");



View it on GitLab: https://salsa.debian.org/java-team/antlr3/-/commit/26a0bd29acc0d069bbc4abbf2622cdffef2e6830

-- 
View it on GitLab: https://salsa.debian.org/java-team/antlr3/-/commit/26a0bd29acc0d069bbc4abbf2622cdffef2e6830
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20221212/55f08ce9/attachment.htm>


More information about the pkg-java-commits mailing list