You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2020/04/18 12:09:59 UTC

[groovy] branch master updated: some more tidy up after antlr2 removal

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new cc4016c  some more tidy up after antlr2 removal
cc4016c is described below

commit cc4016ccc666e54a305930728c09caac91ce9e00
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sat Apr 18 22:09:33 2020 +1000

    some more tidy up after antlr2 removal
---
 gradle/assemble.gradle                             |  3 -
 gradle/docs.gradle                                 |  3 +-
 licenses/LICENSE-BINZIP                            |  7 --
 licenses/LICENSE-JARJAR                            |  7 --
 licenses/LICENSE-SDK                               |  7 --
 licenses/antlr2-JARJAR.txt                         |  4 --
 licenses/antlr2-license.txt                        | 23 -------
 notices/NOTICE-BINZIP                              |  3 -
 notices/NOTICE-GROOIDJARJAR                        |  3 -
 notices/NOTICE-JARJAR                              |  3 -
 notices/NOTICE-SDK                                 |  3 -
 notices/antlr2-JARJAR.txt                          |  2 -
 .../java/org/codehaus/groovy/syntax/CSTNode.java   |  1 -
 .../java/org/codehaus/groovy/syntax/Reduction.java |  2 -
 .../java/org/codehaus/groovy/syntax/Token.java     |  2 -
 subprojects/parser-antlr4/README.adoc              | 74 ----------------------
 .../apache/groovy/parser/antlr4/TestUtils.groovy   |  7 +-
 17 files changed, 4 insertions(+), 150 deletions(-)

diff --git a/gradle/assemble.gradle b/gradle/assemble.gradle
index fd1d5ff..985529d 100644
--- a/gradle/assemble.gradle
+++ b/gradle/assemble.gradle
@@ -191,7 +191,6 @@ allprojects {
             from("$projectDir/licenses") {
                 into('licenses')
                 include('asm-license.txt')
-                include('antlr2-license.txt')
                 include('antlr4-license.txt')
             }
             from("$projectDir/notices/NOTICE-JARJAR")
@@ -223,7 +222,6 @@ allprojects {
                     'groovy/cli/picocli/OptionAccessor*.class'
             ]
             patterns = [
-                    'antlr.**': 'groovyjarjarantlr.@1', // antlr2
                     'org.antlr.**': 'groovyjarjarantlr4.@1', // antlr4
                     'org.objectweb.**': 'groovyjarjarasm.@1',
                     'picocli.**': 'groovyjarjarpicocli.@1'
@@ -421,7 +419,6 @@ ext.distSpec = copySpec {
     }
     into('licenses') {
         from 'licenses'
-        include 'antlr2-license.txt'
         include 'antlr4-license.txt'
         include 'asm-license.txt'
         include 'hamcrest-license.txt'
diff --git a/gradle/docs.gradle b/gradle/docs.gradle
index 4336dc8..a73b3e9 100644
--- a/gradle/docs.gradle
+++ b/gradle/docs.gradle
@@ -47,7 +47,7 @@ def javadocSpec = {
         source = '1.8'
         links('https://docs.oracle.com/javase/8/docs/api/', 'https://docs.oracle.com/javaee/7/api/',
                 'https://commons.apache.org/proper/commons-cli/javadocs/api-release/', 'https://junit.org/junit4/javadoc/latest/',
-                'https://docs.oracle.com/javaee/6/api/', 'https://www.antlr2.org/javadoc/')
+                'https://docs.oracle.com/javaee/6/api/')
     }
 }
 
@@ -64,7 +64,6 @@ def groovydocBaseSpec = {
     link 'https://docs.groovy-lang.org/docs/ant/api/', 'org.apache.ant.', 'org.apache.tools.ant.'
     link 'https://junit.org/junit4/javadoc/latest/', 'org.junit.', 'junit.'
     link 'https://junit.org/junit5/docs/current/api/', 'org.junit.jupiter.', 'org.junit.platform.'
-    link 'https://www.antlr2.org/javadoc/', 'antlr.'
     link 'https://www.antlr.org/api/Java/', 'org.antlr.v4.'
     link 'https://commons.apache.org/proper/commons-cli/javadocs/api-release/', 'org.apache.commons.cli.'
     link 'https://picocli.info/apidocs/', 'picocli.'
diff --git a/licenses/LICENSE-BINZIP b/licenses/LICENSE-BINZIP
index c55517e..9b7543f 100644
--- a/licenses/LICENSE-BINZIP
+++ b/licenses/LICENSE-BINZIP
@@ -203,13 +203,6 @@
 
 ------------------------------------------------------------------------
 
-ANTLR 2 License
-
-Antlr2 is released in the public domain.
-See licenses/antlr2-license.txt for details.
-
-------------------------------------------------------------------------
-
 ANTLR 4 License
 
 Antlr4 is released under a BSD 3-clause license.
diff --git a/licenses/LICENSE-JARJAR b/licenses/LICENSE-JARJAR
index 508934a..73c8c2a 100644
--- a/licenses/LICENSE-JARJAR
+++ b/licenses/LICENSE-JARJAR
@@ -203,13 +203,6 @@
 
 ------------------------------------------------------------------------
 
-ANTLR 2 License
-
-Antlr2 is released in the public domain.
-See licenses/antlr2-license.txt for details.
-
-------------------------------------------------------------------------
-
 ANTLR 4 License
 
 Antlr4 is released under a BSD 3-clause license.
diff --git a/licenses/LICENSE-SDK b/licenses/LICENSE-SDK
index 9046db5..1339c5c 100644
--- a/licenses/LICENSE-SDK
+++ b/licenses/LICENSE-SDK
@@ -203,13 +203,6 @@
 
 ------------------------------------------------------------------------
 
-ANTLR 2 License
-
-Antlr2 is released in the public domain.
-See licenses/antlr2-license.txt for details.
-
-------------------------------------------------------------------------
-
 ANTLR 4 License
 
 Antlr4 is released under a BSD 3-clause license.
diff --git a/licenses/antlr2-JARJAR.txt b/licenses/antlr2-JARJAR.txt
deleted file mode 100644
index 0f7177b..0000000
--- a/licenses/antlr2-JARJAR.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-ANTLR 2 License
-
-Antlr2 is released in the public domain.
-See licenses/antlr2-license.txt for details.
\ No newline at end of file
diff --git a/licenses/antlr2-license.txt b/licenses/antlr2-license.txt
deleted file mode 100644
index 3ce8ed2..0000000
--- a/licenses/antlr2-license.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-ANTLR 2 License
-
-We reserve no legal rights to the ANTLR--it is fully in the public domain. An individual or company may do
-whatever they wish with source code distributed with ANTLR or the code generated by ANTLR, including the
-incorporation of ANTLR, or its output, into commerical software.
-
-We encourage users to develop software with ANTLR. However, we do ask that credit is given to us for
-developing ANTLR. By "credit", we mean that if you use ANTLR or incorporate any source code into one of your
-programs (commercial product, research project, or otherwise) that you acknowledge this fact somewhere in
-the documentation, research report, etc... If you like ANTLR and have developed a nice tool with the output,
-please mention that you developed it using ANTLR. In addition, we ask that the headers remain intact in our
-source code. As long as these guidelines are kept, we expect to continue enhancing this system and expect to
-make other tools available as they are completed.
-
-In countries where the Public Domain status of the work may not be valid, the author grants a copyright
-licence to the general public to deal in the work without restriction and permission to sublicence derivates
-under the terms of any (OSI approved) Open Source licence.
-
-The Python parser generator code under antlr/actions/python/ is covered by the 3-clause BSD licence (this
-part is included in the binary JAR files); the run-time part under lib/python/ is covered by the GNU GPL,
-version 3 or later (this part is not included in the binary JAR files). See [1] for the full details.
-
-https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=750643#80%22
diff --git a/notices/NOTICE-BINZIP b/notices/NOTICE-BINZIP
index 16508d9..998a6c8 100644
--- a/notices/NOTICE-BINZIP
+++ b/notices/NOTICE-BINZIP
@@ -4,9 +4,6 @@ Copyright 2003-2020 The Apache Software Foundation
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
-This product includes/uses ANTLR2 (http://www.antlr2.org/)
-developed by Terence Parr 1989-2006
-
 This product includes/uses ANTLR4 (https://github.com/antlr/antlr4)
 Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
 
diff --git a/notices/NOTICE-GROOIDJARJAR b/notices/NOTICE-GROOIDJARJAR
index 340d7ab..f594942 100644
--- a/notices/NOTICE-GROOIDJARJAR
+++ b/notices/NOTICE-GROOIDJARJAR
@@ -4,9 +4,6 @@ Copyright 2003-2020 The Apache Software Foundation
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
-This product includes/uses ANTLR2 (http://www.antlr2.org/)
-developed by Terence Parr 1989-2006
-
 This product includes/uses ANTLR4 (https://github.com/antlr/antlr4)
 Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
 
diff --git a/notices/NOTICE-JARJAR b/notices/NOTICE-JARJAR
index f0c50ae..85908b7 100644
--- a/notices/NOTICE-JARJAR
+++ b/notices/NOTICE-JARJAR
@@ -4,8 +4,5 @@ Copyright 2003-2020 The Apache Software Foundation
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
-This product includes/uses ANTLR2 (http://www.antlr2.org/)
-developed by Terence Parr 1989-2006
-
 This product includes/uses ANTLR4 (https://github.com/antlr/antlr4)
 Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
\ No newline at end of file
diff --git a/notices/NOTICE-SDK b/notices/NOTICE-SDK
index dbde970..6fe5925 100644
--- a/notices/NOTICE-SDK
+++ b/notices/NOTICE-SDK
@@ -4,9 +4,6 @@ Copyright 2003-2020 The Apache Software Foundation
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
-This product includes/uses ANTLR2 (http://www.antlr2.org/)
-developed by Terence Parr 1989-2006
-
 This product includes/uses ANTLR4 (https://github.com/antlr/antlr4)
 Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
 
diff --git a/notices/antlr2-JARJAR.txt b/notices/antlr2-JARJAR.txt
deleted file mode 100644
index da96f51..0000000
--- a/notices/antlr2-JARJAR.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This product includes/uses ANTLR2 (http://www.antlr2.org/)
-developed by Terence Parr 1989-2006
diff --git a/src/main/java/org/codehaus/groovy/syntax/CSTNode.java b/src/main/java/org/codehaus/groovy/syntax/CSTNode.java
index e074681..14f70ad 100644
--- a/src/main/java/org/codehaus/groovy/syntax/CSTNode.java
+++ b/src/main/java/org/codehaus/groovy/syntax/CSTNode.java
@@ -30,7 +30,6 @@ import java.io.Writer;
  * the result of parsing.  Note that the CSTNode is inextricably linked
  * with the Token in that every CSTNode has a Token as it's root.
  *
- * @see antlr.Parser
  * @see Token
  * @see org.codehaus.groovy.syntax.Reduction
  * @see org.codehaus.groovy.syntax.Types
diff --git a/src/main/java/org/codehaus/groovy/syntax/Reduction.java b/src/main/java/org/codehaus/groovy/syntax/Reduction.java
index 446d123..211c31d 100644
--- a/src/main/java/org/codehaus/groovy/syntax/Reduction.java
+++ b/src/main/java/org/codehaus/groovy/syntax/Reduction.java
@@ -24,11 +24,9 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
-
 /**
  * A syntax reduction, produced by the <code>Parser</code>.
  *
- * @see antlr.Parser
  * @see Token
  * @see CSTNode
  * @see Types
diff --git a/src/main/java/org/codehaus/groovy/syntax/Token.java b/src/main/java/org/codehaus/groovy/syntax/Token.java
index db686cc..7d55d58 100644
--- a/src/main/java/org/codehaus/groovy/syntax/Token.java
+++ b/src/main/java/org/codehaus/groovy/syntax/Token.java
@@ -23,8 +23,6 @@ import org.codehaus.groovy.GroovyBugError;
 /**
  * A <code>CSTNode</code> produced by the <code>Lexer</code>.
  *
- * @see antlr.Parser
- * @see antlr.Token
  * @see Reduction
  * @see Types
  */
diff --git a/subprojects/parser-antlr4/README.adoc b/subprojects/parser-antlr4/README.adoc
deleted file mode 100644
index 4534d97..0000000
--- a/subprojects/parser-antlr4/README.adoc
+++ /dev/null
@@ -1,74 +0,0 @@
-//////////////////////////////////////////
-
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
-
-//////////////////////////////////////////
-
-== This is the home of the new parser Parrot, which is based on Antlr4.
-
-The new parser(Parrot) can parse Groovy source code and construct the related AST, which is almost identical to the one generated by the old parser(except the corrected node position, e.g. line, column of node). Currently all features of Groovy are available. In addition, **the following new features have been added:**
-
-* do-while loops; enhanced (now supporting commas) classic for loops, e.g. `for(int i = 0, j = 10; i < j; i++, j--) {..}`)
-* lambda expressions, e.g. `stream.map(e -> e + 1)`
-* method references and constructor references
-* try-with-resources, AKA ARM
-* code blocks, i.e. `{..}`
-* Java style array initializers, e.g. `new int[] {1, 2, 3}`
-* default methods within interfaces
-* additional places for type annotations
-* new operators: identity operators(`===`, `!==`), elvis assignment(`?=`), `!in`, `!instanceof`
-* safe index, e.g. `nullableVar?[1, 2]`
-* non-static inner class instantiation, e.g. `outer.new Inner()`
-* runtime groovydoc, i.e. groovydoc with `@Groovydoc`; groovydoc attached to AST node as metadata
-
-=== JVM system properties to control parsing
-
-* `groovy.antlr4.cache.threshold`: how frequently to clear DFA cache(default: 64). **Notice:** The more frequently the DFA cache is cleared, the poorer parsing performance will be(you can not set the value that is less than the default value). But the DFA cache has to be cleared to avoid OutOfMemoryError's occurring.
-* `groovy.clear.lexer.dfa.cache`: whether to clear the dfa cache of lexer(default: false)
-* `groovy.attach.groovydoc`: whether to attach groovydoc to node as metadata while parsing groovy source code(default: false)
-* `groovy.attach.runtime.groovydoc`: whether to attach `@Groovydoc` annotation to all members which have groovydoc(i.e. `/** ... */`)
-* `groovy.extract.doc.comment`: whether to collect groovydoc while parsing groovy source code(default: false). **DEPRECATED, USE `groovy.attach.groovydoc` INSTEAD**
-
-*P.S. Parrot is based on the highly optimized version of antlr4(com.tunnelvisionlabs:antlr4), which is licensed under BSD.*
-
-=== FAQ
-
-===== Question(from Slack):
-```
-Can someone explain to me the importance of the Parrot compiler? Basically explain like I am 5?
-```
-===== Answer(by Guillaume Laforge, Project Lead of Apache Groovy):
-```
-the syntax of Groovy hasn’t evolved in a long time
-the current / old parser is a bit complicated to evolve
-and is using a very old version of the parsing library
-so any change we’d want to make to the language (a new operator, for example) becomes very complicated
-So we’ve been wanting to upgrade the underlying parser library for a while, but since the library evolved a lot, that also required a rewrite of the grammar of the language
-But there’s another thing to consider
-Groovy’s always been adopted by Java developers easily because of how close to the Java syntax it’s always been
-so most Java programs are also valid Groovy programs
-it’s been important to Groovy’s success to have this source compatibility
-Java 8's been out for a while already
-and we’ve been asked countless times if we’d support this or that particular syntax enhancement from Java 8
-for “copy’n paste compatibility”, if you will
-We decided to upgrade to a newer version of our parsing library (from v2 to v4 of Antlr)
-to allow Groovy’s syntax to continue to evolve
-to also support new operators and things like that
-but to also support Java 8 constructs, for continued compatibility
-And that’s about it
-```
\ No newline at end of file
diff --git a/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/TestUtils.groovy b/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/TestUtils.groovy
index d805dbc..6dc881d 100644
--- a/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/TestUtils.groovy
+++ b/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/TestUtils.groovy
@@ -185,7 +185,7 @@ final class TestUtils {
     }
 
     static void doRunAndTest(String path) {
-        doRunAndTestAntlr2(path)
+//        doRunAndTestAntlr2(path)
         doRunAndTestAntlr4(path)
     }
 
@@ -194,7 +194,7 @@ final class TestUtils {
     }
 
     static void doRunAndTestAntlr2(String path, CompilerConfiguration compilerConfiguration = CompilerConfiguration.DEFAULT) {
-//        assert executeScript(createAntlr2Shell(compilerConfiguration), "$RESOURCES_PATH/$path")
+        throw new UnsupportedOperationException("Antlr2 is no longer supported")
     }
 
     static GroovyShell createAntlr4Shell(CompilerConfiguration compilerConfiguration = CompilerConfiguration.DEFAULT) {
@@ -202,8 +202,7 @@ final class TestUtils {
     }
 
     static GroovyShell createAntlr2Shell(CompilerConfiguration compilerConfiguration = CompilerConfiguration.DEFAULT) {
-        return null
-//        return new GroovyShell(getAntlr2Config(compilerConfiguration))
+        throw new UnsupportedOperationException("Antlr2 is no longer supported")
     }
 
     //--------------------------------------------------------------------------