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 2017/05/10 22:26:29 UTC

[01/50] [abbrv] groovy git commit: refactor(idea): set language level to 1.8

Repository: groovy
Updated Branches:
  refs/heads/parrot 3caf3a458 -> 35f0fa07e


refactor(idea): set language level to 1.8


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/7cfaa270
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/7cfaa270
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/7cfaa270

Branch: refs/heads/parrot
Commit: 7cfaa270730fa6de2a3d10f423a9efa53d3b0022
Parents: 4275767
Author: John Wagenleitner <jw...@apache.org>
Authored: Sat Apr 22 08:31:50 2017 -0700
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:03:18 2017 +1000

----------------------------------------------------------------------
 gradle/idea.gradle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/7cfaa270/gradle/idea.gradle
----------------------------------------------------------------------
diff --git a/gradle/idea.gradle b/gradle/idea.gradle
index 21af30f..f8fa6ea 100644
--- a/gradle/idea.gradle
+++ b/gradle/idea.gradle
@@ -48,7 +48,7 @@ idea {
 
                 // jdk, language level fix
                 def pRoot = node.component.find { it.'@name' == 'ProjectRootManager' }
-                pRoot.'@languageLevel' = 'JDK_1_7'
+                pRoot.'@languageLevel' = 'JDK_1_8'
                 pRoot.'@project-jdk-name' = '1.8'
 
                 // Use git


[21/50] [abbrv] groovy git commit: Clarify documentation around indy (closes #530)

Posted by pa...@apache.org.
Clarify documentation around indy (closes #530)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/518dca1f
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/518dca1f
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/518dca1f

Branch: refs/heads/parrot
Commit: 518dca1fed848844bd0a8dfb7f5c53d8a2803850
Parents: 046c6aa
Author: John Wagenleitner <jw...@apache.org>
Authored: Sun Apr 30 11:07:34 2017 -0700
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:10:17 2017 +1000

----------------------------------------------------------------------
 src/spec/doc/invokedynamic-support.adoc | 31 ++++++++++++++++++----------
 1 file changed, 20 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/518dca1f/src/spec/doc/invokedynamic-support.adoc
----------------------------------------------------------------------
diff --git a/src/spec/doc/invokedynamic-support.adoc b/src/spec/doc/invokedynamic-support.adoc
index 944d938..9b0bc70 100644
--- a/src/spec/doc/invokedynamic-support.adoc
+++ b/src/spec/doc/invokedynamic-support.adoc
@@ -24,11 +24,10 @@
 
 == Foreword
 
-Since Groovy 2.0, we added support for the JVM http://docs.oracle.com/javase/7/docs/technotes/guides/vm/multiple-language-support.html#invokedynamic[invokedynamic] instruction. This instruction is supported since Java 7 and is a new bytecode instruction in the JVM that allows easier implementation of dynamic languages. This instruction will also be used internally, by the JVM, for the lambda support in Java 8.
+Since Groovy 2.0, support was added for the JVM http://docs.oracle.com/javase/7/docs/technotes/guides/vm/multiple-language-support.html#invokedynamic[invokedynamic] instruction. This instruction is supported since Java 7 and is a new bytecode instruction in the JVM that allows easier implementation of dynamic languages. This instruction will also be used internally, by the JVM, for the lambda support in Java 8.
 
 This means that unlike APIs, AST transformations or syntactic sugar, this feature is **not visible** to the developer or the end user. It is a compilation and runtime feature only. This means that given two programs written in Groovy, you have the choice to compile it with or without invokedynamic support. Whatever you choose, it comes with pros and cons:
 
-- call site caching, as implemented in "normal" Groovy is replaced with invokedynamic since Groovy 2.1
 - it is possible to mix classes compiled with and without invokedynamic in the same project, as long as you run JDK 1.7+
 - depending on the JVM (even different minor versions of the JVM), you can target close to Java performance for dynamic Groovy with invokedynamic support activated
 
@@ -38,15 +37,20 @@ This means that unlike APIs, AST transformations or syntactic sugar, this featur
 
 The Groovy distribution comes with **two** jars:
 
-- groovy-x.y.z.jar : makes use of call site caching
-- groovy-x-y-z-indy.jar : has invokedynamic support bundled, old call site caching still possible
+- groovy-x.y.z.jar : contains Groovy sources compiled with call site caching
+- groovy-x-y-z-indy.jar : contains Groovy sources compiled with invokedynamic instructions
 
-The first jar is Groovy compiled without invokedynamic support, while the second one has invokedynamic support bundled. As Groovy core and the groovy modules are sometimes written in Groovy, we currently have no choice but issuing two distinct versions of Groovy. This means that if you pick the "normal" jar, the groovy classes of groovy itself are compiled with call site caching (1.5+), while if you use the "indy" jar, the groovy classes of groovy itself are compiled using invokedynamic. This means that the invokedynamic version of Groovy doesn't make use of the old call site caching mechanism.
+As Groovy core and the Groovy modules are sometimes written in Groovy, we currently have no choice but to distribute two
+distinct versions of Groovy. This means that if you pick the "normal" jar, the Groovy classes of Groovy itself are
+compiled with call site caching (1.6+), while if you use the "indy" jar, the Groovy classes of Groovy itself are
+compiled using invokedynamic.
 
-Both jars contain a fully working groovy implementation. They are mutually exclusive (don't put both on classpath).
+Both jars contain a fully working Groovy implementation that is capable of compiling user supplied Groovy sources using either
+invokedynamic or call site caching. The sets of jars are mutually exclusive (don't put both on classpath) and the key difference between
+them has to do with how the Groovy source files that make up Groovy itself are compiled.
 
 === Command-line and indy
-If you download the distribution and that you use the command line, it's always the "normal" version of Groovy which is picked up in classpath. This means that whatever command you use (`groovy`, `groovyc`, `groovysh` or `groovyConsole`), invokedynamic support is not available out of the box. To use the invokedynamic version, you have to switch the jars manually. The distribution makes use of the jars in the ++lib++ directory, while the indy jars are available in the ++indy++ directory. You have three things to do:
+If you download the distribution and use the command line, it's always the "normal" version of Groovy which is picked up in classpath. This means that whatever command you use (`groovy`, `groovyc`, `groovysh` or `groovyConsole`), invokedynamic support is not available out of the box. To use a Groovy distribution that was compiled with invokedynamic for its Groovy sources you have to switch the jars manually. The distribution makes use of the jars in the ++lib++ directory, while the indy jars are available in the ++indy++ directory. You have three things to do:
 
 - remove or rename the groovy-*.jar files in the lib directory
 - replace them with the indy version from the indy directory
@@ -59,9 +63,14 @@ Here's a bash script that would do it all at once:
 $ for f in `ls lib/groovy*.jar | cut -d/ -f2`;do k=`basename $f .jar`; mv lib/$k.jar lib/$k.jar.old; cp indy/$k-indy.jar lib/$k.jar ; done
 ----
 
+== Running groovy script from command line
+
+The usual way to run a script from the command line is by `groovy foo.groovy`, where `foo.groovy` is the Groovy program
+in source form. To use indy for this you have to use the indy compilation flag, `groovy --indy foo.groovy`.
+
 == The compilation flag
 
-Independently of the jar version that you use (and after having exchanged the jars as described), invokedynamic support requires a specific compilation flag (__indy__). If you want to compile your classes with invokedynamic support, this flag must be set at compile time. The following tables show you what happens with user compiled classes and groovy core classes depending on the jar you use and the compilation flag:
+Independently of the jar version that you use (and after having exchanged the jars as described), invokedynamic support requires a specific compilation flag (__indy__). If you want to compile your classes with invokedynamic support, this flag must be set at compile time. The following tables show you what happens with user compiled classes and Groovy core classes depending on the jar you use and the compilation flag:
 
 [cols="1,1,1" options="header"]
 .user compiled classes
@@ -72,7 +81,7 @@ Independently of the jar version that you use (and after having exchanged the ja
 
 |normal jar
 |call site caching
-|N/A
+|invokedynamic
 
 |indy jar
 |call site caching
@@ -80,7 +89,7 @@ Independently of the jar version that you use (and after having exchanged the ja
 |===
 
 [cols="1,1,1" options="header"]
-.core groovy classes
+.core Groovy classes
 |===
 |indy flag
 |**off**
@@ -88,7 +97,7 @@ Independently of the jar version that you use (and after having exchanged the ja
 
 |normal jar
 |call site caching
-|N/A
+|call site caching
 
 |indy jar
 |invokedynamic


[47/50] [abbrv] groovy git commit: rename antlr4 parser to remove groovy- prefix since that is by convention for modules

Posted by pa...@apache.org.
rename antlr4 parser to remove groovy- prefix since that is by convention for modules


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/2c01e99f
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/2c01e99f
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/2c01e99f

Branch: refs/heads/parrot
Commit: 2c01e99f33be6d056ca87220e7ea9fe09ef575d3
Parents: a87e465
Author: paulk <pa...@asert.com.au>
Authored: Mon May 8 10:26:36 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:25:33 2017 +1000

----------------------------------------------------------------------
 build.gradle                                    |    2 +-
 settings.gradle                                 |    1 -
 subprojects/groovy-parser-antlr4/README.adoc    |   59 -
 subprojects/groovy-parser-antlr4/build.gradle   |   70 -
 .../apache/groovy/parser/antlr4/GroovyLexer.g4  |  882 ----
 .../apache/groovy/parser/antlr4/GroovyParser.g4 | 1270 ------
 .../parser/antlr4/util/GroovyTestRig.groovy     |   74 -
 .../apache/groovy/parser/AbstractParser.java    |   83 -
 .../org/apache/groovy/parser/Antlr2Parser.java  |   34 -
 .../org/apache/groovy/parser/Antlr4Parser.java  |   39 -
 .../groovy/parser/antlr4/AbstractLexer.java     |   32 -
 .../groovy/parser/antlr4/AbstractParser.java    |   32 -
 .../parser/antlr4/Antlr4ParserPlugin.java       |   45 -
 .../parser/antlr4/Antlr4PluginFactory.java      |   35 -
 .../apache/groovy/parser/antlr4/AstBuilder.java | 4317 ------------------
 .../groovy/parser/antlr4/GroovyLangLexer.java   |   63 -
 .../groovy/parser/antlr4/GroovyLangParser.java  |   38 -
 .../groovy/parser/antlr4/GroovySyntaxError.java |   53 -
 .../groovy/parser/antlr4/GroovydocManager.java  |  183 -
 .../groovy/parser/antlr4/ModifierManager.java   |  198 -
 .../groovy/parser/antlr4/ModifierNode.java      |  164 -
 .../groovy/parser/antlr4/PositionInfo.java      |   73 -
 .../parser/antlr4/SemanticPredicates.java       |  152 -
 .../parser/antlr4/SyntaxErrorReportable.java    |   58 -
 .../TryWithResourcesASTTransformation.java      |  370 --
 .../parser/antlr4/internal/AtnManager.java      |  107 -
 .../internal/DescriptiveErrorStrategy.java      |  110 -
 .../groovy/parser/antlr4/util/StringUtils.java  |  149 -
 .../parser/antlr4/GroovyParserTest.groovy       |  368 --
 .../groovy/parser/antlr4/SyntaxErrorTest.groovy |  181 -
 .../groovy/parser/antlr4/TestUtils.groovy       |  259 --
 .../antlr4/util/ASTComparatorCategory.groovy    |  526 ---
 .../groovy/parser/antlr4/util/AstDumper.groovy  | 1025 -----
 .../test/resources/bugs/BUG-GROOVY-2324.groovy  |   23 -
 .../test/resources/bugs/BUG-GROOVY-4438.groovy  |   26 -
 .../test/resources/bugs/BUG-GROOVY-4757.groovy  |   27 -
 .../test/resources/bugs/BUG-GROOVY-4762.groovy  |   27 -
 .../test/resources/bugs/BUG-GROOVY-5318.groovy  |   19 -
 .../test/resources/bugs/BUG-GROOVY-5652.groovy  |   24 -
 .../test/resources/bugs/BUG-GROOVY-6038.groovy  |   37 -
 .../test/resources/bugs/BUG-GROOVY-8150.groovy  |   21 -
 .../test/resources/bugs/BUG-GROOVY-8161.groovy  |   20 -
 .../src/test/resources/bugs/GROOVY-3898.groovy  |   26 -
 .../core/AnnotationDeclaration_01.groovy        |   57 -
 .../test/resources/core/Annotation_01.groovy    |   19 -
 .../test/resources/core/Annotation_02.groovy    |   20 -
 .../test/resources/core/Annotation_03.groovy    |   21 -
 .../test/resources/core/Annotation_04.groovy    |   20 -
 .../test/resources/core/Annotation_05.groovy    |   19 -
 .../test/resources/core/Annotation_06.groovy    |   20 -
 .../test/resources/core/Annotation_07.groovy    |   20 -
 .../test/resources/core/Annotation_08.groovy    |   28 -
 .../test/resources/core/Annotation_09.groovy    |   32 -
 .../test/resources/core/Annotation_10x.groovy   |   38 -
 .../src/test/resources/core/Array_01x.groovy    |  104 -
 .../src/test/resources/core/Assert_01.groovy    |   46 -
 .../src/test/resources/core/Assert_02x.groovy   |   55 -
 .../src/test/resources/core/Assert_03x.groovy   |   44 -
 .../resources/core/BreakingChange_01x.groovy    |   42 -
 .../resources/core/BreakingChange_02x.groovy    |   27 -
 .../resources/core/BreakingChange_03x.groovy    |   34 -
 .../resources/core/BreakingChange_04x.groovy    |   44 -
 .../resources/core/ClassDeclaration_01.groovy   |   73 -
 .../resources/core/ClassDeclaration_02.groovy   |   60 -
 .../resources/core/ClassDeclaration_03.groovy   |   69 -
 .../resources/core/ClassDeclaration_04.groovy   |   40 -
 .../resources/core/ClassDeclaration_05.groovy   |   38 -
 .../resources/core/ClassDeclaration_06.groovy   |  101 -
 .../resources/core/ClassDeclaration_07.groovy   |   45 -
 .../src/test/resources/core/Closure_01.groovy   |   19 -
 .../src/test/resources/core/Closure_02.groovy   |   19 -
 .../src/test/resources/core/Closure_03.groovy   |   19 -
 .../src/test/resources/core/Closure_04.groovy   |   21 -
 .../src/test/resources/core/Closure_05.groovy   |   21 -
 .../src/test/resources/core/Closure_06.groovy   |   27 -
 .../src/test/resources/core/Closure_07.groovy   |   21 -
 .../src/test/resources/core/Closure_08.groovy   |   34 -
 .../src/test/resources/core/Closure_09.groovy   |   34 -
 .../src/test/resources/core/Closure_10.groovy   |   22 -
 .../test/resources/core/CodeBlock_01x.groovy    |   42 -
 .../src/test/resources/core/Command_01.groovy   |   36 -
 .../src/test/resources/core/Command_02.groovy   |   29 -
 .../src/test/resources/core/Command_03.groovy   |   84 -
 .../src/test/resources/core/Command_04.groovy   |   25 -
 .../src/test/resources/core/Command_05.groovy   |   77 -
 .../src/test/resources/core/Command_06x.groovy  |   26 -
 .../src/test/resources/core/Comments_01.groovy  |   46 -
 .../src/test/resources/core/Comments_02.groovy  |  135 -
 .../resources/core/DefaultMethod_01x.groovy     |   39 -
 .../resources/core/DefaultMethod_02x.groovy     |   54 -
 .../src/test/resources/core/DoWhile_01x.groovy  |   25 -
 .../src/test/resources/core/DoWhile_02x.groovy  |   26 -
 .../src/test/resources/core/DoWhile_03x.groovy  |   29 -
 .../src/test/resources/core/DoWhile_04x.groovy  |   32 -
 .../resources/core/ElvisAssignment_01x.groovy   |   56 -
 .../resources/core/EnumDeclaration_01.groovy    |   62 -
 .../resources/core/EnumDeclaration_02.groovy    |   70 -
 .../resources/core/EnumDeclaration_03.groovy    |   24 -
 .../resources/core/EnumDeclaration_04.groovy    |   22 -
 .../resources/core/EnumDeclaration_05.groovy    |   22 -
 .../test/resources/core/Expression_01.groovy    |  248 -
 .../test/resources/core/Expression_02.groovy    |   24 -
 .../test/resources/core/Expression_03.groovy    |   49 -
 .../test/resources/core/Expression_04.groovy    |   80 -
 .../test/resources/core/Expression_05.groovy    |   58 -
 .../test/resources/core/Expression_06.groovy    |   24 -
 .../test/resources/core/Expression_07.groovy    |   27 -
 .../test/resources/core/Expression_08.groovy    |   24 -
 .../test/resources/core/Expression_09.groovy    |   34 -
 .../test/resources/core/Expression_10.groovy    |   43 -
 .../test/resources/core/Expression_11.groovy    |   34 -
 .../test/resources/core/Expression_12.groovy    |   35 -
 .../test/resources/core/Expression_13.groovy    |   63 -
 .../test/resources/core/Expression_14.groovy    |   40 -
 .../test/resources/core/Expression_15.groovy    |  145 -
 .../test/resources/core/Expression_16.groovy    |   40 -
 .../test/resources/core/Expression_17.groovy    |  159 -
 .../test/resources/core/Expression_18.groovy    |   44 -
 .../test/resources/core/Expression_19.groovy    |   50 -
 .../test/resources/core/Expression_20.groovy    |   20 -
 .../test/resources/core/Expression_21x.groovy   |   24 -
 .../test/resources/core/Expression_22x.groovy   |   29 -
 .../test/resources/core/Expression_23x.groovy   |  115 -
 .../src/test/resources/core/For_01.groovy       |   73 -
 .../src/test/resources/core/For_02.groovy       |   54 -
 .../src/test/resources/core/For_03.groovy       |   55 -
 .../src/test/resources/core/For_04x.groovy      |   54 -
 .../src/test/resources/core/For_05x.groovy      |   56 -
 .../src/test/resources/core/GString_01.groovy   |   48 -
 .../src/test/resources/core/GString_02.groovy   |   77 -
 .../src/test/resources/core/GString_03.groovy   |   67 -
 .../src/test/resources/core/GString_04.groovy   |   19 -
 .../src/test/resources/core/GString_05.groovy   |   19 -
 .../src/test/resources/core/GString_06.groovy   |   19 -
 .../test/resources/core/Groovydoc_01x.groovy    |   70 -
 .../test/resources/core/IdenticalOp_01x.groovy  |   28 -
 .../src/test/resources/core/IfElse_01.groovy    |   62 -
 .../resources/core/ImportDeclaration_01.groovy  |   19 -
 .../resources/core/ImportDeclaration_02.groovy  |   19 -
 .../resources/core/ImportDeclaration_03.groovy  |   22 -
 .../resources/core/ImportDeclaration_04.groovy  |   23 -
 .../resources/core/ImportDeclaration_05.groovy  |   19 -
 .../resources/core/ImportDeclaration_06.groovy  |   21 -
 .../resources/core/ImportDeclaration_07.groovy  |   24 -
 .../resources/core/ImportDeclaration_08.groovy  |   46 -
 .../core/InterfaceDeclaration_01.groovy         |   54 -
 .../core/InterfaceDeclaration_02.groovy         |   60 -
 .../core/InterfaceDeclaration_03.groovy         |   25 -
 .../src/test/resources/core/Label_01.groovy     |   33 -
 .../src/test/resources/core/Lambda_01x.groovy   |   66 -
 .../src/test/resources/core/List_01.groovy      |   33 -
 .../src/test/resources/core/Literal_01.groovy   |   97 -
 .../src/test/resources/core/Literal_02.groovy   |   66 -
 .../src/test/resources/core/Literal_03.groovy   |   21 -
 .../core/LocalVariableDeclaration_01.groovy     |  128 -
 .../src/test/resources/core/Map_01.groovy       |   47 -
 .../resources/core/MethodDeclaration_01.groovy  |   50 -
 .../resources/core/MethodDeclaration_02.groovy  |   59 -
 .../resources/core/MethodPointer_01x.groovy     |   23 -
 .../resources/core/MethodReference_01x.groovy   |  103 -
 .../core/NegativeRelationalOperators_01x.groovy |   39 -
 .../core/NegativeRelationalOperators_02x.groovy |   36 -
 .../resources/core/PackageDeclaration_01.groovy |   19 -
 .../resources/core/PackageDeclaration_02.groovy |   19 -
 .../resources/core/PackageDeclaration_03.groovy |   19 -
 .../resources/core/PackageDeclaration_04.groovy |   38 -
 .../resources/core/PackageDeclaration_05.groovy |   41 -
 .../resources/core/PackageDeclaration_06.groovy |   19 -
 .../src/test/resources/core/Return_01.groovy    |   26 -
 .../test/resources/core/SafeIndex_01x.groovy    |   28 -
 .../test/resources/core/SafeIndex_02x.groovy    |   65 -
 .../test/resources/core/SafeIndex_03x.groovy    |  298 --
 .../src/test/resources/core/Script_01x.groovy   |   23 -
 .../src/test/resources/core/Switch_01.groovy    |   78 -
 .../test/resources/core/Synchronized_01.groovy  |   54 -
 .../src/test/resources/core/Throw_01.groovy     |   20 -
 .../resources/core/TraitDeclaration_01.groovy   |   60 -
 .../resources/core/TraitDeclaration_02.groovy   |   58 -
 .../resources/core/TraitDeclaration_03.groovy   |   66 -
 .../resources/core/TraitDeclaration_04.groovy   |   46 -
 .../resources/core/TraitDeclaration_05.groovy   |   41 -
 .../src/test/resources/core/TryCatch_01.groovy  |  130 -
 .../resources/core/TryWithResources_01x.groovy  |  284 --
 .../src/test/resources/core/Unicode_01.groovy   |   42 -
 .../src/test/resources/core/While_01.groovy     |   76 -
 .../src/test/resources/core/While_02x.groovy    |   23 -
 .../resources/fail/AbstractMethod_01x.groovy    |   21 -
 .../resources/fail/AbstractMethod_02x.groovy    |   22 -
 .../resources/fail/AbstractMethod_03x.groovy    |   21 -
 .../resources/fail/AbstractMethod_04x.groovy    |   19 -
 .../resources/fail/AbstractMethod_05x.groovy    |   19 -
 .../resources/fail/AbstractMethod_06x.groovy    |   19 -
 .../src/test/resources/fail/Break_01x.groovy    |   19 -
 .../src/test/resources/fail/Break_02x.groovy    |   21 -
 .../resources/fail/ClassDeclaration_01x.groovy  |   25 -
 .../fail/ClosureListExpression_01.groovy        |   19 -
 .../fail/ClosureListExpression_02.groovy        |   19 -
 .../fail/ClosureListExpression_03.groovy        |   19 -
 .../fail/ClosureListExpression_04.groovy        |   28 -
 .../fail/ConstructorDeclaration_01.groovy       |   19 -
 .../src/test/resources/fail/Continue_01x.groovy |   19 -
 .../src/test/resources/fail/Continue_02x.groovy |   21 -
 .../src/test/resources/fail/DoWhile_01x.groovy  |   22 -
 .../test/resources/fail/Expression_01.groovy    |   19 -
 .../test/resources/fail/Expression_02.groovy    |   19 -
 .../test/resources/fail/Expression_03.groovy    |   19 -
 .../test/resources/fail/Expression_04.groovy    |   19 -
 .../test/resources/fail/Expression_05.groovy    |   19 -
 .../test/resources/fail/Expression_06.groovy    |   19 -
 .../test/resources/fail/Expression_07.groovy    |   19 -
 .../test/resources/fail/Expression_08.groovy    |   19 -
 .../test/resources/fail/Expression_09.groovy    |   19 -
 .../src/test/resources/fail/For_01.groovy       |   19 -
 .../src/test/resources/fail/For_02.groovy       |   19 -
 .../fail/InterfaceDeclaration_01.groovy         |   21 -
 .../src/test/resources/fail/List_01.groovy      |   19 -
 .../fail/LocalVariableDeclaration_01.groovy     |   19 -
 .../resources/fail/MethodDeclaration_01.groovy  |   23 -
 .../src/test/resources/fail/Modifier_01x.groovy |   19 -
 .../src/test/resources/fail/Modifier_02x.groovy |   19 -
 .../src/test/resources/fail/Modifier_03x.groovy |   19 -
 .../src/test/resources/fail/Modifier_04x.groovy |   21 -
 .../src/test/resources/fail/Modifier_05x.groovy |   21 -
 .../src/test/resources/fail/Modifier_07.groovy  |   19 -
 .../resources/fail/ParExpression_01x.groovy     |   19 -
 .../resources/fail/ParExpression_02x.groovy     |   19 -
 .../resources/fail/ParExpression_03x.groovy     |   19 -
 .../test/resources/fail/Parentheses_01.groovy   |   20 -
 .../src/test/resources/fail/Super_01x.groovy    |   24 -
 .../src/test/resources/fail/Switch_01.groovy    |   27 -
 .../src/test/resources/fail/This_01x.groovy     |   26 -
 .../fail/UnexpectedCharacter_01x.groovy         |   19 -
 .../src/test/resources/fail/Void_01x.groovy     |   21 -
 .../src/test/resources/fail/Void_02x.groovy     |   23 -
 subprojects/parser-antlr4/README.adoc           |   59 +
 subprojects/parser-antlr4/build.gradle          |   70 +
 .../apache/groovy/parser/antlr4/GroovyLexer.g4  |  882 ++++
 .../apache/groovy/parser/antlr4/GroovyParser.g4 | 1270 ++++++
 .../parser/antlr4/util/GroovyTestRig.groovy     |   74 +
 .../apache/groovy/parser/AbstractParser.java    |   83 +
 .../org/apache/groovy/parser/Antlr2Parser.java  |   34 +
 .../org/apache/groovy/parser/Antlr4Parser.java  |   39 +
 .../groovy/parser/antlr4/AbstractLexer.java     |   32 +
 .../groovy/parser/antlr4/AbstractParser.java    |   32 +
 .../parser/antlr4/Antlr4ParserPlugin.java       |   45 +
 .../parser/antlr4/Antlr4PluginFactory.java      |   35 +
 .../apache/groovy/parser/antlr4/AstBuilder.java | 4317 ++++++++++++++++++
 .../groovy/parser/antlr4/GroovyLangLexer.java   |   63 +
 .../groovy/parser/antlr4/GroovyLangParser.java  |   38 +
 .../groovy/parser/antlr4/GroovySyntaxError.java |   53 +
 .../groovy/parser/antlr4/GroovydocManager.java  |  183 +
 .../groovy/parser/antlr4/ModifierManager.java   |  198 +
 .../groovy/parser/antlr4/ModifierNode.java      |  164 +
 .../groovy/parser/antlr4/PositionInfo.java      |   73 +
 .../parser/antlr4/SemanticPredicates.java       |  152 +
 .../parser/antlr4/SyntaxErrorReportable.java    |   58 +
 .../TryWithResourcesASTTransformation.java      |  370 ++
 .../parser/antlr4/internal/AtnManager.java      |  107 +
 .../internal/DescriptiveErrorStrategy.java      |  110 +
 .../groovy/parser/antlr4/util/StringUtils.java  |  149 +
 .../parser/antlr4/GroovyParserTest.groovy       |  368 ++
 .../groovy/parser/antlr4/SyntaxErrorTest.groovy |  181 +
 .../groovy/parser/antlr4/TestUtils.groovy       |  259 ++
 .../antlr4/util/ASTComparatorCategory.groovy    |  526 +++
 .../groovy/parser/antlr4/util/AstDumper.groovy  | 1025 +++++
 .../test/resources/bugs/BUG-GROOVY-2324.groovy  |   23 +
 .../test/resources/bugs/BUG-GROOVY-4438.groovy  |   26 +
 .../test/resources/bugs/BUG-GROOVY-4757.groovy  |   27 +
 .../test/resources/bugs/BUG-GROOVY-4762.groovy  |   27 +
 .../test/resources/bugs/BUG-GROOVY-5318.groovy  |   19 +
 .../test/resources/bugs/BUG-GROOVY-5652.groovy  |   24 +
 .../test/resources/bugs/BUG-GROOVY-6038.groovy  |   37 +
 .../test/resources/bugs/BUG-GROOVY-8150.groovy  |   21 +
 .../test/resources/bugs/BUG-GROOVY-8161.groovy  |   20 +
 .../src/test/resources/bugs/GROOVY-3898.groovy  |   26 +
 .../core/AnnotationDeclaration_01.groovy        |   57 +
 .../test/resources/core/Annotation_01.groovy    |   19 +
 .../test/resources/core/Annotation_02.groovy    |   20 +
 .../test/resources/core/Annotation_03.groovy    |   21 +
 .../test/resources/core/Annotation_04.groovy    |   20 +
 .../test/resources/core/Annotation_05.groovy    |   19 +
 .../test/resources/core/Annotation_06.groovy    |   20 +
 .../test/resources/core/Annotation_07.groovy    |   20 +
 .../test/resources/core/Annotation_08.groovy    |   28 +
 .../test/resources/core/Annotation_09.groovy    |   32 +
 .../test/resources/core/Annotation_10x.groovy   |   38 +
 .../src/test/resources/core/Array_01x.groovy    |  104 +
 .../src/test/resources/core/Assert_01.groovy    |   46 +
 .../src/test/resources/core/Assert_02x.groovy   |   55 +
 .../src/test/resources/core/Assert_03x.groovy   |   44 +
 .../resources/core/BreakingChange_01x.groovy    |   42 +
 .../resources/core/BreakingChange_02x.groovy    |   27 +
 .../resources/core/BreakingChange_03x.groovy    |   34 +
 .../resources/core/BreakingChange_04x.groovy    |   44 +
 .../resources/core/ClassDeclaration_01.groovy   |   73 +
 .../resources/core/ClassDeclaration_02.groovy   |   60 +
 .../resources/core/ClassDeclaration_03.groovy   |   69 +
 .../resources/core/ClassDeclaration_04.groovy   |   40 +
 .../resources/core/ClassDeclaration_05.groovy   |   38 +
 .../resources/core/ClassDeclaration_06.groovy   |  101 +
 .../resources/core/ClassDeclaration_07.groovy   |   45 +
 .../src/test/resources/core/Closure_01.groovy   |   19 +
 .../src/test/resources/core/Closure_02.groovy   |   19 +
 .../src/test/resources/core/Closure_03.groovy   |   19 +
 .../src/test/resources/core/Closure_04.groovy   |   21 +
 .../src/test/resources/core/Closure_05.groovy   |   21 +
 .../src/test/resources/core/Closure_06.groovy   |   27 +
 .../src/test/resources/core/Closure_07.groovy   |   21 +
 .../src/test/resources/core/Closure_08.groovy   |   34 +
 .../src/test/resources/core/Closure_09.groovy   |   34 +
 .../src/test/resources/core/Closure_10.groovy   |   22 +
 .../test/resources/core/CodeBlock_01x.groovy    |   42 +
 .../src/test/resources/core/Command_01.groovy   |   36 +
 .../src/test/resources/core/Command_02.groovy   |   29 +
 .../src/test/resources/core/Command_03.groovy   |   84 +
 .../src/test/resources/core/Command_04.groovy   |   25 +
 .../src/test/resources/core/Command_05.groovy   |   77 +
 .../src/test/resources/core/Command_06x.groovy  |   26 +
 .../src/test/resources/core/Comments_01.groovy  |   46 +
 .../src/test/resources/core/Comments_02.groovy  |  135 +
 .../resources/core/DefaultMethod_01x.groovy     |   39 +
 .../resources/core/DefaultMethod_02x.groovy     |   54 +
 .../src/test/resources/core/DoWhile_01x.groovy  |   25 +
 .../src/test/resources/core/DoWhile_02x.groovy  |   26 +
 .../src/test/resources/core/DoWhile_03x.groovy  |   29 +
 .../src/test/resources/core/DoWhile_04x.groovy  |   32 +
 .../resources/core/ElvisAssignment_01x.groovy   |   56 +
 .../resources/core/EnumDeclaration_01.groovy    |   62 +
 .../resources/core/EnumDeclaration_02.groovy    |   70 +
 .../resources/core/EnumDeclaration_03.groovy    |   24 +
 .../resources/core/EnumDeclaration_04.groovy    |   22 +
 .../resources/core/EnumDeclaration_05.groovy    |   22 +
 .../test/resources/core/Expression_01.groovy    |  248 +
 .../test/resources/core/Expression_02.groovy    |   24 +
 .../test/resources/core/Expression_03.groovy    |   49 +
 .../test/resources/core/Expression_04.groovy    |   80 +
 .../test/resources/core/Expression_05.groovy    |   58 +
 .../test/resources/core/Expression_06.groovy    |   24 +
 .../test/resources/core/Expression_07.groovy    |   27 +
 .../test/resources/core/Expression_08.groovy    |   24 +
 .../test/resources/core/Expression_09.groovy    |   34 +
 .../test/resources/core/Expression_10.groovy    |   43 +
 .../test/resources/core/Expression_11.groovy    |   34 +
 .../test/resources/core/Expression_12.groovy    |   35 +
 .../test/resources/core/Expression_13.groovy    |   63 +
 .../test/resources/core/Expression_14.groovy    |   40 +
 .../test/resources/core/Expression_15.groovy    |  145 +
 .../test/resources/core/Expression_16.groovy    |   40 +
 .../test/resources/core/Expression_17.groovy    |  159 +
 .../test/resources/core/Expression_18.groovy    |   44 +
 .../test/resources/core/Expression_19.groovy    |   50 +
 .../test/resources/core/Expression_20.groovy    |   20 +
 .../test/resources/core/Expression_21x.groovy   |   24 +
 .../test/resources/core/Expression_22x.groovy   |   29 +
 .../test/resources/core/Expression_23x.groovy   |  115 +
 .../src/test/resources/core/For_01.groovy       |   73 +
 .../src/test/resources/core/For_02.groovy       |   54 +
 .../src/test/resources/core/For_03.groovy       |   55 +
 .../src/test/resources/core/For_04x.groovy      |   54 +
 .../src/test/resources/core/For_05x.groovy      |   56 +
 .../src/test/resources/core/GString_01.groovy   |   48 +
 .../src/test/resources/core/GString_02.groovy   |   77 +
 .../src/test/resources/core/GString_03.groovy   |   67 +
 .../src/test/resources/core/GString_04.groovy   |   19 +
 .../src/test/resources/core/GString_05.groovy   |   19 +
 .../src/test/resources/core/GString_06.groovy   |   19 +
 .../test/resources/core/Groovydoc_01x.groovy    |   70 +
 .../test/resources/core/IdenticalOp_01x.groovy  |   28 +
 .../src/test/resources/core/IfElse_01.groovy    |   62 +
 .../resources/core/ImportDeclaration_01.groovy  |   19 +
 .../resources/core/ImportDeclaration_02.groovy  |   19 +
 .../resources/core/ImportDeclaration_03.groovy  |   22 +
 .../resources/core/ImportDeclaration_04.groovy  |   23 +
 .../resources/core/ImportDeclaration_05.groovy  |   19 +
 .../resources/core/ImportDeclaration_06.groovy  |   21 +
 .../resources/core/ImportDeclaration_07.groovy  |   24 +
 .../resources/core/ImportDeclaration_08.groovy  |   46 +
 .../core/InterfaceDeclaration_01.groovy         |   54 +
 .../core/InterfaceDeclaration_02.groovy         |   60 +
 .../core/InterfaceDeclaration_03.groovy         |   25 +
 .../src/test/resources/core/Label_01.groovy     |   33 +
 .../src/test/resources/core/Lambda_01x.groovy   |   66 +
 .../src/test/resources/core/List_01.groovy      |   33 +
 .../src/test/resources/core/Literal_01.groovy   |   97 +
 .../src/test/resources/core/Literal_02.groovy   |   66 +
 .../src/test/resources/core/Literal_03.groovy   |   21 +
 .../core/LocalVariableDeclaration_01.groovy     |  128 +
 .../src/test/resources/core/Map_01.groovy       |   47 +
 .../resources/core/MethodDeclaration_01.groovy  |   50 +
 .../resources/core/MethodDeclaration_02.groovy  |   59 +
 .../resources/core/MethodPointer_01x.groovy     |   23 +
 .../resources/core/MethodReference_01x.groovy   |  103 +
 .../core/NegativeRelationalOperators_01x.groovy |   39 +
 .../core/NegativeRelationalOperators_02x.groovy |   36 +
 .../resources/core/PackageDeclaration_01.groovy |   19 +
 .../resources/core/PackageDeclaration_02.groovy |   19 +
 .../resources/core/PackageDeclaration_03.groovy |   19 +
 .../resources/core/PackageDeclaration_04.groovy |   38 +
 .../resources/core/PackageDeclaration_05.groovy |   41 +
 .../resources/core/PackageDeclaration_06.groovy |   19 +
 .../src/test/resources/core/Return_01.groovy    |   26 +
 .../test/resources/core/SafeIndex_01x.groovy    |   28 +
 .../test/resources/core/SafeIndex_02x.groovy    |   65 +
 .../test/resources/core/SafeIndex_03x.groovy    |  298 ++
 .../src/test/resources/core/Script_01x.groovy   |   23 +
 .../src/test/resources/core/Switch_01.groovy    |   78 +
 .../test/resources/core/Synchronized_01.groovy  |   54 +
 .../src/test/resources/core/Throw_01.groovy     |   20 +
 .../resources/core/TraitDeclaration_01.groovy   |   60 +
 .../resources/core/TraitDeclaration_02.groovy   |   58 +
 .../resources/core/TraitDeclaration_03.groovy   |   66 +
 .../resources/core/TraitDeclaration_04.groovy   |   46 +
 .../resources/core/TraitDeclaration_05.groovy   |   41 +
 .../src/test/resources/core/TryCatch_01.groovy  |  130 +
 .../resources/core/TryWithResources_01x.groovy  |  284 ++
 .../src/test/resources/core/Unicode_01.groovy   |   42 +
 .../src/test/resources/core/While_01.groovy     |   76 +
 .../src/test/resources/core/While_02x.groovy    |   23 +
 .../resources/fail/AbstractMethod_01x.groovy    |   21 +
 .../resources/fail/AbstractMethod_02x.groovy    |   22 +
 .../resources/fail/AbstractMethod_03x.groovy    |   21 +
 .../resources/fail/AbstractMethod_04x.groovy    |   19 +
 .../resources/fail/AbstractMethod_05x.groovy    |   19 +
 .../resources/fail/AbstractMethod_06x.groovy    |   19 +
 .../src/test/resources/fail/Break_01x.groovy    |   19 +
 .../src/test/resources/fail/Break_02x.groovy    |   21 +
 .../resources/fail/ClassDeclaration_01x.groovy  |   25 +
 .../fail/ClosureListExpression_01.groovy        |   19 +
 .../fail/ClosureListExpression_02.groovy        |   19 +
 .../fail/ClosureListExpression_03.groovy        |   19 +
 .../fail/ClosureListExpression_04.groovy        |   28 +
 .../fail/ConstructorDeclaration_01.groovy       |   19 +
 .../src/test/resources/fail/Continue_01x.groovy |   19 +
 .../src/test/resources/fail/Continue_02x.groovy |   21 +
 .../src/test/resources/fail/DoWhile_01x.groovy  |   22 +
 .../test/resources/fail/Expression_01.groovy    |   19 +
 .../test/resources/fail/Expression_02.groovy    |   19 +
 .../test/resources/fail/Expression_03.groovy    |   19 +
 .../test/resources/fail/Expression_04.groovy    |   19 +
 .../test/resources/fail/Expression_05.groovy    |   19 +
 .../test/resources/fail/Expression_06.groovy    |   19 +
 .../test/resources/fail/Expression_07.groovy    |   19 +
 .../test/resources/fail/Expression_08.groovy    |   19 +
 .../test/resources/fail/Expression_09.groovy    |   19 +
 .../src/test/resources/fail/For_01.groovy       |   19 +
 .../src/test/resources/fail/For_02.groovy       |   19 +
 .../fail/InterfaceDeclaration_01.groovy         |   21 +
 .../src/test/resources/fail/List_01.groovy      |   19 +
 .../fail/LocalVariableDeclaration_01.groovy     |   19 +
 .../resources/fail/MethodDeclaration_01.groovy  |   23 +
 .../src/test/resources/fail/Modifier_01x.groovy |   19 +
 .../src/test/resources/fail/Modifier_02x.groovy |   19 +
 .../src/test/resources/fail/Modifier_03x.groovy |   19 +
 .../src/test/resources/fail/Modifier_04x.groovy |   21 +
 .../src/test/resources/fail/Modifier_05x.groovy |   21 +
 .../src/test/resources/fail/Modifier_07.groovy  |   19 +
 .../resources/fail/ParExpression_01x.groovy     |   19 +
 .../resources/fail/ParExpression_02x.groovy     |   19 +
 .../resources/fail/ParExpression_03x.groovy     |   19 +
 .../test/resources/fail/Parentheses_01.groovy   |   20 +
 .../src/test/resources/fail/Super_01x.groovy    |   24 +
 .../src/test/resources/fail/Switch_01.groovy    |   27 +
 .../src/test/resources/fail/This_01x.groovy     |   26 +
 .../fail/UnexpectedCharacter_01x.groovy         |   19 +
 .../src/test/resources/fail/Void_01x.groovy     |   21 +
 .../src/test/resources/fail/Void_02x.groovy     |   23 +
 466 files changed, 19408 insertions(+), 19409 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 2254e1e..47e0d19 100644
--- a/build.gradle
+++ b/build.gradle
@@ -312,7 +312,7 @@ sourceSets {
     }
 }
 
-apply from: 'subprojects/groovy-parser-antlr4/build.gradle'
+apply from: 'subprojects/parser-antlr4/build.gradle'
 
 // make sure examples can be compiled, even if we don't run them
 // todo: reorganize examples so that we can run them too

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/settings.gradle
----------------------------------------------------------------------
diff --git a/settings.gradle b/settings.gradle
index 56b0dc4..5df4d51 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -33,7 +33,6 @@ def subprojects = ['groovy-ant',
         'groovy-test',
         'groovy-testng',
         'groovy-xml',
-        'groovy-parser-antlr4',
         'groovy-macro'
 ]
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/README.adoc
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/README.adoc b/subprojects/groovy-parser-antlr4/README.adoc
deleted file mode 100644
index 4170426..0000000
--- a/subprojects/groovy-parser-antlr4/README.adoc
+++ /dev/null
@@ -1,59 +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 loop, standard loop(e.g. `for(int i = 0, j = 10; i < j; i++, j--) {..}`)
-* lambda expression
-* method reference and constructor reference
-* try-with-resources(i.e. ARM)
-* code block(i.e. `{..}`)
-* array initializer of Java style(e.g. `new int[] {1, 2, 3}`)
-* default method of interface
-* new operators: identity operators(`===`, `!==`), elvis assignment(`?=`), `!in`, `!instanceof`
-* safe index(e.g. `nullableVar?[1, 2]`)
-* runtime groovydoc(i.e. groovydoc with `@Groovydoc`), groovydoc attached to AST node as metadata
-
-=== How to enable the new parser
-
-* In the gradle build the property useAntlr4 has to be set to enable the build of the parser and the execution of all tests with it. Command line example:
-```
-./gradlew -PuseAntlr4=true bootstrapJar
-```
-* To enable the new parser automatically at runtime the system property groovy.antlr4 has to be set. Command line example:
-```
-export JAVA_OPTS="-Dgroovy.antlr4=true"
-groovy foo.groovy
-```
-* This system property also controls groovyc and has to be used in case it is used outside of this build, for example with:
-```
-groovyOptions.forkOptions.jvmArgs += ["-Dgroovy.antlr4=true"]
-```
-
-=== JVM system properties to control parsing
-
-* `groovy.antlr4.cache.threshold`: how frequently to clear DFA cache(default: 50). **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.extract.doc.comment`: whether to collect groovydoc while parsing groovy source code(default: false)
-
-*P.S. Parrot is based on the highly optimized version of antlr4(com.tunnelvisionlabs:antlr4), which is licensed under BSD.*
- 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/build.gradle
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/build.gradle b/subprojects/groovy-parser-antlr4/build.gradle
deleted file mode 100644
index 7570dcf..0000000
--- a/subprojects/groovy-parser-antlr4/build.gradle
+++ /dev/null
@@ -1,70 +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.
- */
-if (!rootProject.hasProperty('useAntlr4')) return
-
-apply plugin: 'me.champeau.gradle.antlr4'
-
-def srcBase = "subprojects/groovy-parser-antlr4/src"
-def srcMain = "$srcBase/main"
-def srcTest = "$srcBase/test"
-def antlr4Source = "$srcMain/antlr4"
-def antlr4OutputRootDir = "$buildDir/generated-sources"
-def antlr4Output = "$antlr4OutputRootDir/org/apache/groovy/parser/antlr4"
-
-// set package for antlr generated classes
-antlr4 {
-    source = file(antlr4Source)
-    extraArgs = ["-no-listener", "-package", "org.apache.groovy.parser.antlr4"]
-    output = file(antlr4Output)
-}
-
-// make the Java compile task depend on the antlr4 task
-compileJava.dependsOn antlr4
-
-// add antlr4 to classpath
-configurations {
-   compile.extendsFrom antlr4
-}
-
-dependencies {
-    antlr4 "com.tunnelvisionlabs:antlr4:$antlr4Version"
-    testCompile project(':groovy-test')
-}
-
-
-task cleanGeneratedSources(type: Delete) {
-    delete antlr4OutputRootDir
-    file(antlr4OutputRootDir).mkdirs()
-}
-
-antlr4.dependsOn cleanGeneratedSources
-
-// add the generated source files to the list of java sources
-sourceSets.main.java.srcDirs += file("$antlr4OutputRootDir");
-sourceSets.main.java.srcDirs += file("$srcMain/java");
-sourceSets.main.groovy.srcDirs += file("$srcMain/groovy");
-sourceSets.main.resources.srcDirs += file("$antlr4Source");
-sourceSets.main.resources.srcDirs += file("$srcMain/resources");
-sourceSets.test.java.srcDirs += file("$srcTest/java");
-sourceSets.test.groovy.srcDirs += file("$srcTest/groovy");
-sourceSets.test.resources.srcDirs += file("$srcTest/resources");
-
-test {
-    jvmArgs "-Dgroovy.extract.doc.comment=true", "-Dgroovy.antlr4.cache.threshold=100"
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyLexer.g4
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyLexer.g4 b/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyLexer.g4
deleted file mode 100644
index 7bcec42..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyLexer.g4
+++ /dev/null
@@ -1,882 +0,0 @@
-/*
- * This file is adapted from the Antlr4 Java grammar which has the following license
- *
- *  Copyright (c) 2013 Terence Parr, Sam Harwell
- *  All rights reserved.
- *  [The "BSD licence"]
- *
- *    http://www.opensource.org/licenses/bsd-license.php
- *
- * Subsequent modifications by the Groovy community have been done under the Apache License v2:
- *
- *  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.
- */
-
-/**
- * The Groovy grammar is based on the official grammar for Java:
- * https://github.com/antlr/grammars-v4/blob/master/java/Java.g4
- */
-lexer grammar GroovyLexer;
-
-options {
-    superClass = AbstractLexer;
-}
-
-@header {
-    import static org.apache.groovy.parser.antlr4.SemanticPredicates.*;
-    import java.util.Deque;
-    import java.util.ArrayDeque;
-    import java.util.Map;
-    import java.util.HashMap;
-    import java.util.Set;
-    import java.util.HashSet;
-    import java.util.Collections;
-    import java.util.Arrays;
-}
-
-@members {
-    private long tokenIndex     = 0;
-    private int  lastTokenType  = 0;
-
-    /**
-     * Record the index and token type of the current token while emitting tokens.
-     */
-    @Override
-    public void emit(Token token) {
-        this.tokenIndex++;
-
-        int tokenType = token.getType();
-        if (Token.DEFAULT_CHANNEL == token.getChannel()) {
-            this.lastTokenType = tokenType;
-        }
-
-        if (RollBackOne == tokenType) {
-            this.rollbackOneChar();
-        }
-
-        super.emit(token);
-    }
-
-    private static final Set<Integer> REGEX_CHECK_SET =
-                                            Collections.unmodifiableSet(
-                                                new HashSet<>(Arrays.asList(Identifier, CapitalizedIdentifier, NullLiteral, BooleanLiteral, THIS, RPAREN, RBRACK, RBRACE, IntegerLiteral, FloatingPointLiteral, StringLiteral, GStringEnd, INC, DEC)));
-    private boolean isRegexAllowed() {
-        if (REGEX_CHECK_SET.contains(this.lastTokenType)) {
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * just a hook, which will be overrided by GroovyLangLexer
-     */
-    protected void rollbackOneChar() {}
-
-    private static class Paren {
-        private String text;
-        private int lastTokenType;
-        private int line;
-        private int column;
-
-        public Paren(String text, int lastTokenType, int line, int column) {
-            this.text = text;
-            this.lastTokenType = lastTokenType;
-            this.line = line;
-            this.column = column;
-        }
-
-        public String getText() {
-            return this.text;
-        }
-
-        public int getLastTokenType() {
-            return this.lastTokenType;
-        }
-
-        public int getLine() {
-            return line;
-        }
-
-        public int getColumn() {
-            return column;
-        }
-
-        @Override
-        public int hashCode() {
-            return (int) (text.hashCode() * line + column);
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (!(obj instanceof Paren)) {
-                return false;
-            }
-
-            Paren other = (Paren) obj;
-
-            return this.text.equals(other.text) && (this.line == other.line && this.column == other.column);
-        }
-    }
-
-    private static final Map<String, String> PAREN_MAP = Collections.unmodifiableMap(new HashMap<String, String>() {
-        {
-            put("(", ")");
-            put("[", "]");
-            put("{", "}");
-        }
-    });
-
-    private final Deque<Paren> parenStack = new ArrayDeque<>(32);
-    private void enterParen() {
-        parenStack.push(new Paren(getText(), this.lastTokenType, getLine(), getCharPositionInLine() + 1));
-    }
-    private void exitParen() {
-        Paren paren = parenStack.peek();
-        String text = getText();
-
-        require(null != paren, "Too many '" + text + "'");
-        require(text.equals(PAREN_MAP.get(paren.getText())),
-                "'" + paren.getText() + "'" + new PositionInfo(paren.getLine(), paren.getColumn()) + " can not match '" + text + "'");
-
-        parenStack.pop();
-    }
-    private boolean isInsideParens() {
-        Paren paren = parenStack.peek();
-
-        // We just care about "(" and "[", inside which the new lines will be ignored.
-        // Notice: the new lines between "{" and "}" can not be ignored.
-        if (null == paren) {
-            return false;
-        }
-        return ("(".equals(paren.getText()) && TRY != paren.getLastTokenType()) // we don't treat try-paren(i.e. try (....)) as parenthesis
-                    || "[".equals(paren.getText());
-    }
-    private void ignoreTokenInsideParens() {
-        if (!this.isInsideParens()) {
-            return;
-        }
-
-        this.setChannel(Token.HIDDEN_CHANNEL);
-    }
-    private void ignoreMultiLineCommentConditionally() {
-        if (!this.isInsideParens() && isFollowedByWhiteSpaces(_input)) {
-            return;
-        }
-
-        this.setChannel(Token.HIDDEN_CHANNEL);
-    }
-
-    @Override
-    public int getSyntaxErrorSource() {
-        return GroovySyntaxError.LEXER;
-    }
-
-    @Override
-    public int getErrorLine() {
-        return getLine();
-    }
-
-    @Override
-    public int getErrorColumn() {
-        return getCharPositionInLine() + 1;
-    }
-}
-
-
-// §3.10.5 String Literals
-
-StringLiteral
-    :   '"'      DqStringCharacter*?           '"'
-    |   '\''     SqStringCharacter*?           '\''
-
-    |   '/'      { this.isRegexAllowed() && _input.LA(1) != '*' }?
-                 SlashyStringCharacter+?       '/'
-
-    |   '"""'    TdqStringCharacter*?          '"""'
-    |   '\'\'\'' TsqStringCharacter*?          '\'\'\''
-    |   '$/'     DollarSlashyStringCharacter+? '/$'
-    ;
-
-// Groovy gstring
-GStringBegin
-    :   '"' DqStringCharacter*? DOLLAR -> pushMode(DQ_GSTRING_MODE), pushMode(GSTRING_TYPE_SELECTOR_MODE)
-    ;
-TdqGStringBegin
-    :   '"""'   TdqStringCharacter*? DOLLAR -> type(GStringBegin), pushMode(TDQ_GSTRING_MODE), pushMode(GSTRING_TYPE_SELECTOR_MODE)
-    ;
-SlashyGStringBegin
-    :   '/' { this.isRegexAllowed() && _input.LA(1) != '*' }? SlashyStringCharacter*? DOLLAR { isFollowedByJavaLetterInGString(_input) }? -> type(GStringBegin), pushMode(SLASHY_GSTRING_MODE), pushMode(GSTRING_TYPE_SELECTOR_MODE)
-    ;
-DollarSlashyGStringBegin
-    :   '$/' DollarSlashyStringCharacter*? DOLLAR { isFollowedByJavaLetterInGString(_input) }? -> type(GStringBegin), pushMode(DOLLAR_SLASHY_GSTRING_MODE), pushMode(GSTRING_TYPE_SELECTOR_MODE)
-    ;
-
-mode DQ_GSTRING_MODE;
-GStringEnd
-    :   '"'     -> popMode
-    ;
-GStringPart
-    :   DOLLAR  -> pushMode(GSTRING_TYPE_SELECTOR_MODE)
-    ;
-GStringCharacter
-    :   DqStringCharacter -> more
-    ;
-
-mode TDQ_GSTRING_MODE;
-TdqGStringEnd
-    :   '"""'    -> type(GStringEnd), popMode
-    ;
-TdqGStringPart
-    :   DOLLAR   -> type(GStringPart), pushMode(GSTRING_TYPE_SELECTOR_MODE)
-    ;
-TdqGStringCharacter
-    :   TdqStringCharacter -> more
-    ;
-
-mode SLASHY_GSTRING_MODE;
-SlashyGStringEnd
-    :   '$'? '/'  -> type(GStringEnd), popMode
-    ;
-SlashyGStringPart
-    :   DOLLAR { isFollowedByJavaLetterInGString(_input) }?   -> type(GStringPart), pushMode(GSTRING_TYPE_SELECTOR_MODE)
-    ;
-SlashyGStringCharacter
-    :   SlashyStringCharacter -> more
-    ;
-
-mode DOLLAR_SLASHY_GSTRING_MODE;
-DollarSlashyGStringEnd
-    :   '/$'      -> type(GStringEnd), popMode
-    ;
-DollarSlashyGStringPart
-    :   DOLLAR { isFollowedByJavaLetterInGString(_input) }?   -> type(GStringPart), pushMode(GSTRING_TYPE_SELECTOR_MODE)
-    ;
-DollarSlashyGStringCharacter
-    :   DollarSlashyStringCharacter -> more
-    ;
-
-mode GSTRING_TYPE_SELECTOR_MODE;
-GStringLBrace
-    :   '{' { this.enterParen();  } -> type(LBRACE), popMode, pushMode(DEFAULT_MODE)
-    ;
-GStringIdentifier
-    :   IdentifierInGString -> type(Identifier), popMode, pushMode(GSTRING_PATH_MODE)
-    ;
-
-
-mode GSTRING_PATH_MODE;
-GStringPathPart
-    :   '.' IdentifierInGString
-    ;
-RollBackOne
-    :   . {
-            // a trick to handle GStrings followed by EOF properly
-            if (EOF == _input.LA(1) && ('"' == _input.LA(-1) || '/' == _input.LA(-1))) {
-                setType(GStringEnd);
-            } else {
-                setChannel(HIDDEN);
-            }
-          } -> popMode
-    ;
-
-
-mode DEFAULT_MODE;
-// character in the double quotation string. e.g. "a"
-fragment
-DqStringCharacter
-    :   ~["\\$]
-    |   EscapeSequence
-    ;
-
-// character in the single quotation string. e.g. 'a'
-fragment
-SqStringCharacter
-    :   ~['\\]
-    |   EscapeSequence
-    ;
-
-// character in the triple double quotation string. e.g. """a"""
-fragment TdqStringCharacter
-    :   ~["\\$]
-    |   '"' { !(_input.LA(1) == '"' && _input.LA(2) == '"') }?
-    |   EscapeSequence
-    ;
-
-// character in the triple single quotation string. e.g. '''a'''
-fragment TsqStringCharacter
-    :   ~['\\]
-    |   '\'' { !(_input.LA(1) == '\'' && _input.LA(2) == '\'') }?
-    |   EscapeSequence
-    ;
-
-// character in the slashy string. e.g. /a/
-fragment SlashyStringCharacter
-    :   SlashEscape
-    |   '$' { !isFollowedByJavaLetterInGString(_input) }?
-    |   ~[/$\u0000]
-    ;
-
-// character in the collar slashy string. e.g. $/a/$
-fragment DollarSlashyStringCharacter
-    :   SlashEscape | DollarSlashEscape | DollarDollarEscape
-    |   '/' { _input.LA(1) != '$' }?
-    |   '$' { !isFollowedByJavaLetterInGString(_input) }?
-    |   ~[/$\u0000]
-    ;
-
-// Groovy keywords
-AS              : 'as';
-DEF             : 'def';
-IN              : 'in';
-TRAIT           : 'trait';
-
-
-// §3.9 Keywords
-BuiltInPrimitiveType
-    :   BOOLEAN
-    |   CHAR
-    |   BYTE
-    |   SHORT
-    |   INT
-    |   LONG
-    |   FLOAT
-    |   DOUBLE
-    ;
-
-ABSTRACT      : 'abstract';
-ASSERT        : 'assert';
-
-fragment
-BOOLEAN       : 'boolean';
-
-BREAK         : 'break';
-
-fragment
-BYTE          : 'byte';
-
-CASE          : 'case';
-CATCH         : 'catch';
-
-fragment
-CHAR          : 'char';
-
-CLASS         : 'class';
-CONST         : 'const';
-CONTINUE      : 'continue';
-DEFAULT       : 'default';
-DO            : 'do';
-
-fragment
-DOUBLE        : 'double';
-
-ELSE          : 'else';
-ENUM          : 'enum';
-EXTENDS       : 'extends';
-FINAL         : 'final';
-FINALLY       : 'finally';
-
-fragment
-FLOAT         : 'float';
-
-
-FOR           : 'for';
-IF            : 'if';
-GOTO          : 'goto';
-IMPLEMENTS    : 'implements';
-IMPORT        : 'import';
-INSTANCEOF    : 'instanceof';
-
-fragment
-INT           : 'int';
-
-INTERFACE     : 'interface';
-
-fragment
-LONG          : 'long';
-
-NATIVE        : 'native';
-NEW           : 'new';
-PACKAGE       : 'package';
-PRIVATE       : 'private';
-PROTECTED     : 'protected';
-PUBLIC        : 'public';
-RETURN        : 'return';
-
-fragment
-SHORT         : 'short';
-
-
-STATIC        : 'static';
-STRICTFP      : 'strictfp';
-SUPER         : 'super';
-SWITCH        : 'switch';
-SYNCHRONIZED  : 'synchronized';
-THIS          : 'this';
-THROW         : 'throw';
-THROWS        : 'throws';
-TRANSIENT     : 'transient';
-TRY           : 'try';
-VOID          : 'void';
-VOLATILE      : 'volatile';
-WHILE         : 'while';
-
-
-// §3.10.1 Integer Literals
-
-IntegerLiteral
-    :   DecimalIntegerLiteral
-    |   HexIntegerLiteral
-    |   OctalIntegerLiteral
-    |   BinaryIntegerLiteral
-    ;
-
-fragment
-DecimalIntegerLiteral
-    :   DecimalNumeral IntegerTypeSuffix?
-    ;
-
-fragment
-HexIntegerLiteral
-    :   HexNumeral IntegerTypeSuffix?
-    ;
-
-fragment
-OctalIntegerLiteral
-    :   OctalNumeral IntegerTypeSuffix?
-    ;
-
-fragment
-BinaryIntegerLiteral
-    :   BinaryNumeral IntegerTypeSuffix?
-    ;
-
-fragment
-IntegerTypeSuffix
-    :   [lLiIgG]
-    ;
-
-fragment
-DecimalNumeral
-    :   '0'
-    |   NonZeroDigit (Digits? | Underscores Digits)
-    ;
-
-fragment
-Digits
-    :   Digit (DigitOrUnderscore* Digit)?
-    ;
-
-fragment
-Digit
-    :   '0'
-    |   NonZeroDigit
-    ;
-
-fragment
-NonZeroDigit
-    :   [1-9]
-    ;
-
-fragment
-DigitOrUnderscore
-    :   Digit
-    |   '_'
-    ;
-
-fragment
-Underscores
-    :   '_'+
-    ;
-
-fragment
-HexNumeral
-    :   '0' [xX] HexDigits
-    ;
-
-fragment
-HexDigits
-    :   HexDigit (HexDigitOrUnderscore* HexDigit)?
-    ;
-
-fragment
-HexDigit
-    :   [0-9a-fA-F]
-    ;
-
-fragment
-HexDigitOrUnderscore
-    :   HexDigit
-    |   '_'
-    ;
-
-fragment
-OctalNumeral
-    :   '0' Underscores? OctalDigits
-    ;
-
-fragment
-OctalDigits
-    :   OctalDigit (OctalDigitOrUnderscore* OctalDigit)?
-    ;
-
-fragment
-OctalDigit
-    :   [0-7]
-    ;
-
-fragment
-OctalDigitOrUnderscore
-    :   OctalDigit
-    |   '_'
-    ;
-
-fragment
-BinaryNumeral
-    :   '0' [bB] BinaryDigits
-    ;
-
-fragment
-BinaryDigits
-    :   BinaryDigit (BinaryDigitOrUnderscore* BinaryDigit)?
-    ;
-
-fragment
-BinaryDigit
-    :   [01]
-    ;
-
-fragment
-BinaryDigitOrUnderscore
-    :   BinaryDigit
-    |   '_'
-    ;
-
-// §3.10.2 Floating-Point Literals
-
-FloatingPointLiteral
-    :   DecimalFloatingPointLiteral
-    |   HexadecimalFloatingPointLiteral
-    ;
-
-fragment
-DecimalFloatingPointLiteral
-    :   Digits '.' Digits ExponentPart? FloatTypeSuffix?
-    |   Digits ExponentPart FloatTypeSuffix?
-    |   Digits FloatTypeSuffix
-    ;
-
-fragment
-ExponentPart
-    :   ExponentIndicator SignedInteger
-    ;
-
-fragment
-ExponentIndicator
-    :   [eE]
-    ;
-
-fragment
-SignedInteger
-    :   Sign? Digits
-    ;
-
-fragment
-Sign
-    :   [+-]
-    ;
-
-fragment
-FloatTypeSuffix
-    :   [fFdDgG]
-    ;
-
-fragment
-HexadecimalFloatingPointLiteral
-    :   HexSignificand BinaryExponent FloatTypeSuffix?
-    ;
-
-fragment
-HexSignificand
-    :   HexNumeral '.'?
-    |   '0' [xX] HexDigits? '.' HexDigits
-    ;
-
-fragment
-BinaryExponent
-    :   BinaryExponentIndicator SignedInteger
-    ;
-
-fragment
-BinaryExponentIndicator
-    :   [pP]
-    ;
-
-// §3.10.3 Boolean Literals
-
-BooleanLiteral
-    :   'true'
-    |   'false'
-    ;
-
-
-// §3.10.6 Escape Sequences for Character and String Literals
-
-fragment
-EscapeSequence
-    :   '\\' [btnfr"'\\]
-    |   OctalEscape
-    |   UnicodeEscape
-    |   DollarEscape
-    |   LineEscape
-    ;
-
-
-fragment
-OctalEscape
-    :   '\\' OctalDigit
-    |   '\\' OctalDigit OctalDigit
-    |   '\\' ZeroToThree OctalDigit OctalDigit
-    ;
-
-// Groovy allows 1 or more u's after the backslash
-fragment
-UnicodeEscape
-    :   '\\' 'u'+ HexDigit HexDigit HexDigit HexDigit
-    ;
-
-fragment
-ZeroToThree
-    :   [0-3]
-    ;
-
-// Groovy Escape Sequences
-
-fragment
-DollarEscape
-    :   '\\' DOLLAR
-    ;
-
-fragment
-LineEscape
-    :   '\\' '\r'? '\n'
-    ;
-
-fragment
-SlashEscape
-    :   '\\' '/'
-    ;
-
-fragment
-DollarSlashEscape
-    :   '$/$'
-    ;
-
-fragment
-DollarDollarEscape
-    :   '$$'
-    ;
-// §3.10.7 The Null Literal
-
-NullLiteral
-    :   'null'
-    ;
-
-// Groovy Operators
-
-RANGE_INCLUSIVE     : '..';
-RANGE_EXCLUSIVE     : '..<';
-SPREAD_DOT          : '*.';
-SAFE_DOT            : '?.';
-ELVIS               : '?:';
-METHOD_POINTER      : '.&';
-METHOD_REFERENCE    : '::';
-REGEX_FIND          : '=~';
-REGEX_MATCH         : '==~';
-POWER               : '**';
-POWER_ASSIGN        : '**=';
-SPACESHIP           : '<=>';
-IDENTICAL           : '===';
-NOT_IDENTICAL       : '!==';
-ARROW               : '->';
-
-// !internalPromise will be parsed as !in ternalPromise, so semantic predicates are necessary
-NOT_INSTANCEOF      : '!instanceof' { isFollowedBy(_input, ' ', '\t', '\r', '\n') }?;
-NOT_IN              : '!in'         { isFollowedBy(_input, ' ', '\t', '\r', '\n', '[', '(', '{') }?;
-
-fragment
-DOLLAR              : '$';
-
-
-// §3.11 Separators
-
-LPAREN          : '('  { this.enterParen();     } -> pushMode(DEFAULT_MODE);
-RPAREN          : ')'  { this.exitParen();      } -> popMode;
-LBRACE          : '{'  { this.enterParen();     } -> pushMode(DEFAULT_MODE);
-RBRACE          : '}'  { this.exitParen();      } -> popMode;
-LBRACK          : '['  { this.enterParen();     } -> pushMode(DEFAULT_MODE);
-RBRACK          : ']'  { this.exitParen();      } -> popMode;
-
-SEMI            : ';';
-COMMA           : ',';
-DOT             : '.';
-
-// §3.12 Operators
-
-ASSIGN          : '=';
-GT              : '>';
-LT              : '<';
-NOT             : '!';
-BITNOT          : '~';
-QUESTION        : '?';
-COLON           : ':';
-EQUAL           : '==';
-LE              : '<=';
-GE              : '>=';
-NOTEQUAL        : '!=';
-AND             : '&&';
-OR              : '||';
-INC             : '++';
-DEC             : '--';
-ADD             : '+';
-SUB             : '-';
-MUL             : '*';
-DIV             : '/';
-BITAND          : '&';
-BITOR           : '|';
-XOR             : '^';
-MOD             : '%';
-
-
-ADD_ASSIGN      : '+=';
-SUB_ASSIGN      : '-=';
-MUL_ASSIGN      : '*=';
-DIV_ASSIGN      : '/=';
-AND_ASSIGN      : '&=';
-OR_ASSIGN       : '|=';
-XOR_ASSIGN      : '^=';
-MOD_ASSIGN      : '%=';
-LSHIFT_ASSIGN   : '<<=';
-RSHIFT_ASSIGN   : '>>=';
-URSHIFT_ASSIGN  : '>>>=';
-ELVIS_ASSIGN    : '?=';
-
-
-// §3.8 Identifiers (must appear after all keywords in the grammar)
-CapitalizedIdentifier
-    :   [A-Z] JavaLetterOrDigit*
-
-    // FIXME REMOVE THE FOLLOWING ALTERNATIVE. Groovy's identifier can be unicode escape(e.g. def \u4e00\u9fa5 = '123'), which will impact the performance and is pointless to support IMO
-    |   [A-Z] (JavaLetterOrDigit | UnicodeEscape)*
-    ;
-
-Identifier
-    :   JavaLetter JavaLetterOrDigit*
-
-    // FIXME REMOVE THE FOLLOWING ALTERNATIVE. Groovy's identifier can be unicode escape(e.g. def \u4e00\u9fa5 = '123'), which will impact the performance and is pointless to support IMO
-    |   (JavaLetter | UnicodeEscape) (JavaLetterOrDigit | UnicodeEscape)*
-    ;
-
-fragment
-IdentifierInGString
-    :   JavaLetterInGString JavaLetterOrDigitInGString*
-    ;
-
-fragment
-JavaLetterInGString
-    :   [a-zA-Z_] // these are the "java letters" below 0x7F, except for $
-    |   // covers all characters above 0x7F which are not a surrogate
-        ~[\u0000-\u007F\uD800-\uDBFF]
-        {Character.isJavaIdentifierStart(_input.LA(-1))}?
-    |   // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
-        [\uD800-\uDBFF] [\uDC00-\uDFFF]
-        {Character.isJavaIdentifierStart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}?
-    ;
-
-fragment
-JavaLetterOrDigitInGString
-    :   [a-zA-Z0-9_] // these are the "java letters or digits" below 0x7F, except for $
-    |   // covers all characters above 0x7F which are not a surrogate
-        ~[\u0000-\u007F\uD800-\uDBFF]
-        {Character.isJavaIdentifierPart(_input.LA(-1))}?
-    |   // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
-        [\uD800-\uDBFF] [\uDC00-\uDFFF]
-        {Character.isJavaIdentifierPart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}?
-    ;
-
-
-fragment
-JavaLetter
-    :   [a-zA-Z$_] // these are the "java letters" below 0x7F
-    |   // covers all characters above 0x7F which are not a surrogate
-        ~[\u0000-\u007F\uD800-\uDBFF]
-        {Character.isJavaIdentifierStart(_input.LA(-1))}?
-    |   // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
-        [\uD800-\uDBFF] [\uDC00-\uDFFF]
-        {Character.isJavaIdentifierStart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}?
-    ;
-
-fragment
-JavaLetterOrDigit
-    :   [a-zA-Z0-9$_] // these are the "java letters or digits" below 0x7F
-    |   // covers all characters above 0x7F which are not a surrogate
-        ~[\u0000-\u007F\uD800-\uDBFF]
-        {Character.isJavaIdentifierPart(_input.LA(-1))}?
-    |   // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
-        [\uD800-\uDBFF] [\uDC00-\uDFFF]
-        {Character.isJavaIdentifierPart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}?
-    ;
-
-//
-// Additional symbols not defined in the lexical specification
-//
-
-AT : '@';
-ELLIPSIS : '...';
-
-//
-// Whitespace, line escape and comments
-//
-WS  :  ([ \t\u000C]+ | LineEscape+)     -> skip
-    ;
-
-
-// Inside (...) and [...] but not {...}, ignore newlines.
-NL  : '\r'? '\n'            { this.ignoreTokenInsideParens(); }
-    ;
-
-// Multiple-line comments(including groovydoc comments)
-ML_COMMENT
-    :   '/*' .*? '*/'       { this.ignoreMultiLineCommentConditionally(); } -> type(NL)
-    ;
-
-// Single-line comments
-SL_COMMENT
-    :   '//' ~[\r\n\uFFFF]* { this.ignoreTokenInsideParens(); }             -> type(NL)
-    ;
-
-// Script-header comments.
-// The very first characters of the file may be "#!".  If so, ignore the first line.
-SH_COMMENT
-    :   '#!' { 0 == this.tokenIndex }?<fail={"Shebang comment should appear at the first line"}> ~[\r\n\uFFFF]* -> skip
-    ;
-
-// Unexpected characters will be handled by groovy parser later.
-UNEXPECTED_CHAR
-    :   .
-    ;


[27/50] [abbrv] groovy git commit: GROOVY-8177: Remedial work still needed for groovy-parser-antlr4 subproject

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_04.groovy
index 2619469..7cd679c 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_04.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_04.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 public trait Person {
     public static final SOME_CONSTANT = 'SOME_CONSTANT';
     private String name = 'Daniel';

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_05.groovy
index dc82624..625074e 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_05.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_05.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 trait SwimmingAbility {
     def swim() {
         prt("swimming..")

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/TryCatch_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/TryCatch_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/TryCatch_01.groovy
index 78431c2..d09e1c3 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/TryCatch_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/TryCatch_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import java.sql.SQLException
 
 try {

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/TryWithResources_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/TryWithResources_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/TryWithResources_01x.groovy
index 9b88740..94a183e 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/TryWithResources_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/TryWithResources_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import groovy.transform.CompileStatic
 
 import java.io.*

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Unicode_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Unicode_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Unicode_01.groovy
index 2071bdc..a065baa 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Unicode_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Unicode_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 def \u0061 = '\uuuuu0061'
 def \u0061\u0062
 def \u0061\u0062\u0063

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/While_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/While_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/While_01.groovy
index 09850de..cbf0249 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/While_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/While_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 while(true) assert true
 
 while(

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/While_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/While_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/While_02x.groovy
index 01e0092..e099280 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/While_02x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/While_02x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 int i = 0
 while (i < 5) {
     i++

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_01x.groovy
index bb8cafe..8dae1bd 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 class A {
     def x()
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_02x.groovy
index 83998ca..80a041c 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_02x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_02x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 enum E {
     A, B
     def y()

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_03x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_03x.groovy
index 8e0ae2f..92ace61 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_03x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_03x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 trait B {
     def z()
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_04x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_04x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_04x.groovy
index 3cc34b5..409fa18 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_04x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_04x.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 def w()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_05x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_05x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_05x.groovy
index 10b79fe..aec108e 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_05x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_05x.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 abstract v()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_06x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_06x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_06x.groovy
index 2dda490..7672201 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_06x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_06x.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 abstract u() {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Break_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Break_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Break_01x.groovy
index 5da7034..14c8d30 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Break_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Break_01x.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 break
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Break_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Break_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Break_02x.groovy
index ebd542b..f08680b 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Break_02x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Break_02x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 if (true) {
     break;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy
index d577c4b..b60a794 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package fail
 
 class A {

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy
index 6f93556..607c5b5 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 [].for(1;2;3){println "in loop"}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy
index ff953b9..29a16ec 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 def x = (1;2;3)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy
index 59beda7..dab42a1 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 [].bar(1;2;3)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy
index 738e0ac..5783cbd 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 class Crasher {
     public void m() {
         def fields = [1,2,3]

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy
index 1990412..1318c4a 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 class Foo { static final Foo() {}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Continue_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Continue_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Continue_01x.groovy
index 45127c0..4a23bf8 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Continue_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Continue_01x.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 continue;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Continue_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Continue_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Continue_02x.groovy
index 5d16400..744b34a 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Continue_02x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Continue_02x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 if (true) {
     continue;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/DoWhile_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/DoWhile_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/DoWhile_01x.groovy
index a56fbba..b770cfb 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/DoWhile_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/DoWhile_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 do
 println 123
 println 123

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_01.groovy
index efb44f7..4313d66 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_01.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 int()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_02.groovy
index a82bea5..d469216 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_02.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_02.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 1 = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_03.groovy
index 792a3e6..904f84e 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_03.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_03.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 m() = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_04.groovy
index bb9792e..0d4e9af 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_04.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_04.groovy
@@ -1 +1,19 @@
+/*
+ *  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 = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_05.groovy
index 7665ee4..58cf67c 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_05.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_05.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 super = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_06.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_06.groovy
index 8b512a0..220518d 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_06.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_06.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 [1, 2] = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_07.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_07.groovy
index 5a59f43..6f6f9b0 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_07.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_07.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 [a: 1, b: 2] = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_08.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_08.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_08.groovy
index 0130d78..fb47d45 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_08.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_08.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 "$x" = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_09.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_09.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_09.groovy
index 616d892..4c1958c 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_09.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_09.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 'x' = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/For_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/For_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/For_01.groovy
index 92ff34f..694dfed 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/For_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/For_01.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 for (*a; a.size() < 10;) {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/For_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/For_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/For_02.groovy
index ce63119..359b9ca 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/For_02.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/For_02.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 for (; a.size() < 10; *a) {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy
index 30fc526..312818e 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 interface Foo {
     def doit( String param = "Groovy", int o )
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/List_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/List_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/List_01.groovy
index 9d7077c..b625423 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/List_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/List_01.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 [,]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/LocalVariableDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/LocalVariableDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/LocalVariableDeclaration_01.groovy
index 9f164c6..590cb87 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/LocalVariableDeclaration_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/LocalVariableDeclaration_01.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 @Test2 (int c, int d) = [1, 2]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy
index 438d97f..a8f27ad 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 { ->
     def say(String msg) {
         println(msg)

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_01x.groovy
index 3a42c5c..d7d4ce7 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_01x.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 def def m() {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_02x.groovy
index df8b840..fcb609a 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_02x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_02x.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 public public class A {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_03x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_03x.groovy
index 9f2c1b8..de1f024 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_03x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_03x.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 final final int a = 1;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_04x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_04x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_04x.groovy
index fa56dec..4b495ad 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_04x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_04x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 class A {
     private public a
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_05x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_05x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_05x.groovy
index 4f05f32..d19ca6c 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_05x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_05x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 class A {
     protected public a
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_07.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_07.groovy
index 320d66e..2134472 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_07.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_07.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 volatile x() {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_01x.groovy
index f25de72..dc1585a 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_01x.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 (1 + 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_02x.groovy
index df4510f..e2ce8a4 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_02x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_02x.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 (1 + 2))
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_03x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_03x.groovy
index 2c33188..af33a2e 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_03x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_03x.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 (1 + 2]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Parentheses_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Parentheses_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Parentheses_01.groovy
index 0faabe6..976b0d2 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Parentheses_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Parentheses_01.groovy
@@ -1,2 +1,20 @@
+/*
+ *  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.
+ */
 def a( {
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Super_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Super_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Super_01x.groovy
index 772723f..8abe436 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Super_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Super_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 class A {
     A(int a) {
         println a

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Switch_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Switch_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Switch_01.groovy
index 7bec301..c548d86 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Switch_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Switch_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 switch (a) {
     case 1:
         break;

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/This_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/This_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/This_01x.groovy
index b1a72cb..d3fdc44 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/This_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/This_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 class A {
     A(int a) {
         println a

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/UnexpectedCharacter_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/UnexpectedCharacter_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/UnexpectedCharacter_01x.groovy
index 7b71c6e..5beccbe 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/UnexpectedCharacter_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/UnexpectedCharacter_01x.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_01x.groovy
index 1d1b56a..fdeb7c4 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 class MyClass {
     void field
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_02x.groovy
index fe9848d..748003e 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_02x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_02x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 class MyClass {
     def foo() {
         void bar = null


[35/50] [abbrv] groovy git commit: rename antlr4 parser to remove groovy- prefix since that is by convention for modules

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy b/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy
new file mode 100644
index 0000000..67a68f8
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy
@@ -0,0 +1,181 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4
+
+import org.apache.groovy.parser.antlr4.util.ASTComparatorCategory
+
+/**
+ * Some syntax error test cases for the new parser
+ *
+ * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
+ * Created on    2016/09/02
+ */
+class SyntaxErrorTest extends GroovyTestCase {
+    public static final String RESOURCES_PATH = 'src/test/resources';
+
+    void setUp() {}
+
+    void tearDown() {}
+
+    void "test groovy core - List"() {
+        TestUtils.shouldFail('fail/List_01.groovy');
+    }
+
+    void "test groovy core - Expression"() {
+        TestUtils.shouldFail('fail/Expression_01.groovy');
+        TestUtils.shouldFail('fail/Expression_02.groovy');
+        TestUtils.shouldFail('fail/Expression_03.groovy');
+//        shouldFail('fail/Expression_04.groovy', true);
+//        shouldFail('fail/Expression_05.groovy', true);
+        TestUtils.shouldFail('fail/Expression_06.groovy');
+        TestUtils.shouldFail('fail/Expression_07.groovy');
+        TestUtils.shouldFail('fail/Expression_08.groovy');
+        TestUtils.shouldFail('fail/Expression_09.groovy');
+    }
+
+    void "test groovy core - Switch"() {
+        TestUtils.shouldFail('fail/Switch_01.groovy');
+    }
+
+    void "test groovy core - LocalVariableDeclaration"() {
+        TestUtils.shouldFail('fail/LocalVariableDeclaration_01.groovy');
+    }
+
+    void "test groovy core - Continue"() {
+        TestUtils.doRunAndShouldFail('fail/Continue_01x.groovy');
+        TestUtils.doRunAndShouldFail('fail/Continue_02x.groovy');
+    }
+
+    void "test groovy core - Break"() {
+        TestUtils.doRunAndShouldFail('fail/Break_01x.groovy');
+        TestUtils.doRunAndShouldFail('fail/Break_02x.groovy');
+    }
+
+    void "test groovy core - UnexpectedCharacter"() {
+        TestUtils.doRunAndShouldFail('fail/UnexpectedCharacter_01x.groovy');
+    }
+
+//    void "test CompilerErrorTest_001.groovy"() {
+//        unzipScriptAndShouldFail("scripts/CompilerErrorTest_001.groovy", [])
+//    }
+
+//    void "test CompilerErrorTest_002.groovy"() {
+//        unzipScriptAndShouldFail("scripts/CompilerErrorTest_002.groovy", [])
+//    }
+
+//    void "test DifferencesFromJavaTest_002.groovy"() {
+//        unzipScriptAndShouldFail("scripts/DifferencesFromJavaTest_002.groovy", [])
+//    }
+
+//    void "test Groovy5212Bug_001.groovy"() {
+//        unzipScriptAndShouldFail("scripts/Groovy5212Bug_001.groovy", [])
+//    }
+
+//    void "test GStringEndTest_001.groovy"() {
+//        unzipScriptAndShouldFail("scripts/GStringEndTest_001.groovy", [])
+//    }
+
+    void "test groovy core - ParExpression"() {
+        TestUtils.doRunAndShouldFail('fail/ParExpression_01x.groovy');
+        TestUtils.doRunAndShouldFail('fail/ParExpression_02x.groovy');
+        TestUtils.doRunAndShouldFail('fail/ParExpression_03x.groovy');
+    }
+
+    void "test groovy core - Parentheses"() {
+        TestUtils.shouldFail('fail/Parentheses_01.groovy');
+    }
+
+    void "test groovy core - This"() {
+        TestUtils.doRunAndShouldFail('fail/This_01x.groovy');
+    }
+
+    void "test groovy core - Super"() {
+        TestUtils.doRunAndShouldFail('fail/Super_01x.groovy');
+    }
+
+    void "test groovy core - AbstractMethod"() {
+        TestUtils.doRunAndShouldFail('fail/AbstractMethod_01x.groovy');
+        TestUtils.doRunAndShouldFail('fail/AbstractMethod_02x.groovy');
+        TestUtils.doRunAndShouldFail('fail/AbstractMethod_03x.groovy');
+        TestUtils.doRunAndShouldFail('fail/AbstractMethod_04x.groovy');
+        TestUtils.doRunAndShouldFail('fail/AbstractMethod_05x.groovy');
+        TestUtils.doRunAndShouldFail('fail/AbstractMethod_06x.groovy');
+    }
+
+    void "test groovy core - BUGs"() {
+        TestUtils.doRunAndShouldFail('bugs/BUG-GROOVY-5318.groovy');
+        TestUtils.doRunAndShouldFail('bugs/BUG-GROOVY-8150.groovy');
+    }
+
+    void "test groovy core - DoWhile"() {
+        TestUtils.doRunAndShouldFail('fail/DoWhile_01x.groovy');
+    }
+
+    void "test groovy core - For"() {
+        TestUtils.shouldFail('fail/For_01.groovy');
+        TestUtils.shouldFail('fail/For_02.groovy');
+    }
+
+    void "test groovy core - Modifier"() {
+        TestUtils.doRunAndShouldFail('fail/Modifier_01x.groovy');
+        TestUtils.doRunAndShouldFail('fail/Modifier_02x.groovy');
+        TestUtils.doRunAndShouldFail('fail/Modifier_03x.groovy');
+        TestUtils.doRunAndShouldFail('fail/Modifier_04x.groovy');
+        TestUtils.doRunAndShouldFail('fail/Modifier_05x.groovy');
+        TestUtils.shouldFail('fail/Modifier_07.groovy');
+    }
+
+    void "test groovy core - ClassDeclaration"() {
+        TestUtils.doRunAndShouldFail('fail/ClassDeclaration_01x.groovy');
+    }
+
+    void "test groovy core - MethodDeclaration"() {
+        TestUtils.shouldFail('fail/MethodDeclaration_01.groovy');
+    }
+
+    void "test groovy core - ConstructorDeclaration"() {
+        TestUtils.shouldFail('fail/ConstructorDeclaration_01.groovy');
+    }
+
+    void "test groovy core - ClosureListExpression"() {
+        TestUtils.shouldFail('fail/ClosureListExpression_01.groovy');
+        TestUtils.shouldFail('fail/ClosureListExpression_02.groovy');
+        TestUtils.shouldFail('fail/ClosureListExpression_03.groovy');
+        TestUtils.shouldFail('fail/ClosureListExpression_04.groovy');
+    }
+
+    void "test groovy core - InterfaceDeclaration"() {
+        TestUtils.shouldFail('fail/InterfaceDeclaration_01.groovy');
+    }
+
+    void "test groovy core - void"() {
+        TestUtils.doRunAndShouldFail('fail/Void_01x.groovy');
+        TestUtils.doRunAndShouldFail('fail/Void_02x.groovy');
+    }
+
+
+    /**************************************/
+    static unzipScriptAndShouldFail(String entryName, List ignoreClazzList, Map<String, String> replacementsMap=[:], boolean toCheckNewParserOnly = false) {
+        ignoreClazzList.addAll(TestUtils.COMMON_IGNORE_CLASS_LIST)
+
+        TestUtils.unzipAndFail(SCRIPT_ZIP_PATH, entryName, TestUtils.addIgnore(ignoreClazzList, ASTComparatorCategory.LOCATION_IGNORE_LIST), replacementsMap, toCheckNewParserOnly)
+    }
+
+    public static final String SCRIPT_ZIP_PATH = "$TestUtils.RESOURCES_PATH/groovy-2.5.0/groovy-2.5.0-SNAPSHOT-20160921-allscripts.zip";
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/TestUtils.groovy
----------------------------------------------------------------------
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
new file mode 100644
index 0000000..a82966f
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/TestUtils.groovy
@@ -0,0 +1,259 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4
+
+import groovy.util.logging.Log
+import org.apache.groovy.parser.AbstractParser
+import org.apache.groovy.parser.Antlr2Parser
+import org.apache.groovy.parser.Antlr4Parser
+import org.apache.groovy.parser.antlr4.util.ASTComparatorCategory
+import org.apache.groovy.parser.antlr4.util.AstDumper
+import org.codehaus.groovy.ast.*
+import org.codehaus.groovy.ast.stmt.*
+import org.codehaus.groovy.control.CompilerConfiguration
+import org.codehaus.groovy.syntax.Token
+
+import java.util.zip.ZipEntry
+import java.util.zip.ZipFile
+
+/**
+ * Utilities for test
+ *
+ * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
+ * Created on    2016/09/21
+ */
+
+@Log
+class TestUtils {
+    public static final String DEFAULT_RESOURCES_PATH = 'subprojects/parser-antlr4/src/test/resources';
+    public static final String RESOURCES_PATH = new File(DEFAULT_RESOURCES_PATH).exists() ? DEFAULT_RESOURCES_PATH : 'src/test/resources';
+
+    static doTest(String path) {
+        return doTest(path, ASTComparatorCategory.DEFAULT_CONFIGURATION)
+    }
+
+    static doTest(String path, List ignoreClazzList) {
+        return doTest(path, addIgnore(ignoreClazzList, ASTComparatorCategory.LOCATION_IGNORE_LIST))
+    }
+
+    static doTest(String path, conf) {
+        AbstractParser antlr4Parser = new Antlr4Parser()
+        AbstractParser antlr2Parser = new Antlr2Parser()
+
+        File file = new File("$RESOURCES_PATH/$path");
+        def (newAST, newElapsedTime) = profile { antlr4Parser.parse(file) }
+        def (oldAST, oldElapsedTime) = profile { antlr2Parser.parse(file) }
+
+
+        assertAST(newAST, oldAST, conf);
+
+        long diffInMillis = newElapsedTime - oldElapsedTime;
+
+        if (diffInMillis >= 500) {
+            log.warning "${path}\t\t\t\t\tdiff:${diffInMillis / 1000}s,\tnew:${newElapsedTime / 1000}s,\told:${oldElapsedTime / 1000}s."
+        }
+
+        return [newAST, oldAST]
+    }
+
+    /*
+    static unzipAndTest(String path, String entryName) {
+        unzipAndTest(path, entryName, ASTComparatorCategory.DEFAULT_CONFIGURATION)
+    }
+    */
+
+    /*
+    static unzipAndTest(String path, String entryName, List ignoreClazzList) {
+        unzipAndTest(path, entryName, addIgnore(ignoreClazzList, ASTComparatorCategory.LOCATION_IGNORE_LIST))
+    }
+    */
+
+    static unzipAndTest(String path, String entryName, conf, Map<String, String> replacementsMap=[:]) {
+        AbstractParser antlr4Parser = new Antlr4Parser()
+        AbstractParser antlr2Parser = new Antlr2Parser()
+
+        String name = "$path!$entryName";
+        String text = readZipEntry(path, entryName);
+
+        replacementsMap?.each {k, v ->
+            text = text.replace(k, v);
+        }
+
+        def (newAST, newElapsedTime) = profile { antlr4Parser.parse(name, text) }
+        def (oldAST, oldElapsedTime) = profile { antlr2Parser.parse(name, text) }
+
+
+        assertAST(newAST, oldAST, conf);
+
+        long diffInMillis = newElapsedTime - oldElapsedTime;
+
+        if (diffInMillis >= 500) {
+            log.warning "${path}!${entryName}\t\t\t\t\tdiff:${diffInMillis / 1000}s,\tnew:${newElapsedTime / 1000}s,\told:${oldElapsedTime / 1000}s."
+        }
+    }
+
+
+    static shouldFail(String path, boolean toCheckNewParserOnly = false) {
+        shouldFail(path, ASTComparatorCategory.DEFAULT_CONFIGURATION, toCheckNewParserOnly)
+    }
+
+    static shouldFail(String path, List ignoreClazzList, boolean toCheckNewParserOnly = false) {
+        shouldFail(path, addIgnore(ignoreClazzList, ASTComparatorCategory.LOCATION_IGNORE_LIST), toCheckNewParserOnly)
+    }
+
+    static shouldFail(String path, conf, boolean toCheckNewParserOnly = false) {
+        AbstractParser antlr4Parser = new Antlr4Parser()
+        AbstractParser antlr2Parser = new Antlr2Parser()
+
+        File file = new File("$RESOURCES_PATH/$path");
+        def (newAST, newElapsedTime) = profile { antlr4Parser.parse(file) }
+        def (oldAST, oldElapsedTime) = profile { antlr2Parser.parse(file) }
+
+        if (toCheckNewParserOnly) {
+            assert (newAST == null || newAST.context.errorCollector.hasErrors())
+        } else {
+            assert (newAST == null || newAST.context.errorCollector.hasErrors()) &&
+                    (oldAST == null || oldAST.context.errorCollector.hasErrors())
+        }
+
+        long diffInMillis = newElapsedTime - oldElapsedTime;
+
+        if (diffInMillis >= 500) {
+            log.warning "${path}\t\t\t\t\tdiff:${diffInMillis / 1000}s,\tnew:${newElapsedTime / 1000}s,\told:${oldElapsedTime / 1000}s."
+        }
+    }
+
+    static unzipAndFail(String path, String entryName, conf, Map<String, String> replacementsMap=[:], boolean toCheckNewParserOnly = false) {
+        AbstractParser antlr4Parser = new Antlr4Parser()
+        AbstractParser antlr2Parser = new Antlr2Parser()
+
+        String name = "$path!$entryName";
+        String text = readZipEntry(path, entryName);
+
+        replacementsMap?.each {k, v ->
+            text = text.replace(k, v);
+        }
+
+        def (newAST, newElapsedTime) = profile { antlr4Parser.parse(name, text) }
+        def (oldAST, oldElapsedTime) = profile { antlr2Parser.parse(name, text) }
+
+        if (toCheckNewParserOnly) {
+            assert (newAST == null || newAST.context.errorCollector.hasErrors())
+        } else {
+            assert (newAST == null || newAST.context.errorCollector.hasErrors()) &&
+                    (oldAST == null || oldAST.context.errorCollector.hasErrors())
+        }
+
+        long diffInMillis = newElapsedTime - oldElapsedTime;
+
+        if (diffInMillis >= 500) {
+            log.warning "${path}!${entryName}\t\t\t\t\tdiff:${diffInMillis / 1000}s,\tnew:${newElapsedTime / 1000}s,\told:${oldElapsedTime / 1000}s."
+        }
+    }
+
+
+    static assertAST(ast1, ast2, conf) {
+        assert null != ast1 && null != ast2
+
+        ASTComparatorCategory.apply(conf) {
+            assert ast1 == ast2
+        }
+
+        assert genSrc(ast1) == genSrc(ast2)
+    }
+
+    static genSrc(ModuleNode ast) {
+        return new AstDumper(ast).gen();
+    }
+
+    static profile(Closure c) {
+        long begin = System.currentTimeMillis()
+        def result = c.call()
+        long end = System.currentTimeMillis()
+
+        return [result, end - begin];
+    }
+
+    static addIgnore(Class aClass, ArrayList<String> ignore, Map<Class, List<String>> c = null) {
+        c = c ?: ASTComparatorCategory.DEFAULT_CONFIGURATION.clone() as Map<Class, List<String>>;
+        c[aClass].addAll(ignore)
+        return c
+    }
+
+    static addIgnore(Collection<Class> aClass, ArrayList<String> ignore, Map<Class, List<String>> c = null) {
+        c = c ?: ASTComparatorCategory.DEFAULT_CONFIGURATION.clone() as Map<Class, List<String>>;
+        aClass.each { c[it].addAll(ignore) }
+        return c
+    }
+
+    static readZipEntry(String path, String entryName) {
+        String result = "";
+
+        def zf = new ZipFile(new File(path));
+        try {
+            def is = new BufferedInputStream(zf.getInputStream(new ZipEntry(entryName)));
+            result = is.getText("UTF-8");
+        } catch (Exception e) {
+            log.severe(e.message);
+        } finally {
+            try {
+                zf.close();
+            } catch(Exception e) {
+                // IGNORED
+            }
+        }
+
+        return result;
+    }
+
+    static doRunAndShouldFail(String path) {
+        assert !executeScript(path);
+    }
+
+    static doRunAndTest(String path) {
+        assert executeScript(path);
+    }
+
+    static executeScript(String path) {
+        executeScript(createAntlr4Shell(), "$RESOURCES_PATH/$path")
+    }
+
+    static executeScript(gsh, String path) {
+        def file = new File(path);
+        def content = file.text;
+
+        try {
+            gsh.evaluate(content);
+//            log.info("Evaluated $file")
+            return true;
+        } catch (Throwable t) {
+            log.severe("Failed $file: ${t.getMessage()}");
+            return false;
+        }
+    }
+
+    static createAntlr4Shell() {
+        CompilerConfiguration configuration = new CompilerConfiguration(CompilerConfiguration.DEFAULT)
+        configuration.pluginFactory = new Antlr4PluginFactory()
+
+        return new GroovyShell(configuration);
+    }
+
+    public static final List COMMON_IGNORE_CLASS_LIST = Collections.unmodifiableList([AssertStatement, BreakStatement, ConstructorNode, ContinueStatement, ExpressionStatement, FieldNode, ForStatement, GenericsType, IfStatement, MethodNode, PackageNode, Parameter, PropertyNode, ReturnStatement, ThrowStatement, Token, WhileStatement]);
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/util/ASTComparatorCategory.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/util/ASTComparatorCategory.groovy b/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/util/ASTComparatorCategory.groovy
new file mode 100644
index 0000000..47b9507
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/util/ASTComparatorCategory.groovy
@@ -0,0 +1,526 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4.util
+
+import groovy.util.logging.Log
+import org.codehaus.groovy.ast.*
+import org.codehaus.groovy.ast.expr.*
+import org.codehaus.groovy.ast.stmt.*
+import org.codehaus.groovy.syntax.Token
+
+import java.util.logging.Level
+
+@Log @SuppressWarnings("GroovyUnusedDeclaration")
+class ASTComparatorCategory {
+    static { log.level = Level.WARNING }
+    static List<String> LOCATION_IGNORE_LIST = ["columnNumber", "lineNumber", "lastColumnNumber", "lastLineNumber", "startLine"]
+    static private List<String> EXPRESSION_IGNORE_LIST = ["text"] + LOCATION_IGNORE_LIST
+
+    /**
+     *  Keeps all checked object pairs and their comparison result.
+     *  Will be cleared at {@link #apply(groovy.lang.Closure)} method }
+     */
+    static objects = [:] as Map<List<Object>, Boolean>
+    static String lastName
+
+    static Map<Class, List<String>> DEFAULT_CONFIGURATION = [
+            (ClassNode): (['module', "declaredMethodsMap", "plainNodeReference", "typeClass", "allInterfaces", "orAddStaticConstructorNode", "allDeclaredMethods", "unresolvedSuperClass", "innerClasses" ] + LOCATION_IGNORE_LIST) as List<String>,
+            (ConstructorNode): ['declaringClass'],
+            (DynamicVariable): [],
+            (EnumConstantClassNode): ["typeClass"],
+            (FieldNode): ["owner", "declaringClass", "initialValueExpression", "assignToken"],
+            (GenericsType): [],
+            (ImportNode): LOCATION_IGNORE_LIST,
+            (InnerClassNode): (['module', "declaredMethodsMap", "plainNodeReference", "typeClass", "allInterfaces", "orAddStaticConstructorNode", "allDeclaredMethods", "unresolvedSuperClass", "innerClasses" ] + LOCATION_IGNORE_LIST) as List<String>,
+            (InterfaceHelperClassNode): [],
+            (MethodNode): ["text", "declaringClass"],
+            (MixinNode): [],
+            (ModuleNode): ["context"],
+            (PackageNode): [],
+            (Parameter): [],
+            (PropertyNode): ['declaringClass', 'initialValueExpression', "assignToken"],
+            (Variable): [],
+            (VariableScope): ["clazzScope", "parent", "declaredVariablesIterator"],
+            (Token): ["root", "startColumn"],
+            (AnnotationNode): (["text"] + LOCATION_IGNORE_LIST) as List<String>,
+            (AssertStatement): ["text"],
+            (BlockStatement): ["columnNumber", "lineNumber", "lastColumnNumber", "lastLineNumber", "text"],
+            (BreakStatement): ["text"],
+            (CaseStatement): ["text"],
+            (CatchStatement): (["text"] + LOCATION_IGNORE_LIST) as List<String>,
+            (ContinueStatement): ["text"],
+            (DoWhileStatement): ["text"],
+            (EmptyStatement): ["text"],
+            (ExpressionStatement): ["text"],
+            (ForStatement): ["text"],
+            (IfStatement): ["text"],
+            (LoopingStatement): ["text"],
+            (ReturnStatement): ["text"],
+            (SwitchStatement): ["columnNumber", "lineNumber", "lastColumnNumber", "lastLineNumber", "text"],
+            (SynchronizedStatement): ["text"],
+            (ThrowStatement): ["text"],
+            (TryCatchStatement): (["text"] + LOCATION_IGNORE_LIST) as List<String>,
+            (WhileStatement): ["text"],
+            (AnnotationConstantExpression): EXPRESSION_IGNORE_LIST,
+            (ArgumentListExpression): EXPRESSION_IGNORE_LIST,
+            (ArrayExpression): EXPRESSION_IGNORE_LIST,
+            (AttributeExpression): EXPRESSION_IGNORE_LIST,
+            (BinaryExpression): EXPRESSION_IGNORE_LIST,
+            (BitwiseNegationExpression): EXPRESSION_IGNORE_LIST,
+            (BooleanExpression): EXPRESSION_IGNORE_LIST,
+            (CastExpression): EXPRESSION_IGNORE_LIST,
+            (ClassExpression): EXPRESSION_IGNORE_LIST,
+            (ClosureExpression): EXPRESSION_IGNORE_LIST,
+            (ClosureListExpression): EXPRESSION_IGNORE_LIST,
+            (ConstantExpression): EXPRESSION_IGNORE_LIST,
+            (ConstructorCallExpression): EXPRESSION_IGNORE_LIST,
+            (DeclarationExpression): ["text", "columnNumber", "lineNumber", "lastColumnNumber", "lastLineNumber"],
+            (ElvisOperatorExpression): EXPRESSION_IGNORE_LIST,
+            (EmptyExpression): EXPRESSION_IGNORE_LIST,
+            (ExpressionTransformer): EXPRESSION_IGNORE_LIST,
+            (FieldExpression): EXPRESSION_IGNORE_LIST,
+            (GStringExpression): EXPRESSION_IGNORE_LIST,
+            (ListExpression): EXPRESSION_IGNORE_LIST,
+            (MapEntryExpression): EXPRESSION_IGNORE_LIST,
+            (MapExpression): EXPRESSION_IGNORE_LIST,
+            (MethodCall): EXPRESSION_IGNORE_LIST,
+            (MethodCallExpression): EXPRESSION_IGNORE_LIST,
+            (MethodPointerExpression): EXPRESSION_IGNORE_LIST,
+            (NamedArgumentListExpression): EXPRESSION_IGNORE_LIST,
+            (NotExpression): EXPRESSION_IGNORE_LIST,
+            (PostfixExpression): EXPRESSION_IGNORE_LIST,
+            (PrefixExpression): EXPRESSION_IGNORE_LIST,
+            (PropertyExpression): EXPRESSION_IGNORE_LIST,
+            (RangeExpression): EXPRESSION_IGNORE_LIST,
+            (SpreadExpression): EXPRESSION_IGNORE_LIST,
+            (SpreadMapExpression): EXPRESSION_IGNORE_LIST,
+            (StaticMethodCallExpression): EXPRESSION_IGNORE_LIST,
+            (TernaryExpression): EXPRESSION_IGNORE_LIST,
+            (TupleExpression): EXPRESSION_IGNORE_LIST,
+            (UnaryMinusExpression): EXPRESSION_IGNORE_LIST,
+            (UnaryPlusExpression): EXPRESSION_IGNORE_LIST,
+            (VariableExpression): EXPRESSION_IGNORE_LIST,
+    ];
+
+    static Map<Class, List<String>> COLLECTION_PROPERTY_CONFIGURATION = [
+            (ModuleNode): ["classes", "name"]
+    ]
+
+    static Map<Class, List<String>> configuration = DEFAULT_CONFIGURATION;
+
+    static void apply(config = DEFAULT_CONFIGURATION, Closure cl) {
+        configuration = config
+        objects.clear()
+        use(ASTComparatorCategory, cl)
+        configuration = DEFAULT_CONFIGURATION
+    }
+
+    /**
+     * Main method that makes the magic. Compares all properties for object a and object b.
+     * There is a lot of problems in this code, like omitted class checking and so on. Just belive, it will be used properly.
+     * @param a
+     * @param b
+     * @return
+     */
+    static reflexiveEquals(a, b, ignore = []) {
+
+        if (a.getClass() != b.getClass()) {
+            log.warning(" !!!! DIFFERENCE WAS FOUND! ${a.getClass()} != ${b.getClass()}")
+            return false;
+        }
+
+        def objects = [a, b]
+        Boolean res = this.objects[objects]
+        if (res != null) {
+            log.info("Skipping [$a, $b] comparison as they are ${ res ? "" : "un" }equal.")
+            return res;
+        }
+        else if (this.objects.containsKey(objects)) {
+            log.info("Skipping as they are processed at higher levels.")
+            return true
+        }
+
+        this.objects[objects] = null
+        log.info("Equals was called for ${ a.getClass() } ${ a.hashCode() }, $lastName")
+        if (a.is(b))
+            return true
+
+        def difference = a.metaClass.properties.find { MetaBeanProperty p ->
+            if (!p.getter)
+                return false
+
+            def name = p.name
+            lastName = "$name :::: ${ a.getClass() } ${ a.hashCode() }"
+
+
+            for (Map.Entry<Class, List<String>> me : COLLECTION_PROPERTY_CONFIGURATION) {
+                if (!(me.key.isCase(a) && me.key.isCase(b))) {
+                    continue;
+                }
+
+                String propName = me.value[0];
+
+                if (name != propName) {
+                    continue;
+                }
+
+                def aValue = a."${propName}"; // FIXME when the propName is "classes", a classNode will be added to moduleNode.classes
+                def bValue = b."${propName}";
+
+                String orderName = me.value[1];
+
+                return new LinkedList(aValue?.getClass()?.isArray() ? Arrays.asList(aValue) : (aValue ?: [])).sort {c1, c2 -> c1."${orderName}" <=> c2."${orderName}"} !=
+                        new LinkedList(bValue?.getClass()?.isArray() ? Arrays.asList(bValue) : (bValue ?: [])).sort {c1, c2 -> c1."${orderName}" <=> c2."${orderName}"}
+            }
+
+
+            !(name in ignore) && (name != 'nodeMetaData' && name != 'metaDataMap') && a."$name" != b."$name"
+        }
+
+        if (difference)
+            log.warning(" !!!! DIFFERENCE WAS FOUND! [${a.metaClass.hasProperty(a, 'text') ? a.text : '<NO TEXT>'}][${a.class}][${difference.name}]:: ${ a."$difference.name" } != ${ b."$difference.name" }")
+        else
+            log.info(" ==== Exit ${ a.getClass() } ${ a.hashCode() } ====== ")
+
+        res = difference == null
+        this.objects[objects] = res
+        this.objects[objects.reverse(false)] = res
+        res
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    // Just a bunch of copypasted methods. Maybe will wrote AST transformation for them.
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+
+    static equals(ClassNode a, ClassNode b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(ConstructorNode a, ConstructorNode b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(DynamicVariable a, DynamicVariable b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(EnumConstantClassNode a, EnumConstantClassNode b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(FieldNode a, FieldNode b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(GenericsType a, GenericsType b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(ImportNode a, ImportNode b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(InnerClassNode a, InnerClassNode b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(InterfaceHelperClassNode a, InterfaceHelperClassNode b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(MethodNode a, MethodNode b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(MixinNode a, MixinNode b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(ModuleNode a, ModuleNode b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(PackageNode a, PackageNode b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(Parameter a, Parameter b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(PropertyNode a, PropertyNode b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(Variable a, Variable b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(VariableScope a, VariableScope b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(Token a, Token b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(CompileUnit a, CompileUnit b) {
+        true
+    }
+
+    static equals(AnnotationNode a, AnnotationNode b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    // Statements
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+
+    static equals(AssertStatement a, AssertStatement b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(BlockStatement a, BlockStatement b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(BreakStatement a, BreakStatement b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(CaseStatement a, CaseStatement b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(CatchStatement a, CatchStatement b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(ContinueStatement a, ContinueStatement b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(DoWhileStatement a, DoWhileStatement b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(EmptyStatement a, EmptyStatement b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(ExpressionStatement a, ExpressionStatement b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(ForStatement a, ForStatement b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(IfStatement a, IfStatement b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(LoopingStatement a, LoopingStatement b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(ReturnStatement a, ReturnStatement b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(SwitchStatement a, SwitchStatement b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(SynchronizedStatement a, SynchronizedStatement b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(ThrowStatement a, ThrowStatement b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(TryCatchStatement a, TryCatchStatement b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(WhileStatement a, WhileStatement b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    /////////////////////////////////////////////////////////////////////////////////////////////
+    // Expressions
+    /////////////////////////////////////////////////////////////////////////////////////////////
+
+    static equals(AnnotationConstantExpression a, AnnotationConstantExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(ArgumentListExpression a, ArgumentListExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(ArrayExpression a, ArrayExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(AttributeExpression a, AttributeExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(BinaryExpression a, BinaryExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(BitwiseNegationExpression a, BitwiseNegationExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(BooleanExpression a, BooleanExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(CastExpression a, CastExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(ClassExpression a, ClassExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(ClosureExpression a, ClosureExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(ClosureListExpression a, ClosureListExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(ConstantExpression a, ConstantExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(ConstructorCallExpression a, ConstructorCallExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(DeclarationExpression a, DeclarationExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(ElvisOperatorExpression a, ElvisOperatorExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(EmptyExpression a, EmptyExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(ExpressionTransformer a, ExpressionTransformer b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(FieldExpression a, FieldExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(GStringExpression a, GStringExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(ListExpression a, ListExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(MapEntryExpression a, MapEntryExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(MapExpression a, MapExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(MethodCall a, MethodCall b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(MethodCallExpression a, MethodCallExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(MethodPointerExpression a, MethodPointerExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(NamedArgumentListExpression a, NamedArgumentListExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(NotExpression a, NotExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(PostfixExpression a, PostfixExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(PrefixExpression a, PrefixExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(PropertyExpression a, PropertyExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(RangeExpression a, RangeExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(SpreadExpression a, SpreadExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(SpreadMapExpression a, SpreadMapExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(StaticMethodCallExpression a, StaticMethodCallExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(TernaryExpression a, TernaryExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(TupleExpression a, TupleExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(UnaryMinusExpression a, UnaryMinusExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(UnaryPlusExpression a, UnaryPlusExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+
+    static equals(VariableExpression a, VariableExpression b) {
+        reflexiveEquals(a, b, configuration[a.class])
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/util/AstDumper.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/util/AstDumper.groovy b/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/util/AstDumper.groovy
new file mode 100644
index 0000000..72a64e5
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/util/AstDumper.groovy
@@ -0,0 +1,1025 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4.util
+
+import org.codehaus.groovy.ast.*
+import org.codehaus.groovy.ast.expr.*
+import org.codehaus.groovy.ast.stmt.*
+import org.codehaus.groovy.classgen.BytecodeExpression
+import org.codehaus.groovy.classgen.GeneratorContext
+import org.codehaus.groovy.classgen.Verifier
+import org.codehaus.groovy.control.CompilationUnit
+import org.codehaus.groovy.control.SourceUnit
+import org.codehaus.groovy.control.io.ReaderSource
+
+import java.lang.reflect.Modifier
+
+/**
+ * Generate the groovy source according to the AST.
+ * It is useful to verify the equality of new and old parser.
+ *
+ * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
+ * Created on    2016/08/16
+ */
+class AstDumper {
+    private ModuleNode ast;
+
+    public AstDumper(ModuleNode ast) {
+        this.ast = ast;
+    }
+
+    /**
+     * Generate the groovy source code according the AST
+     *
+     * @return the groovy source code
+     */
+    public String gen() {
+        StringWriter out = new StringWriter();
+
+        try {
+            AstNodeToScriptVisitor visitor = new AstNodeToScriptVisitor(out, true, true);
+
+            new LinkedList<ClassNode>(this.ast?.classes ?: []).sort { c1, c2 -> c1.name <=> c2.name }?.each {
+                visitor.call(new SourceUnit((String) null, (ReaderSource) null, null, null, null) {
+                    @Override
+                    public ModuleNode getAST() {
+                        return AstDumper.this.ast;
+                    }
+                }, null, it)
+            }
+
+            return out.toString().replaceAll(/([\w_$]+)@[0-9a-z]+/, '$1@<hashcode>');
+        } finally {
+            out.close();
+        }
+    }
+}
+
+/**
+ * *****************************************************
+ * In order to solve the "Egg & Chicken" problem,
+ * we have to copy the source code(instead of invoking it): subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/AstNodeToScriptAdapter.groovy
+ * *****************************************************
+ *
+ *
+ * An adapter from ASTNode tree to source code.
+ *
+ * @author Hamlet D'Arcy
+ */
+class AstNodeToScriptVisitor extends CompilationUnit.PrimaryClassNodeOperation implements GroovyCodeVisitor, GroovyClassVisitor {
+
+    private final Writer _out
+    Stack<String> classNameStack = new Stack<String>()
+    String _indent = ''
+    boolean readyToIndent = true
+    boolean showScriptFreeForm
+    boolean showScriptClass
+    boolean scriptHasBeenVisited
+
+    def AstNodeToScriptVisitor(Writer writer, boolean showScriptFreeForm = true, boolean showScriptClass = true) {
+        this._out = writer
+        this.showScriptFreeForm = showScriptFreeForm
+        this.showScriptClass = showScriptClass
+        this.scriptHasBeenVisited = false
+    }
+
+    void call(SourceUnit source, GeneratorContext context, ClassNode classNode) {
+
+        visitPackage(source?.getAST()?.getPackage())
+
+        visitAllImports(source)
+
+        if (showScriptFreeForm && !scriptHasBeenVisited) {
+            scriptHasBeenVisited = true
+            source?.getAST()?.getStatementBlock()?.visit(this)
+        }
+        if (showScriptClass || !classNode.isScript()) {
+            visitClass classNode
+        }
+    }
+
+    private def visitAllImports(SourceUnit source) {
+        boolean staticImportsPresent = false
+        boolean importsPresent = false
+
+        source?.getAST()?.getStaticImports()?.values()?.each {
+            visitImport(it)
+            staticImportsPresent = true
+        }
+        source?.getAST()?.getStaticStarImports()?.values()?.each {
+            visitImport(it)
+            staticImportsPresent = true
+        }
+
+        if (staticImportsPresent) {
+            printDoubleBreak()
+        }
+
+        source?.getAST()?.getImports()?.each {
+            visitImport(it)
+            importsPresent = true
+        }
+        source?.getAST()?.getStarImports()?.each {
+            visitImport(it)
+            importsPresent = true
+        }
+        if (importsPresent) {
+            printDoubleBreak()
+        }
+    }
+
+
+    void print(parameter) {
+        def output = parameter.toString()
+
+        if (readyToIndent) {
+            _out.print _indent
+            readyToIndent = false
+            while (output.startsWith(' ')) {
+                output = output[1..-1]  // trim left
+            }
+        }
+        if (_out.toString().endsWith(' ')) {
+            if (output.startsWith(' ')) {
+                output = output[1..-1]
+            }
+        }
+        _out.print output
+    }
+
+    def println(parameter) {
+        throw new UnsupportedOperationException('Wrong API')
+    }
+
+    def indented(Closure block) {
+        String startingIndent = _indent
+        _indent = _indent + '    '
+        block()
+        _indent = startingIndent
+    }
+
+    def printLineBreak() {
+        if (!_out.toString().endsWith('\n')) {
+            _out.print '\n'
+        }
+        readyToIndent = true
+    }
+
+    def printDoubleBreak() {
+        if (_out.toString().endsWith('\n\n')) {
+            // do nothing
+        } else if (_out.toString().endsWith('\n')) {
+            _out.print '\n'
+        } else {
+            _out.print '\n'
+            _out.print '\n'
+        }
+        readyToIndent = true
+    }
+
+    void visitPackage(PackageNode packageNode) {
+
+        if (packageNode) {
+
+            packageNode.annotations?.each {
+                visitAnnotationNode(it)
+                printLineBreak()
+            }
+
+            if (packageNode.text.endsWith('.')) {
+                print packageNode.text[0..-2]
+            } else {
+                print packageNode.text
+            }
+            printDoubleBreak()
+        }
+    }
+
+    void visitImport(ImportNode node) {
+        if (node) {
+            node.annotations?.each {
+                visitAnnotationNode(it)
+                printLineBreak()
+            }
+            print node.text
+            printLineBreak()
+        }
+    }
+
+    @Override
+    void visitClass(ClassNode node) {
+
+        classNameStack.push(node.name)
+
+        node?.annotations?.each {
+            visitAnnotationNode(it)
+            printLineBreak()
+        }
+
+        visitModifiers(node.modifiers)
+        print "class $node.name"
+        visitGenerics node?.genericsTypes
+        boolean first = true
+        node.unresolvedInterfaces?.each {
+            if (!first) {
+                print ', '
+            } else {
+                print ' implements '
+            }
+            first = false
+            visitType it
+        }
+        print ' extends '
+        visitType node.unresolvedSuperClass
+        print ' { '
+        printDoubleBreak()
+
+        indented {
+            node?.properties?.each { visitProperty(it) }
+            printLineBreak()
+            node?.fields?.each { visitField(it) }
+            printDoubleBreak()
+            node?.declaredConstructors?.each { visitConstructor(it) }
+            printLineBreak()
+            node?.methods?.each { visitMethod(it) }
+        }
+        print '}'
+        printLineBreak()
+        classNameStack.pop()
+    }
+
+    private void visitGenerics(GenericsType[] generics) {
+
+        if (generics) {
+            print '<'
+            boolean first = true
+            generics.each { GenericsType it ->
+                if (!first) {
+                    print ', '
+                }
+                first = false
+                print it.name
+                if (it.upperBounds) {
+                    print ' extends '
+                    boolean innerFirst = true
+                    it.upperBounds.each { ClassNode upperBound ->
+                        if (!innerFirst) {
+                            print ' & '
+                        }
+                        innerFirst = false
+                        visitType upperBound
+                    }
+                }
+                if (it.lowerBound) {
+                    print ' super '
+                    visitType it.lowerBound
+                }
+            }
+            print '>'
+        }
+    }
+
+    @Override
+    void visitConstructor(ConstructorNode node) {
+        visitMethod(node)
+    }
+
+    private String visitParameters(parameters) {
+        boolean first = true
+
+        parameters.each { Parameter it ->
+            if (!first) {
+                print ', '
+            }
+            first = false
+
+            it.annotations?.each {
+                visitAnnotationNode(it)
+                print(' ')
+            }
+
+            visitModifiers(it.modifiers)
+            visitType it.type
+            print ' ' + it.name
+            if (it.initialExpression && !(it.initialExpression instanceof EmptyExpression)) {
+                print ' = '
+                it.initialExpression.visit this
+            }
+        }
+    }
+
+    @Override
+    void visitMethod(MethodNode node) {
+        node?.annotations?.each {
+            visitAnnotationNode(it)
+            printLineBreak()
+        }
+
+        visitModifiers(node.modifiers)
+        if (node.name == '<init>') {
+            print "${classNameStack.peek()}("
+            visitParameters(node.parameters)
+            print ') {'
+            printLineBreak()
+        } else if (node.name == '<clinit>') {
+            print '{ ' // will already have 'static' from modifiers
+            printLineBreak()
+        } else {
+            visitType node.returnType
+            print " $node.name("
+            visitParameters(node.parameters)
+            print ')'
+            if (node.exceptions) {
+                boolean first = true
+                print ' throws '
+                node.exceptions.each {
+                    if (!first) {
+                        print ', '
+                    }
+                    first = false
+                    visitType it
+                }
+            }
+            print ' {'
+            printLineBreak()
+        }
+
+        indented {
+            node?.code?.visit(this)
+        }
+        printLineBreak()
+        print '}'
+        printDoubleBreak()
+    }
+
+    private def visitModifiers(int modifiers) {
+        if (Modifier.isAbstract(modifiers)) {
+            print 'abstract '
+        }
+        if (Modifier.isFinal(modifiers)) {
+            print 'final '
+        }
+        if (Modifier.isInterface(modifiers)) {
+            print 'interface '
+        }
+        if (Modifier.isNative(modifiers)) {
+            print 'native '
+        }
+        if (Modifier.isPrivate(modifiers)) {
+            print 'private '
+        }
+        if (Modifier.isProtected(modifiers)) {
+            print 'protected '
+        }
+        if (Modifier.isPublic(modifiers)) {
+            print 'public '
+        }
+        if (Modifier.isStatic(modifiers)) {
+            print 'static '
+        }
+        if (Modifier.isSynchronized(modifiers)) {
+            print 'synchronized '
+        }
+        if (Modifier.isTransient(modifiers)) {
+            print 'transient '
+        }
+        if (Modifier.isVolatile(modifiers)) {
+            print 'volatile '
+        }
+    }
+
+    @Override
+    void visitField(FieldNode node) {
+        node?.annotations?.each {
+            visitAnnotationNode(it)
+            printLineBreak()
+        }
+        visitModifiers(node.modifiers)
+        visitType node.type
+        print " $node.name "
+        // do not print initial expression, as this is executed as part of the constructor, unless on static constant
+        Expression exp = node.initialValueExpression
+        if (exp instanceof ConstantExpression) exp = Verifier.transformToPrimitiveConstantIfPossible(exp)
+        ClassNode type = exp?.type
+        if (Modifier.isStatic(node.modifiers) && Modifier.isFinal(node.getModifiers())
+                && exp instanceof ConstantExpression
+                && type == node.type
+                && ClassHelper.isStaticConstantInitializerType(type)) {
+            // GROOVY-5150: final constants may be initialized directly
+            print ' = '
+            if (ClassHelper.STRING_TYPE == type) {
+                print "'"+node.initialValueExpression.text.replaceAll("'", "\\\\'")+"'"
+            } else if (ClassHelper.char_TYPE == type) {
+                print "'${node.initialValueExpression.text}'"
+            } else {
+                print node.initialValueExpression.text
+            }
+        }
+        printLineBreak()
+    }
+
+    void visitAnnotationNode(AnnotationNode node) {
+        print '@' + node?.classNode?.name
+        if (node?.members) {
+            print '('
+            boolean first = true
+            node.members.each { String name, Expression value ->
+                if (first) {
+                    first = false
+                } else {
+                    print ', '
+                }
+                print name + ' = '
+                value.visit(this)
+            }
+            print ')'
+        }
+
+    }
+
+    @Override
+    void visitProperty(PropertyNode node) {
+        // is a FieldNode, avoid double dispatch
+    }
+
+    @Override
+    void visitBlockStatement(BlockStatement block) {
+        block?.statements?.each {
+            it.visit(this)
+            printLineBreak()
+        }
+        if (!_out.toString().endsWith('\n')) {
+            printLineBreak()
+        }
+    }
+
+    @Override
+    void visitForLoop(ForStatement statement) {
+
+        print 'for ('
+        if (statement?.variable != ForStatement.FOR_LOOP_DUMMY) {
+            visitParameters([statement.variable])
+            print ' : '
+        }
+
+        if (statement?.collectionExpression instanceof ListExpression) {
+            statement?.collectionExpression?.visit this
+        } else {
+            statement?.collectionExpression?.visit this
+        }
+        print ') {'
+        printLineBreak()
+        indented {
+            statement?.loopBlock?.visit this
+        }
+        print '}'
+        printLineBreak()
+    }
+
+    @Override
+    void visitIfElse(IfStatement ifElse) {
+        print 'if ('
+        ifElse?.booleanExpression?.visit this
+        print ') {'
+        printLineBreak()
+        indented {
+            ifElse?.ifBlock?.visit this
+        }
+        printLineBreak()
+        if (ifElse?.elseBlock && !(ifElse.elseBlock instanceof EmptyStatement)) {
+            print '} else {'
+            printLineBreak()
+            indented {
+                ifElse?.elseBlock?.visit this
+            }
+            printLineBreak()
+        }
+        print '}'
+        printLineBreak()
+    }
+
+    @Override
+    void visitExpressionStatement(ExpressionStatement statement) {
+        statement.expression.visit this
+    }
+
+    @Override
+    void visitReturnStatement(ReturnStatement statement) {
+        printLineBreak()
+        print 'return '
+        statement.getExpression().visit(this)
+        printLineBreak()
+    }
+
+    @Override
+    void visitSwitch(SwitchStatement statement) {
+        print 'switch ('
+        statement?.expression?.visit this
+        print ') {'
+        printLineBreak()
+        indented {
+            statement?.caseStatements?.each {
+                visitCaseStatement it
+            }
+            if (statement?.defaultStatement) {
+                print 'default: '
+                printLineBreak()
+                statement?.defaultStatement?.visit this
+            }
+        }
+        print '}'
+        printLineBreak()
+    }
+
+    @Override
+    void visitCaseStatement(CaseStatement statement) {
+        print 'case '
+        statement?.expression?.visit this
+        print ':'
+        printLineBreak()
+        indented {
+            statement?.code?.visit this
+        }
+    }
+
+    @Override
+    void visitBreakStatement(BreakStatement statement) {
+        print 'break'
+        printLineBreak()
+    }
+
+    @Override
+    void visitContinueStatement(ContinueStatement statement) {
+        print 'continue'
+        printLineBreak()
+    }
+
+    @Override
+    void visitMethodCallExpression(MethodCallExpression expression) {
+
+        Expression objectExp = expression.getObjectExpression()
+        if (objectExp instanceof VariableExpression) {
+            visitVariableExpression(objectExp, false)
+        } else {
+            objectExp.visit(this)
+        }
+        if (expression.spreadSafe) {
+            print '*'
+        }
+        if (expression.safe) {
+            print '?'
+        }
+        print '.'
+        Expression method = expression.getMethod()
+        if (method instanceof ConstantExpression) {
+            visitConstantExpression(method, true)
+        } else {
+            method.visit(this)
+        }
+        expression.getArguments().visit(this)
+    }
+
+    @Override
+    void visitStaticMethodCallExpression(StaticMethodCallExpression expression) {
+        print expression?.ownerType?.name + '.' + expression?.method
+        if (expression?.arguments instanceof VariableExpression || expression?.arguments instanceof MethodCallExpression) {
+            print '('
+            expression?.arguments?.visit this
+            print ')'
+        } else {
+            expression?.arguments?.visit this
+        }
+    }
+
+    @Override
+    void visitConstructorCallExpression(ConstructorCallExpression expression) {
+        if (expression?.isSuperCall()) {
+            print 'super'
+        } else if (expression?.isThisCall()) {
+            print 'this '
+        } else {
+            print 'new '
+            visitType expression?.type
+        }
+        expression?.arguments?.visit this
+    }
+
+    @Override
+    void visitBinaryExpression(BinaryExpression expression) {
+        expression?.leftExpression?.visit this
+        print " $expression.operation.text "
+        expression.rightExpression.visit this
+
+        if (expression?.operation?.text == '[') {
+            print ']'
+        }
+    }
+
+    @Override
+    void visitPostfixExpression(PostfixExpression expression) {
+        print '('
+        expression?.expression?.visit this
+        print ')'
+        print expression?.operation?.text
+    }
+
+    @Override
+    void visitPrefixExpression(PrefixExpression expression) {
+        print expression?.operation?.text
+        print '('
+        expression?.expression?.visit this
+        print ')'
+    }
+
+
+    @Override
+    void visitClosureExpression(ClosureExpression expression) {
+        print '{ '
+        if (expression?.parameters) {
+            visitParameters(expression?.parameters)
+            print ' ->'
+        }
+        printLineBreak()
+        indented {
+            expression?.code?.visit this
+        }
+        print '}'
+    }
+
+    @Override
+    void visitTupleExpression(TupleExpression expression) {
+        print '('
+        visitExpressionsAndCommaSeparate(expression?.expressions)
+        print ')'
+    }
+
+    @Override
+    void visitRangeExpression(RangeExpression expression) {
+        print '('
+        expression?.from?.visit this
+        print '..'
+        expression?.to?.visit this
+        print ')'
+    }
+
+    @Override
+    void visitPropertyExpression(PropertyExpression expression) {
+        expression?.objectExpression?.visit this
+        if (expression?.spreadSafe) {
+            print '*'
+        } else if (expression?.isSafe()) {
+            print '?'
+        }
+        print '.'
+        if (expression?.property instanceof ConstantExpression) {
+            visitConstantExpression(expression?.property, true)
+        } else {
+            expression?.property?.visit this
+        }
+    }
+
+    @Override
+    void visitAttributeExpression(AttributeExpression attributeExpression) {
+        visitPropertyExpression attributeExpression
+    }
+
+    @Override
+    void visitFieldExpression(FieldExpression expression) {
+        print expression?.field?.name
+    }
+
+    void visitConstantExpression(ConstantExpression expression, boolean unwrapQuotes = false) {
+        if (expression.value instanceof String && !unwrapQuotes) {
+            // string reverse escaping is very naive
+            def escaped = ((String) expression.value).replaceAll('\n', '\\\\n').replaceAll("'", "\\\\'")
+            print "'$escaped'"
+        } else {
+            print expression.value
+        }
+    }
+
+    @Override
+    void visitClassExpression(ClassExpression expression) {
+        print expression.text
+    }
+
+    void visitVariableExpression(VariableExpression expression, boolean spacePad = true) {
+
+        if (spacePad) {
+            print ' ' + expression.name + ' '
+        } else {
+            print expression.name
+        }
+    }
+
+    @Override
+    void visitDeclarationExpression(DeclarationExpression expression) {
+        // handle multiple assignment expressions
+        if (expression?.leftExpression instanceof ArgumentListExpression) {
+            print 'def '
+            visitArgumentlistExpression expression?.leftExpression, true
+            print " $expression.operation.text "
+            expression.rightExpression.visit this
+
+            if (expression?.operation?.text == '[') {
+                print ']'
+            }
+        } else {
+            visitType expression?.leftExpression?.type
+            visitBinaryExpression expression // is a BinaryExpression
+        }
+    }
+
+    @Override
+    void visitGStringExpression(GStringExpression expression) {
+        print '"' + expression.text + '"'
+    }
+
+    @Override
+    void visitSpreadExpression(SpreadExpression expression) {
+        print '*'
+        expression?.expression?.visit this
+    }
+
+    @Override
+    void visitNotExpression(NotExpression expression) {
+        print '!('
+        expression?.expression?.visit this
+        print ')'
+    }
+
+    @Override
+    void visitUnaryMinusExpression(UnaryMinusExpression expression) {
+        print '-('
+        expression?.expression?.visit this
+        print ')'
+    }
+
+    @Override
+    void visitUnaryPlusExpression(UnaryPlusExpression expression) {
+        print '+('
+        expression?.expression?.visit this
+        print ')'
+    }
+
+    @Override
+    void visitCastExpression(CastExpression expression) {
+        print '(('
+        expression?.expression?.visit this
+        print ') as '
+        visitType(expression?.type)
+        print ')'
+
+    }
+
+    /**
+     * Prints out the type, safely handling arrays.
+     * @param classNode
+     *      classnode
+     */
+    void visitType(ClassNode classNode) {
+        def name = classNode.name
+        if (name =~ /^\[+L/ && name.endsWith(';')) {
+            int numDimensions = name.indexOf('L')
+            print "${classNode.name[(numDimensions + 1)..-2]}" + ('[]' * numDimensions)
+        } else {
+            print name
+        }
+        visitGenerics classNode?.genericsTypes
+    }
+
+    void visitArgumentlistExpression(ArgumentListExpression expression, boolean showTypes = false) {
+        print '('
+        int count = expression?.expressions?.size()
+        expression.expressions.each {
+            if (showTypes) {
+                visitType it.type
+                print ' '
+            }
+            if (it instanceof VariableExpression) {
+                visitVariableExpression it, false
+            } else if (it instanceof ConstantExpression) {
+                visitConstantExpression it, false
+            } else {
+                it.visit this
+            }
+            count--
+            if (count) print ', '
+        }
+        print ')'
+    }
+
+    @Override
+    void visitBytecodeExpression(BytecodeExpression expression) {
+        print '/*BytecodeExpression*/'
+        printLineBreak()
+    }
+
+
+
+    @Override
+    void visitMapExpression(MapExpression expression) {
+        print '['
+        if (expression?.mapEntryExpressions?.size() == 0) {
+            print ':'
+        } else {
+            visitExpressionsAndCommaSeparate(expression?.mapEntryExpressions)
+        }
+        print ']'
+    }
+
+    @Override
+    void visitMapEntryExpression(MapEntryExpression expression) {
+        if (expression?.keyExpression instanceof SpreadMapExpression) {
+            print '*'            // is this correct?
+        } else {
+            expression?.keyExpression?.visit this
+        }
+        print ': '
+        expression?.valueExpression?.visit this
+    }
+
+    @Override
+    void visitListExpression(ListExpression expression) {
+        print '['
+        visitExpressionsAndCommaSeparate(expression?.expressions)
+        print ']'
+    }
+
+    @Override
+    void visitTryCatchFinally(TryCatchStatement statement) {
+        print 'try {'
+        printLineBreak()
+        indented {
+            statement?.tryStatement?.visit this
+        }
+        printLineBreak()
+        print '} '
+        printLineBreak()
+        statement?.catchStatements?.each { CatchStatement catchStatement ->
+            visitCatchStatement(catchStatement)
+        }
+        print 'finally { '
+        printLineBreak()
+        indented {
+            statement?.finallyStatement?.visit this
+        }
+        print '} '
+        printLineBreak()
+    }
+
+    @Override
+    void visitThrowStatement(ThrowStatement statement) {
+        print 'throw '
+        statement?.expression?.visit this
+        printLineBreak()
+    }
+
+    @Override
+    void visitSynchronizedStatement(SynchronizedStatement statement) {
+        print 'synchronized ('
+        statement?.expression?.visit this
+        print ') {'
+        printLineBreak()
+        indented {
+            statement?.code?.visit this
+        }
+        print '}'
+    }
+
+    @Override
+    void visitTernaryExpression(TernaryExpression expression) {
+        expression?.booleanExpression?.visit this
+        print ' ? '
+        expression?.trueExpression?.visit this
+        print ' : '
+        expression?.falseExpression?.visit this
+    }
+
+    @Override
+    void visitShortTernaryExpression(ElvisOperatorExpression expression) {
+        visitTernaryExpression(expression)
+    }
+
+    @Override
+    void visitBooleanExpression(BooleanExpression expression) {
+        expression?.expression?.visit this
+    }
+
+    @Override
+    void visitWhileLoop(WhileStatement statement) {
+        print 'while ('
+        statement?.booleanExpression?.visit this
+        print ') {'
+        printLineBreak()
+        indented {
+            statement?.loopBlock?.visit this
+        }
+        printLineBreak()
+        print '}'
+        printLineBreak()
+    }
+
+    @Override
+    void visitDoWhileLoop(DoWhileStatement statement) {
+        print 'do {'
+        printLineBreak()
+        indented {
+            statement?.loopBlock?.visit this
+        }
+        print '} while ('
+        statement?.booleanExpression?.visit this
+        print ')'
+        printLineBreak()
+    }
+
+    @Override
+    void visitCatchStatement(CatchStatement statement) {
+        print 'catch ('
+        visitParameters([statement.variable])
+        print ') {'
+        printLineBreak()
+        indented {
+            statement.code?.visit this
+        }
+        print '} '
+        printLineBreak()
+    }
+
+    @Override
+    void visitBitwiseNegationExpression(BitwiseNegationExpression expression) {
+        print '~('
+        expression?.expression?.visit this
+        print ') '
+    }
+
+    @Override
+    void visitAssertStatement(AssertStatement statement) {
+        print 'assert '
+        statement?.booleanExpression?.visit this
+        print ' : '
+        statement?.messageExpression?.visit this
+    }
+
+    @Override
+    void visitClosureListExpression(ClosureListExpression expression) {
+        boolean first = true
+        expression?.expressions?.each {
+            if (!first) {
+                print ';'
+            }
+            first = false
+            it.visit this
+        }
+    }
+
+    @Override
+    void visitMethodPointerExpression(MethodPointerExpression expression) {
+        expression?.expression?.visit this
+        print '.&'
+        expression?.methodName?.visit this
+    }
+
+    @Override
+    void visitArrayExpression(ArrayExpression expression) {
+        print 'new '
+        visitType expression?.elementType
+        print '['
+        visitExpressionsAndCommaSeparate(expression?.sizeExpression)
+        print ']'
+    }
+
+    private void visitExpressionsAndCommaSeparate(List<? super Expression> expressions) {
+        boolean first = true
+        expressions?.each {
+            if (!first) {
+                print ', '
+            }
+            first = false
+            it.visit this
+        }
+    }
+
+    @Override
+    void visitSpreadMapExpression(SpreadMapExpression expression) {
+        print '*:'
+        expression?.expression?.visit this
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-2324.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-2324.groovy b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-2324.groovy
new file mode 100644
index 0000000..30e2f30
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-2324.groovy
@@ -0,0 +1,23 @@
+/*
+ *  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.
+ */
+class Foo {}
+
+Foo bar
+bar = new Foo()
+assert bar instanceof Foo

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4438.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4438.groovy b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4438.groovy
new file mode 100644
index 0000000..41ee327
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4438.groovy
@@ -0,0 +1,26 @@
+/*
+ *  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.
+ */
+enum Outer {
+    A, B
+    enum Inner{X, Y}
+}
+assert Outer.A instanceof Outer
+assert Outer.B instanceof Outer
+assert Outer.Inner.X instanceof Outer.Inner
+assert Outer.Inner.Y instanceof Outer.Inner
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4757.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4757.groovy b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4757.groovy
new file mode 100644
index 0000000..1a7d2e5
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4757.groovy
@@ -0,0 +1,27 @@
+/*
+ *  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.
+ */
+package bugs
+
+class Foo {
+    <T extends Object> T foo(T t) {
+        return t
+    }
+}
+
+assert 'abc' == new Foo().foo('abc')
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4762.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4762.groovy b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4762.groovy
new file mode 100644
index 0000000..235f6a5
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4762.groovy
@@ -0,0 +1,27 @@
+/*
+ *  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.
+ */
+package bugs
+
+def get123() {2}
+def foo(i) {this}
+
+def a = foo(2).'123'
+def b = foo 2   123
+
+assert a == b
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5318.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5318.groovy b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5318.groovy
new file mode 100644
index 0000000..13cb623
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5318.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+def a= new java.util<Integer>.ArrayList<ArrayList<Integer>>()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5652.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5652.groovy b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5652.groovy
new file mode 100644
index 0000000..e7c6b3f
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5652.groovy
@@ -0,0 +1,24 @@
+/*
+ *  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.
+ */
+package bugs
+
+def list = [[1,2],[3,4]] as List<List<Integer>>
+println list
+println 'bye'
+assert [[1,2],[3,4]] == list

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-6038.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-6038.groovy b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-6038.groovy
new file mode 100644
index 0000000..f41c5e9
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-6038.groovy
@@ -0,0 +1,37 @@
+/*
+ *  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.
+ */
+import java.lang.annotation.*
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+@interface Upper {
+    @Retention(RetentionPolicy.RUNTIME)
+    @Target(ElementType.METHOD)
+    @interface Inner {
+        String testInner()
+    }
+}
+
+class X {
+    @Upper.Inner(testInner='abc')
+    def m() {}
+}
+
+def m = X.class.declaredMethods.find { it.name == 'm' }
+assert m.declaredAnnotations[0].testInner() == 'abc'

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8150.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8150.groovy b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8150.groovy
new file mode 100644
index 0000000..ac0cc9d
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8150.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+def a
+def b = [1]
+((a)) = b
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
new file mode 100644
index 0000000..0b54cda
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
@@ -0,0 +1,20 @@
+/*
+ *  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.
+ */
+for (foo in []) {;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/bugs/GROOVY-3898.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/bugs/GROOVY-3898.groovy b/subprojects/parser-antlr4/src/test/resources/bugs/GROOVY-3898.groovy
new file mode 100644
index 0000000..146b5e6
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/bugs/GROOVY-3898.groovy
@@ -0,0 +1,26 @@
+/*
+ *  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.
+ */
+package bugs
+
+int result = 1
+for((i, j) = [0,0]; i < 3; {i++; j++}()){
+    result = result * i + j
+}
+assert 4 == result
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/AnnotationDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/AnnotationDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/AnnotationDeclaration_01.groovy
new file mode 100644
index 0000000..88f3a3d
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/AnnotationDeclaration_01.groovy
@@ -0,0 +1,57 @@
+/*
+ *  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.
+ */
+import org.codehaus.groovy.transform.GroovyASTTransformationClass
+
+import java.lang.annotation.Documented
+import java.lang.annotation.ElementType
+import java.lang.annotation.Retention
+import java.lang.annotation.RetentionPolicy
+import java.lang.annotation.Target
+
+@Canonical(
+        includes = ['a', 'b'], excludes = ['c']
+)
+@Documented
+@Retention(RetentionPolicy.SOURCE)
+@Target(ElementType.FIELD)
+@GroovyASTTransformationClass('Lulz')
+@interface FunnyAnnotation {
+    public static final String SOME_CONSTANT2 = 'SOME_CONSTANT2';
+    String SOME_CONSTANT = 'SOME_CONSTANT';
+
+    /* This is a comment
+    */
+    String name() default ""
+
+    /**
+     * This has a default, too
+     */
+    boolean synchronize() default false
+
+    boolean synchronize2() default
+            false
+}
+
+@interface a {
+
+}
+
+@interface b {
+    String name()
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Annotation_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Annotation_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Annotation_01.groovy
new file mode 100644
index 0000000..c86b156
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Annotation_01.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+@Export package core

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Annotation_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Annotation_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/Annotation_02.groovy
new file mode 100644
index 0000000..8d624ae
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Annotation_02.groovy
@@ -0,0 +1,20 @@
+/*
+ *  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.
+ */
+@Export
+package core


[42/50] [abbrv] groovy git commit: rename antlr4 parser to remove groovy- prefix since that is by convention for modules

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_02.groovy
deleted file mode 100644
index 8d624ae..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_02.groovy
+++ /dev/null
@@ -1,20 +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.
- */
-@Export
-package core

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_03.groovy
deleted file mode 100644
index 4bea111..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_03.groovy
+++ /dev/null
@@ -1,21 +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.
- */
-@Export
-@Version
-package core

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_04.groovy
deleted file mode 100644
index a3e7d8c..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_04.groovy
+++ /dev/null
@@ -1,20 +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.
- */
-@Export @Version
-package core

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_05.groovy
deleted file mode 100644
index 855b57f..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_05.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-@Test1 import java.util.Map

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_06.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_06.groovy
deleted file mode 100644
index b53f38d..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_06.groovy
+++ /dev/null
@@ -1,20 +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.
- */
-@Test1
-import java.util.Map

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_07.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_07.groovy
deleted file mode 100644
index bbb83e3..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_07.groovy
+++ /dev/null
@@ -1,20 +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.
- */
-@Test1 @Test2
-import java.util.Map

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_08.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_08.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_08.groovy
deleted file mode 100644
index 7a2e4d0..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_08.groovy
+++ /dev/null
@@ -1,28 +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.
- */
-@Test1 @Test2 @Test3
-import java.util.Map
-@Test1 @Test2 @Test3
-import java.util.*
-@Test1 @Test2 @Test3
-import static java.lang.Math
-@Test1 @Test2 @Test3
-import static java.lang.Math.*
-@Test1 @Test2 @Test3
-import static java.lang.Math.pow

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_09.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_09.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_09.groovy
deleted file mode 100644
index b5753c4..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_09.groovy
+++ /dev/null
@@ -1,32 +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.
- */
-@Test1(12)
-@Test1(@Test1)
-@Test2(v=6)
-@Test3(v1=6, v2=8, v3=10)
-@Test4([1, 2, 3])
-@Test5(v=[1, 2, 3])
-@Test6(v1=[1, 2, 3], v2=[1], v3=6)
-package core
-
-@Grapes([
-        @Grab('xx:yy:1.0'), // xx
-        @Grab('zz:yy:1.0') /* zz */
-])
-import xx.yy.ZZ;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_10x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_10x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_10x.groovy
deleted file mode 100644
index 1ee354b..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_10x.groovy
+++ /dev/null
@@ -1,38 +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.
- */
-import java.lang.annotation.RetentionPolicy
-import java.lang.annotation.Retention
-
-def closureClass = NestedAnnotationWithDefault.getAnnotation(AnnWithNestedAnnWithDefault).elem().elem()
-def closure = closureClass.newInstance(null, null)
-assert closure.call() == 3
-
-
-@AnnWithNestedAnnWithDefault(elem = @AnnWithDefaultValue())
-class NestedAnnotationWithDefault {}
-
-@Retention(RetentionPolicy.RUNTIME)
-@interface AnnWithDefaultValue {
-    Class elem() default { 1 + 2 }
-}
-
-@Retention(RetentionPolicy.RUNTIME)
-@interface AnnWithNestedAnnWithDefault {
-    AnnWithDefaultValue elem()
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Array_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Array_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Array_01x.groovy
deleted file mode 100644
index 9af7957..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Array_01x.groovy
+++ /dev/null
@@ -1,104 +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.
- */
-import groovy.transform.CompileStatic
-
-def testArrayInitializer() {
-    def x = new double[] {}
-    assert x.length == 0
-
-    def y = new double[][] {}
-    assert y.length == 0
-
-    def a = new int[] {1, 2}
-    assert a[0] == 1
-    assert a[1] == 2
-    assert a as List == [1, 2]
-
-    def b = new int[][] {
-        new int[] {1, 1.plus(1)},
-        new int[] {2.plus(1), 4}
-    }
-    assert b[0][0] == 1
-    assert b[0][1] == 2
-    assert b[1][0] == 3
-    assert b[1][1] == 4
-
-    def c = new String[] {
-        'a'
-        ,
-        'b'
-        ,
-        'c'
-        ,
-    }
-    assert c[0] == 'a'
-    assert c[1] == 'b'
-    assert c[2] == 'c'
-
-    assert new String[]
-            {
-                'a', 'b'
-            }
-    ==
-            ['a', 'b'] as String[]
-}
-testArrayInitializer();
-
-@CompileStatic
-def testArrayInitializerCS() {
-    def x = new double[] {}
-    assert x.length == 0
-
-    def y = new double[][] {}
-    assert y.length == 0
-
-    def a = new int[] {1, 2}
-    assert a[0] == 1
-    assert a[1] == 2
-    assert a as List == [1, 2]
-
-    def b = new int[][] {
-        new int[] {1, 1.plus(1)},
-        new int[] {2.plus(1), 4}
-    }
-    assert b[0][0] == 1
-    assert b[0][1] == 2
-    assert b[1][0] == 3
-    assert b[1][1] == 4
-
-    def c = new String[] {
-        'a'
-        ,
-        'b'
-        ,
-        'c'
-        ,
-    }
-    assert c[0] == 'a'
-    assert c[1] == 'b'
-    assert c[2] == 'c'
-
-    assert new String[]
-            {
-                'a', 'b'
-            }
-    ==
-    ['a', 'b'] as String[]
-}
-testArrayInitializerCS();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_01.groovy
deleted file mode 100644
index f790083..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_01.groovy
+++ /dev/null
@@ -1,46 +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.
- */
-assert true
-assert true;
-assert true : ':(';
-assert true , ':(';
-assert true :
-        ':('
-assert true ,
-        ':(';
-
-assert true:    \
-    'hello, world'
-
-assert true,    \
-    'hello, world'
-
-assert 1 \
-        + 2 * \
-        3 :    \
-        'hello, world'
-
-assert 1 \
-        + 2 * \
-\
-        3 :    \
-\
-\
-'hello, world'
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_02x.groovy
deleted file mode 100644
index 659232d..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_02x.groovy
+++ /dev/null
@@ -1,55 +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.
- */
-import org.codehaus.groovy.runtime.powerassert.PowerAssertionError
-
-testBinaryExpression()
-
-/***********************************/
-void testBinaryExpression() {
-    isRendered """
-assert a * b
-       | | |
-       0 0 1
-        """, {
-        def a = 0
-        def b = 1
-        assert a * b
-    }
-
-    isRendered """
-assert a[b]
-       |||
-       ||0
-       |false
-       [false]
-        """, {
-        def a = [false]
-        def b = 0
-        assert a[b]
-    }
-}
-
-static isRendered(String expectedRendering, Closure failingAssertion) {
-    try {
-        failingAssertion.call();
-        assert false, "assertion should have failed but didn't"
-    } catch (PowerAssertionError e) {
-        assert expectedRendering.trim() == e.message.trim()
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_03x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_03x.groovy
deleted file mode 100644
index 71f4540..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_03x.groovy
+++ /dev/null
@@ -1,44 +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.
- */
-import org.codehaus.groovy.runtime.powerassert.PowerAssertionError
-
-testPostfixExpression()
-
-/***********************************/
-
-void testPostfixExpression() {
-    isRendered """
-assert x++ == null
-       ||  |
-       |0  false
-       0
-        """, {
-        def x = 0
-        assert x++ == null
-    }
-}
-
-static isRendered(String expectedRendering, Closure failingAssertion) {
-    try {
-        failingAssertion.call();
-        assert false, "assertion should have failed but didn't"
-    } catch (PowerAssertionError e) {
-        assert expectedRendering.trim() == e.message.trim()
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_01x.groovy
deleted file mode 100644
index 33bb86d..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_01x.groovy
+++ /dev/null
@@ -1,42 +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.
- */
-package core
-
-class a<T> {
-    int x = 1;
-}
-
-a b = new a()
-assert b.x == 1
-
-a<String> b2 = new a<String>()
-assert b2.x == 1
-
-a<String>[] b3 = new a<String>[0]
-assert b3.length == 0
-
-core.a b4 = new a()
-assert b4.x == 1
-
-core.a<String> b5 = new a<String>()
-assert b5.x == 1
-
-core.a<String>[] b6 = new a<String>[0]
-assert b6.length == 0
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_02x.groovy
deleted file mode 100644
index 3c38453..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_02x.groovy
+++ /dev/null
@@ -1,27 +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.
- */
-package core
-
-import java.util.concurrent.atomic.AtomicInteger
-
-def inc(AtomicInteger x) { x.incrementAndGet() }
-def a = new AtomicInteger(0)
-
-inc a
-assert 1 == a.get()

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_03x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_03x.groovy
deleted file mode 100644
index 4f9e8d7..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_03x.groovy
+++ /dev/null
@@ -1,34 +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.
- */
-package core
-
-class a {}
-a[] b
-b = new a[0]
-assert 0 == b.length
-
-a[] b2 = new a[0]
-assert 0 == b2.length
-
-core.a[] b3
-b3 = new a[0]
-assert 0 == b3.length
-
-core.a[] b4 = new a[0]
-assert 0 == b4.length
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_04x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_04x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_04x.groovy
deleted file mode 100644
index 477932b..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_04x.groovy
+++ /dev/null
@@ -1,44 +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.
- */
-package core
-
-class B<T> {}
-B b
-b = new B()
-assert b instanceof B
-
-B<String> b2
-b2 = new B<String>()
-assert b2 instanceof B
-
-B<String>[] b3
-b3 = new B<String>[0]
-assert b3 instanceof B[]
-
-core.B b4
-b4 = new B()
-assert b4 instanceof B
-
-core.B<String> b5
-b5 = new B<String>()
-assert b5 instanceof B
-
-core.B<String>[] b6
-b6 = new B<String>[0]
-assert b6 instanceof B[]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_01.groovy
deleted file mode 100644
index 05c8bc3..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_01.groovy
+++ /dev/null
@@ -1,73 +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.
- */
-package core
-
-class A {}
-class B<T> {}
-class C<T extends A> {}
-class D<T extends A & B> {}
-class E<T extends A & B & C> {}
-class F<T extends A & B & C> extends A {}
-class F2 extends A<T> {}
-class G1<T extends A & B & C> extends A implements X {}
-class G2<T extends A & B & C> extends A<T> implements X<T> {}
-class G3                      extends A<T> implements X<T> {}
-class G4                      extends A    implements X<T> {}
-class G5                      extends A    implements X    {}
-class H<T extends A & B & C> extends A implements X, Y {}
-class I<T extends A & B & C> extends A implements X, Y, Z {}
-public class J<T extends A & B & C> extends A implements X, Y, Z {}
-@Test2 public class K<T extends A & B & C> extends A implements X, Y, Z {}
-@Test2 @Test3 public class L<T extends A & B & C> extends A implements X, Y, Z {}
-
-@Test2
-@Test3
-@Test4(value={
-        def a = someMethod()
-        assert a.result() == 'abc'
-})
-@Test5(b=2, a=1)
-@Test6(a=2, b=1)
-public
-class M
-<
-        T extends
-A &
-B &
-C
->
-        extends
-                A
-        implements
-                X,
-                Y,
-                Z
-{
-
-}
-
-class a {}
-
-class OutputTransforms {
-        final  static localTransforms = loadOutputTransforms()
-}
-
-class OutputTransforms2 {
-        @Lazy  static localTransforms = loadOutputTransforms()
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_02.groovy
deleted file mode 100644
index a973737..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_02.groovy
+++ /dev/null
@@ -1,60 +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.
- */
-class AA {
-    {
-        println 123
-    }
-}
-
-class BB {
-    static {
-        println '123'
-    }
-}
-
-class CC {
-    static
-    {
-        println '123'
-    }
-}
-
-class DD {
-    static {
-        println '123'
-    }
-
-    {
-        println 'abc'
-    }
-
-    static {
-        println '234'
-    }
-
-    {
-        println 'bcd'
-    }
-}
-
-class EE {{}}
-class FF {static {}}
-class GG {static {};{}}
-
-class Iterator implements java.util.Iterator {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_03.groovy
deleted file mode 100644
index 70ad9a0..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_03.groovy
+++ /dev/null
@@ -1,69 +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.
- */
-import java.sql.SQLException
-
-class AAA {
-    private volatile XX xx;
-    private transient YY yy;
-
-    public AAA() {
-
-    }
-
-    public AAA(String name) {
-
-    }
-
-    @Test2
-    public AAA(String name, int age) throws Exception {
-
-    }
-
-    AAA(String name, int age, String title) throws Exception {
-
-    }
-
-    private AAA(String name, int age, String title, double income) throws Exception {
-
-    }
-
-    @Test2
-    public synchronized String sayHello(String name) {
-        return "Hello, $name";
-    }
-
-    @Test2
-    public <T> T sayHello2(T name) throws IOException, SQLException {
-        return "Hello, $name";
-    }
-
-    public static privateStaticMethod(){}
-
-    public void m(final int param) {}
-    public void m2(def param) {}
-    public void m3(final int param1, long param2, final String param3) {}
-
-    def "hello world"(p1, p2) {
-        println "$p1, $p2"
-    }
-
-    def run() {
-        this."hello world"('ab', 'bc')
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_04.groovy
deleted file mode 100644
index 78230e8..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_04.groovy
+++ /dev/null
@@ -1,40 +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.
- */
-public class Person {
-    public static final SOME_CONSTANT = 'SOME_CONSTANT';
-    private String name = 'Daniel';
-    private int age;
-    @Test2
-    private String country = 'China',
-            location = 'Shanghai';
-
-    private String field, field2 = 'field2';
-    String someProperty;
-    String someProperty2 = 'someProperty2';
-    String someProperty3 = 'someProperty3',
-            someProperty4 = 'someProperty4';
-    String someProperty5, someProperty6 = 'someProperty6';
-    final String someProperty7 = 'someProperty7';
-    static final String someProperty8 = 'someProperty8';
-
-    @Test3
-    static final String someProperty9 = 'someProperty9';
-
-    protected static def protectedStaticDefField;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_05.groovy
deleted file mode 100644
index 25c3701..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_05.groovy
+++ /dev/null
@@ -1,38 +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.
- */
-public class A extends B {
-    private int age;
-
-    public A() {
-        super()
-    }
-
-    public A(int age) {
-        this()
-    }
-
-    public A(String name) {
-        super(name);
-    }
-
-    public A(String name, int age) {
-        this(name);
-        this.age = age;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_06.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_06.groovy
deleted file mode 100644
index 34a9c2a..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_06.groovy
+++ /dev/null
@@ -1,101 +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.
- */
-public class OuterA {
-    class InnerB {}
-}
-
-class OuterClazz {
-    enum InnerEnum implements SomeInterface {
-        A, B
-    }
-}
-
-
-class AA {
-    class Inner {
-        public def innerMethod() {}
-    }
-    private class PrivateInner {}
-    protected final class ProtectedFinalInner {
-        ProtectedFinalInner() {
-
-        }
-
-        ProtectedFinalInner(Integer a) {
-            new A() {
-                public int method() {
-                    1
-                }
-            }
-        }
-    }
-
-    public int method() {
-        0
-    }
-}
-
-
-
-interface A {
-    static enum B {
-        static interface C {
-        }
-    }
-}
-
-interface A2 {
-    static class B2 {
-        static enum C2 {
-        }
-    }
-}
-
-enum A4 {
-    static interface B4 {
-        static class C4 {
-        }
-    }
-}
-
-
-class A3 {
-    static class B3 {
-        static enum C3 {
-        }
-    }
-}
-
-class A5 {
-    static class B5 {
-        static class C5 {
-        }
-    }
-}
-
-interface A1 {
-    static interface B1 {
-        static enum C1 {
-        }
-    }
-}
-
-
-
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_07.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_07.groovy
deleted file mode 100644
index 4406289..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_07.groovy
+++ /dev/null
@@ -1,45 +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.
- */
-new A() {}
-new A(1, '2') {
-    public void prt() {
-        new B() {}
-        new C() {
-            {
-                new D() {
-                    {
-                        new E() {}
-                        new F() {}
-                    }
-                }
-            }
-        }
-    }
-}
-
-class OuterAA {
-    public void method() {
-        new InnerBB() {}
-        new InnerCC() {{
-            new InnerDD() {}
-            new InnerEE() {}
-        }}
-        new InnerFF() {}
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_01.groovy
deleted file mode 100644
index ba93142..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_01.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-{->}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_02.groovy
deleted file mode 100644
index 92fdd1c..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_02.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-{->12}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_03.groovy
deleted file mode 100644
index 3e91329..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_03.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-{-> {->12}}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_04.groovy
deleted file mode 100644
index 25e391b..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_04.groovy
+++ /dev/null
@@ -1,21 +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.
- */
-{->
-    12
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_05.groovy
deleted file mode 100644
index 3223365..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_05.groovy
+++ /dev/null
@@ -1,21 +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.
- */
-{int a ->
-    a
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_06.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_06.groovy
deleted file mode 100644
index 5c7062b..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_06.groovy
+++ /dev/null
@@ -1,27 +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.
- */
-{int a,
- long b, float[] c,
- double[][] d, String e, Object[] f,
- Object[][] g, Object[][][] h,
- Object[]... i
-    ->
-
-    a
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_07.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_07.groovy
deleted file mode 100644
index c6f6c9f..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_07.groovy
+++ /dev/null
@@ -1,21 +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.
- */
-{Object... i ->
-    i
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_08.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_08.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_08.groovy
deleted file mode 100644
index 9a98f35..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_08.groovy
+++ /dev/null
@@ -1,34 +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.
- */
-{ List<String> i, List<List<String>> j, List<List<List<String>>> k,
-  List<?> l, List<? extends Map> m, List<? super Map> n,
-  List<? extends Map<String, Object>> o, List<? super Map<String, Object>> p,
-  List<String>[] q,  List<? extends Map<String, Object>>[][] r,
-
-  List<
-        ? super
-                Map,
-        ? extends
-        Set,
-        List
-        > s,
-
-  List<? extends Map<String, Object>>[][]... t ->
-    i
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_09.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_09.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_09.groovy
deleted file mode 100644
index 919a8a9..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_09.groovy
+++ /dev/null
@@ -1,34 +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.
- */
-{ String i,
-  final String j, final def String k,
-  @Test2 final def String l,
-  @Test2
-  final
-
-  def
-          String m,
-        final n,
-        def
-          o,
-        p, q,
-        r, s,
-  @Test2 final def String... z ->
-    i
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_10.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_10.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_10.groovy
deleted file mode 100644
index 024b334..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_10.groovy
+++ /dev/null
@@ -1,22 +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.
- */
-{ java.lang.Integer t, Integer u, int v, int[] w, int[][] x,
-    String y = 'y', long... z = 123 ->
-    i
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/CodeBlock_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/CodeBlock_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/CodeBlock_01x.groovy
deleted file mode 100644
index d9dd10d..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/CodeBlock_01x.groovy
+++ /dev/null
@@ -1,42 +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.
- */
-def m() {
-    int result = 0;
-    {
-        int i = 1;
-        result += i;
-    }
-    {
-        int i = 2;
-        result += i;
-
-        {
-            int j = 3;
-            result += j;
-        }
-        {
-            int j = 4;
-            result += j;
-        }
-
-    }
-    return { result }
-}
-
-assert m()() == 10
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_01.groovy
deleted file mode 100644
index beadc8a..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_01.groovy
+++ /dev/null
@@ -1,36 +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.
- */
-a 1
-a 1, 2
-a x: 1, y: 2
-a.b 1, 2
-z.a b(1), c(2)
-a.b x: 1, y: 2
-z.a x: b(1), y: c(2)
-a b(1), c(2)
-a x: b(1), y: c(2)
-z.a x: b(1, 3), y: c(2, 4)
-a b(1, 3), c(2, 4)
-obj.<Integer, Double>a b(1, 3), c(2, 4), d(3, 5)
-println a
-// println a = 1  // breaking change
-println a == 1
-
-result.addAll allElements()
-task someTask() {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_02.groovy
deleted file mode 100644
index a68c6d3..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_02.groovy
+++ /dev/null
@@ -1,29 +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.
- */
-x y
-x y a b
-x y a.b
-x y a
-a b c() d e
-a b c()() d e
-a b c[x] d e
-a b c[x][y] d e
-a b c {x} d e
-(1 + 2).plus 3 plus 4
-[1, 2].subList 0, 1 plus 2

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_03.groovy
deleted file mode 100644
index 313fd8b..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_03.groovy
+++ /dev/null
@@ -1,84 +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.
- */
-println withPool {
-}
-
-println aa("bb", "cc") {
-}
-
-println this.aa("bb", "cc") {
-}
-
-println aa("bb", {println 123;}, "cc") {
-}
-
-aa("bb", "cc") {
-    println 1
-} { println 2 }
-
-cc  {
-    println 1
-} {
-    println 2
-}
-
-dd {
-    println 3
-}
-
-obj.cc  {
-    println 1
-} {
-    println 2
-}
-
-bb 1, 2, {println 123;}
-
-obj."some method" (groovy.xml.dom.DOMCategory) {
-}
-
-obj."some ${'method'}" (groovy.xml.dom.DOMCategory) {
-}
-obj.someMethod (groovy.xml.dom.DOMCategory) {
-}
-
-use (groovy.xml.dom.DOMCategory) {
-}
-
-['a','b','c'].inject('x') {
-    result, item -> item + result + item
-}
-
-println a."${hello}"('world') {
-}
-
-println a."${"$hello"}"('world') {
-}
-
-a."${"$hello"}" 'world', {
-}
-
-a.<String, Object>someMethod 'hello', 'world';
-
-a[x] b
-a[x] b c
-a[x] b c d
-
-"$x"(1, 2) a
-"$x" 1, 2  a

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_04.groovy
deleted file mode 100644
index ba3b2c3..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_04.groovy
+++ /dev/null
@@ -1,25 +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.
- */
-promise = promise.then { it * 2 } then { it * 3 } then { it + 6 }
-promise = promise.then { it * 2 } then { it * 3 } then { it + 6 } someProperty
-promise = promise.then { it * 2 } then { it * 3 } then { it + 6 } 'someProperty'
-promise = promise.then { it * 2 } then { it * 3 } then { it + 6 } "someProperty"
-promise = promise.then { it * 2 } then { it * 3 } then { it + 6 } "somePropert${'y'}"
-result = [1, 2, 3].size().plus 1 plus 2
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_05.groovy
deleted file mode 100644
index 06205a7..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_05.groovy
+++ /dev/null
@@ -1,77 +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.
- */
-((int) 1 / 2)(1, 2) {} {} (2, 3, 4) {}
-(((int) 1 / 2))(1, 2) {} {} (2, 3, 4) {}
-(m())()
-((Integer)m())()
-
-((int) 1 / 2) 1, 2 {} {} (2, 3, 4) {}
-
-'m'() + /aa/() + $/bb/$() + "$m"() + /a${'x'}a/() + $/b${'x'}b/$() + 1.2('b') + 1('a') + 2() + null() + true() + false() + a() + {a,b->}(1, 2) + [1, 2]() + [a:1, b:2]() + new int[0]() + new Integer(1)()
-
-// cast expressions
-(int)(1 / 2)
-(Integer)(1 / 2)
-(java.lang.Integer)(1 / 2)
-
-
-
-1 + 1.("a" + "1")()
-1 + 1.(m())()
-1.("a" + "1")()
-1.("a" + "1")(123)
-1.("a" + "1") 123
-1.(m())()
-1.(m())(123)
-1.(m()) 123
-(1+1).("a"+1)()
-(1+1).("a"+1) a b c
-1+1.("a"+1)()
-
-x = a(1, 2)(3, 4) {} {} (5, 6) {} (7, 8)
-x = a(1, 2) {} (3, 4) {} {} (5, 6) {} (7, 8) {} {}
-x = obj.a(1, 2)(3, 4) {} {} (5, 6) {} (7, 8)
-x = obj.a(1, 2) {} (3, 4) {} {} (5, 6) {} (7, 8) {} {}
-x = {a, b -> }(1, 2)(3, 4) {} {} (5, 6) {} (7, 8)
-x = {a, b -> }(1, 2) {} (3, 4) {} {} (5, 6) {} (7, 8) {}
-x = {a, b -> }(1, 2) {} {} (3, 4) {} {} (5, 6) {} (7, 8) {} {}
-
-
-
-m 1, 2
-"m" 1, 2
-"$m" 1, 2
-
-("m") 1, 2
-("$m") 1, 2
-
-find x:
-        1 confirm right
-
-
-find x:
-        1,
-        y:
-                2 confirm right
-
-a b 1 2
-
-
-(obj.m1(1, 2)) m2(3, 4)
-obj.m1(1, 2) m2(3, 4)

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_06x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_06x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_06x.groovy
deleted file mode 100644
index 64c94bb..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_06x.groovy
+++ /dev/null
@@ -1,26 +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.
- */
-assert 11 == (1.plus 2 plus 3) + (2.plus 3) * (1.multiply 1) - ((1 - 1).intdiv 1 multiply 1) / (2.power 10)
-assert (Long)(1.plus 2 plus 3) instanceof Long
-assert [1, 2, 3] == [(1.plus 0), (1.plus 1), (1.plus 1 plus 1)]
-
-def m(a, b) {
-    return a + b
-}
-assert m((1.plus 2 plus 3), (1.multiply 1)) == 7

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Comments_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Comments_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Comments_01.groovy
deleted file mode 100644
index b01ee37..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Comments_01.groovy
+++ /dev/null
@@ -1,46 +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.
- */
-#!/usr/bin/env groovy
-/*
- *  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.
- */
-
-/**
- * Created by Daniel.Sun on 2016/08/16.
- */
-
-// this is a line comment
-
-println /* method name */ 1 /* one */ /* followed by plus */ + /* plus */ 2 /* two */
-+3
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Comments_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Comments_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Comments_02.groovy
deleted file mode 100644
index dcb4b76..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Comments_02.groovy
+++ /dev/null
@@ -1,135 +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.
- */
-/**
- * test class Comments
- */
-public class Comments {
-    /**
-     * test Comments.SOME_VAR
-     */
-    public static final String SOME_VAR = 'SOME_VAR';
-    /**
-     * test Comments.SOME_VAR2
-     */
-    public static final String SOME_VAR2 = 'SOME_VAR2';
-
-    public static final String SOME_VAR3 = 'SOME_VAR3';
-
-    /**
-     * test Comments.SOME_VAR4
-     */
-    // no groovydoc for SOME_VAR4
-    public static final String SOME_VAR4 = 'SOME_VAR4';
-
-
-    /**
-     * test Comments.constructor1
-     */
-    public Comments() {
-
-    }
-
-    /**
-     * test Comments.m1
-     */
-    def m1() {
-        // executing m1
-    }
-
-    /*
-     * test Comments.m2
-     */
-    private m2() {
-        // executing m2
-    }
-
-    /**
-     * test Comments.m3
-     */
-    public void m3() {
-        // executing m3
-    }
-
-    /**
-     * test class InnerClazz
-     */
-    static class InnerClazz {
-        /**
-         * test InnerClazz.SOME_VAR3
-         */
-        public static final String SOME_VAR3 = 'SOME_VAR3';
-        /**
-         * test InnerClazz.SOME_VAR4
-         */
-        public static final String SOME_VAR4 = 'SOME_VAR4';
-
-        /**
-         * test Comments.m4
-         */
-        public void m4() {
-            // executing m4
-        }
-
-        /**
-         * test Comments.m5
-         */
-        public void m5() {
-            // executing m5
-        }
-    }
-
-    /**
-     * test class InnerEnum
-     */
-    static enum InnerEnum {
-        /**
-         * InnerEnum.NEW
-         */
-        NEW,
-
-        /**
-         * InnerEnum.OLD
-         */
-        OLD
-    }
-
-    static enum InnerEnum2 {}
-}
-
-/**
- * test class Comments2
- */
-class Comments2 {
-    /*
-     * test Comments.SOME_VAR
-     */
-    public static final String SOME_VAR = 'SOME_VAR';
-}
-
-class Comments3 {}
-
-/**
- * test someScriptMethod1
- */
-void someScriptMethod1() {}
-
-/*
- * test someScriptMethod2
- */
-void someScriptMethod2() {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/DefaultMethod_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/DefaultMethod_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/DefaultMethod_01x.groovy
deleted file mode 100644
index 7f0c2b0..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/DefaultMethod_01x.groovy
+++ /dev/null
@@ -1,39 +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.
- */
-
-interface Greetable {
-    String name();
-    default String hello() {
-        return 'hello'
-    }
-    default public String sayHello() {
-        return this.hello() + ', ' + this.name()
-    }
-}
-
-class Person implements Greetable {
-    @Override
-    public String name() {
-        return 'Daniel'
-    }
-}
-
-def p = new Person()
-assert 'hello, Daniel' == "${p.hello()}, ${p.name()}"
-assert 'hello, Daniel' == p.sayHello()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/DefaultMethod_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/DefaultMethod_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/DefaultMethod_02x.groovy
deleted file mode 100644
index 18e564b..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/DefaultMethod_02x.groovy
+++ /dev/null
@@ -1,54 +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.
- */
-interface A {
-    default String hello() {
-        return 'hello'
-    }
-    default String a() {
-        return 'a'
-    }
-    String b();
-}
-
-interface B extends A {
-    public String world();
-}
-
-class C implements B {
-    public static String haha() { return 'haha' }
-
-    public String world() {
-        return 'world'
-    }
-
-    public String name() {
-        return 'c'
-    }
-
-    public String a() {
-        return 'a1';
-    }
-
-    public String b() {
-        return 'b'
-    }
-}
-
-def c = new C()
-assert 'hello, world, c, a1, b, haha' == "${c.hello()}, ${c.world()}, ${c.name()}, ${c.a()}, ${c.b()}, ${C.haha()}"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_01x.groovy
deleted file mode 100644
index ffdda82..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_01x.groovy
+++ /dev/null
@@ -1,25 +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.
- */
-int i = 0;
-
-do {
-    i++
-} while (i < 5)
-
-assert i == 5

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_02x.groovy
deleted file mode 100644
index 5cec460..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_02x.groovy
+++ /dev/null
@@ -1,26 +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.
- */
-int i = 0;
-
-do {
-    i++
-    if (i == 3) break;
-} while (i < 5)
-
-assert i == 3

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_03x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_03x.groovy
deleted file mode 100644
index abddd24..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_03x.groovy
+++ /dev/null
@@ -1,29 +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.
- */
-int i, j = 0;
-
-do {
-    i++
-    if (i == 4) break;
-
-    if (j == 3) continue;
-    j++
-} while (true)
-
-assert j == 3

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_04x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_04x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_04x.groovy
deleted file mode 100644
index f32e88b..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_04x.groovy
+++ /dev/null
@@ -1,32 +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.
- */
-import groovy.transform.CompileStatic
-
-@CompileStatic
-def a() {
-    int i = 0;
-    int result = 0;
-   do {
-        result += 2
-    } while(i++ < 2)
-        result += 3
-
-    return result;
-}
-assert 9 == a()
\ No newline at end of file


[07/50] [abbrv] groovy git commit: fixes groovy/groovy-website#100

Posted by pa...@apache.org.
fixes groovy/groovy-website#100


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/a51162f9
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/a51162f9
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/a51162f9

Branch: refs/heads/parrot
Commit: a51162f9c2ddd428aabc5eb729e5ef5a99751142
Parents: cbd7413
Author: John Wagenleitner <jw...@apache.org>
Authored: Sun Apr 30 10:30:46 2017 -0700
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:04:48 2017 +1000

----------------------------------------------------------------------
 src/spec/doc/core-syntax.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/a51162f9/src/spec/doc/core-syntax.adoc
----------------------------------------------------------------------
diff --git a/src/spec/doc/core-syntax.adoc b/src/spec/doc/core-syntax.adoc
index a0815d0..6d3bf45 100644
--- a/src/spec/doc/core-syntax.adoc
+++ b/src/spec/doc/core-syntax.adoc
@@ -947,7 +947,7 @@ include::{projectdir}/src/spec/test/SyntaxTest.groovy[tags=variable_store_boolea
 `true` and `false` are the only two primitive boolean values.
 But more complex boolean expressions can be represented using <<_bitwise_and_logical_operators,logical operators>>.
 
-In addition, Groovy has <<_the_groovy_truth,special rules>> (often referred to as _Groovy Truth_)
+In addition, Groovy has <<core-semantics.adoc#Groovy-Truth,special rules>> (often referred to as _Groovy Truth_)
 for coercing non-boolean objects to a boolean value.
 
 == Lists


[29/50] [abbrv] groovy git commit: GROOVY-8177: Remedial work still needed for groovy-parser-antlr4 subproject

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_03x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_03x.groovy
index b78abf5..4f9e8d7 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_03x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_03x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package core
 
 class a {}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_04x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_04x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_04x.groovy
index 10cfcac..477932b 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_04x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_04x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package core
 
 class B<T> {}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_01.groovy
index 8260899..05c8bc3 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package core
 
 class A {}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_02.groovy
index b8a1b40..a973737 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_02.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_02.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 class AA {
     {
         println 123

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_03.groovy
index 32c5c41..70ad9a0 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_03.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_03.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import java.sql.SQLException
 
 class AAA {

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_04.groovy
index 7750cb4..78230e8 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_04.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_04.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 public class Person {
     public static final SOME_CONSTANT = 'SOME_CONSTANT';
     private String name = 'Daniel';

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_05.groovy
index 7f66f72..25c3701 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_05.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_05.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 public class A extends B {
     private int age;
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_06.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_06.groovy
index 95e013c..34a9c2a 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_06.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_06.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 public class OuterA {
     class InnerB {}
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_07.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_07.groovy
index 37cd5ee..4406289 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_07.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/ClassDeclaration_07.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 new A() {}
 new A(1, '2') {
     public void prt() {

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_01.groovy
index bb83ebe..ba93142 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_01.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 {->}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_02.groovy
index 3e7bc88..92fdd1c 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_02.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_02.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 {->12}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_03.groovy
index 61d7b27..3e91329 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_03.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_03.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 {-> {->12}}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_04.groovy
index 9c3a357..25e391b 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_04.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_04.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 {->
     12
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_05.groovy
index 47686c3..3223365 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_05.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_05.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 {int a ->
     a
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_06.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_06.groovy
index dde2725..5c7062b 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_06.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_06.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 {int a,
  long b, float[] c,
  double[][] d, String e, Object[] f,

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_07.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_07.groovy
index 9567574..c6f6c9f 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_07.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_07.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 {Object... i ->
     i
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_08.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_08.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_08.groovy
index 3e1811d..9a98f35 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_08.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_08.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 { List<String> i, List<List<String>> j, List<List<List<String>>> k,
   List<?> l, List<? extends Map> m, List<? super Map> n,
   List<? extends Map<String, Object>> o, List<? super Map<String, Object>> p,

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_09.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_09.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_09.groovy
index 8bbcee8..919a8a9 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_09.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_09.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 { String i,
   final String j, final def String k,
   @Test2 final def String l,

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_10.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_10.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_10.groovy
index 010952c..024b334 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_10.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Closure_10.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 { java.lang.Integer t, Integer u, int v, int[] w, int[][] x,
     String y = 'y', long... z = 123 ->
     i

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/CodeBlock_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/CodeBlock_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/CodeBlock_01x.groovy
index d97e372..d9dd10d 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/CodeBlock_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/CodeBlock_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 def m() {
     int result = 0;
     {

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_01.groovy
index 78b7682..beadc8a 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 a 1
 a 1, 2
 a x: 1, y: 2

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_02.groovy
index 49da45a..a68c6d3 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_02.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_02.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 x y
 x y a b
 x y a.b

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_03.groovy
index ed636d9..313fd8b 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_03.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_03.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 println withPool {
 }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_04.groovy
index 2787686..ba3b2c3 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_04.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_04.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 promise = promise.then { it * 2 } then { it * 3 } then { it + 6 }
 promise = promise.then { it * 2 } then { it * 3 } then { it + 6 } someProperty
 promise = promise.then { it * 2 } then { it * 3 } then { it + 6 } 'someProperty'

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_05.groovy
index 03fa641..06205a7 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_05.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_05.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 ((int) 1 / 2)(1, 2) {} {} (2, 3, 4) {}
 (((int) 1 / 2))(1, 2) {} {} (2, 3, 4) {}
 (m())()

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_06x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_06x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_06x.groovy
index a6bcadf..64c94bb 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_06x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Command_06x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 assert 11 == (1.plus 2 plus 3) + (2.plus 3) * (1.multiply 1) - ((1 - 1).intdiv 1 multiply 1) / (2.power 10)
 assert (Long)(1.plus 2 plus 3) instanceof Long
 assert [1, 2, 3] == [(1.plus 0), (1.plus 1), (1.plus 1 plus 1)]

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Comments_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Comments_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Comments_01.groovy
index c38c6fb..b01ee37 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Comments_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Comments_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 #!/usr/bin/env groovy
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Comments_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Comments_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Comments_02.groovy
index b2fea2a..dcb4b76 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Comments_02.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Comments_02.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 /**
  * test class Comments
  */

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/DefaultMethod_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/DefaultMethod_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/DefaultMethod_01x.groovy
index eec33f2..7f0c2b0 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/DefaultMethod_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/DefaultMethod_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 
 interface Greetable {
     String name();

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/DefaultMethod_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/DefaultMethod_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/DefaultMethod_02x.groovy
index e2053c6..18e564b 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/DefaultMethod_02x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/DefaultMethod_02x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 interface A {
     default String hello() {
         return 'hello'

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_01x.groovy
index a56c7ee..ffdda82 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 int i = 0;
 
 do {

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_02x.groovy
index 31f6264..5cec460 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_02x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_02x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 int i = 0;
 
 do {

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_03x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_03x.groovy
index 46c32ff..abddd24 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_03x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_03x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 int i, j = 0;
 
 do {

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_04x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_04x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_04x.groovy
index 5863ca9..f32e88b 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_04x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/DoWhile_04x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import groovy.transform.CompileStatic
 
 @CompileStatic

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/ElvisAssignment_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ElvisAssignment_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ElvisAssignment_01x.groovy
index 101bb54..17d1bab 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ElvisAssignment_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/ElvisAssignment_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import groovy.transform.CompileStatic
 
 def elvisAssignment() {

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_01.groovy
index c4a43c8..ed0f67d 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 enum AAAA {}
 public enum AAAA2 {}
 public enum AAAA3 implements A {}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_02.groovy
index 872c5ee..a5768db 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_02.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_02.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 enum E {
     A() {}, B(1) {{}},
     C(1, 2) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_03.groovy
index 431a9e3..27d3621 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_03.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_03.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 enum H {
     SOME_ENUM_CONSTANT0(a: "0"),
     SOME_ENUM_CONSTANT1(a: "0") {},

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_04.groovy
index e25feb0..b923828 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_04.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_04.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 enum ListEnum1 {
     ONE([111, 222])
     ListEnum1(Object listArg){}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_05.groovy
index f53e0d3..bdeb296 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_05.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_05.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 enum ListEnum1 {
     ONE([111, 222]) {}
     ListEnum1(Object listArg){}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_01.groovy
index e27fbbc..575439a 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 -1
 -12
 -123

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_02.groovy
index 6c16438..5a65f87 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_02.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_02.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 assert (1)
 assert (
         1)

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_03.groovy
index 4e570a3..f5c3819 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_03.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_03.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 1 + 2 + 3
 'a' + 'b' + 'c'
 10 - 2 + 3 - 5 + 6 + 7

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_04.groovy
index de7c2df..e8c72e0 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_04.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_04.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 a = 1
 a = b = 1
 left >>>= 16

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_05.groovy
index 20a8590..d195b10 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_05.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_05.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 true ?: 'a'
 
 true

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_06.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_06.groovy
index 6d8657d..debea2c 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_06.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_06.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 true && false || true && false || true
 true &&
         false ||

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_07.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_07.groovy
index 428b385..9474f18 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_07.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_07.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 1 | 2 ^ 3 & 4 | 5 ^ 6 & 7 | 8
 1 |
         2 ^

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_08.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_08.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_08.groovy
index bce3db2..108e1b0 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_08.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_08.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 a =~ /abc/
 a =~
         /abc/

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_09.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_09.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_09.groovy
index 26f161b..98b7e95 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_09.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_09.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 1 == 1 != 2 == 3 != 4 <=> 5 == 6 != 7
 1 ==
         1 !=

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_10.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_10.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_10.groovy
index 7d3fea2..bdd8c7a 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_10.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_10.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 1 < 2
 1 <
         2

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_11.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_11.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_11.groovy
index 4ee3e30..2030a4a 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_11.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_11.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 1 << 2
 1 <<
         2

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_12.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_12.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_12.groovy
index 5b56a8a..d7c4042 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_12.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_12.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 !true
 !
         true

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_13.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_13.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_13.groovy
index dcf930b..b092c64 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_13.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_13.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 !5
 ~5
 -5

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_14.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_14.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_14.groovy
index 4d7d85d..f7f1ef0 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_14.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_14.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 a = java.lang.Integer
 a = java.lang.Integer.class
 a = Integer

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_15.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_15.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_15.groovy
index 8e2978e..bab67fa 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_15.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_15.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 person.@name
 person.child.@name
 person.@name.count

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_16.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_16.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_16.groovy
index 88a2926..58e7b0a 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_16.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_16.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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
 super
 this.name

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_17.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_17.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_17.groovy
index 7dcf79e..89309fb 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_17.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_17.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 a.m(x: 1, y: 2) {
     println('named arguments');
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_18.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_18.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_18.groovy
index 2b81194..5a8cc37 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_18.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_18.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 1 > 2 ? 'y' : 'n'
 1 >= 2 ? 'y' : 'n'
 1 < 2 ? 'y' : 'n'

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_19.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_19.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_19.groovy
index 95d519f..3f893a6 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_19.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_19.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 List list = new ArrayList();
 List list2 = new java.util.ArrayList();
 List<String> list3 = new ArrayList<String>();

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_20.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_20.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_20.groovy
index 9070b06..7249e85 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_20.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_20.groovy
@@ -1,2 +1,20 @@
+/*
+ *  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.
+ */
 @Test2(pre={ super(xx);})
 class XX {}
\ No newline at end of file


[43/50] [abbrv] groovy git commit: rename antlr4 parser to remove groovy- prefix since that is by convention for modules

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy b/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy
deleted file mode 100644
index 67a68f8..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy
+++ /dev/null
@@ -1,181 +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.
- */
-package org.apache.groovy.parser.antlr4
-
-import org.apache.groovy.parser.antlr4.util.ASTComparatorCategory
-
-/**
- * Some syntax error test cases for the new parser
- *
- * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- * Created on    2016/09/02
- */
-class SyntaxErrorTest extends GroovyTestCase {
-    public static final String RESOURCES_PATH = 'src/test/resources';
-
-    void setUp() {}
-
-    void tearDown() {}
-
-    void "test groovy core - List"() {
-        TestUtils.shouldFail('fail/List_01.groovy');
-    }
-
-    void "test groovy core - Expression"() {
-        TestUtils.shouldFail('fail/Expression_01.groovy');
-        TestUtils.shouldFail('fail/Expression_02.groovy');
-        TestUtils.shouldFail('fail/Expression_03.groovy');
-//        shouldFail('fail/Expression_04.groovy', true);
-//        shouldFail('fail/Expression_05.groovy', true);
-        TestUtils.shouldFail('fail/Expression_06.groovy');
-        TestUtils.shouldFail('fail/Expression_07.groovy');
-        TestUtils.shouldFail('fail/Expression_08.groovy');
-        TestUtils.shouldFail('fail/Expression_09.groovy');
-    }
-
-    void "test groovy core - Switch"() {
-        TestUtils.shouldFail('fail/Switch_01.groovy');
-    }
-
-    void "test groovy core - LocalVariableDeclaration"() {
-        TestUtils.shouldFail('fail/LocalVariableDeclaration_01.groovy');
-    }
-
-    void "test groovy core - Continue"() {
-        TestUtils.doRunAndShouldFail('fail/Continue_01x.groovy');
-        TestUtils.doRunAndShouldFail('fail/Continue_02x.groovy');
-    }
-
-    void "test groovy core - Break"() {
-        TestUtils.doRunAndShouldFail('fail/Break_01x.groovy');
-        TestUtils.doRunAndShouldFail('fail/Break_02x.groovy');
-    }
-
-    void "test groovy core - UnexpectedCharacter"() {
-        TestUtils.doRunAndShouldFail('fail/UnexpectedCharacter_01x.groovy');
-    }
-
-//    void "test CompilerErrorTest_001.groovy"() {
-//        unzipScriptAndShouldFail("scripts/CompilerErrorTest_001.groovy", [])
-//    }
-
-//    void "test CompilerErrorTest_002.groovy"() {
-//        unzipScriptAndShouldFail("scripts/CompilerErrorTest_002.groovy", [])
-//    }
-
-//    void "test DifferencesFromJavaTest_002.groovy"() {
-//        unzipScriptAndShouldFail("scripts/DifferencesFromJavaTest_002.groovy", [])
-//    }
-
-//    void "test Groovy5212Bug_001.groovy"() {
-//        unzipScriptAndShouldFail("scripts/Groovy5212Bug_001.groovy", [])
-//    }
-
-//    void "test GStringEndTest_001.groovy"() {
-//        unzipScriptAndShouldFail("scripts/GStringEndTest_001.groovy", [])
-//    }
-
-    void "test groovy core - ParExpression"() {
-        TestUtils.doRunAndShouldFail('fail/ParExpression_01x.groovy');
-        TestUtils.doRunAndShouldFail('fail/ParExpression_02x.groovy');
-        TestUtils.doRunAndShouldFail('fail/ParExpression_03x.groovy');
-    }
-
-    void "test groovy core - Parentheses"() {
-        TestUtils.shouldFail('fail/Parentheses_01.groovy');
-    }
-
-    void "test groovy core - This"() {
-        TestUtils.doRunAndShouldFail('fail/This_01x.groovy');
-    }
-
-    void "test groovy core - Super"() {
-        TestUtils.doRunAndShouldFail('fail/Super_01x.groovy');
-    }
-
-    void "test groovy core - AbstractMethod"() {
-        TestUtils.doRunAndShouldFail('fail/AbstractMethod_01x.groovy');
-        TestUtils.doRunAndShouldFail('fail/AbstractMethod_02x.groovy');
-        TestUtils.doRunAndShouldFail('fail/AbstractMethod_03x.groovy');
-        TestUtils.doRunAndShouldFail('fail/AbstractMethod_04x.groovy');
-        TestUtils.doRunAndShouldFail('fail/AbstractMethod_05x.groovy');
-        TestUtils.doRunAndShouldFail('fail/AbstractMethod_06x.groovy');
-    }
-
-    void "test groovy core - BUGs"() {
-        TestUtils.doRunAndShouldFail('bugs/BUG-GROOVY-5318.groovy');
-        TestUtils.doRunAndShouldFail('bugs/BUG-GROOVY-8150.groovy');
-    }
-
-    void "test groovy core - DoWhile"() {
-        TestUtils.doRunAndShouldFail('fail/DoWhile_01x.groovy');
-    }
-
-    void "test groovy core - For"() {
-        TestUtils.shouldFail('fail/For_01.groovy');
-        TestUtils.shouldFail('fail/For_02.groovy');
-    }
-
-    void "test groovy core - Modifier"() {
-        TestUtils.doRunAndShouldFail('fail/Modifier_01x.groovy');
-        TestUtils.doRunAndShouldFail('fail/Modifier_02x.groovy');
-        TestUtils.doRunAndShouldFail('fail/Modifier_03x.groovy');
-        TestUtils.doRunAndShouldFail('fail/Modifier_04x.groovy');
-        TestUtils.doRunAndShouldFail('fail/Modifier_05x.groovy');
-        TestUtils.shouldFail('fail/Modifier_07.groovy');
-    }
-
-    void "test groovy core - ClassDeclaration"() {
-        TestUtils.doRunAndShouldFail('fail/ClassDeclaration_01x.groovy');
-    }
-
-    void "test groovy core - MethodDeclaration"() {
-        TestUtils.shouldFail('fail/MethodDeclaration_01.groovy');
-    }
-
-    void "test groovy core - ConstructorDeclaration"() {
-        TestUtils.shouldFail('fail/ConstructorDeclaration_01.groovy');
-    }
-
-    void "test groovy core - ClosureListExpression"() {
-        TestUtils.shouldFail('fail/ClosureListExpression_01.groovy');
-        TestUtils.shouldFail('fail/ClosureListExpression_02.groovy');
-        TestUtils.shouldFail('fail/ClosureListExpression_03.groovy');
-        TestUtils.shouldFail('fail/ClosureListExpression_04.groovy');
-    }
-
-    void "test groovy core - InterfaceDeclaration"() {
-        TestUtils.shouldFail('fail/InterfaceDeclaration_01.groovy');
-    }
-
-    void "test groovy core - void"() {
-        TestUtils.doRunAndShouldFail('fail/Void_01x.groovy');
-        TestUtils.doRunAndShouldFail('fail/Void_02x.groovy');
-    }
-
-
-    /**************************************/
-    static unzipScriptAndShouldFail(String entryName, List ignoreClazzList, Map<String, String> replacementsMap=[:], boolean toCheckNewParserOnly = false) {
-        ignoreClazzList.addAll(TestUtils.COMMON_IGNORE_CLASS_LIST)
-
-        TestUtils.unzipAndFail(SCRIPT_ZIP_PATH, entryName, TestUtils.addIgnore(ignoreClazzList, ASTComparatorCategory.LOCATION_IGNORE_LIST), replacementsMap, toCheckNewParserOnly)
-    }
-
-    public static final String SCRIPT_ZIP_PATH = "$TestUtils.RESOURCES_PATH/groovy-2.5.0/groovy-2.5.0-SNAPSHOT-20160921-allscripts.zip";
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/TestUtils.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/TestUtils.groovy b/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/TestUtils.groovy
deleted file mode 100644
index 5ba538b..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/TestUtils.groovy
+++ /dev/null
@@ -1,259 +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.
- */
-package org.apache.groovy.parser.antlr4
-
-import groovy.util.logging.Log
-import org.apache.groovy.parser.AbstractParser
-import org.apache.groovy.parser.Antlr2Parser
-import org.apache.groovy.parser.Antlr4Parser
-import org.apache.groovy.parser.antlr4.util.ASTComparatorCategory
-import org.apache.groovy.parser.antlr4.util.AstDumper
-import org.codehaus.groovy.ast.*
-import org.codehaus.groovy.ast.stmt.*
-import org.codehaus.groovy.control.CompilerConfiguration
-import org.codehaus.groovy.syntax.Token
-
-import java.util.zip.ZipEntry
-import java.util.zip.ZipFile
-
-/**
- * Utilities for test
- *
- * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- * Created on    2016/09/21
- */
-
-@Log
-class TestUtils {
-    public static final String DEFAULT_RESOURCES_PATH = 'subprojects/groovy-parser-antlr4/src/test/resources';
-    public static final String RESOURCES_PATH = new File(DEFAULT_RESOURCES_PATH).exists() ? DEFAULT_RESOURCES_PATH : 'src/test/resources';
-
-    static doTest(String path) {
-        return doTest(path, ASTComparatorCategory.DEFAULT_CONFIGURATION)
-    }
-
-    static doTest(String path, List ignoreClazzList) {
-        return doTest(path, addIgnore(ignoreClazzList, ASTComparatorCategory.LOCATION_IGNORE_LIST))
-    }
-
-    static doTest(String path, conf) {
-        AbstractParser antlr4Parser = new Antlr4Parser()
-        AbstractParser antlr2Parser = new Antlr2Parser()
-
-        File file = new File("$RESOURCES_PATH/$path");
-        def (newAST, newElapsedTime) = profile { antlr4Parser.parse(file) }
-        def (oldAST, oldElapsedTime) = profile { antlr2Parser.parse(file) }
-
-
-        assertAST(newAST, oldAST, conf);
-
-        long diffInMillis = newElapsedTime - oldElapsedTime;
-
-        if (diffInMillis >= 500) {
-            log.warning "${path}\t\t\t\t\tdiff:${diffInMillis / 1000}s,\tnew:${newElapsedTime / 1000}s,\told:${oldElapsedTime / 1000}s."
-        }
-
-        return [newAST, oldAST]
-    }
-
-    /*
-    static unzipAndTest(String path, String entryName) {
-        unzipAndTest(path, entryName, ASTComparatorCategory.DEFAULT_CONFIGURATION)
-    }
-    */
-
-    /*
-    static unzipAndTest(String path, String entryName, List ignoreClazzList) {
-        unzipAndTest(path, entryName, addIgnore(ignoreClazzList, ASTComparatorCategory.LOCATION_IGNORE_LIST))
-    }
-    */
-
-    static unzipAndTest(String path, String entryName, conf, Map<String, String> replacementsMap=[:]) {
-        AbstractParser antlr4Parser = new Antlr4Parser()
-        AbstractParser antlr2Parser = new Antlr2Parser()
-
-        String name = "$path!$entryName";
-        String text = readZipEntry(path, entryName);
-
-        replacementsMap?.each {k, v ->
-            text = text.replace(k, v);
-        }
-
-        def (newAST, newElapsedTime) = profile { antlr4Parser.parse(name, text) }
-        def (oldAST, oldElapsedTime) = profile { antlr2Parser.parse(name, text) }
-
-
-        assertAST(newAST, oldAST, conf);
-
-        long diffInMillis = newElapsedTime - oldElapsedTime;
-
-        if (diffInMillis >= 500) {
-            log.warning "${path}!${entryName}\t\t\t\t\tdiff:${diffInMillis / 1000}s,\tnew:${newElapsedTime / 1000}s,\told:${oldElapsedTime / 1000}s."
-        }
-    }
-
-
-    static shouldFail(String path, boolean toCheckNewParserOnly = false) {
-        shouldFail(path, ASTComparatorCategory.DEFAULT_CONFIGURATION, toCheckNewParserOnly)
-    }
-
-    static shouldFail(String path, List ignoreClazzList, boolean toCheckNewParserOnly = false) {
-        shouldFail(path, addIgnore(ignoreClazzList, ASTComparatorCategory.LOCATION_IGNORE_LIST), toCheckNewParserOnly)
-    }
-
-    static shouldFail(String path, conf, boolean toCheckNewParserOnly = false) {
-        AbstractParser antlr4Parser = new Antlr4Parser()
-        AbstractParser antlr2Parser = new Antlr2Parser()
-
-        File file = new File("$RESOURCES_PATH/$path");
-        def (newAST, newElapsedTime) = profile { antlr4Parser.parse(file) }
-        def (oldAST, oldElapsedTime) = profile { antlr2Parser.parse(file) }
-
-        if (toCheckNewParserOnly) {
-            assert (newAST == null || newAST.context.errorCollector.hasErrors())
-        } else {
-            assert (newAST == null || newAST.context.errorCollector.hasErrors()) &&
-                    (oldAST == null || oldAST.context.errorCollector.hasErrors())
-        }
-
-        long diffInMillis = newElapsedTime - oldElapsedTime;
-
-        if (diffInMillis >= 500) {
-            log.warning "${path}\t\t\t\t\tdiff:${diffInMillis / 1000}s,\tnew:${newElapsedTime / 1000}s,\told:${oldElapsedTime / 1000}s."
-        }
-    }
-
-    static unzipAndFail(String path, String entryName, conf, Map<String, String> replacementsMap=[:], boolean toCheckNewParserOnly = false) {
-        AbstractParser antlr4Parser = new Antlr4Parser()
-        AbstractParser antlr2Parser = new Antlr2Parser()
-
-        String name = "$path!$entryName";
-        String text = readZipEntry(path, entryName);
-
-        replacementsMap?.each {k, v ->
-            text = text.replace(k, v);
-        }
-
-        def (newAST, newElapsedTime) = profile { antlr4Parser.parse(name, text) }
-        def (oldAST, oldElapsedTime) = profile { antlr2Parser.parse(name, text) }
-
-        if (toCheckNewParserOnly) {
-            assert (newAST == null || newAST.context.errorCollector.hasErrors())
-        } else {
-            assert (newAST == null || newAST.context.errorCollector.hasErrors()) &&
-                    (oldAST == null || oldAST.context.errorCollector.hasErrors())
-        }
-
-        long diffInMillis = newElapsedTime - oldElapsedTime;
-
-        if (diffInMillis >= 500) {
-            log.warning "${path}!${entryName}\t\t\t\t\tdiff:${diffInMillis / 1000}s,\tnew:${newElapsedTime / 1000}s,\told:${oldElapsedTime / 1000}s."
-        }
-    }
-
-
-    static assertAST(ast1, ast2, conf) {
-        assert null != ast1 && null != ast2
-
-        ASTComparatorCategory.apply(conf) {
-            assert ast1 == ast2
-        }
-
-        assert genSrc(ast1) == genSrc(ast2)
-    }
-
-    static genSrc(ModuleNode ast) {
-        return new AstDumper(ast).gen();
-    }
-
-    static profile(Closure c) {
-        long begin = System.currentTimeMillis()
-        def result = c.call()
-        long end = System.currentTimeMillis()
-
-        return [result, end - begin];
-    }
-
-    static addIgnore(Class aClass, ArrayList<String> ignore, Map<Class, List<String>> c = null) {
-        c = c ?: ASTComparatorCategory.DEFAULT_CONFIGURATION.clone() as Map<Class, List<String>>;
-        c[aClass].addAll(ignore)
-        return c
-    }
-
-    static addIgnore(Collection<Class> aClass, ArrayList<String> ignore, Map<Class, List<String>> c = null) {
-        c = c ?: ASTComparatorCategory.DEFAULT_CONFIGURATION.clone() as Map<Class, List<String>>;
-        aClass.each { c[it].addAll(ignore) }
-        return c
-    }
-
-    static readZipEntry(String path, String entryName) {
-        String result = "";
-
-        def zf = new ZipFile(new File(path));
-        try {
-            def is = new BufferedInputStream(zf.getInputStream(new ZipEntry(entryName)));
-            result = is.getText("UTF-8");
-        } catch (Exception e) {
-            log.severe(e.message);
-        } finally {
-            try {
-                zf.close();
-            } catch(Exception e) {
-                // IGNORED
-            }
-        }
-
-        return result;
-    }
-
-    static doRunAndShouldFail(String path) {
-        assert !executeScript(path);
-    }
-
-    static doRunAndTest(String path) {
-        assert executeScript(path);
-    }
-
-    static executeScript(String path) {
-        executeScript(createAntlr4Shell(), "$RESOURCES_PATH/$path")
-    }
-
-    static executeScript(gsh, String path) {
-        def file = new File(path);
-        def content = file.text;
-
-        try {
-            gsh.evaluate(content);
-//            log.info("Evaluated $file")
-            return true;
-        } catch (Throwable t) {
-            log.severe("Failed $file: ${t.getMessage()}");
-            return false;
-        }
-    }
-
-    static createAntlr4Shell() {
-        CompilerConfiguration configuration = new CompilerConfiguration(CompilerConfiguration.DEFAULT)
-        configuration.pluginFactory = new Antlr4PluginFactory()
-
-        return new GroovyShell(configuration);
-    }
-
-    public static final List COMMON_IGNORE_CLASS_LIST = Collections.unmodifiableList([AssertStatement, BreakStatement, ConstructorNode, ContinueStatement, ExpressionStatement, FieldNode, ForStatement, GenericsType, IfStatement, MethodNode, PackageNode, Parameter, PropertyNode, ReturnStatement, ThrowStatement, Token, WhileStatement]);
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/util/ASTComparatorCategory.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/util/ASTComparatorCategory.groovy b/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/util/ASTComparatorCategory.groovy
deleted file mode 100644
index 47b9507..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/util/ASTComparatorCategory.groovy
+++ /dev/null
@@ -1,526 +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.
- */
-package org.apache.groovy.parser.antlr4.util
-
-import groovy.util.logging.Log
-import org.codehaus.groovy.ast.*
-import org.codehaus.groovy.ast.expr.*
-import org.codehaus.groovy.ast.stmt.*
-import org.codehaus.groovy.syntax.Token
-
-import java.util.logging.Level
-
-@Log @SuppressWarnings("GroovyUnusedDeclaration")
-class ASTComparatorCategory {
-    static { log.level = Level.WARNING }
-    static List<String> LOCATION_IGNORE_LIST = ["columnNumber", "lineNumber", "lastColumnNumber", "lastLineNumber", "startLine"]
-    static private List<String> EXPRESSION_IGNORE_LIST = ["text"] + LOCATION_IGNORE_LIST
-
-    /**
-     *  Keeps all checked object pairs and their comparison result.
-     *  Will be cleared at {@link #apply(groovy.lang.Closure)} method }
-     */
-    static objects = [:] as Map<List<Object>, Boolean>
-    static String lastName
-
-    static Map<Class, List<String>> DEFAULT_CONFIGURATION = [
-            (ClassNode): (['module', "declaredMethodsMap", "plainNodeReference", "typeClass", "allInterfaces", "orAddStaticConstructorNode", "allDeclaredMethods", "unresolvedSuperClass", "innerClasses" ] + LOCATION_IGNORE_LIST) as List<String>,
-            (ConstructorNode): ['declaringClass'],
-            (DynamicVariable): [],
-            (EnumConstantClassNode): ["typeClass"],
-            (FieldNode): ["owner", "declaringClass", "initialValueExpression", "assignToken"],
-            (GenericsType): [],
-            (ImportNode): LOCATION_IGNORE_LIST,
-            (InnerClassNode): (['module', "declaredMethodsMap", "plainNodeReference", "typeClass", "allInterfaces", "orAddStaticConstructorNode", "allDeclaredMethods", "unresolvedSuperClass", "innerClasses" ] + LOCATION_IGNORE_LIST) as List<String>,
-            (InterfaceHelperClassNode): [],
-            (MethodNode): ["text", "declaringClass"],
-            (MixinNode): [],
-            (ModuleNode): ["context"],
-            (PackageNode): [],
-            (Parameter): [],
-            (PropertyNode): ['declaringClass', 'initialValueExpression', "assignToken"],
-            (Variable): [],
-            (VariableScope): ["clazzScope", "parent", "declaredVariablesIterator"],
-            (Token): ["root", "startColumn"],
-            (AnnotationNode): (["text"] + LOCATION_IGNORE_LIST) as List<String>,
-            (AssertStatement): ["text"],
-            (BlockStatement): ["columnNumber", "lineNumber", "lastColumnNumber", "lastLineNumber", "text"],
-            (BreakStatement): ["text"],
-            (CaseStatement): ["text"],
-            (CatchStatement): (["text"] + LOCATION_IGNORE_LIST) as List<String>,
-            (ContinueStatement): ["text"],
-            (DoWhileStatement): ["text"],
-            (EmptyStatement): ["text"],
-            (ExpressionStatement): ["text"],
-            (ForStatement): ["text"],
-            (IfStatement): ["text"],
-            (LoopingStatement): ["text"],
-            (ReturnStatement): ["text"],
-            (SwitchStatement): ["columnNumber", "lineNumber", "lastColumnNumber", "lastLineNumber", "text"],
-            (SynchronizedStatement): ["text"],
-            (ThrowStatement): ["text"],
-            (TryCatchStatement): (["text"] + LOCATION_IGNORE_LIST) as List<String>,
-            (WhileStatement): ["text"],
-            (AnnotationConstantExpression): EXPRESSION_IGNORE_LIST,
-            (ArgumentListExpression): EXPRESSION_IGNORE_LIST,
-            (ArrayExpression): EXPRESSION_IGNORE_LIST,
-            (AttributeExpression): EXPRESSION_IGNORE_LIST,
-            (BinaryExpression): EXPRESSION_IGNORE_LIST,
-            (BitwiseNegationExpression): EXPRESSION_IGNORE_LIST,
-            (BooleanExpression): EXPRESSION_IGNORE_LIST,
-            (CastExpression): EXPRESSION_IGNORE_LIST,
-            (ClassExpression): EXPRESSION_IGNORE_LIST,
-            (ClosureExpression): EXPRESSION_IGNORE_LIST,
-            (ClosureListExpression): EXPRESSION_IGNORE_LIST,
-            (ConstantExpression): EXPRESSION_IGNORE_LIST,
-            (ConstructorCallExpression): EXPRESSION_IGNORE_LIST,
-            (DeclarationExpression): ["text", "columnNumber", "lineNumber", "lastColumnNumber", "lastLineNumber"],
-            (ElvisOperatorExpression): EXPRESSION_IGNORE_LIST,
-            (EmptyExpression): EXPRESSION_IGNORE_LIST,
-            (ExpressionTransformer): EXPRESSION_IGNORE_LIST,
-            (FieldExpression): EXPRESSION_IGNORE_LIST,
-            (GStringExpression): EXPRESSION_IGNORE_LIST,
-            (ListExpression): EXPRESSION_IGNORE_LIST,
-            (MapEntryExpression): EXPRESSION_IGNORE_LIST,
-            (MapExpression): EXPRESSION_IGNORE_LIST,
-            (MethodCall): EXPRESSION_IGNORE_LIST,
-            (MethodCallExpression): EXPRESSION_IGNORE_LIST,
-            (MethodPointerExpression): EXPRESSION_IGNORE_LIST,
-            (NamedArgumentListExpression): EXPRESSION_IGNORE_LIST,
-            (NotExpression): EXPRESSION_IGNORE_LIST,
-            (PostfixExpression): EXPRESSION_IGNORE_LIST,
-            (PrefixExpression): EXPRESSION_IGNORE_LIST,
-            (PropertyExpression): EXPRESSION_IGNORE_LIST,
-            (RangeExpression): EXPRESSION_IGNORE_LIST,
-            (SpreadExpression): EXPRESSION_IGNORE_LIST,
-            (SpreadMapExpression): EXPRESSION_IGNORE_LIST,
-            (StaticMethodCallExpression): EXPRESSION_IGNORE_LIST,
-            (TernaryExpression): EXPRESSION_IGNORE_LIST,
-            (TupleExpression): EXPRESSION_IGNORE_LIST,
-            (UnaryMinusExpression): EXPRESSION_IGNORE_LIST,
-            (UnaryPlusExpression): EXPRESSION_IGNORE_LIST,
-            (VariableExpression): EXPRESSION_IGNORE_LIST,
-    ];
-
-    static Map<Class, List<String>> COLLECTION_PROPERTY_CONFIGURATION = [
-            (ModuleNode): ["classes", "name"]
-    ]
-
-    static Map<Class, List<String>> configuration = DEFAULT_CONFIGURATION;
-
-    static void apply(config = DEFAULT_CONFIGURATION, Closure cl) {
-        configuration = config
-        objects.clear()
-        use(ASTComparatorCategory, cl)
-        configuration = DEFAULT_CONFIGURATION
-    }
-
-    /**
-     * Main method that makes the magic. Compares all properties for object a and object b.
-     * There is a lot of problems in this code, like omitted class checking and so on. Just belive, it will be used properly.
-     * @param a
-     * @param b
-     * @return
-     */
-    static reflexiveEquals(a, b, ignore = []) {
-
-        if (a.getClass() != b.getClass()) {
-            log.warning(" !!!! DIFFERENCE WAS FOUND! ${a.getClass()} != ${b.getClass()}")
-            return false;
-        }
-
-        def objects = [a, b]
-        Boolean res = this.objects[objects]
-        if (res != null) {
-            log.info("Skipping [$a, $b] comparison as they are ${ res ? "" : "un" }equal.")
-            return res;
-        }
-        else if (this.objects.containsKey(objects)) {
-            log.info("Skipping as they are processed at higher levels.")
-            return true
-        }
-
-        this.objects[objects] = null
-        log.info("Equals was called for ${ a.getClass() } ${ a.hashCode() }, $lastName")
-        if (a.is(b))
-            return true
-
-        def difference = a.metaClass.properties.find { MetaBeanProperty p ->
-            if (!p.getter)
-                return false
-
-            def name = p.name
-            lastName = "$name :::: ${ a.getClass() } ${ a.hashCode() }"
-
-
-            for (Map.Entry<Class, List<String>> me : COLLECTION_PROPERTY_CONFIGURATION) {
-                if (!(me.key.isCase(a) && me.key.isCase(b))) {
-                    continue;
-                }
-
-                String propName = me.value[0];
-
-                if (name != propName) {
-                    continue;
-                }
-
-                def aValue = a."${propName}"; // FIXME when the propName is "classes", a classNode will be added to moduleNode.classes
-                def bValue = b."${propName}";
-
-                String orderName = me.value[1];
-
-                return new LinkedList(aValue?.getClass()?.isArray() ? Arrays.asList(aValue) : (aValue ?: [])).sort {c1, c2 -> c1."${orderName}" <=> c2."${orderName}"} !=
-                        new LinkedList(bValue?.getClass()?.isArray() ? Arrays.asList(bValue) : (bValue ?: [])).sort {c1, c2 -> c1."${orderName}" <=> c2."${orderName}"}
-            }
-
-
-            !(name in ignore) && (name != 'nodeMetaData' && name != 'metaDataMap') && a."$name" != b."$name"
-        }
-
-        if (difference)
-            log.warning(" !!!! DIFFERENCE WAS FOUND! [${a.metaClass.hasProperty(a, 'text') ? a.text : '<NO TEXT>'}][${a.class}][${difference.name}]:: ${ a."$difference.name" } != ${ b."$difference.name" }")
-        else
-            log.info(" ==== Exit ${ a.getClass() } ${ a.hashCode() } ====== ")
-
-        res = difference == null
-        this.objects[objects] = res
-        this.objects[objects.reverse(false)] = res
-        res
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    // Just a bunch of copypasted methods. Maybe will wrote AST transformation for them.
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-
-    static equals(ClassNode a, ClassNode b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(ConstructorNode a, ConstructorNode b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(DynamicVariable a, DynamicVariable b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(EnumConstantClassNode a, EnumConstantClassNode b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(FieldNode a, FieldNode b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(GenericsType a, GenericsType b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(ImportNode a, ImportNode b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(InnerClassNode a, InnerClassNode b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(InterfaceHelperClassNode a, InterfaceHelperClassNode b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(MethodNode a, MethodNode b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(MixinNode a, MixinNode b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(ModuleNode a, ModuleNode b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(PackageNode a, PackageNode b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(Parameter a, Parameter b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(PropertyNode a, PropertyNode b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(Variable a, Variable b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(VariableScope a, VariableScope b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(Token a, Token b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(CompileUnit a, CompileUnit b) {
-        true
-    }
-
-    static equals(AnnotationNode a, AnnotationNode b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-    // Statements
-    ////////////////////////////////////////////////////////////////////////////////////////////////////
-
-    static equals(AssertStatement a, AssertStatement b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(BlockStatement a, BlockStatement b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(BreakStatement a, BreakStatement b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(CaseStatement a, CaseStatement b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(CatchStatement a, CatchStatement b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(ContinueStatement a, ContinueStatement b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(DoWhileStatement a, DoWhileStatement b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(EmptyStatement a, EmptyStatement b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(ExpressionStatement a, ExpressionStatement b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(ForStatement a, ForStatement b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(IfStatement a, IfStatement b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(LoopingStatement a, LoopingStatement b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(ReturnStatement a, ReturnStatement b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(SwitchStatement a, SwitchStatement b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(SynchronizedStatement a, SynchronizedStatement b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(ThrowStatement a, ThrowStatement b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(TryCatchStatement a, TryCatchStatement b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(WhileStatement a, WhileStatement b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    /////////////////////////////////////////////////////////////////////////////////////////////
-    // Expressions
-    /////////////////////////////////////////////////////////////////////////////////////////////
-
-    static equals(AnnotationConstantExpression a, AnnotationConstantExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(ArgumentListExpression a, ArgumentListExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(ArrayExpression a, ArrayExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(AttributeExpression a, AttributeExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(BinaryExpression a, BinaryExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(BitwiseNegationExpression a, BitwiseNegationExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(BooleanExpression a, BooleanExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(CastExpression a, CastExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(ClassExpression a, ClassExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(ClosureExpression a, ClosureExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(ClosureListExpression a, ClosureListExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(ConstantExpression a, ConstantExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(ConstructorCallExpression a, ConstructorCallExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(DeclarationExpression a, DeclarationExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(ElvisOperatorExpression a, ElvisOperatorExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(EmptyExpression a, EmptyExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(ExpressionTransformer a, ExpressionTransformer b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(FieldExpression a, FieldExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(GStringExpression a, GStringExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(ListExpression a, ListExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(MapEntryExpression a, MapEntryExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(MapExpression a, MapExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(MethodCall a, MethodCall b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(MethodCallExpression a, MethodCallExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(MethodPointerExpression a, MethodPointerExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(NamedArgumentListExpression a, NamedArgumentListExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(NotExpression a, NotExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(PostfixExpression a, PostfixExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(PrefixExpression a, PrefixExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(PropertyExpression a, PropertyExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(RangeExpression a, RangeExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(SpreadExpression a, SpreadExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(SpreadMapExpression a, SpreadMapExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(StaticMethodCallExpression a, StaticMethodCallExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(TernaryExpression a, TernaryExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(TupleExpression a, TupleExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(UnaryMinusExpression a, UnaryMinusExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(UnaryPlusExpression a, UnaryPlusExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-
-    static equals(VariableExpression a, VariableExpression b) {
-        reflexiveEquals(a, b, configuration[a.class])
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/util/AstDumper.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/util/AstDumper.groovy b/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/util/AstDumper.groovy
deleted file mode 100644
index 72a64e5..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/util/AstDumper.groovy
+++ /dev/null
@@ -1,1025 +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.
- */
-package org.apache.groovy.parser.antlr4.util
-
-import org.codehaus.groovy.ast.*
-import org.codehaus.groovy.ast.expr.*
-import org.codehaus.groovy.ast.stmt.*
-import org.codehaus.groovy.classgen.BytecodeExpression
-import org.codehaus.groovy.classgen.GeneratorContext
-import org.codehaus.groovy.classgen.Verifier
-import org.codehaus.groovy.control.CompilationUnit
-import org.codehaus.groovy.control.SourceUnit
-import org.codehaus.groovy.control.io.ReaderSource
-
-import java.lang.reflect.Modifier
-
-/**
- * Generate the groovy source according to the AST.
- * It is useful to verify the equality of new and old parser.
- *
- * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- * Created on    2016/08/16
- */
-class AstDumper {
-    private ModuleNode ast;
-
-    public AstDumper(ModuleNode ast) {
-        this.ast = ast;
-    }
-
-    /**
-     * Generate the groovy source code according the AST
-     *
-     * @return the groovy source code
-     */
-    public String gen() {
-        StringWriter out = new StringWriter();
-
-        try {
-            AstNodeToScriptVisitor visitor = new AstNodeToScriptVisitor(out, true, true);
-
-            new LinkedList<ClassNode>(this.ast?.classes ?: []).sort { c1, c2 -> c1.name <=> c2.name }?.each {
-                visitor.call(new SourceUnit((String) null, (ReaderSource) null, null, null, null) {
-                    @Override
-                    public ModuleNode getAST() {
-                        return AstDumper.this.ast;
-                    }
-                }, null, it)
-            }
-
-            return out.toString().replaceAll(/([\w_$]+)@[0-9a-z]+/, '$1@<hashcode>');
-        } finally {
-            out.close();
-        }
-    }
-}
-
-/**
- * *****************************************************
- * In order to solve the "Egg & Chicken" problem,
- * we have to copy the source code(instead of invoking it): subprojects/groovy-console/src/main/groovy/groovy/inspect/swingui/AstNodeToScriptAdapter.groovy
- * *****************************************************
- *
- *
- * An adapter from ASTNode tree to source code.
- *
- * @author Hamlet D'Arcy
- */
-class AstNodeToScriptVisitor extends CompilationUnit.PrimaryClassNodeOperation implements GroovyCodeVisitor, GroovyClassVisitor {
-
-    private final Writer _out
-    Stack<String> classNameStack = new Stack<String>()
-    String _indent = ''
-    boolean readyToIndent = true
-    boolean showScriptFreeForm
-    boolean showScriptClass
-    boolean scriptHasBeenVisited
-
-    def AstNodeToScriptVisitor(Writer writer, boolean showScriptFreeForm = true, boolean showScriptClass = true) {
-        this._out = writer
-        this.showScriptFreeForm = showScriptFreeForm
-        this.showScriptClass = showScriptClass
-        this.scriptHasBeenVisited = false
-    }
-
-    void call(SourceUnit source, GeneratorContext context, ClassNode classNode) {
-
-        visitPackage(source?.getAST()?.getPackage())
-
-        visitAllImports(source)
-
-        if (showScriptFreeForm && !scriptHasBeenVisited) {
-            scriptHasBeenVisited = true
-            source?.getAST()?.getStatementBlock()?.visit(this)
-        }
-        if (showScriptClass || !classNode.isScript()) {
-            visitClass classNode
-        }
-    }
-
-    private def visitAllImports(SourceUnit source) {
-        boolean staticImportsPresent = false
-        boolean importsPresent = false
-
-        source?.getAST()?.getStaticImports()?.values()?.each {
-            visitImport(it)
-            staticImportsPresent = true
-        }
-        source?.getAST()?.getStaticStarImports()?.values()?.each {
-            visitImport(it)
-            staticImportsPresent = true
-        }
-
-        if (staticImportsPresent) {
-            printDoubleBreak()
-        }
-
-        source?.getAST()?.getImports()?.each {
-            visitImport(it)
-            importsPresent = true
-        }
-        source?.getAST()?.getStarImports()?.each {
-            visitImport(it)
-            importsPresent = true
-        }
-        if (importsPresent) {
-            printDoubleBreak()
-        }
-    }
-
-
-    void print(parameter) {
-        def output = parameter.toString()
-
-        if (readyToIndent) {
-            _out.print _indent
-            readyToIndent = false
-            while (output.startsWith(' ')) {
-                output = output[1..-1]  // trim left
-            }
-        }
-        if (_out.toString().endsWith(' ')) {
-            if (output.startsWith(' ')) {
-                output = output[1..-1]
-            }
-        }
-        _out.print output
-    }
-
-    def println(parameter) {
-        throw new UnsupportedOperationException('Wrong API')
-    }
-
-    def indented(Closure block) {
-        String startingIndent = _indent
-        _indent = _indent + '    '
-        block()
-        _indent = startingIndent
-    }
-
-    def printLineBreak() {
-        if (!_out.toString().endsWith('\n')) {
-            _out.print '\n'
-        }
-        readyToIndent = true
-    }
-
-    def printDoubleBreak() {
-        if (_out.toString().endsWith('\n\n')) {
-            // do nothing
-        } else if (_out.toString().endsWith('\n')) {
-            _out.print '\n'
-        } else {
-            _out.print '\n'
-            _out.print '\n'
-        }
-        readyToIndent = true
-    }
-
-    void visitPackage(PackageNode packageNode) {
-
-        if (packageNode) {
-
-            packageNode.annotations?.each {
-                visitAnnotationNode(it)
-                printLineBreak()
-            }
-
-            if (packageNode.text.endsWith('.')) {
-                print packageNode.text[0..-2]
-            } else {
-                print packageNode.text
-            }
-            printDoubleBreak()
-        }
-    }
-
-    void visitImport(ImportNode node) {
-        if (node) {
-            node.annotations?.each {
-                visitAnnotationNode(it)
-                printLineBreak()
-            }
-            print node.text
-            printLineBreak()
-        }
-    }
-
-    @Override
-    void visitClass(ClassNode node) {
-
-        classNameStack.push(node.name)
-
-        node?.annotations?.each {
-            visitAnnotationNode(it)
-            printLineBreak()
-        }
-
-        visitModifiers(node.modifiers)
-        print "class $node.name"
-        visitGenerics node?.genericsTypes
-        boolean first = true
-        node.unresolvedInterfaces?.each {
-            if (!first) {
-                print ', '
-            } else {
-                print ' implements '
-            }
-            first = false
-            visitType it
-        }
-        print ' extends '
-        visitType node.unresolvedSuperClass
-        print ' { '
-        printDoubleBreak()
-
-        indented {
-            node?.properties?.each { visitProperty(it) }
-            printLineBreak()
-            node?.fields?.each { visitField(it) }
-            printDoubleBreak()
-            node?.declaredConstructors?.each { visitConstructor(it) }
-            printLineBreak()
-            node?.methods?.each { visitMethod(it) }
-        }
-        print '}'
-        printLineBreak()
-        classNameStack.pop()
-    }
-
-    private void visitGenerics(GenericsType[] generics) {
-
-        if (generics) {
-            print '<'
-            boolean first = true
-            generics.each { GenericsType it ->
-                if (!first) {
-                    print ', '
-                }
-                first = false
-                print it.name
-                if (it.upperBounds) {
-                    print ' extends '
-                    boolean innerFirst = true
-                    it.upperBounds.each { ClassNode upperBound ->
-                        if (!innerFirst) {
-                            print ' & '
-                        }
-                        innerFirst = false
-                        visitType upperBound
-                    }
-                }
-                if (it.lowerBound) {
-                    print ' super '
-                    visitType it.lowerBound
-                }
-            }
-            print '>'
-        }
-    }
-
-    @Override
-    void visitConstructor(ConstructorNode node) {
-        visitMethod(node)
-    }
-
-    private String visitParameters(parameters) {
-        boolean first = true
-
-        parameters.each { Parameter it ->
-            if (!first) {
-                print ', '
-            }
-            first = false
-
-            it.annotations?.each {
-                visitAnnotationNode(it)
-                print(' ')
-            }
-
-            visitModifiers(it.modifiers)
-            visitType it.type
-            print ' ' + it.name
-            if (it.initialExpression && !(it.initialExpression instanceof EmptyExpression)) {
-                print ' = '
-                it.initialExpression.visit this
-            }
-        }
-    }
-
-    @Override
-    void visitMethod(MethodNode node) {
-        node?.annotations?.each {
-            visitAnnotationNode(it)
-            printLineBreak()
-        }
-
-        visitModifiers(node.modifiers)
-        if (node.name == '<init>') {
-            print "${classNameStack.peek()}("
-            visitParameters(node.parameters)
-            print ') {'
-            printLineBreak()
-        } else if (node.name == '<clinit>') {
-            print '{ ' // will already have 'static' from modifiers
-            printLineBreak()
-        } else {
-            visitType node.returnType
-            print " $node.name("
-            visitParameters(node.parameters)
-            print ')'
-            if (node.exceptions) {
-                boolean first = true
-                print ' throws '
-                node.exceptions.each {
-                    if (!first) {
-                        print ', '
-                    }
-                    first = false
-                    visitType it
-                }
-            }
-            print ' {'
-            printLineBreak()
-        }
-
-        indented {
-            node?.code?.visit(this)
-        }
-        printLineBreak()
-        print '}'
-        printDoubleBreak()
-    }
-
-    private def visitModifiers(int modifiers) {
-        if (Modifier.isAbstract(modifiers)) {
-            print 'abstract '
-        }
-        if (Modifier.isFinal(modifiers)) {
-            print 'final '
-        }
-        if (Modifier.isInterface(modifiers)) {
-            print 'interface '
-        }
-        if (Modifier.isNative(modifiers)) {
-            print 'native '
-        }
-        if (Modifier.isPrivate(modifiers)) {
-            print 'private '
-        }
-        if (Modifier.isProtected(modifiers)) {
-            print 'protected '
-        }
-        if (Modifier.isPublic(modifiers)) {
-            print 'public '
-        }
-        if (Modifier.isStatic(modifiers)) {
-            print 'static '
-        }
-        if (Modifier.isSynchronized(modifiers)) {
-            print 'synchronized '
-        }
-        if (Modifier.isTransient(modifiers)) {
-            print 'transient '
-        }
-        if (Modifier.isVolatile(modifiers)) {
-            print 'volatile '
-        }
-    }
-
-    @Override
-    void visitField(FieldNode node) {
-        node?.annotations?.each {
-            visitAnnotationNode(it)
-            printLineBreak()
-        }
-        visitModifiers(node.modifiers)
-        visitType node.type
-        print " $node.name "
-        // do not print initial expression, as this is executed as part of the constructor, unless on static constant
-        Expression exp = node.initialValueExpression
-        if (exp instanceof ConstantExpression) exp = Verifier.transformToPrimitiveConstantIfPossible(exp)
-        ClassNode type = exp?.type
-        if (Modifier.isStatic(node.modifiers) && Modifier.isFinal(node.getModifiers())
-                && exp instanceof ConstantExpression
-                && type == node.type
-                && ClassHelper.isStaticConstantInitializerType(type)) {
-            // GROOVY-5150: final constants may be initialized directly
-            print ' = '
-            if (ClassHelper.STRING_TYPE == type) {
-                print "'"+node.initialValueExpression.text.replaceAll("'", "\\\\'")+"'"
-            } else if (ClassHelper.char_TYPE == type) {
-                print "'${node.initialValueExpression.text}'"
-            } else {
-                print node.initialValueExpression.text
-            }
-        }
-        printLineBreak()
-    }
-
-    void visitAnnotationNode(AnnotationNode node) {
-        print '@' + node?.classNode?.name
-        if (node?.members) {
-            print '('
-            boolean first = true
-            node.members.each { String name, Expression value ->
-                if (first) {
-                    first = false
-                } else {
-                    print ', '
-                }
-                print name + ' = '
-                value.visit(this)
-            }
-            print ')'
-        }
-
-    }
-
-    @Override
-    void visitProperty(PropertyNode node) {
-        // is a FieldNode, avoid double dispatch
-    }
-
-    @Override
-    void visitBlockStatement(BlockStatement block) {
-        block?.statements?.each {
-            it.visit(this)
-            printLineBreak()
-        }
-        if (!_out.toString().endsWith('\n')) {
-            printLineBreak()
-        }
-    }
-
-    @Override
-    void visitForLoop(ForStatement statement) {
-
-        print 'for ('
-        if (statement?.variable != ForStatement.FOR_LOOP_DUMMY) {
-            visitParameters([statement.variable])
-            print ' : '
-        }
-
-        if (statement?.collectionExpression instanceof ListExpression) {
-            statement?.collectionExpression?.visit this
-        } else {
-            statement?.collectionExpression?.visit this
-        }
-        print ') {'
-        printLineBreak()
-        indented {
-            statement?.loopBlock?.visit this
-        }
-        print '}'
-        printLineBreak()
-    }
-
-    @Override
-    void visitIfElse(IfStatement ifElse) {
-        print 'if ('
-        ifElse?.booleanExpression?.visit this
-        print ') {'
-        printLineBreak()
-        indented {
-            ifElse?.ifBlock?.visit this
-        }
-        printLineBreak()
-        if (ifElse?.elseBlock && !(ifElse.elseBlock instanceof EmptyStatement)) {
-            print '} else {'
-            printLineBreak()
-            indented {
-                ifElse?.elseBlock?.visit this
-            }
-            printLineBreak()
-        }
-        print '}'
-        printLineBreak()
-    }
-
-    @Override
-    void visitExpressionStatement(ExpressionStatement statement) {
-        statement.expression.visit this
-    }
-
-    @Override
-    void visitReturnStatement(ReturnStatement statement) {
-        printLineBreak()
-        print 'return '
-        statement.getExpression().visit(this)
-        printLineBreak()
-    }
-
-    @Override
-    void visitSwitch(SwitchStatement statement) {
-        print 'switch ('
-        statement?.expression?.visit this
-        print ') {'
-        printLineBreak()
-        indented {
-            statement?.caseStatements?.each {
-                visitCaseStatement it
-            }
-            if (statement?.defaultStatement) {
-                print 'default: '
-                printLineBreak()
-                statement?.defaultStatement?.visit this
-            }
-        }
-        print '}'
-        printLineBreak()
-    }
-
-    @Override
-    void visitCaseStatement(CaseStatement statement) {
-        print 'case '
-        statement?.expression?.visit this
-        print ':'
-        printLineBreak()
-        indented {
-            statement?.code?.visit this
-        }
-    }
-
-    @Override
-    void visitBreakStatement(BreakStatement statement) {
-        print 'break'
-        printLineBreak()
-    }
-
-    @Override
-    void visitContinueStatement(ContinueStatement statement) {
-        print 'continue'
-        printLineBreak()
-    }
-
-    @Override
-    void visitMethodCallExpression(MethodCallExpression expression) {
-
-        Expression objectExp = expression.getObjectExpression()
-        if (objectExp instanceof VariableExpression) {
-            visitVariableExpression(objectExp, false)
-        } else {
-            objectExp.visit(this)
-        }
-        if (expression.spreadSafe) {
-            print '*'
-        }
-        if (expression.safe) {
-            print '?'
-        }
-        print '.'
-        Expression method = expression.getMethod()
-        if (method instanceof ConstantExpression) {
-            visitConstantExpression(method, true)
-        } else {
-            method.visit(this)
-        }
-        expression.getArguments().visit(this)
-    }
-
-    @Override
-    void visitStaticMethodCallExpression(StaticMethodCallExpression expression) {
-        print expression?.ownerType?.name + '.' + expression?.method
-        if (expression?.arguments instanceof VariableExpression || expression?.arguments instanceof MethodCallExpression) {
-            print '('
-            expression?.arguments?.visit this
-            print ')'
-        } else {
-            expression?.arguments?.visit this
-        }
-    }
-
-    @Override
-    void visitConstructorCallExpression(ConstructorCallExpression expression) {
-        if (expression?.isSuperCall()) {
-            print 'super'
-        } else if (expression?.isThisCall()) {
-            print 'this '
-        } else {
-            print 'new '
-            visitType expression?.type
-        }
-        expression?.arguments?.visit this
-    }
-
-    @Override
-    void visitBinaryExpression(BinaryExpression expression) {
-        expression?.leftExpression?.visit this
-        print " $expression.operation.text "
-        expression.rightExpression.visit this
-
-        if (expression?.operation?.text == '[') {
-            print ']'
-        }
-    }
-
-    @Override
-    void visitPostfixExpression(PostfixExpression expression) {
-        print '('
-        expression?.expression?.visit this
-        print ')'
-        print expression?.operation?.text
-    }
-
-    @Override
-    void visitPrefixExpression(PrefixExpression expression) {
-        print expression?.operation?.text
-        print '('
-        expression?.expression?.visit this
-        print ')'
-    }
-
-
-    @Override
-    void visitClosureExpression(ClosureExpression expression) {
-        print '{ '
-        if (expression?.parameters) {
-            visitParameters(expression?.parameters)
-            print ' ->'
-        }
-        printLineBreak()
-        indented {
-            expression?.code?.visit this
-        }
-        print '}'
-    }
-
-    @Override
-    void visitTupleExpression(TupleExpression expression) {
-        print '('
-        visitExpressionsAndCommaSeparate(expression?.expressions)
-        print ')'
-    }
-
-    @Override
-    void visitRangeExpression(RangeExpression expression) {
-        print '('
-        expression?.from?.visit this
-        print '..'
-        expression?.to?.visit this
-        print ')'
-    }
-
-    @Override
-    void visitPropertyExpression(PropertyExpression expression) {
-        expression?.objectExpression?.visit this
-        if (expression?.spreadSafe) {
-            print '*'
-        } else if (expression?.isSafe()) {
-            print '?'
-        }
-        print '.'
-        if (expression?.property instanceof ConstantExpression) {
-            visitConstantExpression(expression?.property, true)
-        } else {
-            expression?.property?.visit this
-        }
-    }
-
-    @Override
-    void visitAttributeExpression(AttributeExpression attributeExpression) {
-        visitPropertyExpression attributeExpression
-    }
-
-    @Override
-    void visitFieldExpression(FieldExpression expression) {
-        print expression?.field?.name
-    }
-
-    void visitConstantExpression(ConstantExpression expression, boolean unwrapQuotes = false) {
-        if (expression.value instanceof String && !unwrapQuotes) {
-            // string reverse escaping is very naive
-            def escaped = ((String) expression.value).replaceAll('\n', '\\\\n').replaceAll("'", "\\\\'")
-            print "'$escaped'"
-        } else {
-            print expression.value
-        }
-    }
-
-    @Override
-    void visitClassExpression(ClassExpression expression) {
-        print expression.text
-    }
-
-    void visitVariableExpression(VariableExpression expression, boolean spacePad = true) {
-
-        if (spacePad) {
-            print ' ' + expression.name + ' '
-        } else {
-            print expression.name
-        }
-    }
-
-    @Override
-    void visitDeclarationExpression(DeclarationExpression expression) {
-        // handle multiple assignment expressions
-        if (expression?.leftExpression instanceof ArgumentListExpression) {
-            print 'def '
-            visitArgumentlistExpression expression?.leftExpression, true
-            print " $expression.operation.text "
-            expression.rightExpression.visit this
-
-            if (expression?.operation?.text == '[') {
-                print ']'
-            }
-        } else {
-            visitType expression?.leftExpression?.type
-            visitBinaryExpression expression // is a BinaryExpression
-        }
-    }
-
-    @Override
-    void visitGStringExpression(GStringExpression expression) {
-        print '"' + expression.text + '"'
-    }
-
-    @Override
-    void visitSpreadExpression(SpreadExpression expression) {
-        print '*'
-        expression?.expression?.visit this
-    }
-
-    @Override
-    void visitNotExpression(NotExpression expression) {
-        print '!('
-        expression?.expression?.visit this
-        print ')'
-    }
-
-    @Override
-    void visitUnaryMinusExpression(UnaryMinusExpression expression) {
-        print '-('
-        expression?.expression?.visit this
-        print ')'
-    }
-
-    @Override
-    void visitUnaryPlusExpression(UnaryPlusExpression expression) {
-        print '+('
-        expression?.expression?.visit this
-        print ')'
-    }
-
-    @Override
-    void visitCastExpression(CastExpression expression) {
-        print '(('
-        expression?.expression?.visit this
-        print ') as '
-        visitType(expression?.type)
-        print ')'
-
-    }
-
-    /**
-     * Prints out the type, safely handling arrays.
-     * @param classNode
-     *      classnode
-     */
-    void visitType(ClassNode classNode) {
-        def name = classNode.name
-        if (name =~ /^\[+L/ && name.endsWith(';')) {
-            int numDimensions = name.indexOf('L')
-            print "${classNode.name[(numDimensions + 1)..-2]}" + ('[]' * numDimensions)
-        } else {
-            print name
-        }
-        visitGenerics classNode?.genericsTypes
-    }
-
-    void visitArgumentlistExpression(ArgumentListExpression expression, boolean showTypes = false) {
-        print '('
-        int count = expression?.expressions?.size()
-        expression.expressions.each {
-            if (showTypes) {
-                visitType it.type
-                print ' '
-            }
-            if (it instanceof VariableExpression) {
-                visitVariableExpression it, false
-            } else if (it instanceof ConstantExpression) {
-                visitConstantExpression it, false
-            } else {
-                it.visit this
-            }
-            count--
-            if (count) print ', '
-        }
-        print ')'
-    }
-
-    @Override
-    void visitBytecodeExpression(BytecodeExpression expression) {
-        print '/*BytecodeExpression*/'
-        printLineBreak()
-    }
-
-
-
-    @Override
-    void visitMapExpression(MapExpression expression) {
-        print '['
-        if (expression?.mapEntryExpressions?.size() == 0) {
-            print ':'
-        } else {
-            visitExpressionsAndCommaSeparate(expression?.mapEntryExpressions)
-        }
-        print ']'
-    }
-
-    @Override
-    void visitMapEntryExpression(MapEntryExpression expression) {
-        if (expression?.keyExpression instanceof SpreadMapExpression) {
-            print '*'            // is this correct?
-        } else {
-            expression?.keyExpression?.visit this
-        }
-        print ': '
-        expression?.valueExpression?.visit this
-    }
-
-    @Override
-    void visitListExpression(ListExpression expression) {
-        print '['
-        visitExpressionsAndCommaSeparate(expression?.expressions)
-        print ']'
-    }
-
-    @Override
-    void visitTryCatchFinally(TryCatchStatement statement) {
-        print 'try {'
-        printLineBreak()
-        indented {
-            statement?.tryStatement?.visit this
-        }
-        printLineBreak()
-        print '} '
-        printLineBreak()
-        statement?.catchStatements?.each { CatchStatement catchStatement ->
-            visitCatchStatement(catchStatement)
-        }
-        print 'finally { '
-        printLineBreak()
-        indented {
-            statement?.finallyStatement?.visit this
-        }
-        print '} '
-        printLineBreak()
-    }
-
-    @Override
-    void visitThrowStatement(ThrowStatement statement) {
-        print 'throw '
-        statement?.expression?.visit this
-        printLineBreak()
-    }
-
-    @Override
-    void visitSynchronizedStatement(SynchronizedStatement statement) {
-        print 'synchronized ('
-        statement?.expression?.visit this
-        print ') {'
-        printLineBreak()
-        indented {
-            statement?.code?.visit this
-        }
-        print '}'
-    }
-
-    @Override
-    void visitTernaryExpression(TernaryExpression expression) {
-        expression?.booleanExpression?.visit this
-        print ' ? '
-        expression?.trueExpression?.visit this
-        print ' : '
-        expression?.falseExpression?.visit this
-    }
-
-    @Override
-    void visitShortTernaryExpression(ElvisOperatorExpression expression) {
-        visitTernaryExpression(expression)
-    }
-
-    @Override
-    void visitBooleanExpression(BooleanExpression expression) {
-        expression?.expression?.visit this
-    }
-
-    @Override
-    void visitWhileLoop(WhileStatement statement) {
-        print 'while ('
-        statement?.booleanExpression?.visit this
-        print ') {'
-        printLineBreak()
-        indented {
-            statement?.loopBlock?.visit this
-        }
-        printLineBreak()
-        print '}'
-        printLineBreak()
-    }
-
-    @Override
-    void visitDoWhileLoop(DoWhileStatement statement) {
-        print 'do {'
-        printLineBreak()
-        indented {
-            statement?.loopBlock?.visit this
-        }
-        print '} while ('
-        statement?.booleanExpression?.visit this
-        print ')'
-        printLineBreak()
-    }
-
-    @Override
-    void visitCatchStatement(CatchStatement statement) {
-        print 'catch ('
-        visitParameters([statement.variable])
-        print ') {'
-        printLineBreak()
-        indented {
-            statement.code?.visit this
-        }
-        print '} '
-        printLineBreak()
-    }
-
-    @Override
-    void visitBitwiseNegationExpression(BitwiseNegationExpression expression) {
-        print '~('
-        expression?.expression?.visit this
-        print ') '
-    }
-
-    @Override
-    void visitAssertStatement(AssertStatement statement) {
-        print 'assert '
-        statement?.booleanExpression?.visit this
-        print ' : '
-        statement?.messageExpression?.visit this
-    }
-
-    @Override
-    void visitClosureListExpression(ClosureListExpression expression) {
-        boolean first = true
-        expression?.expressions?.each {
-            if (!first) {
-                print ';'
-            }
-            first = false
-            it.visit this
-        }
-    }
-
-    @Override
-    void visitMethodPointerExpression(MethodPointerExpression expression) {
-        expression?.expression?.visit this
-        print '.&'
-        expression?.methodName?.visit this
-    }
-
-    @Override
-    void visitArrayExpression(ArrayExpression expression) {
-        print 'new '
-        visitType expression?.elementType
-        print '['
-        visitExpressionsAndCommaSeparate(expression?.sizeExpression)
-        print ']'
-    }
-
-    private void visitExpressionsAndCommaSeparate(List<? super Expression> expressions) {
-        boolean first = true
-        expressions?.each {
-            if (!first) {
-                print ', '
-            }
-            first = false
-            it.visit this
-        }
-    }
-
-    @Override
-    void visitSpreadMapExpression(SpreadMapExpression expression) {
-        print '*:'
-        expression?.expression?.visit this
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-2324.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-2324.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-2324.groovy
deleted file mode 100644
index 30e2f30..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-2324.groovy
+++ /dev/null
@@ -1,23 +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.
- */
-class Foo {}
-
-Foo bar
-bar = new Foo()
-assert bar instanceof Foo

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4438.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4438.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4438.groovy
deleted file mode 100644
index 41ee327..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4438.groovy
+++ /dev/null
@@ -1,26 +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.
- */
-enum Outer {
-    A, B
-    enum Inner{X, Y}
-}
-assert Outer.A instanceof Outer
-assert Outer.B instanceof Outer
-assert Outer.Inner.X instanceof Outer.Inner
-assert Outer.Inner.Y instanceof Outer.Inner
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4757.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4757.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4757.groovy
deleted file mode 100644
index 1a7d2e5..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4757.groovy
+++ /dev/null
@@ -1,27 +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.
- */
-package bugs
-
-class Foo {
-    <T extends Object> T foo(T t) {
-        return t
-    }
-}
-
-assert 'abc' == new Foo().foo('abc')
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4762.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4762.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4762.groovy
deleted file mode 100644
index 235f6a5..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4762.groovy
+++ /dev/null
@@ -1,27 +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.
- */
-package bugs
-
-def get123() {2}
-def foo(i) {this}
-
-def a = foo(2).'123'
-def b = foo 2   123
-
-assert a == b
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5318.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5318.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5318.groovy
deleted file mode 100644
index 13cb623..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5318.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-def a= new java.util<Integer>.ArrayList<ArrayList<Integer>>()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5652.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5652.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5652.groovy
deleted file mode 100644
index e7c6b3f..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5652.groovy
+++ /dev/null
@@ -1,24 +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.
- */
-package bugs
-
-def list = [[1,2],[3,4]] as List<List<Integer>>
-println list
-println 'bye'
-assert [[1,2],[3,4]] == list

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-6038.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-6038.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-6038.groovy
deleted file mode 100644
index f41c5e9..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-6038.groovy
+++ /dev/null
@@ -1,37 +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.
- */
-import java.lang.annotation.*
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-@interface Upper {
-    @Retention(RetentionPolicy.RUNTIME)
-    @Target(ElementType.METHOD)
-    @interface Inner {
-        String testInner()
-    }
-}
-
-class X {
-    @Upper.Inner(testInner='abc')
-    def m() {}
-}
-
-def m = X.class.declaredMethods.find { it.name == 'm' }
-assert m.declaredAnnotations[0].testInner() == 'abc'

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8150.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8150.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8150.groovy
deleted file mode 100644
index ac0cc9d..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8150.groovy
+++ /dev/null
@@ -1,21 +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.
- */
-def a
-def b = [1]
-((a)) = b
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
deleted file mode 100644
index 0b54cda..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
+++ /dev/null
@@ -1,20 +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.
- */
-for (foo in []) {;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/bugs/GROOVY-3898.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/GROOVY-3898.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/GROOVY-3898.groovy
deleted file mode 100644
index 146b5e6..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/GROOVY-3898.groovy
+++ /dev/null
@@ -1,26 +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.
- */
-package bugs
-
-int result = 1
-for((i, j) = [0,0]; i < 3; {i++; j++}()){
-    result = result * i + j
-}
-assert 4 == result
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/AnnotationDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/AnnotationDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/AnnotationDeclaration_01.groovy
deleted file mode 100644
index 88f3a3d..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/AnnotationDeclaration_01.groovy
+++ /dev/null
@@ -1,57 +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.
- */
-import org.codehaus.groovy.transform.GroovyASTTransformationClass
-
-import java.lang.annotation.Documented
-import java.lang.annotation.ElementType
-import java.lang.annotation.Retention
-import java.lang.annotation.RetentionPolicy
-import java.lang.annotation.Target
-
-@Canonical(
-        includes = ['a', 'b'], excludes = ['c']
-)
-@Documented
-@Retention(RetentionPolicy.SOURCE)
-@Target(ElementType.FIELD)
-@GroovyASTTransformationClass('Lulz')
-@interface FunnyAnnotation {
-    public static final String SOME_CONSTANT2 = 'SOME_CONSTANT2';
-    String SOME_CONSTANT = 'SOME_CONSTANT';
-
-    /* This is a comment
-    */
-    String name() default ""
-
-    /**
-     * This has a default, too
-     */
-    boolean synchronize() default false
-
-    boolean synchronize2() default
-            false
-}
-
-@interface a {
-
-}
-
-@interface b {
-    String name()
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_01.groovy
deleted file mode 100644
index c86b156..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_01.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-@Export package core


[48/50] [abbrv] groovy git commit: GROOVY-8178: Codenarc broken in quality build

Posted by pa...@apache.org.
GROOVY-8178: Codenarc broken in quality build


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/255893f4
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/255893f4
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/255893f4

Branch: refs/heads/parrot
Commit: 255893f486add8be65698e839097bc165653a132
Parents: 2c01e99
Author: paulk <pa...@asert.com.au>
Authored: Mon May 8 21:41:55 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:26:02 2017 +1000

----------------------------------------------------------------------
 config/codenarc/codenarc.groovy | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/255893f4/config/codenarc/codenarc.groovy
----------------------------------------------------------------------
diff --git a/config/codenarc/codenarc.groovy b/config/codenarc/codenarc.groovy
index 8d8b64f..1d58fac 100644
--- a/config/codenarc/codenarc.groovy
+++ b/config/codenarc/codenarc.groovy
@@ -161,7 +161,8 @@ ruleset {
         'DuplicateImport' {
             doNotApplyToFileNames='StaticImportTest.groovy,'
         }
-        exclude 'ImportFromSamePackage'   // too many to worry about, review later
+        exclude 'ImportFromSamePackage'     // too many to worry about, review later
+        exclude 'UnusedImport'              // currently failing
         exclude 'MisorderedStaticImports'   // too many to worry about, opposite to IDEA default
     }
 


[41/50] [abbrv] groovy git commit: rename antlr4 parser to remove groovy- prefix since that is by convention for modules

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/ElvisAssignment_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ElvisAssignment_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ElvisAssignment_01x.groovy
deleted file mode 100644
index 17d1bab..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ElvisAssignment_01x.groovy
+++ /dev/null
@@ -1,56 +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.
- */
-import groovy.transform.CompileStatic
-
-def elvisAssignment() {
-    def a = 2
-    a ?= 1
-    assert a == 2
-
-    a = null
-    a ?= 1
-    assert a == 1
-
-    a = null
-    a ?= a ?= 1
-    assert a == 1
-
-    a = null
-    assert (a ?= '2') == '2'
-}
-elvisAssignment();
-
-@CompileStatic
-def csElvisAssignment() {
-    def a = 2
-    a ?= 1
-    assert a == 2
-
-    a = null
-    a ?= 1
-    assert a == 1
-
-    a = null
-    a ?= a ?= 1
-    assert a == 1
-
-    a = null
-    assert (a ?= '2') == '2'
-}
-csElvisAssignment();

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_01.groovy
deleted file mode 100644
index ed0f67d..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_01.groovy
+++ /dev/null
@@ -1,62 +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.
- */
-enum AAAA {}
-public enum AAAA2 {}
-public enum AAAA3 implements A {}
-@Test2
-public enum AAAA4 implements A,B {}
-enum BBBB {A}
-enum CCCC {A, B}
-enum DDDD {A, B,}
-enum EEEE {
-    A,
-    B}
-enum FFFF {
-    A,
-    B,}
-enum GGGG
-{A,
-B,}
-
-enum E1 {
-    A(111,'aa'), B(222,'bb')
-}
-
-@Test2
-enum E2 {
-    A2,
-    B2,C2,
-    D2
-    private void a() {}
-    def c;
-}
-
-enum E3 {
-    A(1), B(2)
-
-    public static final String SOME_CONSTANT = '123';
-    private String name;
-    private int age = 2;
-    String title = "title"
-    public E9(int x) {}
-}
-
-
-
-enum e {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_02.groovy
deleted file mode 100644
index a5768db..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_02.groovy
+++ /dev/null
@@ -1,70 +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.
- */
-enum E {
-    A() {}, B(1) {{}},
-    C(1, 2) {
-        public void prt() {
-            println "$x, $y"
-        }
-
-        void prt2() {
-            println "$x, $y"
-        }
-
-        @Test2 prt3() {
-            println "$x, $y"
-        }
-
-        private void prt4() {
-            println "$x, $y"
-        }
-
-        private prt5() {
-            println "$x, $y"
-        }
-    },
-    D {
-        void hello() {}
-    }
-
-    protected int x;
-    protected int y;
-
-    E() {}
-    E(int x) {
-        this.x = x;
-    }
-    E(int x, y) {
-        this(x)
-        this.y = y;
-    }
-
-    void prt() {
-        println "123"
-    }
-}
-
-enum F {
-    @Test2
-    A
-}
-
-enum G implements I<T> {
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_03.groovy
deleted file mode 100644
index 27d3621..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_03.groovy
+++ /dev/null
@@ -1,24 +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.
- */
-enum H {
-    SOME_ENUM_CONSTANT0(a: "0"),
-    SOME_ENUM_CONSTANT1(a: "0") {},
-    SOME_ENUM_CONSTANT2(a: "1", b: "2"),
-    SOME_ENUM_CONSTANT3(c: "3", d: "4") {}
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_04.groovy
deleted file mode 100644
index b923828..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_04.groovy
+++ /dev/null
@@ -1,22 +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.
- */
-enum ListEnum1 {
-    ONE([111, 222])
-    ListEnum1(Object listArg){}
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_05.groovy
deleted file mode 100644
index bdeb296..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_05.groovy
+++ /dev/null
@@ -1,22 +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.
- */
-enum ListEnum1 {
-    ONE([111, 222]) {}
-    ListEnum1(Object listArg){}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_01.groovy
deleted file mode 100644
index 575439a..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_01.groovy
+++ /dev/null
@@ -1,248 +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.
- */
--1
--12
--123
-
--1.2
--1.2f
--1.2F
--1.2d
--1.2D
--1.2g
--1.2G
-
--0x1234567890abcdef
--0X1234567890ABCDEF
--0x1234567890abcdefi
--0x1234567890abcdefl
--0x1234567890abcdefg
--0x1234567890abcdefI
--0x1234567890abcdefL
--0x1234567890abcdefG
--0xabcdef
--0xABCDEF
--0xABCDEF
--0xabcdef
--0xABCDEF
-
--01234567
--01234567
--01234567
--01234567i
--01234567l
--01234567g
--01234567I
--01234567L
--01234567G
-
--1__2
--2_12_3
--2__12__3
--2__12__3.1__2
--2__12__3.1__2
--12e10
--12e-10
--12e10
--12e-10
--12.12e10
--12.12e-10
--12.12e10
--12.12e-10
--12.12e-10f
--12.12e-10d
--12.12e-10g
--12e-10F
--120e-10D
--11F
--12D
--1.1F
--1.2D
--12e-10G
--12.1__2e-10f
--12.1_2e-10d
--1__12_2.12e-10g
--0xab__cdef
--0xAB__CD_EF
--012__34567L
-
--0b010101
--0B10101011
-
-+1
-+12
-+123
-
-+1.2
-+1.2f
-+1.2F
-+1.2d
-+1.2D
-+1.2g
-+1.2G
-
-+0x1234567890abcdef
-+0X1234567890ABCDEF
-+0x1234567890abcdefi
-+0x1234567890abcdefl
-+0x1234567890abcdefg
-+0x1234567890abcdefI
-+0x1234567890abcdefL
-+0x1234567890abcdefG
-+0xabcdef
-+0xABCDEF
-+0xABCDEF
-+0xabcdef
-+0xABCDEF
-
-+01234567
-+01234567
-+01234567
-+01234567i
-+01234567l
-+01234567g
-+01234567I
-+01234567L
-+01234567G
-
-+1__2
-+2_12_3
-+2__12__3
-+2__12__3.1__2
-+2__12__3.1__2
-+12e10
-+12e-10
-+12e10
-+12e-10
-+12.12e10
-+12.12e-10
-+12.12e10
-+12.12e-10
-+12.12e-10f
-+12.12e-10d
-+12.12e-10g
-+12e-10F
-+120e-10D
-+11F
-+12D
-+1.1F
-+1.2D
-+12e-10G
-+12.1__2e-10f
-+12.1_2e-10d
-+1__12_2.12e-10g
-+0xab__cdef
-+0xAB__CD_EF
-+012__34567L
-
-+0b010101
-+0B10101011
-
-~1
-~12
-~123
-
-~1.2
-~1.2f
-~1.2F
-~1.2d
-~1.2D
-~1.2g
-~1.2G
-
-~0x1234567890abcdef
-~0X1234567890ABCDEF
-~0x1234567890abcdefi
-~0x1234567890abcdefl
-~0x1234567890abcdefg
-~0x1234567890abcdefI
-~0x1234567890abcdefL
-~0x1234567890abcdefG
-~0xabcdef
-~0xABCDEF
-~0xABCDEF
-~0xabcdef
-~0xABCDEF
-
-~01234567
-~01234567
-~01234567
-~01234567i
-~01234567l
-~01234567g
-~01234567I
-~01234567L
-~01234567G
-
-~1__2
-~2_12_3
-~2__12__3
-~2__12__3.1__2
-~2__12__3.1__2
-~12e10
-~12e-10
-~12e10
-~12e-10
-~12.12e10
-~12.12e-10
-~12.12e10
-~12.12e-10
-~12.12e-10f
-~12.12e-10d
-~12.12e-10g
-~12e-10F
-~120e-10D
-~11F
-~12D
-~1.1F
-~1.2D
-~12e-10G
-~12.1__2e-10f
-~12.1_2e-10d
-~1__12_2.12e-10g
-~0xab__cdef
-~0xAB__CD_EF
-~012__34567L
-
-~0b010101
-~0B10101011
-
-!true
-!false
-
-+a
--a
-
-++a
---a
-
-int[]
-String[]
-String[][]
-
-
-1
-2147483647
-2147483648
-9223372036854775807
-9223372036854775808
--1
--2147483648
--2147483649
--9223372036854775808

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_02.groovy
deleted file mode 100644
index 5a65f87..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_02.groovy
+++ /dev/null
@@ -1,24 +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.
- */
-assert (1)
-assert (
-        1)
-assert (
-        1
-)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_03.groovy
deleted file mode 100644
index f5c3819..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_03.groovy
+++ /dev/null
@@ -1,49 +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.
- */
-1 + 2 + 3
-'a' + 'b' + 'c'
-10 - 2 + 3 - 5 + 6 + 7
-++a + 1 - --b - 6 + ++c + 'a' + 2 - 3
-++a +
-        1 -
-        --b -
-        6 +
-        ++c +
-        'a' +
-        2 *
-        3 +
-        a++ -
-        a--
-
-1 * 2 / 3 % 4
-1 *
-        2 /
-        3 %
-        4
-
-
-1 ** 2 ** 3
-1 **
-        2 **
-        3
-
-1 + 2 * 3 - 4 / 5 + 6 % 7 - 8 ** 9
-
-
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_04.groovy
deleted file mode 100644
index e8c72e0..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_04.groovy
+++ /dev/null
@@ -1,80 +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.
- */
-a = 1
-a = b = 1
-left >>>= 16
-left >>= 8
-left <<= 2
-sum += sup
-cantlive -= you
-times *= me
-times **= me
-slash /= nstore
-your |= me
-here %= sometimes
-water ^= oil
-a &= that
-
-a = e f g h
-a = b *= c += d %= e f g h
-
-obj.name = '123'
-m().result = 123
-map[a] = 1
-map['a'] = 1
-map["$a"] = 1
-map[a.b] = 1
-map[a()] = 1
-map[obj.a()] = 1
-map[a().result] = 1
-map[a + b] = 1
-obj.prop[0][1] = 'a'
-this = someValue;
-super = someValue;
-
-list[0] = 1
-list[1, 2] = [11, 22]
-
-(a)         = [1]
-(a)         = x++
-(a)         = (SomeType)x++
-(a)         = obj.m()
-(a)         = [1]
-(a)         = [1] + [2]
-(a, b)      = [1, 2]
-(a, b, c)   = [1, 2, 3]
-
-(obj) =
-        a =
-              b =
-                left >>>=
-                        left >>=
-                                left <<=
-                                        sum +=
-                                                cantlive -=
-                                                        times *=
-                                                                times **=
-                                                                        slash /=
-                                                                                your |=
-                                                                                        here %=
-                                                                                                water ^=
-                                                                                                        a &=
-                                                                                                                that =
-                                                                                                                        x y z
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_05.groovy
deleted file mode 100644
index d195b10..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_05.groovy
+++ /dev/null
@@ -1,58 +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.
- */
-true ?: 'a'
-
-true
-?: 'a'
-
-true
-?:
-'a'
-
-true ? 'a' : 'b'
-
-true ?
-        'a'
-        :
-        'b'
-
-true ?
-        'a'
-        :
-        true ?: 'b'
-
-true ?
-        'a'
-        :
-        true ? 'b' : 'c'
-
-true ?: true ?: 'a'
-
-1 == 2 ?: 3
-1 == 2 ? 3 : 4
-
-1 == 2 || 1 != 3 && !(1 == 6)
-    ? 2 > 3 && 3 >= 1
-        ? 4 < 5 && 2 <= 9 ?: 6 ^ 8 | 9 & 10
-        : 8 * 2 / (3 % 4 + 6) - 2
-    : 9
-
-
-bar = 0 ? "moo"         \
-              : "cow"

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_06.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_06.groovy
deleted file mode 100644
index debea2c..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_06.groovy
+++ /dev/null
@@ -1,24 +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.
- */
-true && false || true && false || true
-true &&
-        false ||
-        true &&
-        false ||
-        true

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_07.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_07.groovy
deleted file mode 100644
index 9474f18..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_07.groovy
+++ /dev/null
@@ -1,27 +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.
- */
-1 | 2 ^ 3 & 4 | 5 ^ 6 & 7 | 8
-1 |
-        2 ^
-        3 &
-        4 |
-        5 ^
-        6 &
-        7 |
-        8
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_08.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_08.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_08.groovy
deleted file mode 100644
index 108e1b0..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_08.groovy
+++ /dev/null
@@ -1,24 +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.
- */
-a =~ /abc/
-a =~
-        /abc/
-b ==~ /abc/
-b ==~
-        /abc/

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_09.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_09.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_09.groovy
deleted file mode 100644
index 98b7e95..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_09.groovy
+++ /dev/null
@@ -1,34 +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.
- */
-1 == 1 != 2 == 3 != 4 <=> 5 == 6 != 7
-1 ==
-        1 !=
-        2 ==
-        3 !=
-        4 <=>
-        5 ==
-        6 !=
-        7
-2 == 3 != 4 <=> 5
-
-
-        2 ==
-        3 !=
-        4 <=>
-        5

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_10.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_10.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_10.groovy
deleted file mode 100644
index bdd8c7a..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_10.groovy
+++ /dev/null
@@ -1,43 +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.
- */
-1 < 2
-1 <
-        2
-2 <= 2
-2 <=
-        2
-2 >= 2
-2 >=
-        2
-2 > 1
-2 >
-        1
-1 in [1, 2, 3]
-1 in
-        [1, 2, 3]
-
-'abc' instanceof String
-'abc' instanceof
-        String
-'abc' as String
-'abc' as
-        String
-
-
-1 < 2 && 2 <= 2 | 2 >= 2 && (2 > 1 || 1 == 1) & (1 != 2 || 1 ^ 2 && 1 <=> 2) && 1 in [1, 2, 3] && 'abc' as String || 'abc' instanceof String
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_11.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_11.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_11.groovy
deleted file mode 100644
index 2030a4a..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_11.groovy
+++ /dev/null
@@ -1,34 +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.
- */
-1 << 2
-1 <<
-        2
-1 >> 2
-1 >>
-        2
-1 >>> 3
-1 >>>
-        3
-
-1..2
-1..
-        2
-1..<2
-1..<
-        2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_12.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_12.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_12.groovy
deleted file mode 100644
index d7c4042..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_12.groovy
+++ /dev/null
@@ -1,35 +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.
- */
-!true
-!
-        true
-~1
-~
-        1
-(String)'abc'
-(int) obj.someMethod()
-(int) (obj.someMethod())
-(int) 1 / 2
-1 / (int) 2
-(int) a++
-(int) a--
-(int) ++a
-(int) --a
-(int) ~123
-(boolean) !false
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_13.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_13.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_13.groovy
deleted file mode 100644
index b092c64..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_13.groovy
+++ /dev/null
@@ -1,63 +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.
- */
-!5
-~5
--5
-+5
--a
-+a
-
-5+5
-+(+5)
--(-5)
-+(-5)
--(+5)
-
-5 + 10
-5 - 10
-5 * 10
-5 / 10
-5 % 10
-5 ** 10
-
-5--
-5++
---5
-++5
-
-5 >> 10
-5 >>> 10
-5 << 10
-5 > 10
-5 < 10
-
-5 ^ 10
-
-5 | 10
-5 & 10
-
-5 || 10
-5 && 10
-5 ==  10
-5 !=  10
-5 <=>  10
-
-5..10
-5..10
-5..<10 > 1..3

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_14.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_14.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_14.groovy
deleted file mode 100644
index f7f1ef0..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_14.groovy
+++ /dev/null
@@ -1,40 +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.
- */
-a = java.lang.Integer
-a = java.lang.Integer.class
-a = Integer
-a = Integer.class
-a = void
-a = void.class
-a = boolean
-a = boolean.class
-a = byte
-a = byte.class
-a = char
-a = char.class
-a = short
-a = short.class
-a = int
-a = int.class
-a = float
-a = float.class
-a = long
-a = long.class
-a = double
-a = double.class
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_15.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_15.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_15.groovy
deleted file mode 100644
index bab67fa..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_15.groovy
+++ /dev/null
@@ -1,145 +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.
- */
-person.@name
-person.child.@name
-person.@name.count
-person.&sayHello
-person.child.&sayHello
-person?.child
-person?.@child
-person*.child
-person*.@child
-person.'name'
-person.@'name'
-person?.'name'
-person?.@'name'
-person*.'child'
-person*.@'child'
-person.&'sayHello'
-person.new
-person.@new
-person?.new
-person?.@new
-person*.new
-person*.@new
-person.&new
-person."$name"
-person.@"$name"
-person?."$name"
-person?.@"$name"
-person*."$name"
-person*.@"$name"
-person.&"$methodName"
-person.("$firstname" + "$lastname")
-person.@("$firstname" + "$lastname")
-person?.("$firstname" + "$lastname")
-person?.@("$firstname" + "$lastname")
-person*.("$firstname" + "$lastname")
-person*.@("$firstname" + "$lastname")
-person.&("$method" + "$name")
-
-a.b?.c[1, 2, 3]*.d
-a[1, *[2, 3]]*.b
-a[*[2, 3]]*.b
-
-person
-*.
-child
-*.
-@child
-?.
-child
-?.
-@child
-.
-child
-        .
-@name
-.&
-length
-
-a.b()
-a.'b'()
-a."$b"()
-a?.b()
-a*.b()
-a()
-'a'()
-"$a"()
-
-obj.a
-    .b()
-    ?.c()
-    *.d()
-
-obj.a(1, 2)
-a(1, 2)
-
-obj.a(x: 1, y: 2)
-a(x: 1, y: 2)
-
-a.@b()
-a.@b(1, 2, 3)
-a?.@b()
-a?.@b(1, 2, 3)
-a*.@b()
-a*.@b(1, 2, 3)
-
-a.<Integer>b(1, 2)
-
-a
-        .
-<Integer>b(1, 2)
-
-a.<Integer, String>b(1, '2')
-a?.<Integer, String>b(1, '2')
-a*.<Integer, String>b(1, '2')
-obj?.a*.<
-        Integer,
-        String
-        >b(1, '2')
-
-String[] codes = [
-        className + '.' + propertyName + '.typeMismatch.error',
-        className + '.' + propertyName + '.typeMismatch',
-        classAsPropertyName + '.' + propertyName + '.typeMismatch.error',
-        classAsPropertyName + '.' + propertyName + '.typeMismatch',
-        bindingResult.resolveMessageCodes('typeMismatch', propertyName)
-].flatten() as String[]
-
-
-person*.child[1, 2 + 6, *[3, 4]]*.@child*.@child()?.@child().@child()?.child?.@child.child.getChild().getChild(1, 2).getChild(name: 'a', age: 2).'child'."$child".('chi' + 'ld').@name.class.&equals
-
-
-(obj.x)()
-(obj.@x)()
-
-
-static.unused = { -> }
-
-ResolveOptions resolveOptions = new ResolveOptions()\
-            .setConfs(['default'] as String[])\
-            .setOutputReport(false)\
-            .setValidate(args.containsKey('validate') ? args.validate : false)
-
-new A("b") C.d()
-
-m()()
-
-a = {a,b-> }()

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_16.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_16.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_16.groovy
deleted file mode 100644
index 58e7b0a..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_16.groovy
+++ /dev/null
@@ -1,40 +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
-super
-this.name
-super.name
-
-
-def x = {->}()
-x = {a, b -> a + b }(1, 2)
-
-void()
-void(1, 2)
-void(1, 2) {
-
-}
-void(x: 1, y: 2)
-void(x: 1, y: 2) {
-
-}
-
-use(String) {
-}
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_17.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_17.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_17.groovy
deleted file mode 100644
index 89309fb..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_17.groovy
+++ /dev/null
@@ -1,159 +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.
- */
-a.m(x: 1, y: 2) {
-    println('named arguments');
-}
-
-a.m(x: 1, y: 2, z: 3) {
-    println('named arguments');
-} {
-    println('named arguments');
-}
-
-
-a.m(x: 1, y: 2, z: 3)
-
-{
-    println('named arguments');
-}
-
-{
-    println('named arguments');
-}
-
-
-
-a.m(1, 2) {
-    println('normal arguments');
-}
-
-a.m(1, 2, 3) {
-    println('normal arguments');
-} {
-    println('normal arguments');
-}
-
-a.m(1, 2, 3)
-
-{
-    println('normal arguments');
-}
-
-
-{
-    println('normal arguments');
-}
-
-
-
-
-m {
-    println('closure arguments');
-}
-
-m {
-    println('closure arguments');
-} {
-    println('closure arguments');
-}
-
-m {
-    println('closure arguments');
-} {
-    println('closure arguments');
-} {
-    println('closure arguments');
-}
-
-
-m
-
-{
-    println('closure arguments');
-}
-
-{
-    println('closure arguments');
-}
-
-{
-    println('closure arguments');
-}
-
-'m' {
-    println('closure arguments');
-}
-
-
-1 {
-
-}
-1.1 {
-
-}
-
--1 {
-
-}
-
--1.1 {
-
-}
-
-1()
-1.1()
-1(1, 2, 3)
-1.1(1, 2, 3)
--1()
--1.1()
--1(1, 2, 3)
--1.1(1, 2, 3)
-
-1(1, 2) {
-
-}
-
-1.1(1, 2) {
-
-}
-
--1(1, 2) {
-
-}
-
--1.1(1, 2) {
-
-}
-
-hello(x: 1, y: 2, z: 3)
-hello('a', 'b')
-hello(x: 1, 'a', y: 2, 'b', z: 3)
-hello('c', x: 1, 'a', y: 2, 'b', z: 3)
-
-
-A[x: 1, y: 2]
-A[*: someMap]
-A[*: someMap, z: 3]
-A[w: 0, *: someMap]
-A[*: [x: 1, y: 2]]
-A[*: [x: 1, y: 2], z: 3]
-A[w: 0, *: [x: 1, y: 2]]
-
-SomeMethod(a, b)
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_18.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_18.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_18.groovy
deleted file mode 100644
index 5a8cc37..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_18.groovy
+++ /dev/null
@@ -1,44 +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.
- */
-1 > 2 ? 'y' : 'n'
-1 >= 2 ? 'y' : 'n'
-1 < 2 ? 'y' : 'n'
-1 <= 2 ? 'y' : 'n'
-1 == 2 ? 'y' : 'n'
-1 != 2 ? 'y' : 'n'
-
-p29 = 1 > 2 ? /ab/ : /cd/
-p30=++a == b[2].next()
-p31=a <=> b == a.compareTo(b)
-p32 = 1 in [1, 2, 3] == 1 instanceof Integer
-p33 = 1-2+3
-p34 = 1+2-3
-p35 = 1*2/3
-p36 = 1/2*3
-p37 = 1*2%3
-p38 = 1%2*3
-p39 = 1/2%3
-p40 = 1%2/3
-p41 = 1+2+3
-p42 = 1-2-3
-p43 = 1*2*3
-p44 = 1/2/3
-p45 = 1%2%3
-p46 = 1-2*3+4/5-6%7-8-9+10/11*12-13+14+15-16%17%18/19/20*21*22
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_19.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_19.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_19.groovy
deleted file mode 100644
index 3f893a6..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_19.groovy
+++ /dev/null
@@ -1,50 +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.
- */
-List list = new ArrayList();
-List list2 = new java.util.ArrayList();
-List<String> list3 = new ArrayList<String>();
-List<String> list4 = new java.util.ArrayList<String>();
-List<String> list5 = new ArrayList<>();
-//List<String> list6 = new java.util.ArrayList<>(); // the old parser can not parse "new java.util.ArrayList<>()"
-def x = new A<EE, TT>();
-int[] a = new int[10];
-int[][] b = new int[length()][2 * 8];
-ArrayList[] c = new ArrayList[10];
-ArrayList[][] cc = new ArrayList[10][size()];
-java.util.ArrayList[] d = new java.util.ArrayList[10];
-ArrayList[] e = new ArrayList<String>[10];
-java.util.ArrayList[] f = new java.util.ArrayList<String>[10];
-java.util.ArrayList[] g = new java.util.ArrayList<String>[size()];
-
-int[][] h = new int[10][];
-int[][][] i = new int[10][][];
-ArrayList[][] j = new ArrayList[10][];
-ArrayList[][] k = new ArrayList<String>[10][];
-
-def bb = new A.B();
-def bb2 = new A.B[0];
-
-new
-    A
-        ('x', 'y');
-
-
-new a();
-new $a();
-new as.def.in.trait.a();

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_20.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_20.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_20.groovy
deleted file mode 100644
index 7249e85..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_20.groovy
+++ /dev/null
@@ -1,20 +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.
- */
-@Test2(pre={ super(xx);})
-class XX {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_21x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_21x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_21x.groovy
deleted file mode 100644
index c983dc9..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_21x.groovy
+++ /dev/null
@@ -1,24 +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.
- */
-new int[5]
-new int[5][]
-new int[5][6][]
-new int[5][6][7][]
-new int[5][6][7][][]
-new int[5][6][7][][][]

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_22x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_22x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_22x.groovy
deleted file mode 100644
index e744a27..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_22x.groovy
+++ /dev/null
@@ -1,29 +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.
- */
-int j = 0
-++j++
-assert j == 1
-
-int i = 0
-((i++)++)++
-assert i == 1
-++(++(++i))
-assert i == 2
-++(++(++i++)++)++
-assert i == 3

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_23x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_23x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_23x.groovy
deleted file mode 100644
index 2f3007d..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_23x.groovy
+++ /dev/null
@@ -1,115 +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.
- */
-def a
-    =
-        1 + 2
-assert 3 == a
-
-a
-    +=
-        2
-assert 5 == a
-
-int b
-    =
-        1,
-    c
-        =
-            2
-assert 1 == b
-assert 2 == c
-
-def (int x, int y)
-    =
-        [1, 2]
-assert 1 == x
-assert 2 == y
-(x)
-    =
-        [3]
-assert 3 == x
-
-@SuppressWarnings(value
-        =
-        "all")
-def m(p1
-        =
-            1,
-      p2
-        =
-            2,
-      int... p3
-                =
-                    [3]) {
-    return p1 + p2 + p3[0]
-}
-assert 6 == m()
-
-def w
-    =
-        1
-            <<
-                2
-assert 4 == w
-assert 'a'
-            instanceof
-                        String
-assert 1
-            <
-                2
-
-assert 1
-            ==
-                1
-
-assert 'a'
-            ==~
-                /a/
-assert true
-            &
-                true
-assert true
-            ^
-                false
-assert true
-            |
-                true
-
-assert true
-            &&
-                true
-
-assert true
-            ||
-                true
-
-
-def z =
-        9
-            /
-                3
-                    *
-                        2
-assert 6 == z
-
-def r =
-         3
-            %
-                2
-assert 1 == r
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/For_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/For_01.groovy
deleted file mode 100644
index b1cbefb..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_01.groovy
+++ /dev/null
@@ -1,73 +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.
- */
-for (i in someList) {}
-
-
-for (i in someList) {
-    break;
-}
-
-for (i in someList)
-{
-    break;
-}
-
-for (int i in someList) {
-    break;
-}
-
-for (String i in someList) {
-    break;
-}
-
-for (final String i in someList) {
-    break;
-}
-
-for (@Test2 String i in someList) {
-    break;
-}
-
-
-for (int i : someList) {}
-
-for (int i : someList) {
-    break;
-}
-
-for (int i : someList)
-{
-    break;
-}
-
-for (int i : someList) {
-    break;
-}
-
-for (String i : someList) {
-    break;
-}
-
-for (final String i : someList) {
-    break;
-}
-
-for (@Test2 String i : someList) {
-    break;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/For_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/For_02.groovy
deleted file mode 100644
index 5a2b795..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_02.groovy
+++ /dev/null
@@ -1,54 +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.
- */
-for (int i = 0; true; false) {}
-for (int i = 0; true; false) {
-
-}
-for (int i = 0; true; false)
-{
-}
-for (int i = 0;
-     true;
-     false)
-{
-}
-for(;;) {
-
-}
-for(int i = 0;;) {
-
-}
-for(;true;) {
-
-}
-for(;;false) {
-
-}
-
-for (int i = 0; i < 10; i++) {
-
-}
-
-for (i = 0; i < 10; i++) {
-
-}
-
-for(;;) {
-    continue;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/For_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/For_03.groovy
deleted file mode 100644
index d37aef3..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_03.groovy
+++ /dev/null
@@ -1,55 +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.
- */
-outer:
-for (def i in [1, 2]) {
-    for (def j in [1, 2, 3, 4, 5]) {
-        if (j == 1) {
-            break outer;
-        } else if (j == 2) {
-            continue outer;
-        }
-
-        if (j == 3) {
-            continue;
-        }
-
-        if (j == 4) {
-            break;
-        }
-    }
-}
-
-
-for (;;)
-    int number = 1
-
-
-int i
-for (i = 0; i < 5; i++);
-
-
-
-
-for (Object child in children()) {
-    if (child instanceof String) {
-        break
-    } else {
-        continue
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/For_04x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_04x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/For_04x.groovy
deleted file mode 100644
index dcd7b57..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_04x.groovy
+++ /dev/null
@@ -1,54 +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.
- */
-import groovy.transform.CompileStatic
-
-@CompileStatic
-def testCS() {
-    int result = 0
-    for (def (int i, int j) = [0, 0]; i < 5 && j < 5; i = i + 2, j++) {
-        result += i;
-        result += j;
-    }
-    assert 9 == result
-
-    result = 0
-    for (int i = 0, j = 0; i < 5 && j < 5; i = i + 2, j++) {
-        result += i;
-        result += j;
-    }
-    assert 9 == result
-}
-testCS()
-
-def test() {
-    int result = 0
-    for ((i, j) = [0, 0]; i < 5 && j < 5; i = i + 2, j++) {
-        result += i;
-        result += j;
-    }
-    assert 9 == result
-
-    result = 0
-    for (int i = 0, j = 0; i < 5 && j < 5; i = i + 2, j++) {
-        result += i;
-        result += j;
-    }
-    assert 9 == result
-}
-test()

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/For_05x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_05x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/For_05x.groovy
deleted file mode 100644
index dd63224..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_05x.groovy
+++ /dev/null
@@ -1,56 +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.
- */
-import groovy.transform.CompileStatic
-
-@CompileStatic
-def testCS() {
-    int result = 0
-    for (int i = 0, n = 5; i < n; i++) {
-        result += i
-    }
-    assert 10 == result
-
-    result = 0;
-    int i;
-    int j;
-    for (i = 1, j = 5; i < j; i++, j--) {
-        result += i;
-        result += j;
-    }
-    assert 12 == result
-}
-testCS();
-
-def test() {
-    int result = 0
-    for (int i = 0, n = 5; i < n; i++) {
-        result += i
-    }
-    assert 10 == result
-
-    result = 0;
-    int i;
-    int j;
-    for (i = 1, j = 5; i < j; i++, j--) {
-        result += i;
-        result += j;
-    }
-    assert 12 == result
-}
-test();

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_01.groovy
deleted file mode 100644
index d233bab..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_01.groovy
+++ /dev/null
@@ -1,48 +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.
- */
-"abc${'123'}def"
-"${'123'}def"
-"${'123'}"
-"a:$a"
-"a:$a.b.c"
-"$a.b.c"
-"$a.b.c,d"
-"${12}a${}c${34}"
-"${->12}"
-"${12}${->12}${'12'}"
-"""abc${'123'}def"""
-"""${'123'}def"""
-"""${'123'}"""
-"""a:$a"""
-"""a:$a.b.c"""
-"""$a.b.c"""
-"""$a.b.c,d"""
-"""${12}a${}c${34}"""
-"""${->12}"""
-"""${12}${->12}${'12'}"""
-"""${12}${->12}${'12'}${a=1;return a;}"""
-
-
-"${}"
-"${;}"
-"${;;}"
-"${;;;}"
-
-"${a b}"
-"${obj.a b}"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_02.groovy
deleted file mode 100644
index 2e69232..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_02.groovy
+++ /dev/null
@@ -1,77 +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.
- */
-/abc${'123'}def $a.b.c,d${->12}/
-$/${-12}abc${'123'}def $a.b.c,d${->12}/$
-
-def p1=/ab/
-def p2=/a${c}b/
-p3=/a${c}b/
-p4=/a${c}b/*2
-p5=!/a${c}b/
-p6= ~/a${c}b/
-p7=~/a${c}b/
-p8==~/a${c}b/
-p9=/a${c}b/ + /a${c}b/
-p10=/ab/
-p11=/ab/*2
-p12=!/ab/
-p13= ~/ab/
-p14=~/ab/
-p15==~/ab/
-p16=/ab/ + /ab/
-p17=/ab/ == /cd/
-p18=/a${c}b/ == /c${f}d/
-p19=/ab/ != /cd/
-p20=/a${c}b/ != /c${f}d/
-p27=1?:/cd/
-p28=1?:/a${c}b/
-p29=1>2?/ab/:/cd/
-p30=1>2?/c${f}d/:/c${f}d/
-p29=true?
-        /ab/:
-        /cd/
-p30=true?
-        /c${f}d/:
-        /c${f}d/
-p31=/A/ && /B/
-p32=/a${b}/ && /c${d}/
-p33=/A/ || /B/
-p34=/a${b}/ || /c${d}/
-p39=/$a/
-p40=/^a+$/
-p41=/$0+/
-p42=/$2a+/
-p43=/$$2a+/
-p44=/^$|$|^$$2a+$/
-p45=/
-    hello, world!
-/
-p46=/hello\
-world/
-p47=/hello\
-    \/
-world/
-p48=/^hello\
-    \/$|^
-world$/
-p49=/ $x $ /
-p50=/$x\
-    $
-/
-p51=/$$/

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_03.groovy
deleted file mode 100644
index 731986b..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_03.groovy
+++ /dev/null
@@ -1,67 +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.
- */
-def a = """hello${a}
-world
-"""
-
-a = """
-hello
-${a}
-world
-"""
-
-a =~ $/(${123}hello) \/
-            ${a}world\1
- \u9fa5 \r
-/$
-a =~ $/\
-    x  $
-    $$
-    $/
-/$
-a =~ $/\
-    $x  $
-    $$
-    $/
-/$
-a = $/
-            Hello name,
-            today we're date.
-
-            $ dollar sign
-            $$ escaped dollar sign
-            \ backslash
-            / forward slash
-            $/ escaped forward slash
-            $/$ escaped dollar slashy string delimiter
-        /$
-
-a = $/
-            Hello $name,
-            today we're ${date}.
-
-            $ dollar sign
-            $$ escaped dollar sign
-            \ backslash
-            / forward slash
-            $/ escaped forward slash
-            $/$ escaped dollar slashy string delimiter
-        /$
-a = $/$$VAR/$
-a = $/$$ $VAR/$

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_04.groovy
deleted file mode 100644
index 1d7b1c2..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_04.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-"At $date"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_05.groovy
deleted file mode 100644
index e49c060..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_05.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-"""At $date"""
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_06.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_06.groovy
deleted file mode 100644
index 18d5770..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_06.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-/At $date/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Groovydoc_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Groovydoc_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Groovydoc_01x.groovy
deleted file mode 100644
index 9bbf9f5..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Groovydoc_01x.groovy
+++ /dev/null
@@ -1,70 +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.
- */
-/**
- * @Groovydoc
- * class AA
- */
-class AA {
-    /**
-     * @Groovydoc
-     * field SOME_FIELD
-     */
-    public static final int SOME_FIELD = 1;
-
-    /**
-     * @Groovydoc
-     * constructor AA
-     */
-    public AA() {
-
-    }
-
-    /**
-     * @Groovydoc
-     * method m
-     */
-    public void m() {
-
-    }
-
-    /**
-     * @Groovydoc
-     * class InnerClass
-     */
-    class InnerClass {
-
-    }
-
-
-}
-
-/**
- * @Groovydoc
- * annotation BB
- */
-@interface BB {
-
-}
-
-assert AA.class.getAnnotation(groovy.lang.Groovydoc).value().contains('class AA')
-assert AA.class.getMethod('m', new Class[0]).getAnnotation(groovy.lang.Groovydoc).value().contains('method m')
-assert AA.class.getConstructor().getAnnotation(groovy.lang.Groovydoc).value().contains('constructor AA')
-assert AA.class.getField('SOME_FIELD').getAnnotation(groovy.lang.Groovydoc).value().contains('field SOME_FIELD')
-assert AA.class.getDeclaredClasses().find {it.simpleName.contains('InnerClass')}.getAnnotation(groovy.lang.Groovydoc).value().contains('class InnerClass')
-assert BB.class.getAnnotation(groovy.lang.Groovydoc).value().contains('annotation BB')
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/IdenticalOp_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/IdenticalOp_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/IdenticalOp_01x.groovy
deleted file mode 100644
index 9110bb4..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/IdenticalOp_01x.groovy
+++ /dev/null
@@ -1,28 +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.
- */
-def x = []
-def y = []
-assert y !== x
-
-assert 'a' === 'a'
-assert 'a' !== new String('a')
-assert null === null
-assert true === true
-assert false === false
-assert 0 == 0 && 'a' === 'a' && 1 != 2 && 'a' !== new String('a') && 1 == 1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/IfElse_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/IfElse_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/IfElse_01.groovy
deleted file mode 100644
index 94687b8..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/IfElse_01.groovy
+++ /dev/null
@@ -1,62 +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.
- */
-if (true)
-    assert true, ':('
-
-if (true) assert true, ':('
-
-if (true)
-    assert true, ':('
-else
-    assert false, ':('
-
-if (true) assert true, ':('
-else
-    assert false, ':('
-
-if (true) assert true, ':('
-else assert false, ':('
-
-if (true) assert true, ':(' else assert false, ':('
-
-
-if (false)
-    int number = 1
-
-
-if(true) 1; else 0
-
-if(true) 1 else 0
-
-if(true) 1; else 0;
-
-if(true)
-    1;
-else
-    0
-
-if(true)
-    1
-else
-    0
-
-if(true)
-    1;
-else
-    0;

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_01.groovy
deleted file mode 100644
index f0ed391..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_01.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-import java.util.Map
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_02.groovy
deleted file mode 100644
index f32f0c8..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_02.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-import java.util.Map;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_03.groovy
deleted file mode 100644
index c308f92..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_03.groovy
+++ /dev/null
@@ -1,22 +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.
- */
-import java.util.Map
-import java.util.HashMap;
-import java.io.InputStream
-import java.io.BufferedInputStream;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_04.groovy
deleted file mode 100644
index d54207f..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_04.groovy
+++ /dev/null
@@ -1,23 +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.
- */
-package core;
-import java.util.Map
-import java.util.HashMap;
-import java.io.InputStream
-import java.io.BufferedInputStream;
\ No newline at end of file


[02/50] [abbrv] groovy git commit: GROOVY-8127: Access to Trait$Trait$Helper#$self is forbidden (closes #529)

Posted by pa...@apache.org.
GROOVY-8127: Access to Trait$Trait$Helper#$self is forbidden (closes #529)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/aff9fff5
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/aff9fff5
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/aff9fff5

Branch: refs/heads/parrot
Commit: aff9fff589e6d3eb8d9f405cf8dfdf258128b488
Parents: 7cfaa27
Author: paulk <pa...@asert.com.au>
Authored: Mon Apr 24 18:02:34 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:03:38 2017 +1000

----------------------------------------------------------------------
 .../transform/trait/TraitASTTransformation.java | 22 ++++----
 .../groovy/transform/trait/TraitComposer.java   |  7 +--
 src/test/groovy/bugs/Groovy8127Bug.groovy       | 53 ++++++++++++++++++++
 3 files changed, 70 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/aff9fff5/src/main/org/codehaus/groovy/transform/trait/TraitASTTransformation.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/trait/TraitASTTransformation.java b/src/main/org/codehaus/groovy/transform/trait/TraitASTTransformation.java
index 8222056..4ac7753 100644
--- a/src/main/org/codehaus/groovy/transform/trait/TraitASTTransformation.java
+++ b/src/main/org/codehaus/groovy/transform/trait/TraitASTTransformation.java
@@ -73,9 +73,13 @@ import static org.codehaus.groovy.ast.tools.GeneralUtils.returnS;
 import static org.codehaus.groovy.transform.trait.SuperCallTraitTransformer.UNRESOLVED_HELPER_CLASS;
 
 /**
- * Handles generation of code for the @Trait annotation. A class annotated with @Trait will generate, instead: <ul>
- * <li>an <i>interface</i> with the same name</li> <li>an utility inner class that will be used by the compiler to
- * handle the trait</li> </ul>
+ * Handles generation of code for the traits (trait keyword is equivalent to using the @Trait annotation).
+ * A class annotated with @Trait will generate, instead:
+ * <ul>
+ * <li>an <i>interface</i> with the same name</li>
+ * <li>a utility inner class that will be used by the compiler to implement the trait</li>
+ * <li>potentially a utility inner class to assist with implementing trait fields</li>
+ * </ul>
  *
  * @author Cedric Champeau
  */
@@ -415,21 +419,21 @@ public class TraitASTTransformation extends AbstractASTTransformation implements
         Expression initialExpression = field.getInitialExpression();
         MethodNode selectedMethod = field.isStatic()?staticInitializer:initializer;
         if (initialExpression != null) {
+            VariableExpression thisObject = new VariableExpression(selectedMethod.getParameters()[0]);
+            ExpressionStatement initCode = new ExpressionStatement(initialExpression);
+            processBody(thisObject, initCode, trait, helper, fieldHelper, knownFields);
             if (field.isFinal()) {
                 String baseName = field.isStatic() ? Traits.STATIC_INIT_METHOD : Traits.INIT_METHOD;
                 MethodNode fieldInitializer = new MethodNode(
                         baseName + Traits.remappedFieldName(trait, field.getName()),
                         ACC_STATIC | ACC_PUBLIC | ACC_SYNTHETIC,
                         field.getOriginType(),
-                        Parameter.EMPTY_ARRAY,
+                        new Parameter[]{createSelfParameter(trait, field.isStatic())},
                         ClassNode.EMPTY_ARRAY,
-                        returnS(initialExpression)
+                        returnS(initCode.getExpression())
                 );
                 helper.addMethod(fieldInitializer);
             }
-            VariableExpression thisObject = new VariableExpression(selectedMethod.getParameters()[0]);
-            ExpressionStatement initCode = new ExpressionStatement(initialExpression);
-            processBody(thisObject, initCode, trait, helper, fieldHelper, knownFields);
             BlockStatement code = (BlockStatement) selectedMethod.getCode();
             MethodCallExpression mce;
             if (field.isStatic()) {
@@ -480,7 +484,7 @@ public class TraitASTTransformation extends AbstractASTTransformation implements
                 ACC_STATIC | ACC_PUBLIC | ACC_FINAL | ACC_SYNTHETIC,
                 field.getOriginType(),
                 fieldHelper,
-                field.isFinal() ? initialExpression : null
+                null
         );
         // copy annotations from field to dummy field
         List<AnnotationNode> copied = new LinkedList<AnnotationNode>();

http://git-wip-us.apache.org/repos/asf/groovy/blob/aff9fff5/src/main/org/codehaus/groovy/transform/trait/TraitComposer.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/transform/trait/TraitComposer.java b/src/main/org/codehaus/groovy/transform/trait/TraitComposer.java
index 1025e61..b97f480 100644
--- a/src/main/org/codehaus/groovy/transform/trait/TraitComposer.java
+++ b/src/main/org/codehaus/groovy/transform/trait/TraitComposer.java
@@ -71,6 +71,7 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
+import static org.codehaus.groovy.ast.tools.GeneralUtils.args;
 import static org.codehaus.groovy.ast.tools.GeneralUtils.assignX;
 import static org.codehaus.groovy.ast.tools.GeneralUtils.callX;
 import static org.codehaus.groovy.ast.tools.GeneralUtils.returnS;
@@ -257,13 +258,13 @@ public abstract class TraitComposer {
                             List<AnnotationNode> copied = new LinkedList<AnnotationNode>();
                             List<AnnotationNode> notCopied = new LinkedList<AnnotationNode>();
                             GeneralUtils.copyAnnotatedNodeAnnotations(helperField, copied, notCopied);
-                            FieldNode fieldNode = cNode.addField(fieldName, fieldMods, returnType, (fieldMods & Opcodes.ACC_FINAL) == 0 ? null : helperField.getInitialExpression());
+                            FieldNode fieldNode = cNode.addField(fieldName, fieldMods, returnType, null);
                             fieldNode.addAnnotations(copied);
                             // getInitialExpression above will be null if not in same source unit
                             // so instead set within (static) initializer
-                            if (fieldNode.isFinal() && !(helperClassNode instanceof InnerClassNode)) {
+                            if (fieldNode.isFinal()) {
                                 String baseName = fieldNode.isStatic() ? Traits.STATIC_INIT_METHOD : Traits.INIT_METHOD;
-                                Expression mce = callX(helperClassNode, baseName + fieldNode.getName());
+                                Expression mce = callX(helperClassNode, baseName + fieldNode.getName(), args(varX("this")));
                                 Statement stmt = stmt(assignX(varX(fieldNode.getName(), fieldNode.getType()), mce));
                                 if (isStatic == 0) {
                                     cNode.addObjectInitializerStatements(stmt);

http://git-wip-us.apache.org/repos/asf/groovy/blob/aff9fff5/src/test/groovy/bugs/Groovy8127Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy8127Bug.groovy b/src/test/groovy/bugs/Groovy8127Bug.groovy
new file mode 100644
index 0000000..842390e
--- /dev/null
+++ b/src/test/groovy/bugs/Groovy8127Bug.groovy
@@ -0,0 +1,53 @@
+/*
+ *  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.
+ */
+package groovy.bugs
+
+import gls.CompilableTestSupport
+
+class Groovy8127Bug extends CompilableTestSupport {
+    void testTraitWithClosureReferencingField() {
+        assertScript """
+        trait BarTrait {
+            String result = ''
+            public final Runnable bar = { result = 'changeme' } as Runnable
+            void doRun() { bar.run() }
+        }
+
+        class Bar implements BarTrait {}
+
+        def b = new Bar()
+        b.doRun()
+        assert b.result == 'changeme'
+        """
+    }
+
+    void testTraitWithCompileStaticAndCoercedClosure() {
+        shouldCompile """
+        @groovy.transform.CompileStatic
+        trait FooTrait {
+            public final Runnable foo = { println new Date() } as Runnable
+            void doRun() { foo.run() }
+        }
+
+        class Foo implements FooTrait { }
+
+        new Foo().doRun()
+        """
+    }
+}


[10/50] [abbrv] groovy git commit: GROOVY-8161: Empty statement before semicolon with parrot parser

Posted by pa...@apache.org.
GROOVY-8161: Empty statement before semicolon with parrot parser


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/07456a51
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/07456a51
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/07456a51

Branch: refs/heads/parrot
Commit: 07456a51e98affe92ac626944e7ce3e6a45fe3b0
Parents: 53b4f90
Author: sunlan <su...@apache.org>
Authored: Sat May 6 01:00:36 2017 +0800
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:06:12 2017 +1000

----------------------------------------------------------------------
 .../apache/groovy/parser/antlr4/AstBuilder.java |  14 +-
 .../parser/antlr4/GroovyParserTest.groovy       | 312 ++++++++++---------
 .../test/resources/bugs/BUG-GROOVY-8161.groovy  |   2 +
 3 files changed, 172 insertions(+), 156 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/07456a51/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
index 087c291..e0708f7 100644
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
+++ b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
@@ -1285,14 +1285,14 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
 
         this.configureAST(methodNode, ctx);
 
-        validateMethodDeclaration(ctx, methodNode, modifierManager);
+        validateMethodDeclaration(ctx, methodNode, modifierManager, classNode);
 
         groovydocManager.handle(methodNode, ctx);
 
         return methodNode;
     }
 
-    private void validateMethodDeclaration(MethodDeclarationContext ctx, MethodNode methodNode, ModifierManager modifierManager) {
+    private void validateMethodDeclaration(MethodDeclarationContext ctx, MethodNode methodNode, ModifierManager modifierManager, ClassNode classNode) {
         boolean isAbstractMethod = methodNode.isAbstract();
         boolean hasMethodBody = asBoolean(methodNode.getCode());
 
@@ -1304,6 +1304,11 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
             if (!isAbstractMethod && !hasMethodBody) { // non-abstract method without body in the non-script(e.g. class, enum, trait) is not allowed!
                 throw createParsingFailedException("You defined a method[" + methodNode.getName() + "] without body. Try adding a method body, or declare it abstract", methodNode);
             }
+
+            boolean isInterfaceOrAbstractClass = asBoolean(classNode) && classNode.isAbstract() && !classNode.isAnnotationDefinition();
+            if (isInterfaceOrAbstractClass && !modifierManager.contains(DEFAULT) && isAbstractMethod && hasMethodBody) {
+                throw createParsingFailedException("You defined an abstract method[" + methodNode.getName() + "] with body. Try removing the method body" + (classNode.isInterface() ? ", or declare it default" : ""), methodNode);
+            }
         }
 
         modifierManager.validate(methodNode);
@@ -3470,11 +3475,12 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
         return this.configureAST(
                 this.createBlockStatement(
                         ctx.blockStatement().stream()
-                                .map(this::visitBlockStatement).collect(Collectors.toList())),
+                                .map(this::visitBlockStatement)
+                                .filter(e -> asBoolean(e))
+                                .collect(Collectors.toList())),
                 ctx);
     }
 
-
     @Override
     public Statement visitBlockStatement(BlockStatementContext ctx) {
         if (asBoolean(ctx.localVariableDeclaration())) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/07456a51/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy b/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
index 6892237..480d2ab 100644
--- a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
@@ -18,11 +18,18 @@
  */
 package org.apache.groovy.parser.antlr4
 
-import org.codehaus.groovy.ast.*
+import org.codehaus.groovy.ast.ClassNode
+import org.codehaus.groovy.ast.FieldNode
+import org.codehaus.groovy.ast.MethodNode
+import org.codehaus.groovy.ast.Parameter
+import org.codehaus.groovy.ast.PropertyNode
 import org.codehaus.groovy.ast.stmt.AssertStatement
 import org.codehaus.groovy.ast.stmt.ExpressionStatement
 import org.codehaus.groovy.syntax.Token
 
+import static org.apache.groovy.parser.antlr4.TestUtils.doTest
+import static org.apache.groovy.parser.antlr4.TestUtils.doRunAndTest
+
 /**
  * Some basic test cases for the new parser
  *
@@ -36,12 +43,12 @@ class GroovyParserTest extends GroovyTestCase {
     void tearDown() {}
 
     void "test groovy core - Comments"() {
-        TestUtils.doTest('core/Comments_01.groovy', [ExpressionStatement]);
+        doTest('core/Comments_01.groovy', [ExpressionStatement]);
         doTestAttachedComments();
     }
 
     private static doTestAttachedComments() {
-        def (newAST, oldAST) = TestUtils.doTest('core/Comments_02.groovy');
+        def (newAST, oldAST) = doTest('core/Comments_02.groovy');
         List<ClassNode> classes = new ArrayList<>(newAST.classes).sort { c1, c2 -> c1.name <=> c2.name };
         List<MethodNode> methods = new ArrayList<>(newAST.methods).sort { m1, m2 -> m1.name <=> m2.name };
 
@@ -76,285 +83,286 @@ class GroovyParserTest extends GroovyTestCase {
     }
 
     void "test groovy core - PackageDeclaration"() {
-        TestUtils.doTest('core/PackageDeclaration_01.groovy');
-        TestUtils.doTest('core/PackageDeclaration_02.groovy');
-        TestUtils.doTest('core/PackageDeclaration_03.groovy');
-        TestUtils.doTest('core/PackageDeclaration_04.groovy');
-        TestUtils.doTest('core/PackageDeclaration_05.groovy');
-        TestUtils.doTest('core/PackageDeclaration_06.groovy');
+        doTest('core/PackageDeclaration_01.groovy');
+        doTest('core/PackageDeclaration_02.groovy');
+        doTest('core/PackageDeclaration_03.groovy');
+        doTest('core/PackageDeclaration_04.groovy');
+        doTest('core/PackageDeclaration_05.groovy');
+        doTest('core/PackageDeclaration_06.groovy');
     }
 
     void "test groovy core - ImportDeclaration"() {
-        TestUtils.doTest('core/ImportDeclaration_01.groovy');
-        TestUtils.doTest('core/ImportDeclaration_02.groovy');
-        TestUtils.doTest('core/ImportDeclaration_03.groovy');
-        TestUtils.doTest('core/ImportDeclaration_04.groovy');
-        TestUtils.doTest('core/ImportDeclaration_05.groovy');
-        TestUtils.doTest('core/ImportDeclaration_06.groovy');
-        TestUtils.doTest('core/ImportDeclaration_07.groovy');
-        TestUtils.doTest('core/ImportDeclaration_08.groovy');
+        doTest('core/ImportDeclaration_01.groovy');
+        doTest('core/ImportDeclaration_02.groovy');
+        doTest('core/ImportDeclaration_03.groovy');
+        doTest('core/ImportDeclaration_04.groovy');
+        doTest('core/ImportDeclaration_05.groovy');
+        doTest('core/ImportDeclaration_06.groovy');
+        doTest('core/ImportDeclaration_07.groovy');
+        doTest('core/ImportDeclaration_08.groovy');
     }
 
     void "test groovy core - Annotation"() {
-        TestUtils.doTest('core/Annotation_01.groovy');
-        TestUtils.doTest('core/Annotation_02.groovy');
-        TestUtils.doTest('core/Annotation_03.groovy');
-        TestUtils.doTest('core/Annotation_04.groovy');
-        TestUtils.doTest('core/Annotation_05.groovy');
-        TestUtils.doTest('core/Annotation_06.groovy');
-        TestUtils.doTest('core/Annotation_07.groovy');
-        TestUtils.doTest('core/Annotation_08.groovy');
-        TestUtils.doTest('core/Annotation_09.groovy');
-        TestUtils.doRunAndTest('core/Annotation_10x.groovy');
+        doTest('core/Annotation_01.groovy');
+        doTest('core/Annotation_02.groovy');
+        doTest('core/Annotation_03.groovy');
+        doTest('core/Annotation_04.groovy');
+        doTest('core/Annotation_05.groovy');
+        doTest('core/Annotation_06.groovy');
+        doTest('core/Annotation_07.groovy');
+        doTest('core/Annotation_08.groovy');
+        doTest('core/Annotation_09.groovy');
+        doRunAndTest('core/Annotation_10x.groovy');
     }
 
     void "test groovy core - Literal"() {
-        TestUtils.doTest('core/Literal_01.groovy');
-        TestUtils.doTest('core/Literal_02.groovy', [ExpressionStatement]);
-        TestUtils.doTest('core/Literal_03.groovy');
+        doTest('core/Literal_01.groovy');
+        doTest('core/Literal_02.groovy', [ExpressionStatement]);
+        doTest('core/Literal_03.groovy');
     }
 
     void "test groovy core - GString"() {
-        TestUtils.doTest('core/GString_01.groovy');
-        TestUtils.doTest('core/GString_02.groovy');
-        TestUtils.doTest('core/GString_03.groovy');
-        TestUtils.doTest('core/GString_04.groovy');
-        TestUtils.doTest('core/GString_05.groovy');
-        TestUtils.doTest('core/GString_06.groovy');
+        doTest('core/GString_01.groovy');
+        doTest('core/GString_02.groovy');
+        doTest('core/GString_03.groovy');
+        doTest('core/GString_04.groovy');
+        doTest('core/GString_05.groovy');
+        doTest('core/GString_06.groovy');
     }
 
     void "test groovy core - Closure"() {
-        TestUtils.doTest('core/Closure_01.groovy');
-        TestUtils.doTest('core/Closure_02.groovy');
-        TestUtils.doTest('core/Closure_03.groovy');
-        TestUtils.doTest('core/Closure_04.groovy');
-        TestUtils.doTest('core/Closure_05.groovy', [Parameter]);
-        TestUtils.doTest('core/Closure_06.groovy', [Parameter]);
-        TestUtils.doTest('core/Closure_07.groovy', [Parameter]);
-        TestUtils.doTest('core/Closure_08.groovy', [Parameter]);
-        TestUtils.doTest('core/Closure_09.groovy', [Parameter]);
-        TestUtils.doTest('core/Closure_10.groovy', [Parameter]);
+        doTest('core/Closure_01.groovy');
+        doTest('core/Closure_02.groovy');
+        doTest('core/Closure_03.groovy');
+        doTest('core/Closure_04.groovy');
+        doTest('core/Closure_05.groovy', [Parameter]);
+        doTest('core/Closure_06.groovy', [Parameter]);
+        doTest('core/Closure_07.groovy', [Parameter]);
+        doTest('core/Closure_08.groovy', [Parameter]);
+        doTest('core/Closure_09.groovy', [Parameter]);
+        doTest('core/Closure_10.groovy', [Parameter]);
     }
 
     void "test groovy core - Lambda"() {
-        TestUtils.doRunAndTest('core/Lambda_01x.groovy');
+        doRunAndTest('core/Lambda_01x.groovy');
     }
 
     void "test groovy core - MethodReference"() {
-        TestUtils.doRunAndTest('core/MethodReference_01x.groovy');
+        doRunAndTest('core/MethodReference_01x.groovy');
     }
 
     void "test groovy core - MethodPointer"() {
-        TestUtils.doRunAndTest('core/MethodPointer_01x.groovy');
+        doRunAndTest('core/MethodPointer_01x.groovy');
     }
 
     void "test groovy core - ElvisAssignment"() {
-        TestUtils.doRunAndTest('core/ElvisAssignment_01x.groovy');
+        doRunAndTest('core/ElvisAssignment_01x.groovy');
     }
 
     void "test groovy core - List"() {
-        TestUtils.doTest('core/List_01.groovy');
+        doTest('core/List_01.groovy');
     }
 
     void "test groovy core - Map"() {
-        TestUtils.doTest('core/Map_01.groovy');
+        doTest('core/Map_01.groovy');
     }
 
     void "test groovy core - Expression"() {
-        TestUtils.doTest('core/Expression_01.groovy');
-        TestUtils.doTest('core/Expression_02.groovy');
-        TestUtils.doTest('core/Expression_03.groovy');
-        TestUtils.doTest('core/Expression_04.groovy');
-        TestUtils.doTest('core/Expression_05.groovy');
-        TestUtils.doTest('core/Expression_06.groovy');
-        TestUtils.doTest('core/Expression_07.groovy');
-        TestUtils.doTest('core/Expression_08.groovy');
-        TestUtils.doTest('core/Expression_09.groovy');
-        TestUtils.doTest('core/Expression_10.groovy');
-        TestUtils.doTest('core/Expression_11.groovy');
-        TestUtils.doTest('core/Expression_12.groovy');
-        TestUtils.doTest('core/Expression_13.groovy');
-        TestUtils.doTest('core/Expression_14.groovy');
-        TestUtils.doTest('core/Expression_15.groovy');
-        TestUtils.doTest('core/Expression_16.groovy', [Parameter, ExpressionStatement]);
-        TestUtils.doTest('core/Expression_17.groovy');
-        TestUtils.doTest('core/Expression_18.groovy');
-        TestUtils.doTest('core/Expression_19.groovy');
-        TestUtils.doTest('core/Expression_20.groovy');
-        TestUtils.doRunAndTest('core/Expression_21x.groovy');
-        TestUtils.doTest('core/Expression_22x.groovy');
-        TestUtils.doRunAndTest('core/Expression_22x.groovy');
-        TestUtils.doRunAndTest('core/Expression_23x.groovy');
+        doTest('core/Expression_01.groovy');
+        doTest('core/Expression_02.groovy');
+        doTest('core/Expression_03.groovy');
+        doTest('core/Expression_04.groovy');
+        doTest('core/Expression_05.groovy');
+        doTest('core/Expression_06.groovy');
+        doTest('core/Expression_07.groovy');
+        doTest('core/Expression_08.groovy');
+        doTest('core/Expression_09.groovy');
+        doTest('core/Expression_10.groovy');
+        doTest('core/Expression_11.groovy');
+        doTest('core/Expression_12.groovy');
+        doTest('core/Expression_13.groovy');
+        doTest('core/Expression_14.groovy');
+        doTest('core/Expression_15.groovy');
+        doTest('core/Expression_16.groovy', [Parameter, ExpressionStatement]);
+        doTest('core/Expression_17.groovy');
+        doTest('core/Expression_18.groovy');
+        doTest('core/Expression_19.groovy');
+        doTest('core/Expression_20.groovy');
+        doRunAndTest('core/Expression_21x.groovy');
+        doTest('core/Expression_22x.groovy');
+        doRunAndTest('core/Expression_22x.groovy');
+        doRunAndTest('core/Expression_23x.groovy');
     }
 
     void "test groovy core - IdenticalOp"() {
-        TestUtils.doRunAndTest('core/IdenticalOp_01x.groovy');
+        doRunAndTest('core/IdenticalOp_01x.groovy');
     }
 
     void "test groovy core - Assert"() {
-        TestUtils.doTest('core/Assert_01.groovy');
-        TestUtils.doRunAndTest('core/Assert_02x.groovy');
-        TestUtils.doRunAndTest('core/Assert_03x.groovy');
+        doTest('core/Assert_01.groovy');
+        doRunAndTest('core/Assert_02x.groovy');
+        doRunAndTest('core/Assert_03x.groovy');
     }
 
     void "test groovy core - IfElse"() {
-        TestUtils.doTest('core/IfElse_01.groovy', [AssertStatement]);
+        doTest('core/IfElse_01.groovy', [AssertStatement]);
     }
 
     void "test groovy core - For"() {
-        TestUtils.doTest('core/For_01.groovy', [AssertStatement]);
-        TestUtils.doTest('core/For_02.groovy');
-        TestUtils.doTest('core/For_03.groovy');
-        TestUtils.doRunAndTest('core/For_04x.groovy');
-        TestUtils.doRunAndTest('core/For_05x.groovy');
+        doTest('core/For_01.groovy', [AssertStatement]);
+        doTest('core/For_02.groovy');
+        doTest('core/For_03.groovy');
+        doRunAndTest('core/For_04x.groovy');
+        doRunAndTest('core/For_05x.groovy');
     }
 
     void "test groovy core - While"() {
-        TestUtils.doTest('core/While_01.groovy');
-        TestUtils.doRunAndTest('core/While_02x.groovy');
+        doTest('core/While_01.groovy');
+        doRunAndTest('core/While_02x.groovy');
     }
 
     void "test groovy core - CodeBlock"() {
-        TestUtils.doRunAndTest('core/CodeBlock_01x.groovy');
+        doRunAndTest('core/CodeBlock_01x.groovy');
     }
 
     void "test groovy core - DoWhile"() {
-        TestUtils.doRunAndTest('core/DoWhile_01x.groovy');
-        TestUtils.doRunAndTest('core/DoWhile_02x.groovy');
-        TestUtils.doRunAndTest('core/DoWhile_03x.groovy');
-        TestUtils.doRunAndTest('core/DoWhile_04x.groovy');
+        doRunAndTest('core/DoWhile_01x.groovy');
+        doRunAndTest('core/DoWhile_02x.groovy');
+        doRunAndTest('core/DoWhile_03x.groovy');
+        doRunAndTest('core/DoWhile_04x.groovy');
     }
 
 
     void "test groovy core - TryCatch"() {
-        TestUtils.doTest('core/TryCatch_01.groovy');
+        doTest('core/TryCatch_01.groovy');
     }
 
     void "test groovy core - TryWithResources"() {
-        TestUtils.doRunAndTest('core/TryWithResources_01x.groovy');
+        doRunAndTest('core/TryWithResources_01x.groovy');
     }
 
     void "test groovy core - SafeIndex"() {
-        TestUtils.doRunAndTest('core/SafeIndex_01x.groovy');
-        TestUtils.doRunAndTest('core/SafeIndex_02x.groovy');
-        TestUtils.doRunAndTest('core/SafeIndex_03x.groovy');
+        doRunAndTest('core/SafeIndex_01x.groovy');
+        doRunAndTest('core/SafeIndex_02x.groovy');
+        doRunAndTest('core/SafeIndex_03x.groovy');
     }
 
     void "test groovy core - NegativeRelationalOperators"() {
-        TestUtils.doRunAndTest('core/NegativeRelationalOperators_01x.groovy');
-        TestUtils.doRunAndTest('core/NegativeRelationalOperators_02x.groovy');
+        doRunAndTest('core/NegativeRelationalOperators_01x.groovy');
+        doRunAndTest('core/NegativeRelationalOperators_02x.groovy');
     }
 
     void "test groovy core - DefaultMethod"() {
-        TestUtils.doRunAndTest('core/DefaultMethod_01x.groovy');
-        TestUtils.doRunAndTest('core/DefaultMethod_02x.groovy');
+        doRunAndTest('core/DefaultMethod_01x.groovy');
+        doRunAndTest('core/DefaultMethod_02x.groovy');
     }
 
 
     void "test groovy core - Switch"() {
-        TestUtils.doTest('core/Switch_01.groovy');
+        doTest('core/Switch_01.groovy');
     }
 
     void "test groovy core - Synchronized"() {
-        TestUtils.doTest('core/Synchronized_01.groovy');
+        doTest('core/Synchronized_01.groovy');
     }
 
     void "test groovy core - Return"() {
-        TestUtils.doTest('core/Return_01.groovy');
+        doTest('core/Return_01.groovy');
     }
 
     void "test groovy core - Throw"() {
-        TestUtils.doTest('core/Throw_01.groovy');
+        doTest('core/Throw_01.groovy');
     }
 
     void "test groovy core - Label"() {
-        TestUtils.doTest('core/Label_01.groovy');
+        doTest('core/Label_01.groovy');
     }
 
     void "test groovy core - LocalVariableDeclaration"() {
-        TestUtils.doTest('core/LocalVariableDeclaration_01.groovy', [Token]); // [class org.codehaus.groovy.syntax.Token][startLine]:: 9 != 8
+        doTest('core/LocalVariableDeclaration_01.groovy', [Token]); // [class org.codehaus.groovy.syntax.Token][startLine]:: 9 != 8
     }
 
     void "test groovy core - MethodDeclaration"() {
-        TestUtils.doTest('core/MethodDeclaration_01.groovy');
-        TestUtils.doTest('core/MethodDeclaration_02.groovy');
+        doTest('core/MethodDeclaration_01.groovy');
+        doTest('core/MethodDeclaration_02.groovy');
     }
 
     void "test groovy core - ClassDeclaration"() {
-        TestUtils.doTest('core/ClassDeclaration_01.groovy');
-        TestUtils.doTest('core/ClassDeclaration_02.groovy');
-        TestUtils.doTest('core/ClassDeclaration_03.groovy');
-        TestUtils.doTest('core/ClassDeclaration_04.groovy', [PropertyNode, FieldNode]);
-        TestUtils.doTest('core/ClassDeclaration_05.groovy', [ExpressionStatement]);
-        TestUtils.doTest('core/ClassDeclaration_06.groovy');
-        TestUtils.doTest('core/ClassDeclaration_07.groovy');
+        doTest('core/ClassDeclaration_01.groovy');
+        doTest('core/ClassDeclaration_02.groovy');
+        doTest('core/ClassDeclaration_03.groovy');
+        doTest('core/ClassDeclaration_04.groovy', [PropertyNode, FieldNode]);
+        doTest('core/ClassDeclaration_05.groovy', [ExpressionStatement]);
+        doTest('core/ClassDeclaration_06.groovy');
+        doTest('core/ClassDeclaration_07.groovy');
     }
 
     void "test groovy core - InterfaceDeclaration"() {
-        TestUtils.doTest('core/InterfaceDeclaration_01.groovy');
-        TestUtils.doTest('core/InterfaceDeclaration_02.groovy');
-        TestUtils.doTest('core/InterfaceDeclaration_03.groovy');
+        doTest('core/InterfaceDeclaration_01.groovy');
+        doTest('core/InterfaceDeclaration_02.groovy');
+        doTest('core/InterfaceDeclaration_03.groovy');
     }
 
     void "test groovy core - EnumDeclaration"() {
-        TestUtils.doTest('core/EnumDeclaration_01.groovy');
-        TestUtils.doTest('core/EnumDeclaration_02.groovy', [ExpressionStatement]);
-        TestUtils.doTest('core/EnumDeclaration_03.groovy');
-        TestUtils.doTest('core/EnumDeclaration_04.groovy');
-        TestUtils.doTest('core/EnumDeclaration_05.groovy');
+        doTest('core/EnumDeclaration_01.groovy');
+        doTest('core/EnumDeclaration_02.groovy', [ExpressionStatement]);
+        doTest('core/EnumDeclaration_03.groovy');
+        doTest('core/EnumDeclaration_04.groovy');
+        doTest('core/EnumDeclaration_05.groovy');
     }
 
     void "test groovy core - TraitDeclaration"() {
-        TestUtils.doTest('core/TraitDeclaration_01.groovy');
-        TestUtils.doTest('core/TraitDeclaration_02.groovy');
-        TestUtils.doTest('core/TraitDeclaration_03.groovy');
-        TestUtils.doTest('core/TraitDeclaration_04.groovy', [PropertyNode, FieldNode]);
-        TestUtils.doTest('core/TraitDeclaration_05.groovy');
+        doTest('core/TraitDeclaration_01.groovy');
+        doTest('core/TraitDeclaration_02.groovy');
+        doTest('core/TraitDeclaration_03.groovy');
+        doTest('core/TraitDeclaration_04.groovy', [PropertyNode, FieldNode]);
+        doTest('core/TraitDeclaration_05.groovy');
     }
 
     void "test groovy core - AnnotationDeclaration"() {
-        TestUtils.doTest('core/AnnotationDeclaration_01.groovy');
+        doTest('core/AnnotationDeclaration_01.groovy');
     }
 
     void "test groovy core - Command"() {
-        TestUtils.doTest('core/Command_01.groovy');
-        TestUtils.doTest('core/Command_02.groovy');
-        TestUtils.doTest('core/Command_03.groovy', [ExpressionStatement, Parameter]);
-        TestUtils.doTest('core/Command_04.groovy', [ExpressionStatement]);
-        TestUtils.doTest('core/Command_05.groovy');
-        TestUtils.doRunAndTest('core/Command_06x.groovy')
+        doTest('core/Command_01.groovy');
+        doTest('core/Command_02.groovy');
+        doTest('core/Command_03.groovy', [ExpressionStatement, Parameter]);
+        doTest('core/Command_04.groovy', [ExpressionStatement]);
+        doTest('core/Command_05.groovy');
+        doRunAndTest('core/Command_06x.groovy')
     }
 
     void "test groovy core - Unicode"() {
-        TestUtils.doTest('core/Unicode_01.groovy');
+        doTest('core/Unicode_01.groovy');
     }
 
     void "test groovy core - BreakingChanges"() {
-        TestUtils.doRunAndTest('core/BreakingChange_01x.groovy');
-        TestUtils.doRunAndTest('core/BreakingChange_02x.groovy');
-        TestUtils.doRunAndTest('core/BreakingChange_03x.groovy');
-        TestUtils.doRunAndTest('core/BreakingChange_04x.groovy');
+        doRunAndTest('core/BreakingChange_01x.groovy');
+        doRunAndTest('core/BreakingChange_02x.groovy');
+        doRunAndTest('core/BreakingChange_03x.groovy');
+        doRunAndTest('core/BreakingChange_04x.groovy');
     }
 
     void "test groovy core - Array"() {
-        TestUtils.doRunAndTest('core/Array_01x.groovy');
+        doRunAndTest('core/Array_01x.groovy');
     }
 
     void "test groovy core - Groovydoc"() {
-        TestUtils.doRunAndTest('core/Groovydoc_01x.groovy');
+        doRunAndTest('core/Groovydoc_01x.groovy');
     }
 
     void "test groovy core - Script"() {
-        TestUtils.doRunAndTest('core/Script_01x.groovy');
+        doRunAndTest('core/Script_01x.groovy');
     }
 
     void "test groovy core - BUG"() {
-        TestUtils.doRunAndTest('bugs/BUG-GROOVY-4757.groovy');
-        TestUtils.doRunAndTest('bugs/GROOVY-3898.groovy');
-        TestUtils.doRunAndTest('bugs/BUG-GROOVY-5652.groovy');
-        TestUtils.doRunAndTest('bugs/BUG-GROOVY-4762.groovy');
-        TestUtils.doRunAndTest('bugs/BUG-GROOVY-4438.groovy');
-        TestUtils.doRunAndTest('bugs/BUG-GROOVY-6038.groovy');
-        TestUtils.doRunAndTest('bugs/BUG-GROOVY-2324.groovy');
+        doRunAndTest('bugs/BUG-GROOVY-4757.groovy');
+        doRunAndTest('bugs/GROOVY-3898.groovy');
+        doRunAndTest('bugs/BUG-GROOVY-5652.groovy');
+        doRunAndTest('bugs/BUG-GROOVY-4762.groovy');
+        doRunAndTest('bugs/BUG-GROOVY-4438.groovy');
+        doRunAndTest('bugs/BUG-GROOVY-6038.groovy');
+        doRunAndTest('bugs/BUG-GROOVY-2324.groovy');
+        doTest('bugs/BUG-GROOVY-8161.groovy');
     }
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/07456a51/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
new file mode 100644
index 0000000..c7913ed
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
@@ -0,0 +1,2 @@
+for (foo in []) {;
+}
\ No newline at end of file


[45/50] [abbrv] groovy git commit: rename antlr4 parser to remove groovy- prefix since that is by convention for modules

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
deleted file mode 100644
index e0708f7..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
+++ /dev/null
@@ -1,4317 +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.
- */
-package org.apache.groovy.parser.antlr4;
-
-import groovy.lang.IntRange;
-import org.antlr.v4.runtime.ANTLRErrorListener;
-import org.antlr.v4.runtime.ANTLRInputStream;
-import org.antlr.v4.runtime.CommonTokenStream;
-import org.antlr.v4.runtime.RecognitionException;
-import org.antlr.v4.runtime.Recognizer;
-import org.antlr.v4.runtime.Token;
-import org.antlr.v4.runtime.atn.PredictionMode;
-import org.antlr.v4.runtime.misc.ParseCancellationException;
-import org.antlr.v4.runtime.tree.ParseTree;
-import org.antlr.v4.runtime.tree.TerminalNode;
-import org.apache.groovy.parser.antlr4.internal.AtnManager;
-import org.apache.groovy.parser.antlr4.internal.DescriptiveErrorStrategy;
-import org.apache.groovy.parser.antlr4.util.StringUtils;
-import org.codehaus.groovy.GroovyBugError;
-import org.codehaus.groovy.antlr.EnumHelper;
-import org.codehaus.groovy.ast.ASTNode;
-import org.codehaus.groovy.ast.AnnotationNode;
-import org.codehaus.groovy.ast.ClassHelper;
-import org.codehaus.groovy.ast.ClassNode;
-import org.codehaus.groovy.ast.ConstructorNode;
-import org.codehaus.groovy.ast.EnumConstantClassNode;
-import org.codehaus.groovy.ast.FieldNode;
-import org.codehaus.groovy.ast.GenericsType;
-import org.codehaus.groovy.ast.ImportNode;
-import org.codehaus.groovy.ast.InnerClassNode;
-import org.codehaus.groovy.ast.MethodNode;
-import org.codehaus.groovy.ast.ModuleNode;
-import org.codehaus.groovy.ast.PackageNode;
-import org.codehaus.groovy.ast.Parameter;
-import org.codehaus.groovy.ast.PropertyNode;
-import org.codehaus.groovy.ast.expr.AnnotationConstantExpression;
-import org.codehaus.groovy.ast.expr.ArgumentListExpression;
-import org.codehaus.groovy.ast.expr.ArrayExpression;
-import org.codehaus.groovy.ast.expr.AttributeExpression;
-import org.codehaus.groovy.ast.expr.BinaryExpression;
-import org.codehaus.groovy.ast.expr.BitwiseNegationExpression;
-import org.codehaus.groovy.ast.expr.BooleanExpression;
-import org.codehaus.groovy.ast.expr.CastExpression;
-import org.codehaus.groovy.ast.expr.ClassExpression;
-import org.codehaus.groovy.ast.expr.ClosureExpression;
-import org.codehaus.groovy.ast.expr.ClosureListExpression;
-import org.codehaus.groovy.ast.expr.ConstantExpression;
-import org.codehaus.groovy.ast.expr.ConstructorCallExpression;
-import org.codehaus.groovy.ast.expr.DeclarationExpression;
-import org.codehaus.groovy.ast.expr.ElvisOperatorExpression;
-import org.codehaus.groovy.ast.expr.EmptyExpression;
-import org.codehaus.groovy.ast.expr.Expression;
-import org.codehaus.groovy.ast.expr.GStringExpression;
-import org.codehaus.groovy.ast.expr.LambdaExpression;
-import org.codehaus.groovy.ast.expr.ListExpression;
-import org.codehaus.groovy.ast.expr.MapEntryExpression;
-import org.codehaus.groovy.ast.expr.MapExpression;
-import org.codehaus.groovy.ast.expr.MethodCallExpression;
-import org.codehaus.groovy.ast.expr.MethodPointerExpression;
-import org.codehaus.groovy.ast.expr.MethodReferenceExpression;
-import org.codehaus.groovy.ast.expr.NamedArgumentListExpression;
-import org.codehaus.groovy.ast.expr.NotExpression;
-import org.codehaus.groovy.ast.expr.PostfixExpression;
-import org.codehaus.groovy.ast.expr.PrefixExpression;
-import org.codehaus.groovy.ast.expr.PropertyExpression;
-import org.codehaus.groovy.ast.expr.RangeExpression;
-import org.codehaus.groovy.ast.expr.SpreadExpression;
-import org.codehaus.groovy.ast.expr.SpreadMapExpression;
-import org.codehaus.groovy.ast.expr.TernaryExpression;
-import org.codehaus.groovy.ast.expr.TupleExpression;
-import org.codehaus.groovy.ast.expr.UnaryMinusExpression;
-import org.codehaus.groovy.ast.expr.UnaryPlusExpression;
-import org.codehaus.groovy.ast.expr.VariableExpression;
-import org.codehaus.groovy.ast.stmt.AssertStatement;
-import org.codehaus.groovy.ast.stmt.BlockStatement;
-import org.codehaus.groovy.ast.stmt.BreakStatement;
-import org.codehaus.groovy.ast.stmt.CaseStatement;
-import org.codehaus.groovy.ast.stmt.CatchStatement;
-import org.codehaus.groovy.ast.stmt.ContinueStatement;
-import org.codehaus.groovy.ast.stmt.DoWhileStatement;
-import org.codehaus.groovy.ast.stmt.EmptyStatement;
-import org.codehaus.groovy.ast.stmt.ExpressionStatement;
-import org.codehaus.groovy.ast.stmt.ForStatement;
-import org.codehaus.groovy.ast.stmt.IfStatement;
-import org.codehaus.groovy.ast.stmt.ReturnStatement;
-import org.codehaus.groovy.ast.stmt.Statement;
-import org.codehaus.groovy.ast.stmt.SwitchStatement;
-import org.codehaus.groovy.ast.stmt.SynchronizedStatement;
-import org.codehaus.groovy.ast.stmt.ThrowStatement;
-import org.codehaus.groovy.ast.stmt.TryCatchStatement;
-import org.codehaus.groovy.ast.stmt.WhileStatement;
-import org.codehaus.groovy.control.CompilationFailedException;
-import org.codehaus.groovy.control.CompilePhase;
-import org.codehaus.groovy.control.SourceUnit;
-import org.codehaus.groovy.control.messages.SyntaxErrorMessage;
-import org.codehaus.groovy.runtime.IOGroovyMethods;
-import org.codehaus.groovy.runtime.StringGroovyMethods;
-import org.codehaus.groovy.syntax.Numbers;
-import org.codehaus.groovy.syntax.SyntaxException;
-import org.codehaus.groovy.syntax.Types;
-import org.objectweb.asm.Opcodes;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.lang.reflect.Field;
-import java.util.ArrayDeque;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Deque;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.logging.Logger;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import static org.apache.groovy.parser.antlr4.GroovyLangParser.*;
-import static org.codehaus.groovy.runtime.DefaultGroovyMethods.asBoolean;
-import static org.codehaus.groovy.runtime.DefaultGroovyMethods.last;
-
-/**
- * Building the AST from the parse tree generated by Antlr4
- *
- * @author <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- *         Created on 2016/08/14
- */
-public class AstBuilder extends GroovyParserBaseVisitor<Object> implements GroovyParserVisitor<Object> {
-
-    public AstBuilder(SourceUnit sourceUnit, ClassLoader classLoader) {
-        this.sourceUnit = sourceUnit;
-        this.moduleNode = new ModuleNode(sourceUnit);
-        this.classLoader = classLoader; // unused for the time being
-
-        this.lexer = new GroovyLangLexer(
-                new ANTLRInputStream(
-                        this.readSourceCode(sourceUnit)));
-        this.parser = new GroovyLangParser(
-                new CommonTokenStream(this.lexer));
-
-        this.parser.setErrorHandler(new DescriptiveErrorStrategy());
-
-        this.tryWithResourcesASTTransformation = new TryWithResourcesASTTransformation(this);
-        this.groovydocManager = new GroovydocManager(this);
-    }
-
-    private GroovyParserRuleContext buildCST() {
-        GroovyParserRuleContext result;
-
-        // parsing have to wait util clearing is complete.
-        AtnManager.RRWL.readLock().lock();
-        try {
-            result = buildCST(PredictionMode.SLL);
-        } catch (Throwable t) {
-            // if some syntax error occurred in the lexer, no need to retry the powerful LL mode
-            if (t instanceof GroovySyntaxError && GroovySyntaxError.LEXER == ((GroovySyntaxError) t).getSource()) {
-                throw t;
-            }
-
-            result = buildCST(PredictionMode.LL);
-        } finally {
-            AtnManager.RRWL.readLock().unlock();
-        }
-
-        return result;
-    }
-
-    private GroovyParserRuleContext buildCST(PredictionMode predictionMode) {
-        parser.getInterpreter().setPredictionMode(predictionMode);
-
-        if (PredictionMode.SLL.equals(predictionMode)) {
-            this.removeErrorListeners();
-        } else {
-            ((CommonTokenStream) parser.getInputStream()).reset();
-            this.addErrorListeners();
-        }
-
-        return parser.compilationUnit();
-    }
-
-    public ModuleNode buildAST() {
-        try {
-            return (ModuleNode) this.visit(this.buildCST());
-        } catch (Throwable t) {
-            CompilationFailedException cfe;
-
-            if (t instanceof CompilationFailedException) {
-                cfe = (CompilationFailedException) t;
-            } else if (t instanceof ParseCancellationException) {
-                cfe = createParsingFailedException(t.getCause());
-            } else {
-                cfe = createParsingFailedException(t);
-            }
-
-//            LOGGER.log(Level.SEVERE, "Failed to build AST", cfe);
-
-            throw cfe;
-        }
-    }
-
-    @Override
-    public ModuleNode visitCompilationUnit(CompilationUnitContext ctx) {
-        this.visit(ctx.packageDeclaration());
-
-        ctx.statement().stream()
-                .map(this::visit)
-//                .filter(e -> e instanceof Statement)
-                .forEach(e -> {
-                    if (e instanceof DeclarationListStatement) { // local variable declaration
-                        ((DeclarationListStatement) e).getDeclarationStatements().forEach(moduleNode::addStatement);
-                    } else if (e instanceof Statement) {
-                        moduleNode.addStatement((Statement) e);
-                    } else if (e instanceof MethodNode) { // script method
-                        moduleNode.addMethod((MethodNode) e);
-                    }
-                });
-
-        this.classNodeList.forEach(moduleNode::addClass);
-
-        if (this.isPackageInfoDeclaration()) {
-            this.addPackageInfoClassNode();
-        } else {
-            // if groovy source file only contains blank(including EOF), add "return null" to the AST
-            if (this.isBlankScript(ctx)) {
-                this.addEmptyReturnStatement();
-            }
-        }
-
-        this.configureScriptClassNode();
-
-        return moduleNode;
-    }
-
-    @Override
-    public PackageNode visitPackageDeclaration(PackageDeclarationContext ctx) {
-        String packageName = this.visitQualifiedName(ctx.qualifiedName());
-        moduleNode.setPackageName(packageName + DOT_STR);
-
-        PackageNode packageNode = moduleNode.getPackage();
-
-        this.visitAnnotationsOpt(ctx.annotationsOpt()).forEach(packageNode::addAnnotation);
-
-        return this.configureAST(packageNode, ctx);
-    }
-
-    @Override
-    public ImportNode visitImportDeclaration(ImportDeclarationContext ctx) {
-        ImportNode importNode;
-
-        boolean hasStatic = asBoolean(ctx.STATIC());
-        boolean hasStar = asBoolean(ctx.MUL());
-        boolean hasAlias = asBoolean(ctx.alias);
-
-        List<AnnotationNode> annotationNodeList = this.visitAnnotationsOpt(ctx.annotationsOpt());
-
-        if (hasStatic) {
-            if (hasStar) { // e.g. import static java.lang.Math.*
-                String qualifiedName = this.visitQualifiedName(ctx.qualifiedName());
-                ClassNode type = ClassHelper.make(qualifiedName);
-
-
-                moduleNode.addStaticStarImport(type.getText(), type, annotationNodeList);
-
-                importNode = last(moduleNode.getStaticStarImports().values());
-            } else { // e.g. import static java.lang.Math.pow
-                List<GroovyParserRuleContext> identifierList = new LinkedList<>(ctx.qualifiedName().qualifiedNameElement());
-                int identifierListSize = identifierList.size();
-                String name = identifierList.get(identifierListSize - 1).getText();
-                ClassNode classNode =
-                        ClassHelper.make(
-                                identifierList.stream()
-                                        .limit(identifierListSize - 1)
-                                        .map(ParseTree::getText)
-                                        .collect(Collectors.joining(DOT_STR)));
-                String alias = hasAlias
-                        ? ctx.alias.getText()
-                        : name;
-
-                moduleNode.addStaticImport(classNode, name, alias, annotationNodeList);
-
-                importNode = last(moduleNode.getStaticImports().values());
-            }
-        } else {
-            if (hasStar) { // e.g. import java.util.*
-                String qualifiedName = this.visitQualifiedName(ctx.qualifiedName());
-
-                moduleNode.addStarImport(qualifiedName + DOT_STR, annotationNodeList);
-
-                importNode = last(moduleNode.getStarImports());
-            } else { // e.g. import java.util.Map
-                String qualifiedName = this.visitQualifiedName(ctx.qualifiedName());
-                String name = last(ctx.qualifiedName().qualifiedNameElement()).getText();
-                ClassNode classNode = ClassHelper.make(qualifiedName);
-                String alias = hasAlias
-                        ? ctx.alias.getText()
-                        : name;
-
-                moduleNode.addImport(alias, classNode, annotationNodeList);
-
-                importNode = last(moduleNode.getImports());
-            }
-        }
-
-        return this.configureAST(importNode, ctx);
-    }
-
-    // statement {    --------------------------------------------------------------------
-    @Override
-    public AssertStatement visitAssertStatement(AssertStatementContext ctx) {
-        Expression conditionExpression = (Expression) this.visit(ctx.ce);
-        BooleanExpression booleanExpression =
-                this.configureAST(
-                        new BooleanExpression(conditionExpression), conditionExpression);
-
-        if (!asBoolean(ctx.me)) {
-            return this.configureAST(
-                    new AssertStatement(booleanExpression), ctx);
-        }
-
-        return this.configureAST(new AssertStatement(booleanExpression,
-                        (Expression) this.visit(ctx.me)),
-                ctx);
-    }
-
-    @Override
-    public AssertStatement visitAssertStmtAlt(AssertStmtAltContext ctx) {
-        return this.configureAST(this.visitAssertStatement(ctx.assertStatement()), ctx);
-    }
-
-    @Override
-    public IfStatement visitIfElseStmtAlt(IfElseStmtAltContext ctx) {
-        Expression conditionExpression = this.visitParExpression(ctx.parExpression());
-        BooleanExpression booleanExpression =
-                this.configureAST(
-                        new BooleanExpression(conditionExpression), conditionExpression);
-
-        Statement ifBlock =
-                this.unpackStatement(
-                        (Statement) this.visit(ctx.tb));
-        Statement elseBlock =
-                this.unpackStatement(
-                        asBoolean(ctx.ELSE())
-                                ? (Statement) this.visit(ctx.fb)
-                                : EmptyStatement.INSTANCE);
-
-        return this.configureAST(new IfStatement(booleanExpression, ifBlock, elseBlock), ctx);
-    }
-
-    @Override
-    public Statement visitLoopStmtAlt(LoopStmtAltContext ctx) {
-        return this.configureAST((Statement) this.visit(ctx.loopStatement()), ctx);
-    }
-
-    @Override
-    public ForStatement visitForStmtAlt(ForStmtAltContext ctx) {
-        Pair<Parameter, Expression> controlPair = this.visitForControl(ctx.forControl());
-
-        Statement loopBlock = this.unpackStatement((Statement) this.visit(ctx.statement()));
-
-        return this.configureAST(
-                new ForStatement(controlPair.getKey(), controlPair.getValue(), asBoolean(loopBlock) ? loopBlock : EmptyStatement.INSTANCE),
-                ctx);
-    }
-
-    @Override
-    public Pair<Parameter, Expression> visitForControl(ForControlContext ctx) {
-        if (asBoolean(ctx.enhancedForControl())) { // e.g. for(int i in 0..<10) {}
-            return this.visitEnhancedForControl(ctx.enhancedForControl());
-        }
-
-        if (asBoolean(ctx.classicalForControl())) { // e.g. for(int i = 0; i < 10; i++) {}
-            return this.visitClassicalForControl(ctx.classicalForControl());
-        }
-
-        throw createParsingFailedException("Unsupported for control: " + ctx.getText(), ctx);
-    }
-
-    @Override
-    public Expression visitForInit(ForInitContext ctx) {
-        if (!asBoolean(ctx)) {
-            return EmptyExpression.INSTANCE;
-        }
-
-        if (asBoolean(ctx.localVariableDeclaration())) {
-            DeclarationListStatement declarationListStatement = this.visitLocalVariableDeclaration(ctx.localVariableDeclaration());
-            List<?> declarationExpressionList = declarationListStatement.getDeclarationExpressions();
-
-            if (declarationExpressionList.size() == 1) {
-                return this.configureAST((Expression) declarationExpressionList.get(0), ctx);
-            } else {
-                return this.configureAST(new ClosureListExpression((List<Expression>) declarationExpressionList), ctx);
-            }
-        }
-
-        if (asBoolean(ctx.expressionList())) {
-            return this.translateExpressionList(ctx.expressionList());
-        }
-
-        throw createParsingFailedException("Unsupported for init: " + ctx.getText(), ctx);
-    }
-
-    @Override
-    public Expression visitForUpdate(ForUpdateContext ctx) {
-        if (!asBoolean(ctx)) {
-            return EmptyExpression.INSTANCE;
-        }
-
-        return this.translateExpressionList(ctx.expressionList());
-    }
-
-    private Expression translateExpressionList(ExpressionListContext ctx) {
-        List<Expression> expressionList = this.visitExpressionList(ctx);
-
-        if (expressionList.size() == 1) {
-            return this.configureAST(expressionList.get(0), ctx);
-        } else {
-            return this.configureAST(new ClosureListExpression(expressionList), ctx);
-        }
-    }
-
-    @Override
-    public Pair<Parameter, Expression> visitEnhancedForControl(EnhancedForControlContext ctx) {
-        Parameter parameter = this.configureAST(
-                new Parameter(this.visitType(ctx.type()), this.visitVariableDeclaratorId(ctx.variableDeclaratorId()).getName()),
-                ctx.variableDeclaratorId());
-
-        // FIXME Groovy will ignore variableModifier of parameter in the for control
-        // In order to make the new parser behave same with the old one, we do not process variableModifier*
-
-        return new Pair<>(parameter, (Expression) this.visit(ctx.expression()));
-    }
-
-    @Override
-    public Pair<Parameter, Expression> visitClassicalForControl(ClassicalForControlContext ctx) {
-        ClosureListExpression closureListExpression = new ClosureListExpression();
-
-        closureListExpression.addExpression(this.visitForInit(ctx.forInit()));
-        closureListExpression.addExpression(asBoolean(ctx.expression()) ? (Expression) this.visit(ctx.expression()) : EmptyExpression.INSTANCE);
-        closureListExpression.addExpression(this.visitForUpdate(ctx.forUpdate()));
-
-        return new Pair<>(ForStatement.FOR_LOOP_DUMMY, closureListExpression);
-    }
-
-    @Override
-    public WhileStatement visitWhileStmtAlt(WhileStmtAltContext ctx) {
-        Expression conditionExpression = this.visitParExpression(ctx.parExpression());
-        BooleanExpression booleanExpression =
-                this.configureAST(
-                        new BooleanExpression(conditionExpression), conditionExpression);
-
-        Statement loopBlock = this.unpackStatement((Statement) this.visit(ctx.statement()));
-
-        return this.configureAST(
-                new WhileStatement(booleanExpression, asBoolean(loopBlock) ? loopBlock : EmptyStatement.INSTANCE),
-                ctx);
-    }
-
-    @Override
-    public DoWhileStatement visitDoWhileStmtAlt(DoWhileStmtAltContext ctx) {
-        Expression conditionExpression = this.visitParExpression(ctx.parExpression());
-
-        BooleanExpression booleanExpression =
-                this.configureAST(
-                        new BooleanExpression(conditionExpression),
-                        conditionExpression
-                );
-
-        Statement loopBlock = this.unpackStatement((Statement) this.visit(ctx.statement()));
-
-        return this.configureAST(
-                new DoWhileStatement(booleanExpression, asBoolean(loopBlock) ? loopBlock : EmptyStatement.INSTANCE),
-                ctx);
-    }
-
-    @Override
-    public Statement visitTryCatchStmtAlt(TryCatchStmtAltContext ctx) {
-        return this.configureAST(this.visitTryCatchStatement(ctx.tryCatchStatement()), ctx);
-    }
-
-    @Override
-    public Statement visitTryCatchStatement(TryCatchStatementContext ctx) {
-        TryCatchStatement tryCatchStatement =
-                new TryCatchStatement((Statement) this.visit(ctx.block()),
-                        this.visitFinallyBlock(ctx.finallyBlock()));
-
-        if (asBoolean(ctx.resources())) {
-            this.visitResources(ctx.resources()).forEach(tryCatchStatement::addResource);
-        }
-
-        ctx.catchClause().stream().map(this::visitCatchClause)
-                .reduce(new LinkedList<CatchStatement>(), (r, e) -> {
-                    r.addAll(e); // merge several LinkedList<CatchStatement> instances into one LinkedList<CatchStatement> instance
-                    return r;
-                })
-                .forEach(tryCatchStatement::addCatch);
-
-        return this.configureAST(
-                tryWithResourcesASTTransformation.transform(
-                        this.configureAST(tryCatchStatement, ctx)),
-                ctx);
-    }
-
-
-    @Override
-    public List<ExpressionStatement> visitResources(ResourcesContext ctx) {
-        return this.visitResourceList(ctx.resourceList());
-    }
-
-    @Override
-    public List<ExpressionStatement> visitResourceList(ResourceListContext ctx) {
-        return ctx.resource().stream().map(this::visitResource).collect(Collectors.toList());
-    }
-
-    @Override
-    public ExpressionStatement visitResource(ResourceContext ctx) {
-        if (asBoolean(ctx.localVariableDeclaration())) {
-            List<ExpressionStatement> declarationStatements = this.visitLocalVariableDeclaration(ctx.localVariableDeclaration()).getDeclarationStatements();
-
-            if (declarationStatements.size() > 1) {
-                throw createParsingFailedException("Multi resources can not be declared in one statement", ctx);
-            }
-
-            return declarationStatements.get(0);
-        } else if (asBoolean(ctx.expression())) {
-            Expression expression = (Expression) this.visit(ctx.expression());
-            if (!(expression instanceof BinaryExpression
-                    && Types.ASSIGN == ((BinaryExpression) expression).getOperation().getType()
-                    && ((BinaryExpression) expression).getLeftExpression() instanceof VariableExpression)) {
-
-                throw createParsingFailedException("Only variable declarations are allowed to declare resource", ctx);
-            }
-
-            BinaryExpression assignmentExpression = (BinaryExpression) expression;
-
-            return this.configureAST(
-                    new ExpressionStatement(
-                            this.configureAST(
-                                    new DeclarationExpression(
-                                            this.configureAST(
-                                                    new VariableExpression(assignmentExpression.getLeftExpression().getText()),
-                                                    assignmentExpression.getLeftExpression()
-                                            ),
-                                            assignmentExpression.getOperation(),
-                                            assignmentExpression.getRightExpression()
-                                    ), ctx)
-                    ), ctx);
-        }
-
-        throw createParsingFailedException("Unsupported resource declaration: " + ctx.getText(), ctx);
-    }
-
-    /**
-     * Multi-catch(1..*) clause will be unpacked to several normal catch clauses, so the return type is List
-     *
-     * @param ctx the parse tree
-     * @return
-     */
-    @Override
-    public List<CatchStatement> visitCatchClause(CatchClauseContext ctx) {
-        // FIXME Groovy will ignore variableModifier of parameter in the catch clause
-        // In order to make the new parser behave same with the old one, we do not process variableModifier*
-
-        return this.visitCatchType(ctx.catchType()).stream()
-                .map(e -> this.configureAST(
-                        new CatchStatement(
-                                // FIXME The old parser does not set location info for the parameter of the catch clause.
-                                // we could make it better
-                                //this.configureAST(new Parameter(e, this.visitIdentifier(ctx.identifier())), ctx.Identifier()),
-
-                                new Parameter(e, this.visitIdentifier(ctx.identifier())),
-                                this.visitBlock(ctx.block())),
-                        ctx.block()))
-                .collect(Collectors.toList());
-    }
-
-    @Override
-    public List<ClassNode> visitCatchType(CatchTypeContext ctx) {
-        if (!asBoolean(ctx)) {
-            return Collections.singletonList(ClassHelper.OBJECT_TYPE);
-        }
-
-        return ctx.qualifiedClassName().stream()
-                .map(this::visitQualifiedClassName)
-                .collect(Collectors.toList());
-    }
-
-
-    @Override
-    public Statement visitFinallyBlock(FinallyBlockContext ctx) {
-        if (!asBoolean(ctx)) {
-            return EmptyStatement.INSTANCE;
-        }
-
-        return this.configureAST(
-                this.createBlockStatement((Statement) this.visit(ctx.block())),
-                ctx);
-    }
-
-    @Override
-    public SwitchStatement visitSwitchStmtAlt(SwitchStmtAltContext ctx) {
-        return this.configureAST(this.visitSwitchStatement(ctx.switchStatement()), ctx);
-    }
-
-    public SwitchStatement visitSwitchStatement(SwitchStatementContext ctx) {
-        List<Statement> statementList =
-                ctx.switchBlockStatementGroup().stream()
-                        .map(this::visitSwitchBlockStatementGroup)
-                        .reduce(new LinkedList<>(), (r, e) -> {
-                            r.addAll(e);
-                            return r;
-                        });
-
-        List<CaseStatement> caseStatementList = new LinkedList<>();
-        List<Statement> defaultStatementList = new LinkedList<>();
-
-        statementList.forEach(e -> {
-            if (e instanceof CaseStatement) {
-                caseStatementList.add((CaseStatement) e);
-            } else if (isTrue(e, IS_SWITCH_DEFAULT)) {
-                defaultStatementList.add(e);
-            }
-        });
-
-        int defaultStatementListSize = defaultStatementList.size();
-        if (defaultStatementListSize > 1) {
-            throw createParsingFailedException("switch statement should have only one default case, which should appear at last", defaultStatementList.get(0));
-        }
-
-        if (defaultStatementListSize > 0 && last(statementList) instanceof CaseStatement) {
-            throw createParsingFailedException("default case should appear at last", defaultStatementList.get(0));
-        }
-
-        return this.configureAST(
-                new SwitchStatement(
-                        this.visitParExpression(ctx.parExpression()),
-                        caseStatementList,
-                        defaultStatementListSize == 0 ? EmptyStatement.INSTANCE : defaultStatementList.get(0)
-                ),
-                ctx);
-
-    }
-
-
-    @Override
-    @SuppressWarnings({"unchecked"})
-    public List<Statement> visitSwitchBlockStatementGroup(SwitchBlockStatementGroupContext ctx) {
-        int labelCnt = ctx.switchLabel().size();
-        List<Token> firstLabelHolder = new ArrayList<>(1);
-
-        return (List<Statement>) ctx.switchLabel().stream()
-                .map(e -> (Object) this.visitSwitchLabel(e))
-                .reduce(new ArrayList<Statement>(4), (r, e) -> {
-                    List<Statement> statementList = (List<Statement>) r;
-                    Pair<Token, Expression> pair = (Pair<Token, Expression>) e;
-
-                    boolean isLast = labelCnt - 1 == statementList.size();
-
-                    switch (pair.getKey().getType()) {
-                        case CASE: {
-                            if (!asBoolean(statementList)) {
-                                firstLabelHolder.add(pair.getKey());
-                            }
-
-                            statementList.add(
-                                    this.configureAST(
-                                            new CaseStatement(
-                                                    pair.getValue(),
-
-                                                    // check whether processing the last label. if yes, block statement should be attached.
-                                                    isLast ? this.visitBlockStatements(ctx.blockStatements())
-                                                            : EmptyStatement.INSTANCE
-                                            ),
-                                            firstLabelHolder.get(0)));
-
-                            break;
-                        }
-                        case DEFAULT: {
-
-                            BlockStatement blockStatement = this.visitBlockStatements(ctx.blockStatements());
-                            blockStatement.putNodeMetaData(IS_SWITCH_DEFAULT, true);
-
-                            statementList.add(
-                                    // this.configureAST(blockStatement, pair.getKey())
-                                    blockStatement
-                            );
-
-                            break;
-                        }
-                    }
-
-                    return statementList;
-                });
-
-    }
-
-    @Override
-    public Pair<Token, Expression> visitSwitchLabel(SwitchLabelContext ctx) {
-        if (asBoolean(ctx.CASE())) {
-            return new Pair<>(ctx.CASE().getSymbol(), (Expression) this.visit(ctx.expression()));
-        } else if (asBoolean(ctx.DEFAULT())) {
-            return new Pair<>(ctx.DEFAULT().getSymbol(), EmptyExpression.INSTANCE);
-        }
-
-        throw createParsingFailedException("Unsupported switch label: " + ctx.getText(), ctx);
-    }
-
-
-    @Override
-    public SynchronizedStatement visitSynchronizedStmtAlt(SynchronizedStmtAltContext ctx) {
-        return this.configureAST(
-                new SynchronizedStatement(this.visitParExpression(ctx.parExpression()), this.visitBlock(ctx.block())),
-                ctx);
-    }
-
-
-    @Override
-    public ExpressionStatement visitExpressionStmtAlt(ExpressionStmtAltContext ctx) {
-        return (ExpressionStatement) this.visit(ctx.statementExpression());
-    }
-
-    @Override
-    public ReturnStatement visitReturnStmtAlt(ReturnStmtAltContext ctx) {
-        return this.configureAST(new ReturnStatement(asBoolean(ctx.expression())
-                        ? (Expression) this.visit(ctx.expression())
-                        : ConstantExpression.EMPTY_EXPRESSION),
-                ctx);
-    }
-
-    @Override
-    public ThrowStatement visitThrowStmtAlt(ThrowStmtAltContext ctx) {
-        return this.configureAST(
-                new ThrowStatement((Expression) this.visit(ctx.expression())),
-                ctx);
-    }
-
-    @Override
-    public Statement visitLabeledStmtAlt(LabeledStmtAltContext ctx) {
-        Statement statement = (Statement) this.visit(ctx.statement());
-
-        statement.addStatementLabel(this.visitIdentifier(ctx.identifier()));
-
-        return statement; // this.configureAST(statement, ctx);
-    }
-
-    @Override
-    public BreakStatement visitBreakStatement(BreakStatementContext ctx) {
-        String label = asBoolean(ctx.identifier())
-                ? this.visitIdentifier(ctx.identifier())
-                : null;
-
-        return this.configureAST(new BreakStatement(label), ctx);
-    }
-
-    @Override
-    public BreakStatement visitBreakStmtAlt(BreakStmtAltContext ctx) {
-        return this.configureAST(this.visitBreakStatement(ctx.breakStatement()), ctx);
-    }
-
-    @Override
-    public ContinueStatement visitContinueStatement(ContinueStatementContext ctx) {
-        String label = asBoolean(ctx.identifier())
-                ? this.visitIdentifier(ctx.identifier())
-                : null;
-
-        return this.configureAST(new ContinueStatement(label), ctx);
-
-    }
-
-    @Override
-    public ContinueStatement visitContinueStmtAlt(ContinueStmtAltContext ctx) {
-        return this.configureAST(this.visitContinueStatement(ctx.continueStatement()), ctx);
-    }
-
-    @Override
-    public ImportNode visitImportStmtAlt(ImportStmtAltContext ctx) {
-        return this.configureAST(this.visitImportDeclaration(ctx.importDeclaration()), ctx);
-    }
-
-    @Override
-    public ClassNode visitTypeDeclarationStmtAlt(TypeDeclarationStmtAltContext ctx) {
-        return this.configureAST(this.visitTypeDeclaration(ctx.typeDeclaration()), ctx);
-    }
-
-
-    @Override
-    public Statement visitLocalVariableDeclarationStmtAlt(LocalVariableDeclarationStmtAltContext ctx) {
-        return this.configureAST(this.visitLocalVariableDeclaration(ctx.localVariableDeclaration()), ctx);
-    }
-
-    @Override
-    public MethodNode visitMethodDeclarationStmtAlt(MethodDeclarationStmtAltContext ctx) {
-        return this.configureAST(this.visitMethodDeclaration(ctx.methodDeclaration()), ctx);
-    }
-
-    // } statement    --------------------------------------------------------------------
-
-    @Override
-    public ClassNode visitTypeDeclaration(TypeDeclarationContext ctx) {
-        if (asBoolean(ctx.classDeclaration())) { // e.g. class A {}
-            ctx.classDeclaration().putNodeMetaData(TYPE_DECLARATION_MODIFIERS, this.visitClassOrInterfaceModifiersOpt(ctx.classOrInterfaceModifiersOpt()));
-            return this.configureAST(this.visitClassDeclaration(ctx.classDeclaration()), ctx);
-        }
-
-        throw createParsingFailedException("Unsupported type declaration: " + ctx.getText(), ctx);
-    }
-
-    private void initUsingGenerics(ClassNode classNode) {
-        if (classNode.isUsingGenerics()) {
-            return;
-        }
-
-        if (!classNode.isEnum()) {
-            classNode.setUsingGenerics(classNode.getSuperClass().isUsingGenerics());
-        }
-
-        if (!classNode.isUsingGenerics() && asBoolean((Object) classNode.getInterfaces())) {
-            for (ClassNode anInterface : classNode.getInterfaces()) {
-                classNode.setUsingGenerics(classNode.isUsingGenerics() || anInterface.isUsingGenerics());
-
-                if (classNode.isUsingGenerics())
-                    break;
-            }
-        }
-    }
-
-    @Override
-    public ClassNode visitClassDeclaration(ClassDeclarationContext ctx) {
-        String packageName = moduleNode.getPackageName();
-        packageName = asBoolean((Object) packageName) ? packageName : "";
-
-        List<ModifierNode> modifierNodeList = ctx.getNodeMetaData(TYPE_DECLARATION_MODIFIERS);
-        Objects.requireNonNull(modifierNodeList, "modifierNodeList should not be null");
-
-        ModifierManager modifierManager = new ModifierManager(this, modifierNodeList);
-        int modifiers = modifierManager.getClassModifiersOpValue();
-
-        boolean syntheticPublic = ((modifiers & Opcodes.ACC_SYNTHETIC) != 0);
-        modifiers &= ~Opcodes.ACC_SYNTHETIC;
-
-        final ClassNode outerClass = classNodeStack.peek();
-        ClassNode classNode;
-        String className = this.visitIdentifier(ctx.identifier());
-        if (asBoolean(ctx.ENUM())) {
-            classNode =
-                    EnumHelper.makeEnumNode(
-                            asBoolean(outerClass) ? className : packageName + className,
-                            modifiers, null, outerClass);
-        } else {
-            if (asBoolean(outerClass)) {
-                classNode =
-                        new InnerClassNode(
-                                outerClass,
-                                outerClass.getName() + "$" + className,
-                                modifiers | (outerClass.isInterface() ? Opcodes.ACC_STATIC : 0),
-                                ClassHelper.OBJECT_TYPE);
-            } else {
-                classNode =
-                        new ClassNode(
-                                packageName + className,
-                                modifiers,
-                                ClassHelper.OBJECT_TYPE);
-            }
-
-        }
-
-        this.configureAST(classNode, ctx);
-        classNode.putNodeMetaData(CLASS_NAME, className);
-        classNode.setSyntheticPublic(syntheticPublic);
-
-        if (asBoolean(ctx.TRAIT())) {
-            classNode.addAnnotation(new AnnotationNode(ClassHelper.make(GROOVY_TRANSFORM_TRAIT)));
-        }
-        classNode.addAnnotations(modifierManager.getAnnotations());
-        classNode.setGenericsTypes(this.visitTypeParameters(ctx.typeParameters()));
-
-        boolean isInterface = asBoolean(ctx.INTERFACE()) && !asBoolean(ctx.AT());
-        boolean isInterfaceWithDefaultMethods = false;
-
-        // declaring interface with default method
-        if (isInterface && this.containsDefaultMethods(ctx)) {
-            isInterfaceWithDefaultMethods = true;
-            classNode.addAnnotation(new AnnotationNode(ClassHelper.make(GROOVY_TRANSFORM_TRAIT)));
-            classNode.putNodeMetaData(IS_INTERFACE_WITH_DEFAULT_METHODS, true);
-        }
-
-        if (asBoolean(ctx.CLASS()) || asBoolean(ctx.TRAIT()) || isInterfaceWithDefaultMethods) { // class OR trait OR interface with default methods
-            classNode.setSuperClass(this.visitType(ctx.sc));
-            classNode.setInterfaces(this.visitTypeList(ctx.is));
-
-            this.initUsingGenerics(classNode);
-        } else if (isInterface) { // interface(NOT annotation)
-            classNode.setModifiers(classNode.getModifiers() | Opcodes.ACC_INTERFACE | Opcodes.ACC_ABSTRACT);
-
-            classNode.setSuperClass(ClassHelper.OBJECT_TYPE);
-            classNode.setInterfaces(this.visitTypeList(ctx.scs));
-
-            this.initUsingGenerics(classNode);
-
-            this.hackMixins(classNode);
-        } else if (asBoolean(ctx.ENUM())) { // enum
-            classNode.setModifiers(classNode.getModifiers() | Opcodes.ACC_ENUM | Opcodes.ACC_FINAL);
-
-            classNode.setInterfaces(this.visitTypeList(ctx.is));
-
-            this.initUsingGenerics(classNode);
-        } else if (asBoolean(ctx.AT())) { // annotation
-            classNode.setModifiers(classNode.getModifiers() | Opcodes.ACC_INTERFACE | Opcodes.ACC_ABSTRACT | Opcodes.ACC_ANNOTATION);
-
-            classNode.addInterface(ClassHelper.Annotation_TYPE);
-
-            this.hackMixins(classNode);
-        } else {
-            throw createParsingFailedException("Unsupported class declaration: " + ctx.getText(), ctx);
-        }
-
-        // we put the class already in output to avoid the most inner classes
-        // will be used as first class later in the loader. The first class
-        // there determines what GCL#parseClass for example will return, so we
-        // have here to ensure it won't be the inner class
-        if (asBoolean(ctx.CLASS()) || asBoolean(ctx.TRAIT())) {
-            classNodeList.add(classNode);
-        }
-
-        int oldAnonymousInnerClassCounter = this.anonymousInnerClassCounter;
-        classNodeStack.push(classNode);
-        ctx.classBody().putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
-        this.visitClassBody(ctx.classBody());
-        classNodeStack.pop();
-        this.anonymousInnerClassCounter = oldAnonymousInnerClassCounter;
-
-        if (!(asBoolean(ctx.CLASS()) || asBoolean(ctx.TRAIT()))) {
-            classNodeList.add(classNode);
-        }
-
-        groovydocManager.handle(classNode, ctx);
-
-        return classNode;
-    }
-
-    @SuppressWarnings({"unchecked"})
-    private boolean containsDefaultMethods(ClassDeclarationContext ctx) {
-        List<MethodDeclarationContext> methodDeclarationContextList =
-                (List<MethodDeclarationContext>) ctx.classBody().classBodyDeclaration().stream()
-                .map(ClassBodyDeclarationContext::memberDeclaration)
-                .filter(Objects::nonNull)
-                .map(e -> (Object) e.methodDeclaration())
-                .filter(Objects::nonNull).reduce(new LinkedList<MethodDeclarationContext>(), (r, e) -> {
-                    MethodDeclarationContext methodDeclarationContext = (MethodDeclarationContext) e;
-
-                    if (createModifierManager(methodDeclarationContext).contains(DEFAULT)) {
-                        ((List) r).add(methodDeclarationContext);
-                    }
-
-                    return r;
-        });
-
-        return !methodDeclarationContextList.isEmpty();
-    }
-
-    @Override
-    public Void visitClassBody(ClassBodyContext ctx) {
-        ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);
-        Objects.requireNonNull(classNode, "classNode should not be null");
-
-        if (asBoolean(ctx.enumConstants())) {
-            ctx.enumConstants().putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
-            this.visitEnumConstants(ctx.enumConstants());
-        }
-
-        ctx.classBodyDeclaration().forEach(e -> {
-            e.putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
-            this.visitClassBodyDeclaration(e);
-        });
-
-        return null;
-    }
-
-    @Override
-    public List<FieldNode> visitEnumConstants(EnumConstantsContext ctx) {
-        ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);
-        Objects.requireNonNull(classNode, "classNode should not be null");
-
-        return ctx.enumConstant().stream()
-                .map(e -> {
-                    e.putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
-                    return this.visitEnumConstant(e);
-                })
-                .collect(Collectors.toList());
-    }
-
-    @Override
-    public FieldNode visitEnumConstant(EnumConstantContext ctx) {
-        ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);
-        Objects.requireNonNull(classNode, "classNode should not be null");
-
-        InnerClassNode anonymousInnerClassNode = null;
-        if (asBoolean(ctx.anonymousInnerClassDeclaration())) {
-            ctx.anonymousInnerClassDeclaration().putNodeMetaData(ANONYMOUS_INNER_CLASS_SUPER_CLASS, classNode);
-            anonymousInnerClassNode = this.visitAnonymousInnerClassDeclaration(ctx.anonymousInnerClassDeclaration());
-        }
-
-        FieldNode enumConstant =
-                EnumHelper.addEnumConstant(
-                        classNode,
-                        this.visitIdentifier(ctx.identifier()),
-                        createEnumConstantInitExpression(ctx.arguments(), anonymousInnerClassNode));
-
-        this.visitAnnotationsOpt(ctx.annotationsOpt()).forEach(enumConstant::addAnnotation);
-
-        groovydocManager.handle(enumConstant, ctx);
-
-        return this.configureAST(enumConstant, ctx);
-    }
-
-    private Expression createEnumConstantInitExpression(ArgumentsContext ctx, InnerClassNode anonymousInnerClassNode) {
-        if (!asBoolean(ctx) && !asBoolean(anonymousInnerClassNode)) {
-            return null;
-        }
-
-        TupleExpression argumentListExpression = (TupleExpression) this.visitArguments(ctx);
-        List<Expression> expressions = argumentListExpression.getExpressions();
-
-        if (expressions.size() == 1) {
-            Expression expression = expressions.get(0);
-
-            if (expression instanceof NamedArgumentListExpression) { // e.g. SOME_ENUM_CONSTANT(a: "1", b: "2")
-                List<MapEntryExpression> mapEntryExpressionList = ((NamedArgumentListExpression) expression).getMapEntryExpressions();
-                ListExpression listExpression =
-                        new ListExpression(
-                                mapEntryExpressionList.stream()
-                                        .map(e -> (Expression) e)
-                                        .collect(Collectors.toList()));
-
-                if (asBoolean(anonymousInnerClassNode)) {
-                    listExpression.addExpression(
-                            this.configureAST(
-                                    new ClassExpression(anonymousInnerClassNode),
-                                    anonymousInnerClassNode));
-                }
-
-                if (mapEntryExpressionList.size() > 1) {
-                    listExpression.setWrapped(true);
-                }
-
-                return this.configureAST(listExpression, ctx);
-            }
-
-            if (!asBoolean(anonymousInnerClassNode)) {
-                if (expression instanceof ListExpression) {
-                    ListExpression listExpression = new ListExpression();
-                    listExpression.addExpression(expression);
-
-                    return this.configureAST(listExpression, ctx);
-                }
-
-                return expression;
-            }
-
-            ListExpression listExpression = new ListExpression();
-
-            if (expression instanceof ListExpression) {
-                ((ListExpression) expression).getExpressions().forEach(listExpression::addExpression);
-            } else {
-                listExpression.addExpression(expression);
-            }
-
-            listExpression.addExpression(
-                    this.configureAST(
-                            new ClassExpression(anonymousInnerClassNode),
-                            anonymousInnerClassNode));
-
-            return this.configureAST(listExpression, ctx);
-        }
-
-        ListExpression listExpression = new ListExpression(expressions);
-        if (asBoolean(anonymousInnerClassNode)) {
-            listExpression.addExpression(
-                    this.configureAST(
-                            new ClassExpression(anonymousInnerClassNode),
-                            anonymousInnerClassNode));
-        }
-
-        if (asBoolean(ctx)) {
-            listExpression.setWrapped(true);
-        }
-
-        return asBoolean(ctx)
-                ? this.configureAST(listExpression, ctx)
-                : this.configureAST(listExpression, anonymousInnerClassNode);
-    }
-
-
-    @Override
-    public Void visitClassBodyDeclaration(ClassBodyDeclarationContext ctx) {
-        ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);
-        Objects.requireNonNull(classNode, "classNode should not be null");
-
-        if (asBoolean(ctx.memberDeclaration())) {
-            ctx.memberDeclaration().putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
-            this.visitMemberDeclaration(ctx.memberDeclaration());
-        } else if (asBoolean(ctx.block())) {
-            Statement statement = this.visitBlock(ctx.block());
-
-            if (asBoolean(ctx.STATIC())) { // e.g. static { }
-                classNode.addStaticInitializerStatements(Collections.singletonList(statement), false);
-            } else { // e.g.  { }
-                classNode.addObjectInitializerStatements(
-                        this.configureAST(
-                                this.createBlockStatement(statement),
-                                statement));
-            }
-        }
-
-        return null;
-    }
-
-    @Override
-    public Void visitMemberDeclaration(MemberDeclarationContext ctx) {
-        ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);
-        Objects.requireNonNull(classNode, "classNode should not be null");
-
-        if (asBoolean(ctx.methodDeclaration())) {
-            ctx.methodDeclaration().putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
-            this.visitMethodDeclaration(ctx.methodDeclaration());
-        } else if (asBoolean(ctx.fieldDeclaration())) {
-            ctx.fieldDeclaration().putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
-            this.visitFieldDeclaration(ctx.fieldDeclaration());
-        } else if (asBoolean(ctx.classDeclaration())) {
-            ctx.classDeclaration().putNodeMetaData(TYPE_DECLARATION_MODIFIERS, this.visitModifiersOpt(ctx.modifiersOpt()));
-            ctx.classDeclaration().putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
-            this.visitClassDeclaration(ctx.classDeclaration());
-        }
-
-        return null;
-    }
-
-    @Override
-    public GenericsType[] visitTypeParameters(TypeParametersContext ctx) {
-        if (!asBoolean(ctx)) {
-            return null;
-        }
-
-        return ctx.typeParameter().stream()
-                .map(this::visitTypeParameter)
-                .toArray(GenericsType[]::new);
-    }
-
-    @Override
-    public GenericsType visitTypeParameter(TypeParameterContext ctx) {
-        return this.configureAST(
-                new GenericsType(
-                        ClassHelper.make(this.visitClassName(ctx.className())),
-                        this.visitTypeBound(ctx.typeBound()),
-                        null
-                ),
-                ctx);
-    }
-
-    @Override
-    public ClassNode[] visitTypeBound(TypeBoundContext ctx) {
-        if (!asBoolean(ctx)) {
-            return null;
-        }
-
-        return ctx.type().stream()
-                .map(this::visitType)
-                .toArray(ClassNode[]::new);
-    }
-
-    @Override
-    public Void visitFieldDeclaration(FieldDeclarationContext ctx) {
-        ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);
-        Objects.requireNonNull(classNode, "classNode should not be null");
-
-        ctx.variableDeclaration().putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
-        this.visitVariableDeclaration(ctx.variableDeclaration());
-
-        return null;
-    }
-
-    private ConstructorCallExpression checkThisAndSuperConstructorCall(Statement statement) {
-        if (!(statement instanceof BlockStatement)) { // method code must be a BlockStatement
-            return null;
-        }
-
-        BlockStatement blockStatement = (BlockStatement) statement;
-        List<Statement> statementList = blockStatement.getStatements();
-
-        for (int i = 0, n = statementList.size(); i < n; i++) {
-            Statement s = statementList.get(i);
-            if (s instanceof ExpressionStatement) {
-                Expression expression = ((ExpressionStatement) s).getExpression();
-                if ((expression instanceof ConstructorCallExpression) && 0 != i) {
-                    return (ConstructorCallExpression) expression;
-                }
-            }
-        }
-
-        return null;
-    }
-
-    private ModifierManager createModifierManager(MethodDeclarationContext ctx) {
-        List<ModifierNode> modifierNodeList = Collections.emptyList();
-
-        if (asBoolean(ctx.modifiers())) {
-            modifierNodeList = this.visitModifiers(ctx.modifiers());
-        } else if (asBoolean(ctx.modifiersOpt())) {
-            modifierNodeList = this.visitModifiersOpt(ctx.modifiersOpt());
-        }
-
-        return new ModifierManager(this, modifierNodeList);
-    }
-
-    private void validateParametersOfMethodDeclaration(Parameter[] parameters, ClassNode classNode) {
-        if (!classNode.isInterface()) {
-            return;
-        }
-
-        Arrays.stream(parameters).forEach(e -> {
-            if (e.hasInitialExpression()) {
-                throw createParsingFailedException("Cannot specify default value for method parameter '" + e.getName() + " = " + e.getInitialExpression().getText() + "' inside an interface", e);
-            }
-        });
-    }
-
-    @Override
-    public MethodNode visitMethodDeclaration(MethodDeclarationContext ctx) {
-        ModifierManager modifierManager = createModifierManager(ctx);
-        String methodName = this.visitMethodName(ctx.methodName());
-        ClassNode returnType = this.visitReturnType(ctx.returnType());
-        Parameter[] parameters = this.visitFormalParameters(ctx.formalParameters());
-        ClassNode[] exceptions = this.visitQualifiedClassNameList(ctx.qualifiedClassNameList());
-
-        anonymousInnerClassesDefinedInMethodStack.push(new LinkedList<>());
-        Statement code = this.visitMethodBody(ctx.methodBody());
-        List<InnerClassNode> anonymousInnerClassList = anonymousInnerClassesDefinedInMethodStack.pop();
-
-        MethodNode methodNode;
-        // if classNode is not null, the method declaration is for class declaration
-        ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);
-        if (asBoolean(classNode)) {
-            validateParametersOfMethodDeclaration(parameters, classNode);
-
-            methodNode = createConstructorOrMethodNodeForClass(ctx, modifierManager, methodName, returnType, parameters, exceptions, code, classNode);
-        } else { // script method declaration
-            methodNode = createScriptMethodNode(modifierManager, methodName, returnType, parameters, exceptions, code);
-        }
-        anonymousInnerClassList.forEach(e -> e.setEnclosingMethod(methodNode));
-
-        methodNode.setGenericsTypes(this.visitTypeParameters(ctx.typeParameters()));
-        methodNode.setSyntheticPublic(
-                this.isSyntheticPublic(
-                        this.isAnnotationDeclaration(classNode),
-                        classNode instanceof EnumConstantClassNode,
-                        asBoolean(ctx.returnType()),
-                        modifierManager));
-
-        if (modifierManager.contains(STATIC)) {
-            Arrays.stream(methodNode.getParameters()).forEach(e -> e.setInStaticContext(true));
-            methodNode.getVariableScope().setInStaticContext(true);
-        }
-
-        this.configureAST(methodNode, ctx);
-
-        validateMethodDeclaration(ctx, methodNode, modifierManager, classNode);
-
-        groovydocManager.handle(methodNode, ctx);
-
-        return methodNode;
-    }
-
-    private void validateMethodDeclaration(MethodDeclarationContext ctx, MethodNode methodNode, ModifierManager modifierManager, ClassNode classNode) {
-        boolean isAbstractMethod = methodNode.isAbstract();
-        boolean hasMethodBody = asBoolean(methodNode.getCode());
-
-        if (9 == ctx.ct) { // script
-            if (isAbstractMethod || !hasMethodBody) { // method should not be declared abstract in the script
-                throw createParsingFailedException("You can not define a " + (isAbstractMethod ? "abstract" : "") + " method[" + methodNode.getName() + "] " + (!hasMethodBody ? "without method body" : "") + " in the script. Try " + (isAbstractMethod ? "removing the 'abstract'" : "") + (isAbstractMethod && !hasMethodBody ? " and" : "") + (!hasMethodBody ? " adding a method body" : ""), methodNode);
-            }
-        } else {
-            if (!isAbstractMethod && !hasMethodBody) { // non-abstract method without body in the non-script(e.g. class, enum, trait) is not allowed!
-                throw createParsingFailedException("You defined a method[" + methodNode.getName() + "] without body. Try adding a method body, or declare it abstract", methodNode);
-            }
-
-            boolean isInterfaceOrAbstractClass = asBoolean(classNode) && classNode.isAbstract() && !classNode.isAnnotationDefinition();
-            if (isInterfaceOrAbstractClass && !modifierManager.contains(DEFAULT) && isAbstractMethod && hasMethodBody) {
-                throw createParsingFailedException("You defined an abstract method[" + methodNode.getName() + "] with body. Try removing the method body" + (classNode.isInterface() ? ", or declare it default" : ""), methodNode);
-            }
-        }
-
-        modifierManager.validate(methodNode);
-
-        if (methodNode instanceof ConstructorNode) {
-            modifierManager.validate((ConstructorNode) methodNode);
-        }
-    }
-
-    private MethodNode createScriptMethodNode(ModifierManager modifierManager, String methodName, ClassNode returnType, Parameter[] parameters, ClassNode[] exceptions, Statement code) {
-        MethodNode methodNode;
-        methodNode =
-                new MethodNode(
-                        methodName,
-                        modifierManager.contains(PRIVATE) ? Opcodes.ACC_PRIVATE : Opcodes.ACC_PUBLIC,
-                        returnType,
-                        parameters,
-                        exceptions,
-                        code);
-
-        modifierManager.processMethodNode(methodNode);
-        return methodNode;
-    }
-
-    private MethodNode createConstructorOrMethodNodeForClass(MethodDeclarationContext ctx, ModifierManager modifierManager, String methodName, ClassNode returnType, Parameter[] parameters, ClassNode[] exceptions, Statement code, ClassNode classNode) {
-        MethodNode methodNode;
-        String className = classNode.getNodeMetaData(CLASS_NAME);
-        int modifiers = modifierManager.getClassMemberModifiersOpValue();
-
-        if (!asBoolean(ctx.returnType())
-                && asBoolean(ctx.methodBody())
-                && methodName.equals(className)) { // constructor declaration
-
-            methodNode = createConstructorNodeForClass(methodName, parameters, exceptions, code, classNode, modifiers);
-        } else { // class memeber method declaration
-            methodNode = createMethodNodeForClass(ctx, modifierManager, methodName, returnType, parameters, exceptions, code, classNode, modifiers);
-        }
-
-        modifierManager.attachAnnotations(methodNode);
-        return methodNode;
-    }
-
-    private MethodNode createMethodNodeForClass(MethodDeclarationContext ctx, ModifierManager modifierManager, String methodName, ClassNode returnType, Parameter[] parameters, ClassNode[] exceptions, Statement code, ClassNode classNode, int modifiers) {
-        MethodNode methodNode;
-        if (asBoolean(ctx.elementValue())) { // the code of annotation method
-            code = this.configureAST(
-                    new ExpressionStatement(
-                            this.visitElementValue(ctx.elementValue())),
-                    ctx.elementValue());
-
-        }
-
-        modifiers |= !modifierManager.contains(STATIC) && (classNode.isInterface() || (isTrue(classNode, IS_INTERFACE_WITH_DEFAULT_METHODS) && !modifierManager.contains(DEFAULT))) ? Opcodes.ACC_ABSTRACT : 0;
-
-        checkWhetherMethodNodeWithSameSignatureExists(classNode, methodName, parameters, ctx);
-
-        methodNode = classNode.addMethod(methodName, modifiers, returnType, parameters, exceptions, code);
-
-        methodNode.setAnnotationDefault(asBoolean(ctx.elementValue()));
-        return methodNode;
-    }
-
-    private void checkWhetherMethodNodeWithSameSignatureExists(ClassNode classNode, String methodName, Parameter[] parameters, MethodDeclarationContext ctx) {
-        MethodNode sameSigMethodNode = classNode.getDeclaredMethod(methodName, parameters);
-
-        if (null == sameSigMethodNode) {
-            return;
-        }
-
-        throw createParsingFailedException("The method " +  sameSigMethodNode.getText() + " duplicates another method of the same signature", ctx);
-    }
-
-    private ConstructorNode createConstructorNodeForClass(String methodName, Parameter[] parameters, ClassNode[] exceptions, Statement code, ClassNode classNode, int modifiers) {
-        ConstructorCallExpression thisOrSuperConstructorCallExpression = this.checkThisAndSuperConstructorCall(code);
-        if (asBoolean(thisOrSuperConstructorCallExpression)) {
-            throw createParsingFailedException(thisOrSuperConstructorCallExpression.getText() + " should be the first statement in the constructor[" + methodName + "]", thisOrSuperConstructorCallExpression);
-        }
-
-        return classNode.addConstructor(
-                modifiers,
-                parameters,
-                exceptions,
-                code);
-    }
-
-    @Override
-    public String visitMethodName(MethodNameContext ctx) {
-        if (asBoolean(ctx.identifier())) {
-            return this.visitIdentifier(ctx.identifier());
-        }
-
-        if (asBoolean(ctx.stringLiteral())) {
-            return this.visitStringLiteral(ctx.stringLiteral()).getText();
-        }
-
-        throw createParsingFailedException("Unsupported method name: " + ctx.getText(), ctx);
-    }
-
-    @Override
-    public ClassNode visitReturnType(ReturnTypeContext ctx) {
-        if (!asBoolean(ctx)) {
-            return ClassHelper.OBJECT_TYPE;
-        }
-
-        if (asBoolean(ctx.type())) {
-            return this.visitType(ctx.type());
-        }
-
-        if (asBoolean(ctx.VOID())) {
-            return ClassHelper.VOID_TYPE;
-        }
-
-        throw createParsingFailedException("Unsupported return type: " + ctx.getText(), ctx);
-    }
-
-    @Override
-    public Statement visitMethodBody(MethodBodyContext ctx) {
-        if (!asBoolean(ctx)) {
-            return null;
-        }
-
-        return this.configureAST(this.visitBlock(ctx.block()), ctx);
-    }
-
-    @Override
-    public DeclarationListStatement visitLocalVariableDeclaration(LocalVariableDeclarationContext ctx) {
-        return this.configureAST(this.visitVariableDeclaration(ctx.variableDeclaration()), ctx);
-    }
-
-    private ModifierManager createModifierManager(VariableDeclarationContext ctx) {
-        List<ModifierNode> modifierNodeList = Collections.emptyList();
-
-        if (asBoolean(ctx.variableModifiers())) {
-            modifierNodeList = this.visitVariableModifiers(ctx.variableModifiers());
-        } else if (asBoolean(ctx.variableModifiersOpt())) {
-            modifierNodeList = this.visitVariableModifiersOpt(ctx.variableModifiersOpt());
-        } else if (asBoolean(ctx.modifiers())) {
-            modifierNodeList = this.visitModifiers(ctx.modifiers());
-        } else if (asBoolean(ctx.modifiersOpt())) {
-            modifierNodeList = this.visitModifiersOpt(ctx.modifiersOpt());
-        }
-
-        return new ModifierManager(this, modifierNodeList);
-    }
-
-    private DeclarationListStatement createMultiAssignmentDeclarationListStatement(VariableDeclarationContext ctx, ModifierManager modifierManager) {
-        if (!modifierManager.contains(DEF)) {
-            throw createParsingFailedException("keyword def is required to declare tuple, e.g. def (int a, int b) = [1, 2]", ctx);
-        }
-
-        return this.configureAST(
-                new DeclarationListStatement(
-                        this.configureAST(
-                                modifierManager.attachAnnotations(
-                                        new DeclarationExpression(
-                                                new ArgumentListExpression(
-                                                        this.visitTypeNamePairs(ctx.typeNamePairs()).stream()
-                                                                .peek(e -> modifierManager.processVariableExpression((VariableExpression) e))
-                                                                .collect(Collectors.toList())
-                                                ),
-                                                this.createGroovyTokenByType(ctx.ASSIGN().getSymbol(), Types.ASSIGN),
-                                                this.visitVariableInitializer(ctx.variableInitializer())
-                                        )
-                                ),
-                                ctx
-                        )
-                ),
-                ctx
-        );
-    }
-
-    @Override
-    public DeclarationListStatement visitVariableDeclaration(VariableDeclarationContext ctx) {
-        ModifierManager modifierManager = this.createModifierManager(ctx);
-
-        if (asBoolean(ctx.typeNamePairs())) { // e.g. def (int a, int b) = [1, 2]
-            return this.createMultiAssignmentDeclarationListStatement(ctx, modifierManager);
-        }
-
-        ClassNode variableType = this.visitType(ctx.type());
-        ctx.variableDeclarators().putNodeMetaData(VARIABLE_DECLARATION_VARIABLE_TYPE, variableType);
-        List<DeclarationExpression> declarationExpressionList = this.visitVariableDeclarators(ctx.variableDeclarators());
-
-        // if classNode is not null, the variable declaration is for class declaration. In other words, it is a field declaration
-        ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);
-
-        if (asBoolean(classNode)) {
-            return createFieldDeclarationListStatement(ctx, modifierManager, variableType, declarationExpressionList, classNode);
-        }
-
-        declarationExpressionList.forEach(e -> {
-            VariableExpression variableExpression = (VariableExpression) e.getLeftExpression();
-
-            modifierManager.processVariableExpression(variableExpression);
-            modifierManager.attachAnnotations(e);
-        });
-
-        int size = declarationExpressionList.size();
-        if (size > 0) {
-            DeclarationExpression declarationExpression = declarationExpressionList.get(0);
-
-            if (1 == size) {
-                this.configureAST(declarationExpression, ctx);
-            } else {
-                // Tweak start of first declaration
-                declarationExpression.setLineNumber(ctx.getStart().getLine());
-                declarationExpression.setColumnNumber(ctx.getStart().getCharPositionInLine() + 1);
-            }
-        }
-
-        return this.configureAST(new DeclarationListStatement(declarationExpressionList), ctx);
-    }
-
-    private DeclarationListStatement createFieldDeclarationListStatement(VariableDeclarationContext ctx, ModifierManager modifierManager, ClassNode variableType, List<DeclarationExpression> declarationExpressionList, ClassNode classNode) {
-        declarationExpressionList.forEach(e -> {
-            VariableExpression variableExpression = (VariableExpression) e.getLeftExpression();
-
-            int modifiers = modifierManager.getClassMemberModifiersOpValue();
-
-            Expression initialValue = EmptyExpression.INSTANCE.equals(e.getRightExpression()) ? null : e.getRightExpression();
-            Object defaultValue = findDefaultValueByType(variableType);
-
-            if (classNode.isInterface()) {
-                if (!asBoolean(initialValue)) {
-                    initialValue = !asBoolean(defaultValue) ? null : new ConstantExpression(defaultValue);
-                }
-
-                modifiers |= Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC | Opcodes.ACC_FINAL;
-            }
-
-            if (classNode.isInterface() || modifierManager.containsVisibilityModifier()) {
-                FieldNode fieldNode =
-                        classNode.addField(
-                                variableExpression.getName(),
-                                modifiers,
-                                variableType,
-                                initialValue);
-                modifierManager.attachAnnotations(fieldNode);
-
-                groovydocManager.handle(fieldNode, ctx);
-
-                this.configureAST(fieldNode, ctx);
-            } else {
-                PropertyNode propertyNode =
-                        classNode.addProperty(
-                                variableExpression.getName(),
-                                modifiers | Opcodes.ACC_PUBLIC,
-                                variableType,
-                                initialValue,
-                                null,
-                                null);
-
-                FieldNode fieldNode = propertyNode.getField();
-                fieldNode.setModifiers(modifiers & ~Opcodes.ACC_PUBLIC | Opcodes.ACC_PRIVATE);
-                fieldNode.setSynthetic(!classNode.isInterface());
-                modifierManager.attachAnnotations(fieldNode);
-
-                groovydocManager.handle(fieldNode, ctx);
-                groovydocManager.handle(propertyNode, ctx);
-
-                this.configureAST(fieldNode, ctx);
-                this.configureAST(propertyNode, ctx);
-            }
-
-        });
-
-        return null;
-    }
-
-    @Override
-    public List<Expression> visitTypeNamePairs(TypeNamePairsContext ctx) {
-        return ctx.typeNamePair().stream().map(this::visitTypeNamePair).collect(Collectors.toList());
-    }
-
-    @Override
-    public VariableExpression visitTypeNamePair(TypeNamePairContext ctx) {
-        return this.configureAST(
-                new VariableExpression(
-                        this.visitVariableDeclaratorId(ctx.variableDeclaratorId()).getName(),
-                        this.visitType(ctx.type())),
-                ctx);
-    }
-
-    @Override
-    public List<DeclarationExpression> visitVariableDeclarators(VariableDeclaratorsContext ctx) {
-        ClassNode variableType = ctx.getNodeMetaData(VARIABLE_DECLARATION_VARIABLE_TYPE);
-        Objects.requireNonNull(variableType, "variableType should not be null");
-
-        return ctx.variableDeclarator().stream()
-                .map(e -> {
-                    e.putNodeMetaData(VARIABLE_DECLARATION_VARIABLE_TYPE, variableType);
-                    return this.visitVariableDeclarator(e);
-//                    return this.configureAST(this.visitVariableDeclarator(e), ctx);
-                })
-                .collect(Collectors.toList());
-    }
-
-    @Override
-    public DeclarationExpression visitVariableDeclarator(VariableDeclaratorContext ctx) {
-        ClassNode variableType = ctx.getNodeMetaData(VARIABLE_DECLARATION_VARIABLE_TYPE);
-        Objects.requireNonNull(variableType, "variableType should not be null");
-
-        org.codehaus.groovy.syntax.Token token;
-        if (asBoolean(ctx.ASSIGN())) {
-            token = createGroovyTokenByType(ctx.ASSIGN().getSymbol(), Types.ASSIGN);
-        } else {
-            token = new org.codehaus.groovy.syntax.Token(Types.ASSIGN, ASSIGN_STR, ctx.start.getLine(), 1);
-        }
-
-        return this.configureAST(
-                new DeclarationExpression(
-                        this.configureAST(
-                                new VariableExpression(
-                                        this.visitVariableDeclaratorId(ctx.variableDeclaratorId()).getName(),
-                                        variableType
-                                ),
-                                ctx.variableDeclaratorId()),
-                        token,
-                        this.visitVariableInitializer(ctx.variableInitializer())),
-                ctx);
-    }
-
-    @Override
-    public Expression visitVariableInitializer(VariableInitializerContext ctx) {
-        if (!asBoolean(ctx)) {
-            return EmptyExpression.INSTANCE;
-        }
-
-        if (asBoolean(ctx.statementExpression())) {
-            return this.configureAST(
-                    ((ExpressionStatement) this.visit(ctx.statementExpression())).getExpression(),
-                    ctx);
-        }
-
-        if (asBoolean(ctx.standardLambda())) {
-            return this.configureAST(this.visitStandardLambda(ctx.standardLambda()), ctx);
-        }
-
-        throw createParsingFailedException("Unsupported variable initializer: " + ctx.getText(), ctx);
-    }
-
-    @Override
-    public List<Expression> visitVariableInitializers(VariableInitializersContext ctx) {
-        if (!asBoolean(ctx)) {
-            return Collections.emptyList();
-        }
-
-        return ctx.variableInitializer().stream()
-                        .map(this::visitVariableInitializer)
-                        .collect(Collectors.toList());
-    }
-
-    @Override
-    public List<Expression> visitArrayInitializer(ArrayInitializerContext ctx) {
-        if (!asBoolean(ctx)) {
-            return Collections.emptyList();
-        }
-
-        return this.visitVariableInitializers(ctx.variableInitializers());
-    }
-
-    @Override
-    public Statement visitBlock(BlockContext ctx) {
-        if (!asBoolean(ctx)) {
-            return this.createBlockStatement();
-        }
-
-        return this.configureAST(
-                this.visitBlockStatementsOpt(ctx.blockStatementsOpt()),
-                ctx);
-    }
-
-
-    @Override
-    public ExpressionStatement visitNormalExprAlt(NormalExprAltContext ctx) {
-        return this.configureAST(new ExpressionStatement((Expression) this.visit(ctx.expression())), ctx);
-    }
-
-    @Override
-    public ExpressionStatement visitCommandExprAlt(CommandExprAltContext ctx) {
-        return this.configureAST(new ExpressionStatement(this.visitCommandExpression(ctx.commandExpression())), ctx);
-    }
-
-    @Override
-    public Expression visitCommandExpression(CommandExpressionContext ctx) {
-        Expression baseExpr = this.visitPathExpression(ctx.pathExpression());
-        Expression arguments = this.visitEnhancedArgumentList(ctx.enhancedArgumentList());
-
-        MethodCallExpression methodCallExpression;
-        if (baseExpr instanceof PropertyExpression) { // e.g. obj.a 1, 2
-            methodCallExpression =
-                    this.configureAST(
-                            this.createMethodCallExpression(
-                                    (PropertyExpression) baseExpr, arguments),
-                            arguments);
-
-        } else if (baseExpr instanceof MethodCallExpression && !isTrue(baseExpr, IS_INSIDE_PARENTHESES)) { // e.g. m {} a, b  OR  m(...) a, b
-            if (asBoolean(arguments)) {
-                // The error should never be thrown.
-                throw new GroovyBugError("When baseExpr is a instance of MethodCallExpression, which should follow NO argumentList");
-            }
-
-            methodCallExpression = (MethodCallExpression) baseExpr;
-        } else if (
-                !isTrue(baseExpr, IS_INSIDE_PARENTHESES)
-                        && (baseExpr instanceof VariableExpression /* e.g. m 1, 2 */
-                        || baseExpr instanceof GStringExpression /* e.g. "$m" 1, 2 */
-                        || (baseExpr instanceof ConstantExpression && isTrue(baseExpr, IS_STRING)) /* e.g. "m" 1, 2 */)
-                ) {
-            methodCallExpression =
-                    this.configureAST(
-                            this.createMethodCallExpression(baseExpr, arguments),
-                            arguments);
-        } else { // e.g. a[x] b, new A() b, etc.
-            methodCallExpression =
-                    this.configureAST(
-                            new MethodCallExpression(
-                                    baseExpr,
-                                    CALL_STR,
-                                    arguments
-                            ),
-                            arguments
-                    );
-
-            methodCallExpression.setImplicitThis(false);
-        }
-
-        if (!asBoolean(ctx.commandArgument())) {
-            return this.configureAST(methodCallExpression, ctx);
-        }
-
-        return this.configureAST(
-                (Expression) ctx.commandArgument().stream()
-                        .map(e -> (Object) e)
-                        .reduce(methodCallExpression,
-                                (r, e) -> {
-                                    CommandArgumentContext commandArgumentContext = (CommandArgumentContext) e;
-                                    commandArgumentContext.putNodeMetaData(CMD_EXPRESSION_BASE_EXPR, r);
-
-                                    return this.visitCommandArgument(commandArgumentContext);
-                                }
-                        ),
-                ctx);
-    }
-
-    @Override
-    public Expression visitCommandArgument(CommandArgumentContext ctx) {
-        // e.g. x y a b     we call "x y" as the base expression
-        Expression baseExpr = ctx.getNodeMetaData(CMD_EXPRESSION_BASE_EXPR);
-
-        Expression primaryExpr = (Expression) this.visit(ctx.primary());
-
-        if (asBoolean(ctx.enhancedArgumentList())) { // e.g. x y a b
-            if (baseExpr instanceof PropertyExpression) { // the branch should never reach, because a.b.c will be parsed as a path expression, not a method call
-                throw createParsingFailedException("Unsupported command argument: " + ctx.getText(), ctx);
-            }
-
-            // the following code will process "a b" of "x y a b"
-            MethodCallExpression methodCallExpression =
-                    new MethodCallExpression(
-                            baseExpr,
-                            this.createConstantExpression(primaryExpr),
-                            this.visitEnhancedArgumentList(ctx.enhancedArgumentList())
-                    );
-            methodCallExpression.setImplicitThis(false);
-
-            return this.configureAST(methodCallExpression, ctx);
-        } else if (asBoolean(ctx.pathElement())) { // e.g. x y a.b
-            Expression pathExpression =
-                    this.createPathExpression(
-                            this.configureAST(
-                                    new PropertyExpression(baseExpr, this.createConstantExpression(primaryExpr)),
-                                    primaryExpr
-                            ),
-                            ctx.pathElement()
-                    );
-
-            return this.configureAST(pathExpression, ctx);
-        }
-
-        // e.g. x y a
-        return this.configureAST(
-                new PropertyExpression(
-                        baseExpr,
-                        primaryExpr instanceof VariableExpression
-                                ? this.createConstantExpression(primaryExpr)
-                                : primaryExpr
-                ),
-                primaryExpr
-        );
-    }
-
-
-    // expression {    --------------------------------------------------------------------
-
-    @Override
-    public ClassNode visitCastParExpression(CastParExpressionContext ctx) {
-        return this.visitType(ctx.type());
-    }
-
-    @Override
-    public Expression visitParExpression(ParExpressionContext ctx) {
-        Expression expression;
-
-        if (asBoolean(ctx.statementExpression())) {
-            expression = ((ExpressionStatement) this.visit(ctx.statementExpression())).getExpression();
-        } else if (asBoolean(ctx.standardLambda())) {
-            expression = this.visitStandardLambda(ctx.standardLambda());
-        } else {
-            throw createParsingFailedException("Unsupported parentheses expression: " + ctx.getText(), ctx);
-        }
-
-        expression.putNodeMetaData(IS_INSIDE_PARENTHESES, true);
-
-        Integer insideParenLevel = expression.getNodeMetaData(INSIDE_PARENTHESES_LEVEL);
-        if (asBoolean((Object) insideParenLevel)) {
-            insideParenLevel++;
-        } else {
-            insideParenLevel = 1;
-        }
-        expression.putNodeMetaData(INSIDE_PARENTHESES_LEVEL, insideParenLevel);
-
-        return this.configureAST(expression, ctx);
-    }
-
-    @Override
-    public Expression visitPathExpression(PathExpressionContext ctx) {
-        return this.configureAST(
-                this.createPathExpression((Expression) this.visit(ctx.primary()), ctx.pathElement()),
-                ctx);
-    }
-
-    @Override
-    public Expression visitPathElement(PathElementContext ctx) {
-        Expression baseExpr = ctx.getNodeMetaData(PATH_EXPRESSION_BASE_EXPR);
-        Objects.requireNonNull(baseExpr, "baseExpr is required!");
-
-        if (asBoolean(ctx.namePart())) {
-            Expression namePartExpr = this.visitNamePart(ctx.namePart());
-            GenericsType[] genericsTypes = this.visitNonWildcardTypeArguments(ctx.nonWildcardTypeArguments());
-
-
-            if (asBoolean(ctx.DOT())) {
-                if (asBoolean(ctx.AT())) { // e.g. obj.@a
-                    return this.configureAST(new AttributeExpression(baseExpr, namePartExpr), ctx);
-                } else { // e.g. obj.p
-                    PropertyExpression propertyExpression = new PropertyExpression(baseExpr, namePartExpr);
-                    propertyExpression.putNodeMetaData(PATH_EXPRESSION_BASE_EXPR_GENERICS_TYPES, genericsTypes);
-
-                    return this.configureAST(propertyExpression, ctx);
-                }
-            } else if (asBoolean(ctx.SAFE_DOT())) {
-                if (asBoolean(ctx.AT())) { // e.g. obj?.@a
-                    return this.configureAST(new AttributeExpression(baseExpr, namePartExpr, true), ctx);
-                } else { // e.g. obj?.p
-                    PropertyExpression propertyExpression = new PropertyExpression(baseExpr, namePartExpr, true);
-                    propertyExpression.putNodeMetaData(PATH_EXPRESSION_BASE_EXPR_GENERICS_TYPES, genericsTypes);
-
-                    return this.configureAST(propertyExpression, ctx);
-                }
-            } else if (asBoolean(ctx.METHOD_POINTER())) { // e.g. obj.&m
-                return this.configureAST(new MethodPointerExpression(baseExpr, namePartExpr), ctx);
-            } else if (asBoolean(ctx.METHOD_REFERENCE())) { // e.g. obj::m
-                return this.configureAST(new MethodReferenceExpression(baseExpr, namePartExpr), ctx);
-            } else if (asBoolean(ctx.SPREAD_DOT())) {
-                if (asBoolean(ctx.AT())) { // e.g. obj*.@a
-                    AttributeExpression attributeExpression = new AttributeExpression(baseExpr, namePartExpr, true);
-
-                    attributeExpression.setSpreadSafe(true);
-
-                    return this.configureAST(attributeExpression, ctx);
-                } else { // e.g. obj*.p
-                    PropertyExpression propertyExpression = new PropertyExpression(baseExpr, namePartExpr, true);
-                    propertyExpression.putNodeMetaData(PATH_EXPRESSION_BASE_EXPR_GENERICS_TYPES, genericsTypes);
-
-                    propertyExpression.setSpreadSafe(true);
-
-                    return this.configureAST(propertyExpression, ctx);
-                }
-            }
-        }
-
-        if (asBoolean(ctx.indexPropertyArgs())) { // e.g. list[1, 3, 5]
-            Pair<Token, Expression> pair = this.visitIndexPropertyArgs(ctx.indexPropertyArgs());
-
-            return this.configureAST(
-                    new BinaryExpression(baseExpr, createGroovyToken(pair.getKey()), pair.getValue(), asBoolean(ctx.indexPropertyArgs().QUESTION())),
-                    ctx);
-        }
-
-        if (asBoolean(ctx.namedPropertyArgs())) { // this is a special way to new instance, e.g. Person(name: 'Daniel.Sun', location: 'Shanghai')
-            List<MapEntryExpression> mapEntryExpressionList =
-                    this.visitNamedPropertyArgs(ctx.namedPropertyArgs());
-
-            Expression right;
-            if (mapEntryExpressionList.size() == 1) {
-                MapEntryExpression mapEntryExpression = mapEntryExpressionList.get(0);
-
-                if (mapEntryExpression.getKeyExpression() instanceof SpreadMapExpression) {
-                    right = mapEntryExpression.getKeyExpression();
-                } else {
-                    right = mapEntryExpression;
-                }
-            } else {
-                ListExpression listExpression =
-                        this.configureAST(
-                                new ListExpression(
-                                        mapEntryExpressionList.stream()
-                                                .map(
-                                                        e -> {
-                                                            if (e.getKeyExpression() instanceof SpreadMapExpression) {
-                                                                return e.getKeyExpression();
-                                                            }
-
-                                                            return e;
-                                                        }
-                                                )
-                                                .collect(Collectors.toList())),
-                                ctx.namedPropertyArgs()
-                        );
-                listExpression.setWrapped(true);
-                right = listExpression;
-            }
-
-            return this.configureAST(
-                    new BinaryExpression(baseExpr, createGroovyToken(ctx.namedPropertyArgs().LBRACK().getSymbol()), right),
-                    ctx);
-        }
-
-        if (asBoolean(ctx.arguments())) {
-            Expression argumentsExpr = this.visitArguments(ctx.arguments());
-
-            if (isTrue(baseExpr, IS_INSIDE_PARENTHESES)) { // e.g. (obj.x)(), (obj.@x)()
-                MethodCallExpression methodCallExpression =
-                        new MethodCallExpression(
-                                baseExpr,
-                                CALL_STR,
-                                argumentsExpr
-                        );
-
-                methodCallExpression.setImplicitThis(false);
-
-                return this.configureAST(methodCallExpression, ctx);
-            }
-
-            if (baseExpr instanceof AttributeExpression) { // e.g. obj.@a(1, 2)
-                AttributeExpression attributeExpression = (AttributeExpression) baseExpr;
-                attributeExpression.setSpreadSafe(false); // whether attributeExpression is spread safe or not, we must reset it as false
-
-                MethodCallExpression methodCallExpression =
-                        new MethodCallExpression(
-                                attributeExpression,
-                                CALL_STR,
-                                argumentsExpr
-                        );
-
-                return this.configureAST(methodCallExpression, ctx);
-            }
-
-            if (baseExpr instanceof PropertyExpression) { // e.g. obj.a(1, 2)
-                MethodCallExpression methodCallExpression =
-                        this.createMethodCallExpression((PropertyExpression) baseExpr, argumentsExpr);
-
-                return this.configureAST(methodCallExpression, ctx);
-            }
-
-            if (baseExpr instanceof VariableExpression) { // void and primitive type AST node must be an instance of VariableExpression
-                String baseExprText = baseExpr.getText();
-                if (VOID_STR.equals(baseExprText)) { // e.g. void()
-                    MethodCallExpression methodCallExpression =
-                            new MethodCallExpression(
-                                    this.createConstantExpression(baseExpr),
-                                    CALL_STR,
-                                    argumentsExpr
-                            );
-
-                    methodCallExpression.setImplicitThis(false);
-
-                    return this.configureAST(methodCallExpression, ctx);
-                } else if (PRIMITIVE_TYPE_SET.contains(baseExprText)) { // e.g. int(), long(), float(), etc.
-                    throw createParsingFailedException("Primitive type literal: " + baseExprText + " cannot be used as a method name", ctx);
-                }
-            }
-
-            if (baseExpr instanceof VariableExpression
-                    || baseExpr instanceof GStringExpression
-                    || (baseExpr instanceof ConstantExpression && isTrue(baseExpr, IS_STRING))) { // e.g. m(), "$m"(), "m"()
-
-          

<TRUNCATED>

[20/50] [abbrv] groovy git commit: GROOVY-8176: tap - exception in phase 'instruction selection' (closes #535)

Posted by pa...@apache.org.
GROOVY-8176: tap - exception in phase 'instruction selection' (closes #535)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/2c63110e
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/2c63110e
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/2c63110e

Branch: refs/heads/parrot
Commit: 2c63110e9920fa9127d405bca573b2a01f73dbf5
Parents: 55ee3c5
Author: paulk <pa...@asert.com.au>
Authored: Fri May 5 13:36:41 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:10:17 2017 +1000

----------------------------------------------------------------------
 .../groovy/ast/tools/WideningCategories.java    |  6 +--
 src/test/groovy/bugs/Groovy8176Bug.groovy       | 40 ++++++++++++++++++++
 2 files changed, 43 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/2c63110e/src/main/org/codehaus/groovy/ast/tools/WideningCategories.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/ast/tools/WideningCategories.java b/src/main/org/codehaus/groovy/ast/tools/WideningCategories.java
index a8dcf22..6f89b60 100644
--- a/src/main/org/codehaus/groovy/ast/tools/WideningCategories.java
+++ b/src/main/org/codehaus/groovy/ast/tools/WideningCategories.java
@@ -232,9 +232,9 @@ public class WideningCategories {
         // it according to the types provided by the two class nodes
         ClassNode holderForA = findGenericsTypeHolderForClass(a, lub);
         ClassNode holderForB = findGenericsTypeHolderForClass(b, lub);
-        // lets compare their generics type
-        GenericsType[] agt = holderForA.getGenericsTypes();
-        GenericsType[] bgt = holderForB.getGenericsTypes();
+        // let's compare their generics type
+        GenericsType[] agt = holderForA == null ? null : holderForA.getGenericsTypes();
+        GenericsType[] bgt = holderForB == null ? null : holderForB.getGenericsTypes();
         if (agt==null || bgt==null || agt.length!=bgt.length) {
             return lub;
         }

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c63110e/src/test/groovy/bugs/Groovy8176Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy8176Bug.groovy b/src/test/groovy/bugs/Groovy8176Bug.groovy
new file mode 100644
index 0000000..5c52122
--- /dev/null
+++ b/src/test/groovy/bugs/Groovy8176Bug.groovy
@@ -0,0 +1,40 @@
+/*
+ *  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.
+ */
+package groovy.bugs
+
+class Groovy8176Bug extends GroovyTestCase {
+    void testTernaryWithTap() {
+        assertScript '''
+            import groovy.transform.CompileStatic
+
+            @CompileStatic
+            static <M extends Map> M merge(M to, Map from) {
+                !from ? to : to.tap {
+                    one = from['one']
+                    two = from['two']
+                }
+            }
+
+            def orig = [:]
+            def result = merge(orig, [one: 1, two: 2.0])
+            assert result == [one: 1, two: 2.0]
+            assert result.is(orig)
+        '''
+    }
+}


[26/50] [abbrv] groovy git commit: Sql, DataSet: Add @ClosureParams to closure parameters of following methods (closes #536): * asList * eachRow * each * query * rows * withStatement

Posted by pa...@apache.org.
Sql, DataSet: Add @ClosureParams to closure parameters of following methods (closes #536):
* asList
* eachRow
* each
* query
* rows
* withStatement


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/931b6eb9
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/931b6eb9
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/931b6eb9

Branch: refs/heads/parrot
Commit: 931b6eb9ef93bc400d6b06e89d9c62e16ab7927c
Parents: c26bf46
Author: Shil Sinha <sh...@apache.org>
Authored: Sun Apr 30 20:01:27 2017 -0400
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:11:04 2017 +1000

----------------------------------------------------------------------
 .../src/main/java/groovy/sql/DataSet.java       |   7 +-
 .../src/main/java/groovy/sql/Sql.java           | 118 ++++++++++++-------
 .../test/groovy/groovy/sql/SqlSTCTest.groovy    |  82 +++++++++++++
 3 files changed, 164 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/931b6eb9/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java b/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java
index 6e5f0f8..b294be0 100644
--- a/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java
+++ b/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java
@@ -20,6 +20,8 @@ package groovy.sql;
 
 import groovy.lang.Closure;
 import groovy.lang.GroovyRuntimeException;
+import groovy.transform.stc.ClosureParams;
+import groovy.transform.stc.SimpleType;
 import org.codehaus.groovy.ast.ClassNode;
 import org.codehaus.groovy.ast.MethodNode;
 import org.codehaus.groovy.ast.CodeVisitorSupport;
@@ -332,7 +334,7 @@ public class DataSet extends Sql {
      * @throws SQLException if a database access error occurs
      * @see groovy.sql.Sql#eachRow(String, java.util.List, groovy.lang.Closure)
      */
-    public void each(Closure closure) throws SQLException {
+    public void each(@ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure closure) throws SQLException {
         eachRow(getSql(), getParameters(), closure);
     }
 
@@ -346,7 +348,8 @@ public class DataSet extends Sql {
      * @throws SQLException if a database access error occurs
      * @see groovy.sql.Sql#eachRow(String, java.util.List, int, int, groovy.lang.Closure)
      */
-    public void each(int offset, int maxRows, Closure closure) throws SQLException {
+    public void each(int offset, int maxRows,
+                     @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure closure) throws SQLException {
         eachRow(getSql(), getParameters(), offset, maxRows, closure);
     }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/931b6eb9/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java b/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
index fd0ff13..87b3df6 100644
--- a/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
+++ b/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
@@ -42,6 +42,8 @@ import javax.sql.DataSource;
 
 import groovy.lang.MissingPropertyException;
 import groovy.lang.Tuple;
+import groovy.transform.stc.ClosureParams;
+import groovy.transform.stc.SimpleType;
 import org.codehaus.groovy.runtime.InvokerHelper;
 
 import static org.codehaus.groovy.runtime.SqlGroovyMethods.toRowResult;
@@ -960,7 +962,7 @@ public class Sql {
      * @param closure called for each row with a <code>ResultSet</code>
      * @throws SQLException if a database access error occurs
      */
-    public void query(String sql, Closure closure) throws SQLException {
+    public void query(String sql, @ClosureParams(value=SimpleType.class, options="java.sql.ResultSet") Closure closure) throws SQLException {
         Connection connection = createConnection();
         Statement statement = null;
         ResultSet results = null;
@@ -1000,7 +1002,7 @@ public class Sql {
      * @param closure called for each row with a <code>ResultSet</code>
      * @throws SQLException if a database access error occurs
      */
-    public void query(String sql, List<Object> params, Closure closure) throws SQLException {
+    public void query(String sql, List<Object> params, @ClosureParams(value=SimpleType.class, options="java.sql.ResultSet") Closure closure) throws SQLException {
         Connection connection = createConnection();
         PreparedStatement statement = null;
         ResultSet results = null;
@@ -1026,7 +1028,7 @@ public class Sql {
      * @throws SQLException if a database access error occurs
      * @since 1.8.7
      */
-    public void query(String sql, Map map, Closure closure) throws SQLException {
+    public void query(String sql, Map map, @ClosureParams(value=SimpleType.class, options="java.sql.ResultSet") Closure closure) throws SQLException {
         query(sql, singletonList(map), closure);
     }
 
@@ -1040,7 +1042,7 @@ public class Sql {
      * @throws SQLException if a database access error occurs
      * @since 1.8.7
      */
-    public void query(Map map, String sql, Closure closure) throws SQLException {
+    public void query(Map map, String sql, @ClosureParams(value=SimpleType.class, options="java.sql.ResultSet") Closure closure) throws SQLException {
         query(sql, singletonList(map), closure);
     }
 
@@ -1072,7 +1074,7 @@ public class Sql {
      * @throws SQLException if a database access error occurs
      * @see #expand(Object)
      */
-    public void query(GString gstring, Closure closure) throws SQLException {
+    public void query(GString gstring, @ClosureParams(value=SimpleType.class, options="java.sql.ResultSet") Closure closure) throws SQLException {
         List<Object> params = getParameters(gstring);
         String sql = asSql(gstring, params);
         query(sql, params, closure);
@@ -1100,7 +1102,7 @@ public class Sql {
      * @param closure called for each row with a GroovyResultSet
      * @throws SQLException if a database access error occurs
      */
-    public void eachRow(String sql, Closure closure) throws SQLException {
+    public void eachRow(String sql, @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure closure) throws SQLException {
         eachRow(sql, (Closure) null, closure);
     }
 
@@ -1127,7 +1129,8 @@ public class Sql {
      * @param closure called for each row with a GroovyResultSet
      * @throws SQLException if a database access error occurs
      */
-    public void eachRow(String sql, int offset, int maxRows, Closure closure) throws SQLException {
+    public void eachRow(String sql, int offset, int maxRows,
+                        @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure closure) throws SQLException {
         eachRow(sql, (Closure) null, offset, maxRows, closure);
     }
 
@@ -1161,7 +1164,8 @@ public class Sql {
      * @param rowClosure  called for each row with a GroovyResultSet
      * @throws SQLException if a database access error occurs
      */
-    public void eachRow(String sql, Closure metaClosure, Closure rowClosure) throws SQLException {
+    public void eachRow(String sql, @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure,
+                        @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure rowClosure) throws SQLException {
         eachRow(sql, metaClosure, 0, 0, rowClosure);
     }
 
@@ -1192,7 +1196,9 @@ public class Sql {
      * @param rowClosure  called for each row with a GroovyResultSet
      * @throws SQLException if a database access error occurs
      */
-    public void eachRow(String sql, Closure metaClosure, int offset, int maxRows, Closure rowClosure) throws SQLException {
+    public void eachRow(String sql,
+                        @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure, int offset, int maxRows,
+                        @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure rowClosure) throws SQLException {
         Connection connection = createConnection();
         Statement statement = null;
         ResultSet results = null;
@@ -1256,7 +1262,9 @@ public class Sql {
      * @param rowClosure  called for each row with a GroovyResultSet
      * @throws SQLException if a database access error occurs
      */
-    public void eachRow(String sql, List<Object> params, Closure metaClosure, int offset, int maxRows, Closure rowClosure) throws SQLException {
+    public void eachRow(String sql, List<Object> params,
+                        @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure, int offset, int maxRows,
+                        @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure rowClosure) throws SQLException {
         Connection connection = createConnection();
         PreparedStatement statement = null;
         ResultSet results = null;
@@ -1293,7 +1301,9 @@ public class Sql {
      * @throws SQLException if a database access error occurs
      * @since 1.8.7
      */
-    public void eachRow(String sql, Map map, Closure metaClosure, int offset, int maxRows, Closure rowClosure) throws SQLException {
+    public void eachRow(String sql, Map map,
+                        @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure, int offset, int maxRows,
+                        @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure rowClosure) throws SQLException {
         eachRow(sql, singletonList(map), metaClosure, offset, maxRows, rowClosure);
     }
 
@@ -1310,7 +1320,9 @@ public class Sql {
      * @throws SQLException if a database access error occurs
      * @since 1.8.7
      */
-    public void eachRow(Map map, String sql, Closure metaClosure, int offset, int maxRows, Closure rowClosure) throws SQLException {
+    public void eachRow(Map map, String sql,
+                        @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure, int offset, int maxRows,
+                        @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure rowClosure) throws SQLException {
         eachRow(sql, singletonList(map), metaClosure, offset, maxRows, rowClosure);
     }
 
@@ -1348,7 +1360,9 @@ public class Sql {
      * @param rowClosure  called for each row with a GroovyResultSet
      * @throws SQLException if a database access error occurs
      */
-    public void eachRow(String sql, List<Object> params, Closure metaClosure, Closure rowClosure) throws SQLException {
+    public void eachRow(String sql, List<Object> params,
+                        @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure,
+                        @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure rowClosure) throws SQLException {
         eachRow(sql, params, metaClosure, 0, 0, rowClosure);
     }
 
@@ -1363,7 +1377,9 @@ public class Sql {
      * @throws SQLException if a database access error occurs
      * @since 1.8.7
      */
-    public void eachRow(String sql, Map params, Closure metaClosure, Closure rowClosure) throws SQLException {
+    public void eachRow(String sql, Map params,
+                        @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure,
+                        @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure rowClosure) throws SQLException {
         eachRow(sql, singletonList(params), metaClosure, rowClosure);
     }
 
@@ -1378,7 +1394,9 @@ public class Sql {
      * @throws SQLException if a database access error occurs
      * @since 1.8.7
      */
-    public void eachRow(Map params, String sql, Closure metaClosure, Closure rowClosure) throws SQLException {
+    public void eachRow(Map params, String sql,
+                        @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure,
+                        @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure rowClosure) throws SQLException {
         eachRow(sql, singletonList(params), metaClosure, rowClosure);
     }
 
@@ -1402,7 +1420,8 @@ public class Sql {
      * @param closure called for each row with a GroovyResultSet
      * @throws SQLException if a database access error occurs
      */
-    public void eachRow(String sql, List<Object> params, Closure closure) throws SQLException {
+    public void eachRow(String sql, List<Object> params,
+                        @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure closure) throws SQLException {
         eachRow(sql, params, null, closure);
     }
 
@@ -1416,7 +1435,8 @@ public class Sql {
      * @throws SQLException if a database access error occurs
      * @since 1.8.7
      */
-    public void eachRow(String sql, Map params, Closure closure) throws SQLException {
+    public void eachRow(String sql, Map params,
+                        @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure closure) throws SQLException {
         eachRow(sql, singletonList(params), closure);
     }
 
@@ -1430,7 +1450,8 @@ public class Sql {
      * @throws SQLException if a database access error occurs
      * @since 1.8.7
      */
-    public void eachRow(Map params, String sql, Closure closure) throws SQLException {
+    public void eachRow(Map params, String sql,
+                        @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure closure) throws SQLException {
         eachRow(sql, singletonList(params), closure);
     }
 
@@ -1457,7 +1478,8 @@ public class Sql {
      * @param closure called for each row with a GroovyResultSet
      * @throws SQLException if a database access error occurs
      */
-    public void eachRow(String sql, List<Object> params, int offset, int maxRows, Closure closure) throws SQLException {
+    public void eachRow(String sql, List<Object> params, int offset, int maxRows,
+                        @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure closure) throws SQLException {
         eachRow(sql, params, null, offset, maxRows, closure);
     }
 
@@ -1473,7 +1495,8 @@ public class Sql {
      * @throws SQLException if a database access error occurs
      * @since 1.8.7
      */
-    public void eachRow(String sql, Map params, int offset, int maxRows, Closure closure) throws SQLException {
+    public void eachRow(String sql, Map params, int offset, int maxRows,
+                        @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure closure) throws SQLException {
         eachRow(sql, singletonList(params), offset, maxRows, closure);
     }
 
@@ -1489,7 +1512,8 @@ public class Sql {
      * @throws SQLException if a database access error occurs
      * @since 1.8.7
      */
-    public void eachRow(Map params, String sql, int offset, int maxRows, Closure closure) throws SQLException {
+    public void eachRow(Map params, String sql, int offset, int maxRows,
+                        @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure closure) throws SQLException {
         eachRow(sql, singletonList(params), offset, maxRows, closure);
     }
 
@@ -1526,7 +1550,8 @@ public class Sql {
      * @throws SQLException if a database access error occurs
      * @see #expand(Object)
      */
-    public void eachRow(GString gstring, Closure metaClosure, Closure rowClosure) throws SQLException {
+    public void eachRow(GString gstring, @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure,
+                        @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure rowClosure) throws SQLException {
         List<Object> params = getParameters(gstring);
         String sql = asSql(gstring, params);
         eachRow(sql, params, metaClosure, rowClosure);
@@ -1557,7 +1582,9 @@ public class Sql {
      * @param rowClosure  called for each row with a GroovyResultSet
      * @throws SQLException if a database access error occurs
      */
-    public void eachRow(GString gstring, Closure metaClosure, int offset, int maxRows, Closure rowClosure) throws SQLException {
+    public void eachRow(GString gstring,
+                        @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure, int offset, int maxRows,
+                        @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure rowClosure) throws SQLException {
         List<Object> params = getParameters(gstring);
         String sql = asSql(gstring, params);
         eachRow(sql, params, metaClosure, offset, maxRows, rowClosure);
@@ -1585,7 +1612,8 @@ public class Sql {
      * @param closure called for each row with a GroovyResultSet
      * @throws SQLException if a database access error occurs
      */
-    public void eachRow(GString gstring, int offset, int maxRows, Closure closure) throws SQLException {
+    public void eachRow(GString gstring, int offset, int maxRows,
+                        @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure closure) throws SQLException {
         List<Object> params = getParameters(gstring);
         String sql = asSql(gstring, params);
         eachRow(sql, params, offset, maxRows, closure);
@@ -1612,7 +1640,7 @@ public class Sql {
      * @throws SQLException if a database access error occurs
      * @see #expand(Object)
      */
-    public void eachRow(GString gstring, Closure closure) throws SQLException {
+    public void eachRow(GString gstring, @ClosureParams(value=SimpleType.class, options="groovy.sql.GroovyResultSet") Closure closure) throws SQLException {
         eachRow(gstring, null, closure);
     }
 
@@ -1680,7 +1708,8 @@ public class Sql {
      * @return a list of GroovyRowResult objects
      * @throws SQLException if a database access error occurs
      */
-    public List<GroovyRowResult> rows(String sql, Closure metaClosure) throws SQLException {
+    public List<GroovyRowResult> rows(String sql, @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure)
+            throws SQLException {
         return rows(sql, 0, 0, metaClosure);
     }
 
@@ -1708,7 +1737,8 @@ public class Sql {
      * @return a list of GroovyRowResult objects
      * @throws SQLException if a database access error occurs
      */
-    public List<GroovyRowResult> rows(String sql, int offset, int maxRows, Closure metaClosure) throws SQLException {
+    public List<GroovyRowResult> rows(String sql, int offset, int maxRows,
+                                      @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure) throws SQLException {
         AbstractQueryCommand command = createQueryCommand(sql);
         // for efficiency set maxRows (adjusted for the first offset rows we are going to skip the cursor over)
         command.setMaxRows(offset + maxRows);
@@ -1898,8 +1928,8 @@ public class Sql {
      * @return a list of GroovyRowResult objects
      * @throws SQLException if a database access error occurs
      */
-    public List<GroovyRowResult> rows(String sql, List<Object> params, Closure metaClosure)
-            throws SQLException {
+    public List<GroovyRowResult> rows(String sql, List<Object> params,
+                                      @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure) throws SQLException {
         return rows(sql, params, 0, 0, metaClosure);
     }
 
@@ -1914,7 +1944,8 @@ public class Sql {
      * @throws SQLException if a database access error occurs
      * @since 1.8.7
      */
-    public List<GroovyRowResult> rows(String sql, Map params, Closure metaClosure) throws SQLException {
+    public List<GroovyRowResult> rows(String sql, Map params,
+                                      @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure) throws SQLException {
         return rows(sql, singletonList(params), metaClosure);
     }
 
@@ -1929,7 +1960,8 @@ public class Sql {
      * @throws SQLException if a database access error occurs
      * @since 1.8.7
      */
-    public List<GroovyRowResult> rows(Map params, String sql, Closure metaClosure) throws SQLException {
+    public List<GroovyRowResult> rows(Map params, String sql,
+                                      @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure) throws SQLException {
         return rows(sql, singletonList(params), metaClosure);
     }
 
@@ -1962,9 +1994,8 @@ public class Sql {
      * @return a list of GroovyRowResult objects
      * @throws SQLException if a database access error occurs
      */
-    public List<GroovyRowResult> rows(String sql, List<Object> params, int offset, int maxRows, Closure metaClosure)
-            throws SQLException {
-
+    public List<GroovyRowResult> rows(String sql, List<Object> params, int offset, int maxRows,
+                                      @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure) throws SQLException {
         AbstractQueryCommand command = createPreparedQueryCommand(sql, params);
         // for efficiency set maxRows (adjusted for the first offset rows we are going to skip the cursor over)
         command.setMaxRows(offset + maxRows);
@@ -1988,7 +2019,8 @@ public class Sql {
      * @throws SQLException if a database access error occurs
      * @since 1.8.7
      */
-    public List<GroovyRowResult> rows(String sql, Map params, int offset, int maxRows, Closure metaClosure) throws SQLException {
+    public List<GroovyRowResult> rows(String sql, Map params, int offset, int maxRows,
+                                      @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure) throws SQLException {
         return rows(sql, singletonList(params), offset, maxRows, metaClosure);
     }
 
@@ -2005,7 +2037,8 @@ public class Sql {
      * @throws SQLException if a database access error occurs
      * @since 1.8.7
      */
-    public List<GroovyRowResult> rows(Map params, String sql, int offset, int maxRows, Closure metaClosure) throws SQLException {
+    public List<GroovyRowResult> rows(Map params, String sql, int offset, int maxRows,
+                                      @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure) throws SQLException {
         return rows(sql, singletonList(params), offset, maxRows, metaClosure);
     }
 
@@ -2079,7 +2112,7 @@ public class Sql {
      * @throws SQLException if a database access error occurs
      * @see #expand(Object)
      */
-    public List<GroovyRowResult> rows(GString gstring, Closure metaClosure)
+    public List<GroovyRowResult> rows(GString gstring, @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure)
             throws SQLException {
         List<Object> params = getParameters(gstring);
         String sql = asSql(gstring, params);
@@ -2111,7 +2144,8 @@ public class Sql {
      * @return a list of GroovyRowResult objects
      * @throws SQLException if a database access error occurs
      */
-    public List<GroovyRowResult> rows(GString gstring, int offset, int maxRows, Closure metaClosure) throws SQLException {
+    public List<GroovyRowResult> rows(GString gstring, int offset, int maxRows,
+                                      @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure) throws SQLException {
         List<Object> params = getParameters(gstring);
         String sql = asSql(gstring, params);
         return rows(sql, params, offset, maxRows, metaClosure);
@@ -3464,7 +3498,7 @@ public class Sql {
      *
      * @param configureStatement the closure
      */
-    public void withStatement(Closure configureStatement) {
+    public void withStatement(@ClosureParams(value=SimpleType.class, options="java.sql.Statement") Closure configureStatement) {
         this.configureStatement = configureStatement;
     }
 
@@ -3929,11 +3963,13 @@ public class Sql {
      * @return the resulting list of rows
      * @throws SQLException if a database error occurs
      */
-    protected List<GroovyRowResult> asList(String sql, ResultSet rs, Closure metaClosure) throws SQLException {
+    protected List<GroovyRowResult> asList(String sql, ResultSet rs,
+                                           @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure) throws SQLException {
         return asList(sql, rs, 0, 0, metaClosure);
     }
 
-    protected List<GroovyRowResult> asList(String sql, ResultSet rs, int offset, int maxRows, Closure metaClosure) throws SQLException {
+    protected List<GroovyRowResult> asList(String sql, ResultSet rs, int offset, int maxRows,
+                                           @ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure) throws SQLException {
         List<GroovyRowResult> results = new ArrayList<GroovyRowResult>();
 
         try {

http://git-wip-us.apache.org/repos/asf/groovy/blob/931b6eb9/subprojects/groovy-sql/src/test/groovy/groovy/sql/SqlSTCTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-sql/src/test/groovy/groovy/sql/SqlSTCTest.groovy b/subprojects/groovy-sql/src/test/groovy/groovy/sql/SqlSTCTest.groovy
new file mode 100644
index 0000000..fa2da7f
--- /dev/null
+++ b/subprojects/groovy-sql/src/test/groovy/groovy/sql/SqlSTCTest.groovy
@@ -0,0 +1,82 @@
+/*
+ *  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.
+ */
+package groovy.sql
+
+import groovy.transform.TypeChecked
+import org.codehaus.groovy.control.CompilerConfiguration
+import org.codehaus.groovy.control.customizers.ASTTransformationCustomizer
+
+class SqlSTCTest extends GroovyShellTestCase {
+
+    @Override
+    GroovyShell createNewShell() {
+        def config = new CompilerConfiguration().addCompilationCustomizers(new ASTTransformationCustomizer(TypeChecked))
+        new GroovyShell(config)
+    }
+
+    void testEachRow() {
+        shell.evaluate '''
+            def test(groovy.sql.Sql sql) { 
+                sql.eachRow('SELECT * FROM FOO', { println it.columnCount }) { 
+                    java.sql.Date date = it.getDate(1); println it[1] 
+                } 
+            }
+        '''
+    }
+
+    void testEach() {
+        shell.evaluate '''
+            def test(groovy.sql.DataSet ds) { 
+                ds.each { java.sql.Date date = it.getDate(1); println it[1] } 
+            }
+        '''
+    }
+
+    void testQuery() {
+        shell.evaluate '''
+            def test(groovy.sql.Sql sql) { 
+                sql.query('SELECT * FROM FOO') { java.sql.Date date = it.getDate(1) } 
+            }
+        '''
+    }
+
+    void testRows() {
+        shell.evaluate '''
+            def test(groovy.sql.Sql sql) { 
+                sql.rows('SELECT * FROM FOO') { println it.columnCount } 
+            }
+        '''
+    }
+
+    void testAsList() {
+        shell.evaluate '''
+            def test(groovy.sql.Sql sql, java.sql.ResultSet rs) { 
+                sql.asList('SELECT * FROM FOO', rs) { println it.columnCount } 
+            }
+        '''
+    }
+
+    void testWithStatement() {
+        shell.evaluate '''
+            def test(groovy.sql.Sql sql) {
+                sql.withStatement { it.maxRows = 10 }
+            }
+        '''
+    }
+}
\ No newline at end of file


[17/50] [abbrv] groovy git commit: Minor refactoring

Posted by pa...@apache.org.
Minor refactoring


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/bd353a68
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/bd353a68
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/bd353a68

Branch: refs/heads/parrot
Commit: bd353a684a2c673779f79c7a18911970e24cff4d
Parents: b469cbb
Author: sunlan <su...@apache.org>
Authored: Sat May 6 01:44:14 2017 +0800
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:09:11 2017 +1000

----------------------------------------------------------------------
 .../groovy/classgen/asm/WriterController.java   | 24 ++++++++------------
 .../groovy/control/CompilerConfiguration.java   | 12 ++++++++++
 2 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/bd353a68/src/main/org/codehaus/groovy/classgen/asm/WriterController.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/asm/WriterController.java b/src/main/org/codehaus/groovy/classgen/asm/WriterController.java
index e4cfdbe..4eec57e 100644
--- a/src/main/org/codehaus/groovy/classgen/asm/WriterController.java
+++ b/src/main/org/codehaus/groovy/classgen/asm/WriterController.java
@@ -19,6 +19,8 @@
 package org.codehaus.groovy.classgen.asm;
 
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import org.codehaus.groovy.GroovyBugError;
@@ -39,6 +41,8 @@ import org.objectweb.asm.ClassVisitor;
 import org.objectweb.asm.MethodVisitor;
 import org.objectweb.asm.Opcodes;
 
+import static org.codehaus.groovy.control.CompilerConfiguration.JDK_TO_BYTECODE_VERSION_MAP;
+
 public class WriterController {
 
     private AsmClassGenerator acg;
@@ -133,24 +137,16 @@ public class WriterController {
             if (CompilerConfiguration.JDK7.equals(targetBytecode)) {
                 return Opcodes.V1_7;
             }
+
             return Opcodes.V1_8;
         } else {
-            if (CompilerConfiguration.JDK4.equals(targetBytecode)) {
-                return Opcodes.V1_4;
-            }
-            if (CompilerConfiguration.JDK5.equals(targetBytecode)) {
-                return Opcodes.V1_5;
-            }
-            if (CompilerConfiguration.JDK6.equals(targetBytecode)) {
-                return Opcodes.V1_6;
-            }
-            if (CompilerConfiguration.JDK7.equals(targetBytecode)) {
-                return Opcodes.V1_7;
-            }
-            if (CompilerConfiguration.JDK8.equals(targetBytecode)) {
-                return Opcodes.V1_8;
+            Integer bytecodeVersion = JDK_TO_BYTECODE_VERSION_MAP.get(targetBytecode);
+
+            if (null != bytecodeVersion) {
+                return bytecodeVersion;
             }
         }
+
         throw new GroovyBugError("Bytecode version ["+targetBytecode+"] is not supported by the compiler");
     }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/bd353a68/src/main/org/codehaus/groovy/control/CompilerConfiguration.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/control/CompilerConfiguration.java b/src/main/org/codehaus/groovy/control/CompilerConfiguration.java
index 1ee26d3..4278b55 100644
--- a/src/main/org/codehaus/groovy/control/CompilerConfiguration.java
+++ b/src/main/org/codehaus/groovy/control/CompilerConfiguration.java
@@ -21,6 +21,7 @@ package org.codehaus.groovy.control;
 import org.codehaus.groovy.control.customizers.CompilationCustomizer;
 import org.codehaus.groovy.control.io.NullWriter;
 import org.codehaus.groovy.control.messages.WarningMessage;
+import org.objectweb.asm.Opcodes;
 
 import java.io.File;
 import java.io.PrintWriter;
@@ -60,6 +61,17 @@ public class CompilerConfiguration {
     /** An array of the valid targetBytecode values **/
     public static final String[] ALLOWED_JDKS = { JDK4, JDK5, JDK6, JDK7, JDK8 };
 
+    /**
+     * JDK version to bytecode version mapping
+     */
+    public static final Map<String, Integer> JDK_TO_BYTECODE_VERSION_MAP = Collections.unmodifiableMap(new HashMap<String, Integer>() {{
+        put(JDK4, Opcodes.V1_4);
+        put(JDK5, Opcodes.V1_5);
+        put(JDK6, Opcodes.V1_6);
+        put(JDK7, Opcodes.V1_7);
+        put(JDK8, Opcodes.V1_8);
+    }});
+
     // Just call getVMVersion() once.
     public static final String currentJVMVersion = getVMVersion();
 


[46/50] [abbrv] groovy git commit: rename antlr4 parser to remove groovy- prefix since that is by convention for modules

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4 b/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
deleted file mode 100644
index 6ddf17f..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
+++ /dev/null
@@ -1,1270 +0,0 @@
-/*
- * This file is adapted from the Antlr4 Java grammar which has the following license
- *
- *  Copyright (c) 2013 Terence Parr, Sam Harwell
- *  All rights reserved.
- *  [The "BSD licence"]
- *
- *    http://www.opensource.org/licenses/bsd-license.php
- *
- * Subsequent modifications by the Groovy community have been done under the Apache License v2:
- *
- *  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.
- */
-
-/**
- * The Groovy grammar is based on the official grammar for Java:
- * https://github.com/antlr/grammars-v4/blob/master/java/Java.g4
- */
-parser grammar GroovyParser;
-
-options {
-    tokenVocab = GroovyLexer;
-    contextSuperClass = GroovyParserRuleContext;
-    superClass = AbstractParser;
-}
-
-@header {
-    import java.util.Map;
-    import org.codehaus.groovy.util.ListHashMap;
-    import org.apache.groovy.parser.antlr4.SemanticPredicates;
-    import org.codehaus.groovy.GroovyBugError;
-}
-
-@members {
-
-    public static class GroovyParserRuleContext extends ParserRuleContext {
-        private Map metaDataMap = null;
-
-        public GroovyParserRuleContext() {}
-
-        public GroovyParserRuleContext(ParserRuleContext parent, int invokingStateNumber) {
-            super(parent, invokingStateNumber);
-        }
-
-        /**
-         * Gets the node meta data.
-         *
-         * @param key - the meta data key
-         * @return the node meta data value for this key
-         */
-        public <T> T getNodeMetaData(Object key) {
-            if (metaDataMap == null) {
-                return (T) null;
-            }
-            return (T) metaDataMap.get(key);
-        }
-
-        /**
-         * Sets the node meta data.
-         *
-         * @param key - the meta data key
-         * @param value - the meta data value
-         * @throws GroovyBugError if key is null or there is already meta
-         *                        data under that key
-         */
-        public void setNodeMetaData(Object key, Object value) {
-            if (key==null) throw new GroovyBugError("Tried to set meta data with null key on "+this+".");
-            if (metaDataMap == null) {
-                metaDataMap = new ListHashMap();
-            }
-            Object old = metaDataMap.put(key,value);
-            if (old!=null) throw new GroovyBugError("Tried to overwrite existing meta data "+this+".");
-        }
-
-        /**
-         * Sets the node meta data but allows overwriting values.
-         *
-         * @param key   - the meta data key
-         * @param value - the meta data value
-         * @return the old node meta data value for this key
-         * @throws GroovyBugError if key is null
-         */
-        public Object putNodeMetaData(Object key, Object value) {
-            if (key == null) throw new GroovyBugError("Tried to set meta data with null key on " + this + ".");
-            if (metaDataMap == null) {
-                metaDataMap = new ListHashMap();
-            }
-            return metaDataMap.put(key, value);
-        }
-    }
-
-    @Override
-    public int getSyntaxErrorSource() {
-        return GroovySyntaxError.PARSER;
-    }
-
-    @Override
-    public int getErrorLine() {
-        Token token = _input.LT(-1);
-
-        if (null == token) {
-            return -1;
-        }
-
-        return token.getLine();
-    }
-
-    @Override
-    public int getErrorColumn() {
-        Token token = _input.LT(-1);
-
-        if (null == token) {
-            return -1;
-        }
-
-        return token.getCharPositionInLine() + 1 + token.getText().length();
-    }
-}
-
-// starting point for parsing a groovy file
-compilationUnit
-    :   nls
-        (packageDeclaration (sep | EOF))? (statement (sep | EOF))* EOF
-    ;
-
-packageDeclaration
-    :   annotationsOpt PACKAGE qualifiedName
-    ;
-
-importDeclaration
-    :   annotationsOpt IMPORT STATIC? qualifiedName (DOT MUL | AS alias=identifier)?
-    ;
-
-
-typeDeclaration
-    :   classOrInterfaceModifiersOpt classDeclaration
-    ;
-
-modifier
-    :   classOrInterfaceModifier
-    |   m=(   NATIVE
-          |   SYNCHRONIZED
-          |   TRANSIENT
-          |   VOLATILE
-          |   DEF
-          )
-    ;
-
-modifiersOpt
-    :   modifiers?
-    ;
-
-modifiers
-    :   (modifier nls)+
-    ;
-
-classOrInterfaceModifiersOpt
-    :   classOrInterfaceModifiers?
-    ;
-
-classOrInterfaceModifiers
-    :   (classOrInterfaceModifier nls)+
-    ;
-
-classOrInterfaceModifier
-    :   annotation       // class or interface
-    |   m=(   PUBLIC     // class or interface
-          |   PROTECTED  // class or interface
-          |   PRIVATE    // class or interface
-          |   STATIC     // class or interface
-          |   ABSTRACT   // class or interface
-          |   FINAL      // class only -- does not apply to interfaces
-          |   STRICTFP   // class or interface
-          |   DEFAULT    // interface only -- does not apply to classes
-          )
-    ;
-
-variableModifier
-    :   annotation
-    |   m=( FINAL
-          | DEF
-          // Groovy supports declaring local variables as instance/class fields,
-          // e.g. import groovy.transform.*; @Field static List awe = [1, 2, 3]
-          // e.g. import groovy.transform.*; def a = { @Field public List awe = [1, 2, 3] }
-          // Notice: Groovy 2.4.7 just allows to declare local variables with the following modifiers when using annotations(e.g. @Field)
-          // TODO check whether the following modifiers accompany annotations or not. Because the legacy codes(e.g. benchmark/bench/heapsort.groovy) allow to declare the special instance/class fields without annotations, we leave it as it is for the time being
-          | PUBLIC
-          | PROTECTED
-          | PRIVATE
-          | STATIC
-          | ABSTRACT
-          | STRICTFP
-          )
-    ;
-
-variableModifiersOpt
-    :   variableModifiers?
-    ;
-
-variableModifiers
-    :   (variableModifier nls)+
-    ;
-
-typeParameters
-    :   LT nls typeParameter (COMMA nls typeParameter)* nls GT
-    ;
-
-typeParameter
-    :   className (EXTENDS nls typeBound)?
-    ;
-
-typeBound
-    :   type (BITAND nls type)*
-    ;
-
-typeList
-    :   type (COMMA nls type)*
-    ;
-
-
-/**
- *  t   0: class; 1: interface; 2: enum; 3: annotation; 4: trait
- */
-classDeclaration
-locals[ int t ]
-    :   (   CLASS { $t = 0; }
-        |   INTERFACE { $t = 1; }
-        |   ENUM { $t = 2; }
-        |   AT INTERFACE { $t = 3; }
-        |   TRAIT { $t = 4; }
-        )
-        identifier nls
-
-        (
-            { 3 != $t }?
-            typeParameters? nls
-            (
-                { 2 != $t }?
-                (EXTENDS nls
-                    (
-                        // Only interface can extend more than one super class
-                        {1 == $t}? scs=typeList
-                    |
-                        sc=type
-                    )
-                nls)?
-            |
-                /* enum should not have type parameters and extends */
-            )
-
-            (
-                {1 != $t}?
-                (IMPLEMENTS nls is=typeList nls)?
-            |
-                /* interface should not implement other interfaces */
-            )
-        |
-            /* annotation should not have implements and extends*/
-        )
-
-        classBody[$t]
-    ;
-
-// t    see the comment of classDeclaration
-classBody[int t]
-    :   LBRACE nls
-        (
-            /* Only enum can have enum constants */
-            { 2 == $t }?
-            enumConstants? nls
-        |
-
-        )
-        classBodyDeclaration[$t]? (sep classBodyDeclaration[$t])* sep? RBRACE
-    ;
-
-enumConstants
-    :   enumConstant (nls COMMA nls enumConstant)* (nls COMMA)?
-    ;
-
-enumConstant
-    :   annotationsOpt identifier arguments? anonymousInnerClassDeclaration[1]?
-    ;
-
-classBodyDeclaration[int t]
-    :   SEMI
-    |   (STATIC nls)? block
-    |   memberDeclaration[$t]
-    ;
-
-memberDeclaration[int t]
-    :   methodDeclaration[0, $t]
-    |   fieldDeclaration
-    |   modifiersOpt classDeclaration
-    ;
-
-/**
- *  t   0: *class member* all kinds of method declaration AND constructor declaration,
- *      1: normal method declaration, 2: abstract method declaration
- *      3: normal method declaration OR abstract method declaration
- *  ct  9: script, other see the comment of classDeclaration
- */
-methodDeclaration[int t, int ct]
-    :   { 3 == $ct }?
-        returnType[$ct] methodName LPAREN rparen (DEFAULT nls elementValue)?
-    |
-        (   { 0 == $t }?
-            modifiersOpt typeParameters?
-        |   modifiersOpt  typeParameters? returnType[$ct]
-        |   modifiers  typeParameters? returnType[$ct]?
-        )
-        methodName formalParameters (nls THROWS nls qualifiedClassNameList)?
-        (
-            { 0 == $t || 3 == $t || 1 == $t}?
-            nls methodBody
-        |
-            { 0 == $t || 3 == $t || 2 == $t }?
-            /* no method body */
-        )
-    ;
-
-methodName
-    :   identifier
-    |   stringLiteral
-    ;
-
-returnType[int ct]
-    :
-        standardType
-    |
-        // annotation method can not have void return type
-        { 3 != $ct }? VOID
-    ;
-
-fieldDeclaration
-    :   variableDeclaration[1]
-    ;
-
-variableDeclarators
-    :   variableDeclarator (COMMA nls variableDeclarator)*
-    ;
-
-variableDeclarator
-    :   variableDeclaratorId (nls ASSIGN nls variableInitializer)?
-    ;
-
-variableDeclaratorId
-    :   identifier
-    ;
-
-variableInitializer
-    :   statementExpression
-    |   standardLambda
-    ;
-
-variableInitializers
-    :   variableInitializer nls (COMMA nls variableInitializer nls)* nls COMMA?
-    ;
-
-standardType
-options { baseContext = type; }
-    :   primitiveType (LBRACK RBRACK)*
-    |   standardClassOrInterfaceType (LBRACK RBRACK)*
-    ;
-
-type
-    :   (   primitiveType
-        |
-            // !!! ERROR ALTERNATIVE !!!
-            VOID { require(false, "void is not allowed here", -4); }
-        ) (LBRACK RBRACK)*
-    |   generalClassOrInterfaceType (LBRACK RBRACK)*
-    ;
-
-classOrInterfaceType
-    :   (   qualifiedClassName
-        |   qualifiedStandardClassName
-        ) typeArguments?
-    ;
-
-generalClassOrInterfaceType
-options { baseContext = classOrInterfaceType; }
-    :   qualifiedClassName typeArguments?
-    ;
-
-standardClassOrInterfaceType
-options { baseContext = classOrInterfaceType; }
-    :   qualifiedStandardClassName typeArguments?
-    ;
-
-primitiveType
-    :   BuiltInPrimitiveType
-    ;
-
-typeArguments
-    :   LT nls typeArgument (COMMA nls typeArgument)* nls GT
-    ;
-
-typeArgument
-    :   type
-    |   QUESTION ((EXTENDS | SUPER) nls type)?
-    ;
-
-qualifiedClassNameList
-    :   qualifiedClassName (COMMA nls qualifiedClassName)*
-    ;
-
-formalParameters
-    :   LPAREN formalParameterList? rparen
-    ;
-
-formalParameterList
-    :   formalParameter (COMMA nls formalParameter)* (COMMA nls lastFormalParameter)?
-    |   lastFormalParameter
-    ;
-
-formalParameter
-    :   variableModifiersOpt type?          variableDeclaratorId (nls ASSIGN nls expression)?
-    ;
-
-lastFormalParameter
-    :   variableModifiersOpt type? ELLIPSIS variableDeclaratorId (nls ASSIGN nls expression)?
-    ;
-
-methodBody
-    :   block
-    ;
-
-qualifiedName
-    :   qualifiedNameElement (DOT qualifiedNameElement)*
-    ;
-
-/**
- *  Java doesn't have the keywords 'as', 'in', 'def', 'trait' so we make some allowances
- *  for them in package names for better integration with existing Java packages
- */
-qualifiedNameElement
-    :   identifier
-    |   DEF
-    |   IN
-    |   AS
-    |   TRAIT
-    ;
-
-qualifiedClassName
-    :   (qualifiedNameElement DOT)* identifier
-    ;
-
-qualifiedStandardClassName
-    :   (qualifiedNameElement DOT)* (className DOT)* className
-    ;
-
-literal
-    :   IntegerLiteral                                                                      #integerLiteralAlt
-    |   FloatingPointLiteral                                                                #floatingPointLiteralAlt
-    |   stringLiteral                                                                       #stringLiteralAlt
-    |   BooleanLiteral                                                                      #booleanLiteralAlt
-    |   NullLiteral                                                                         #nullLiteralAlt
-    ;
-
-// GSTRING
-
-gstring
-    :   GStringBegin gstringValue (GStringPart  gstringValue)* GStringEnd
-    ;
-
-gstringValue
-    :   gstringPath
-    |   LBRACE statementExpression? RBRACE
-    |   closure
-    ;
-
-gstringPath
-    :   identifier GStringPathPart*
-    ;
-
-
-// LAMBDA EXPRESSION
-lambda
-options { baseContext = standardLambda; }
-	:	lambdaParameters nls ARROW nls lambdaBody
-	;
-
-standardLambda
-	:	standardLambdaParameters nls ARROW nls lambdaBody
-	;
-
-lambdaParameters
-options { baseContext = standardLambdaParameters; }
-    :   formalParameters
-
-    // { a -> a * 2 } can be parsed as a lambda expression in a block, but we expect a closure.
-    // So it is better to put parameters in the parentheses and the following single parameter without parentheses is limited
-//    |   variableDeclaratorId
-    ;
-
-standardLambdaParameters
-    :   formalParameters
-    |   variableDeclaratorId
-    ;
-
-lambdaBody
-	:	block
-	|	statementExpression
-	;
-
-
-// CLOSURE
-closure
-locals[ String footprint = "" ]
-    :   LBRACE nls (formalParameterList? nls ARROW nls)? blockStatementsOpt RBRACE
-    ;
-
-blockStatementsOpt
-    :   blockStatements?
-    ;
-
-blockStatements
-    :   blockStatement (sep blockStatement)* sep?
-    ;
-
-// ANNOTATIONS
-
-annotationsOpt
-    :   (annotation nls)*
-    ;
-
-annotation
-    :   AT annotationName ( LPAREN elementValues? rparen )?
-    ;
-
-elementValues
-    :   elementValuePairs
-    |   elementValue
-    ;
-
-annotationName : qualifiedClassName ;
-
-elementValuePairs
-    :   elementValuePair (COMMA elementValuePair)*
-    ;
-
-elementValuePair
-    :   elementValuePairName nls ASSIGN nls elementValue
-    ;
-
-elementValuePairName
-    :   identifier
-    |   keywords
-    ;
-
-// TODO verify the potential performance issue because rule expression contains sub-rule assignments(https://github.com/antlr/grammars-v4/issues/215)
-elementValue
-    :   elementValueArrayInitializer
-    |   annotation
-    |   expression
-    ;
-
-elementValueArrayInitializer
-    :   LBRACK (elementValue (COMMA elementValue)*)? (COMMA)? RBRACK
-    ;
-
-// STATEMENTS / BLOCKS
-
-block
-    :   LBRACE nls blockStatementsOpt RBRACE
-    ;
-
-blockStatement
-    :   localVariableDeclaration
-    |   statement
-    ;
-
-localVariableDeclaration
-    :   { !SemanticPredicates.isInvalidLocalVariableDeclaration(_input) }?
-        variableDeclaration[0]
-    ;
-
-/**
- *  t   0: local variable declaration; 1: field declaration
- */
-variableDeclaration[int t]
-    :   (   { 0 == $t }? variableModifiers
-        |   { 1 == $t }? modifiers
-        )
-        type? variableDeclarators
-    |
-        (   { 0 == $t }? variableModifiersOpt
-        |   { 1 == $t }? modifiersOpt
-        )
-        type variableDeclarators
-    |
-        (   { 0 == $t }? variableModifiers
-        |   { 1 == $t }? modifiers
-        )
-        typeNamePairs nls ASSIGN nls variableInitializer
-    ;
-
-typeNamePairs
-    :   LPAREN typeNamePair (COMMA typeNamePair)* rparen
-    ;
-
-typeNamePair
-    :   type? variableDeclaratorId
-    ;
-
-variableNames
-    :   LPAREN variableDeclaratorId (COMMA variableDeclaratorId)+ rparen
-    ;
-
-switchStatement
-locals[ String footprint = "" ]
-    :   SWITCH parExpression nls LBRACE nls switchBlockStatementGroup* nls RBRACE
-    ;
-
-loopStatement
-locals[ String footprint = "" ]
-    :   FOR LPAREN forControl rparen nls statement                                                          #forStmtAlt
-    |   WHILE parExpression nls statement                                                                   #whileStmtAlt
-    |   DO nls statement nls WHILE parExpression                                                            #doWhileStmtAlt
-    ;
-
-continueStatement
-locals[ boolean isInsideLoop ]
-@init {
-    try {
-        $isInsideLoop = null != $loopStatement::footprint;
-    } catch(NullPointerException e) {
-        $isInsideLoop = false;
-    }
-}
-    :   CONTINUE
-        { require($isInsideLoop, "the continue statement is only allowed inside loops", -8); }
-        identifier?
-    ;
-
-breakStatement
-locals[ boolean isInsideLoop, boolean isInsideSwitch ]
-@init {
-    try {
-        $isInsideLoop = null != $loopStatement::footprint;
-    } catch(NullPointerException e) {
-        $isInsideLoop = false;
-    }
-
-    try {
-        $isInsideSwitch = null != $switchStatement::footprint;
-    } catch(NullPointerException e) {
-        $isInsideSwitch = false;
-    }
-}
-    :   BREAK
-        { require($isInsideLoop || $isInsideSwitch, "the break statement is only allowed inside loops or switches", -5); }
-        identifier?
-    ;
-
-tryCatchStatement
-locals[boolean resourcesExists = false]
-    :   TRY (resources { $resourcesExists = true; })? nls
-        block
-        (
-            (nls catchClause)+
-            (nls finallyBlock)?
-        |
-            nls finallyBlock
-        |
-            // try-with-resources can have no catche and finally clauses
-            { $resourcesExists }?<fail={"catch or finally clauses are required for try-catch statement"}>
-        )
-    ;
-
-assertStatement
-locals[ String footprint = "" ]
-    :   ASSERT ce=expression ((COLON | COMMA) nls me=expression)?
-    ;
-
-statement
-    :   block                                                                                               #blockStmtAlt
-    |   IF parExpression nls tb=statement ((nls | sep) ELSE nls fb=statement)?                              #ifElseStmtAlt
-    |   loopStatement                                                                                       #loopStmtAlt
-
-    |   tryCatchStatement                                                                                   #tryCatchStmtAlt
-
-    |   switchStatement                                                                                     #switchStmtAlt
-    |   SYNCHRONIZED parExpression nls block                                                                #synchronizedStmtAlt
-    |   RETURN expression?                                                                                  #returnStmtAlt
-    |   THROW expression                                                                                    #throwStmtAlt
-
-    |   breakStatement                                                                                      #breakStmtAlt
-    |   continueStatement                                                                                   #continueStmtAlt
-
-    |   identifier COLON nls statement                                                                      #labeledStmtAlt
-
-    // Import statement.  Can be used in any scope.  Has "import x as y" also.
-    |   importDeclaration                                                                                   #importStmtAlt
-
-    |   assertStatement                                                                                     #assertStmtAlt
-
-    |   typeDeclaration                                                                                     #typeDeclarationStmtAlt
-    |   localVariableDeclaration                                                                            #localVariableDeclarationStmtAlt
-
-    // validate the method in the AstBuilder#visitMethodDeclaration, e.g. method without method body is not allowed
-    |   { !SemanticPredicates.isInvalidMethodDeclaration(_input) }?
-        methodDeclaration[3, 9]                                                                             #methodDeclarationStmtAlt
-
-    |   statementExpression                                                                                 #expressionStmtAlt
-
-    |   SEMI                                                                                                #emptyStmtAlt
-    ;
-
-catchClause
-    :   CATCH LPAREN variableModifiersOpt catchType? identifier rparen nls block
-    ;
-
-catchType
-    :   qualifiedClassName (BITOR qualifiedClassName)*
-    ;
-
-finallyBlock
-    :   FINALLY nls block
-    ;
-
-
-resources
-    :   LPAREN nls resourceList sep? rparen
-    ;
-
-resourceList
-    :   resource (sep resource)*
-    ;
-
-resource
-    :   localVariableDeclaration
-    |   expression
-    ;
-
-
-/** Matches cases then statements, both of which are mandatory.
- *  To handle empty cases at the end, we add switchLabel* to statement.
- */
-switchBlockStatementGroup
-    :   (switchLabel nls)+ blockStatements
-    ;
-
-switchLabel
-    :   CASE expression COLON
-    |   DEFAULT COLON
-    ;
-
-forControl
-    :   enhancedForControl
-    |   classicalForControl
-    ;
-
-enhancedForControl
-    :   variableModifiersOpt type? variableDeclaratorId (COLON | IN) expression
-    ;
-
-classicalForControl
-    :   forInit? SEMI expression? SEMI forUpdate?
-    ;
-
-forInit
-    :   localVariableDeclaration
-    |   expressionList[false]
-    ;
-
-forUpdate
-    :   expressionList[false]
-    ;
-
-
-// EXPRESSIONS
-
-castParExpression
-    :   LPAREN type rparen
-    ;
-
-parExpression
-    :   LPAREN (statementExpression | standardLambda) rparen
-    ;
-
-expressionList[boolean canSpread]
-    :   expressionListElement[$canSpread] (COMMA expressionListElement[$canSpread])*
-    ;
-
-expressionListElement[boolean canSpread]
-    :   (   MUL { require($canSpread, "spread operator is not allowed here", -1); }
-        |
-        ) expression
-    ;
-
-/**
- *  In order to resolve the syntactic ambiguities, e.g. (String)'abc' can be parsed as a cast expression or a parentheses-less method call(method name: (String), arguments: 'abc')
- *      try to match expression first.
- *  If it is not a normal expression, then try to match the command expression
- */
-statementExpression
-    :   expression                          #normalExprAlt
-    |   commandExpression                   #commandExprAlt
-    ;
-
-postfixExpression
-locals[ boolean isInsideAssert ]
-@init {
-    try {
-        $isInsideAssert = null != $assertStatement::footprint;
-    } catch(NullPointerException e) {
-        $isInsideAssert = false;
-    }
-}
-    :   pathExpression op=(INC | DEC)?
-    ;
-
-expression
-    // qualified names, array expressions, method invocation, post inc/dec, type casting (level 1)
-    // The cast expression must be put before pathExpression to resovle the ambiguities between type casting and call on parentheses expression, e.g. (int)(1 / 2)
-    :   castParExpression expression                                                        #castExprAlt
-    |   postfixExpression                                                                   #postfixExprAlt
-
-    // ~(BNOT)/!(LNOT) (level 1)
-    |   (BITNOT | NOT) nls expression                                                       #unaryNotExprAlt
-
-    // math power operator (**) (level 2)
-    |   left=expression op=POWER nls right=expression                                       #powerExprAlt
-
-    // ++(prefix)/--(prefix)/+(unary)/-(unary) (level 3)
-    |   op=(INC | DEC | ADD | SUB) expression                                               #unaryAddExprAlt
-
-    // multiplication/division/modulo (level 4)
-    |   left=expression nls op=(MUL | DIV | MOD) nls right=expression                       #multiplicativeExprAlt
-
-    // binary addition/subtraction (level 5)
-    |   left=expression op=(ADD | SUB) nls right=expression                                 #additiveExprAlt
-
-    // bit shift expressions (level 6)
-    |   left=expression nls
-            (           (   dlOp=LT LT
-                        |   tgOp=GT GT GT
-                        |   dgOp=GT GT
-                        )
-            |   rangeOp=(    RANGE_INCLUSIVE
-                        |    RANGE_EXCLUSIVE
-                        )
-            ) nls
-        right=expression                                                                    #shiftExprAlt
-
-    // boolean relational expressions (level 7)
-    |   left=expression nls op=(AS | INSTANCEOF | NOT_INSTANCEOF) nls type                  #relationalExprAlt
-    |   left=expression nls op=(LE | GE | GT | LT | IN | NOT_IN)  nls right=expression      #relationalExprAlt
-
-    // equality/inequality (==/!=) (level 8)
-    |   left=expression nls
-            op=(    IDENTICAL
-               |    NOT_IDENTICAL
-               |    EQUAL
-               |    NOTEQUAL
-               |    SPACESHIP
-               ) nls
-        right=expression                                                                    #equalityExprAlt
-
-    // regex find and match (=~ and ==~) (level 8.5)
-    // jez: moved =~ closer to precedence of == etc, as...
-    // 'if (foo =~ "a.c")' is very close in intent to 'if (foo == "abc")'
-    |   left=expression nls op=(REGEX_FIND | REGEX_MATCH) nls right=expression              #regexExprAlt
-
-    // bitwise or non-short-circuiting and (&)  (level 9)
-    |   left=expression nls op=BITAND nls right=expression                                  #andExprAlt
-
-    // exclusive or (^)  (level 10)
-    |   left=expression nls op=XOR nls right=expression                                     #exclusiveOrExprAlt
-
-    // bitwise or non-short-circuiting or (|)  (level 11)
-    |   left=expression nls op=BITOR nls right=expression                                   #inclusiveOrExprAlt
-
-    // logical and (&&)  (level 12)
-    |   left=expression nls op=AND nls right=expression                                     #logicalAndExprAlt
-
-    // logical or (||)  (level 13)
-    |   left=expression nls op=OR nls right=expression                                      #logicalOrExprAlt
-
-    // conditional test (level 14)
-    |   <assoc=right> con=expression nls
-        (   QUESTION nls tb=expression nls COLON nls
-        |   ELVIS nls
-        )
-        fb=expression                                                                       #conditionalExprAlt
-
-    // assignment expression (level 15)
-    // "(a) = [1]" is a special case of multipleAssignmentExprAlt, it will be handle by assignmentExprAlt
-    |   <assoc=right> left=variableNames nls op=ASSIGN nls right=statementExpression        #multipleAssignmentExprAlt
-    |   <assoc=right> left=expression nls
-                        op=(   ASSIGN
-                           |   ADD_ASSIGN
-                           |   SUB_ASSIGN
-                           |   MUL_ASSIGN
-                           |   DIV_ASSIGN
-                           |   AND_ASSIGN
-                           |   OR_ASSIGN
-                           |   XOR_ASSIGN
-                           |   RSHIFT_ASSIGN
-                           |   URSHIFT_ASSIGN
-                           |   LSHIFT_ASSIGN
-                           |   MOD_ASSIGN
-                           |   POWER_ASSIGN
-                           |   ELVIS_ASSIGN
-                           ) nls
-                     (statementExpression | standardLambda)                                 #assignmentExprAlt
-    ;
-
-commandExpression
-    :   pathExpression
-        (
-            { SemanticPredicates.isFollowingMethodName($pathExpression.t) }?
-            argumentList
-        |
-            /* if pathExpression is a method call, no need to have any more arguments */
-        )
-
-        commandArgument*
-    ;
-
-commandArgument
-    :   primary
-        // what follows is either a normal argument, parens,
-        // an appended block, an index operation, or nothing
-        // parens (a b already processed):
-        //      a b c() d e -> a(b).c().d(e)
-        //      a b c()() d e -> a(b).c().call().d(e)
-        // index (a b already processed):
-        //      a b c[x] d e -> a(b).c[x].d(e)
-        //      a b c[x][y] d e -> a(b).c[x][y].d(e)
-        // block (a b already processed):
-        //      a b c {x} d e -> a(b).c({x}).d(e)
-        //
-        // parens/block completes method call
-        // index makes method call to property get with index
-        //
-        (   pathElement+
-        |   argumentList
-        )?
-    ;
-
-/**
- *  A "path expression" is a name or other primary, possibly qualified by various
- *  forms of dot, and/or followed by various kinds of brackets.
- *  It can be used for value or assigned to, or else further qualified, indexed, or called.
- *  It is called a "path" because it looks like a linear path through a data structure.
- *  Examples:  x.y, x?.y, x*.y, x.@y; x[], x[y], x[y,z]; x(), x(y), x(y,z); x{s}; a.b[n].c(x).d{s}
- *  (Compare to a C lvalue, or LeftHandSide in the JLS section 15.26.)
- *  General expressions are built up from path expressions, using operators like '+' and '='.
- *
- *  t   0: primary, 1: namePart, 2: arguments, 3: closure, 4: indexPropertyArgs, 5: namedPropertyArgs
- */
-pathExpression returns [int t]
-    :   primary (pathElement { $t = $pathElement.t; })*
-    ;
-
-pathElement returns [int t]
-locals[ boolean isInsideClosure ]
-@init {
-    try {
-        $isInsideClosure = null != $closure::footprint;
-    } catch(NullPointerException e) {
-        $isInsideClosure = false;
-    }
-}
-    :   nls
-
-        // AT: foo.@bar selects the field (or attribute), not property
-        ( SPREAD_DOT nls (AT | nonWildcardTypeArguments)?       // Spread operator:  x*.y  ===  x?.collect{it.y}
-        | SAFE_DOT nls (AT | nonWildcardTypeArguments)?         // Optional-null operator:  x?.y  === (x==null)?null:x.y
-        | METHOD_POINTER nls                                    // Method pointer operator: foo.&y == foo.metaClass.getMethodPointer(foo, "y")
-        | METHOD_REFERENCE nls                                  // Method reference: System.out::println
-        | DOT nls (AT | nonWildcardTypeArguments)?              // The all-powerful dot.
-        )
-        namePart
-        { $t = 1; }
-
-    |   arguments
-        { $t = 2; }
-
-    // Can always append a block, as foo{bar}
-    |   nls closure
-        { $t = 3; }
-
-    // Element selection is always an option, too.
-    // In Groovy, the stuff between brackets is a general argument list,
-    // since the bracket operator is transformed into a method call.
-    |   indexPropertyArgs
-        { $t = 4; }
-
-    |   namedPropertyArgs
-        { $t = 5; }
-    ;
-
-/**
- *  This is the grammar for what can follow a dot:  x.a, x.@a, x.&a, x.'a', etc.
- */
-namePart
-    :
-        (   identifier
-
-        // foo.'bar' is in all ways same as foo.bar, except that bar can have an arbitrary spelling
-        |   stringLiteral
-
-        |   dynamicMemberName
-
-        /* just a PROPOSAL, which has not been implemented yet!
-        // PROPOSAL, DECIDE:  Is this inline form of the 'with' statement useful?
-        // Definition:  a.{foo} === {with(a) {foo}}
-        // May cover some path expression use-cases previously handled by dynamic scoping (closure delegates).
-        |   block
-        */
-
-        // let's allow common keywords as property names
-        |   keywords
-        )
-    ;
-
-/**
- *  If a dot is followed by a parenthesized or quoted expression, the member is computed dynamically,
- *  and the member selection is done only at runtime.  This forces a statically unchecked member access.
- */
-dynamicMemberName
-    :   parExpression
-    |   gstring
-    ;
-
-/** An expression may be followed by [...].
- *  Unlike Java, these brackets may contain a general argument list,
- *  which is passed to the array element operator, which can make of it what it wants.
- *  The brackets may also be empty, as in T[].  This is how Groovy names array types.
- */
-indexPropertyArgs
-    :   QUESTION? LBRACK expressionList[true]? RBRACK
-    ;
-
-namedPropertyArgs
-    :   LBRACK mapEntryList RBRACK
-    ;
-
-primary
-    :   identifier                                                                          #identifierPrmrAlt
-    |   literal                                                                             #literalPrmrAlt
-    |   gstring                                                                             #gstringPrmrAlt
-    |   NEW nls creator                                                                     #newPrmrAlt
-    |   THIS                                                                                #thisPrmrAlt
-    |   SUPER                                                                               #superPrmrAlt
-    |   parExpression                                                                       #parenPrmrAlt
-    |   closure                                                                             #closurePrmrAlt
-    |   lambda                                                                              #lambdaPrmrAlt
-    |   list                                                                                #listPrmrAlt
-    |   map                                                                                 #mapPrmrAlt
-    |   builtInType                                                                         #typePrmrAlt
-    ;
-
-list
-locals[boolean empty = true]
-    :   LBRACK
-        (
-            expressionList[true]
-            { $empty = false; }
-        )?
-        (
-            COMMA
-            { require(!$empty, "Empty list constructor should not contain any comma(,)", -1); }
-        )?
-        RBRACK
-    ;
-
-map
-    :   LBRACK
-        (   mapEntryList COMMA?
-        |   COLON
-        )
-        RBRACK
-    ;
-
-mapEntryList
-    :   mapEntry (COMMA mapEntry)*
-    ;
-
-mapEntry
-    :   mapEntryLabel COLON nls expression
-    |   MUL COLON nls expression
-    ;
-
-mapEntryLabel
-    :   keywords
-    |   primary
-    ;
-
-creator
-    :   createdName
-        (   nls arguments anonymousInnerClassDeclaration[0]?
-        |   (LBRACK expression RBRACK)+ (b+=LBRACK RBRACK)*
-        |   (b+=LBRACK RBRACK)+ nls arrayInitializer
-        )
-    ;
-
-arrayInitializer
-    :   LBRACE nls variableInitializers? nls RBRACE
-    ;
-
-/**
- *  t   0: anonymous inner class; 1: anonymous enum
- */
-anonymousInnerClassDeclaration[int t]
-    :   classBody[0]
-    ;
-
-createdName
-    :   primitiveType
-    |   qualifiedClassName typeArgumentsOrDiamond?
-    ;
-
-nonWildcardTypeArguments
-    :   LT nls typeList nls GT
-    ;
-
-typeArgumentsOrDiamond
-    :   LT GT
-    |   typeArguments
-    ;
-
-arguments
-    :   LPAREN
-        (   enhancedArgumentList?
-        |   enhancedArgumentList COMMA
-        )
-        rparen
-    ;
-
-argumentList
-options { baseContext = enhancedArgumentList; }
-    :   argumentListElement
-        (   COMMA nls
-            argumentListElement
-        )*
-    ;
-
-enhancedArgumentList
-    :   enhancedArgumentListElement
-        (   COMMA nls
-            enhancedArgumentListElement
-        )*
-    ;
-
-argumentListElement
-options { baseContext = enhancedArgumentListElement; }
-    :   expressionListElement[true]
-    |   mapEntry
-    ;
-
-enhancedArgumentListElement
-    :   expressionListElement[true]
-    |   standardLambda
-    |   mapEntry
-    ;
-
-stringLiteral
-    :   StringLiteral
-    ;
-
-className
-    :   CapitalizedIdentifier
-    ;
-
-identifier
-    :   Identifier
-    |   CapitalizedIdentifier
-
-    |
-        // if 'static' followed by DOT, we can treat them as identifiers, e.g. static.unused = { -> }
-        { DOT == _input.LT(2).getType() }?
-        STATIC
-    ;
-
-builtInType
-    :   BuiltInPrimitiveType
-    |   VOID
-    ;
-
-keywords
-    :   ABSTRACT
-    |   AS
-    |   ASSERT
-    |   BREAK
-    |   CASE
-    |   CATCH
-    |   CLASS
-    |   CONST
-    |   CONTINUE
-    |   DEF
-    |   DEFAULT
-    |   DO
-    |   ELSE
-    |   ENUM
-    |   EXTENDS
-    |   FINAL
-    |   FINALLY
-    |   FOR
-    |   GOTO
-    |   IF
-    |   IMPLEMENTS
-    |   IMPORT
-    |   IN
-    |   INSTANCEOF
-    |   INTERFACE
-    |   NATIVE
-    |   NEW
-    |   PACKAGE
-    |   RETURN
-    |   STATIC
-    |   STRICTFP
-    |   SUPER
-    |   SWITCH
-    |   SYNCHRONIZED
-    |   THIS
-    |   THROW
-    |   THROWS
-    |   TRANSIENT
-    |   TRAIT
-    |   TRY
-    |   VOLATILE
-    |   WHILE
-
-    |   NullLiteral
-    |   BooleanLiteral
-
-    |   BuiltInPrimitiveType
-    |   VOID
-
-    |   PUBLIC
-    |   PROTECTED
-    |   PRIVATE
-    ;
-
-rparen
-    :   RPAREN
-    |
-        // !!!Error Alternatives, impact the performance of parsing!!!
-        { require(false, "Missing ')'"); }
-    ;
-
-nls
-    :   NL*
-    ;
-
-sep :   SEMI NL*
-    |   NL+ (SEMI NL*)*
-    ;
-
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/groovy/org/apache/groovy/parser/antlr4/util/GroovyTestRig.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/groovy/org/apache/groovy/parser/antlr4/util/GroovyTestRig.groovy b/subprojects/groovy-parser-antlr4/src/main/groovy/org/apache/groovy/parser/antlr4/util/GroovyTestRig.groovy
deleted file mode 100644
index 798ed5f..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/groovy/org/apache/groovy/parser/antlr4/util/GroovyTestRig.groovy
+++ /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.
- */
-package org.apache.groovy.parser.antlr4.util
-
-import groovy.util.logging.Log
-import org.antlr.v4.gui.TestRig
-import org.antlr.v4.runtime.ANTLRInputStream
-import org.antlr.v4.runtime.CommonTokenStream
-import org.apache.groovy.parser.antlr4.GroovyLangLexer
-import org.apache.groovy.parser.antlr4.GroovyLangParser
-
-/**
- * A basic debug tool for investigating the parse trees and tokens of Groovy source code
- *
- * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- * Created on    2016/08/14
- */
-@Log
-public class GroovyTestRig extends TestRig {
-    public GroovyTestRig(String[] args) throws Exception {
-        super(['Groovy', args.contains('-lexer') ? 'tokens' : 'compilationUnit', *args] as String[]);
-    }
-
-    public void inspectParseTree() {
-        def inputFile = new File(this.inputFiles[0]);
-
-        if (!(inputFile.exists() && inputFile.isFile())) {
-            log.info "Input file[${inputFile.absolutePath}] does not exist."
-            return;
-        }
-
-        byte[] content = inputFile.bytes;
-        String text = new String(content, this.encoding ?: 'UTF-8');
-
-        GroovyLangLexer lexer = new GroovyLangLexer(new ANTLRInputStream(text));
-        CommonTokenStream tokens = new CommonTokenStream(lexer);
-        GroovyLangParser parser = new GroovyLangParser(tokens);
-
-        this.process(lexer, GroovyLangParser.class, parser, new ByteArrayInputStream(content), new StringReader(text));
-    }
-
-    public static void main(String[] args) {
-        if (args.length == 0) {
-            log.info "Usage: [-tokens] [-lexer] [-tree] [-gui] [-ps file.ps] [-encoding encodingname] [-trace] [-diagnostics] [-SLL] input-filename";
-            return;
-        }
-
-        if (args.every { it.startsWith('-') }) {
-            log.info "input-filename is required!"
-            return;
-        }
-
-        GroovyTestRig groovyTestRig = new GroovyTestRig(args);
-
-        groovyTestRig.inspectParseTree();
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/AbstractParser.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/AbstractParser.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/AbstractParser.java
deleted file mode 100644
index f216797..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/AbstractParser.java
+++ /dev/null
@@ -1,83 +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.
- */
-package org.apache.groovy.parser;
-
-import groovy.lang.GroovyClassLoader;
-import org.codehaus.groovy.ast.ModuleNode;
-import org.codehaus.groovy.control.CompilerConfiguration;
-import org.codehaus.groovy.control.ErrorCollector;
-import org.codehaus.groovy.control.SourceUnit;
-
-import java.io.File;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * The base parser for creating a module node.
- * The concrete compiler configuration can be specified by the sub-classes of the base parser(e.g. Antlr2Parser, Antlr4Parser)
- *
- * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- * Created on    2016/08/14
- */
-public abstract class AbstractParser {
-    private static final Logger LOGGER = Logger.getLogger(AbstractParser.class.getName());
-
-    public ModuleNode parse(File file) {
-        if (null == file || !file.exists()) {
-            throw new IllegalArgumentException(file + " does not exist.");
-        }
-
-        CompilerConfiguration configuration = this.getCompilerConfiguration();
-        SourceUnit sourceUnit = new SourceUnit(file, configuration, new GroovyClassLoader(), new ErrorCollector(configuration));
-
-        return this.parse(sourceUnit);
-    }
-
-    public ModuleNode parse(String name, String text) {
-        if (null == name) {
-            throw new IllegalArgumentException("name should not be null");
-        }
-
-        if (null == text) {
-            throw new IllegalArgumentException("text should not be null");
-        }
-
-        CompilerConfiguration configuration = this.getCompilerConfiguration();
-        SourceUnit sourceUnit = new SourceUnit(name, text, configuration, new GroovyClassLoader(), new ErrorCollector(configuration));
-
-        return this.parse(sourceUnit);
-    }
-
-    public ModuleNode parse(SourceUnit sourceUnit) {
-        try {
-            sourceUnit.parse();
-            sourceUnit.completePhase();
-            sourceUnit.nextPhase();
-            sourceUnit.convert();
-
-            return sourceUnit.getAST();
-        } catch (Exception e) {
-            LOGGER.log(Level.SEVERE, "Failed to parse " + sourceUnit.getName(), e);
-
-            return null;
-        }
-    }
-
-    protected abstract CompilerConfiguration getCompilerConfiguration();
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/Antlr2Parser.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/Antlr2Parser.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/Antlr2Parser.java
deleted file mode 100644
index 6567896..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/Antlr2Parser.java
+++ /dev/null
@@ -1,34 +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.
- */
-package org.apache.groovy.parser;
-
-import org.codehaus.groovy.control.CompilerConfiguration;
-
-/**
- * The Antlr2 parser for creating a module node.
- *
- * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- * Created on    2016/08/14
- */
-public class Antlr2Parser extends AbstractParser {
-    @Override
-    protected CompilerConfiguration getCompilerConfiguration() {
-        return CompilerConfiguration.DEFAULT;
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/Antlr4Parser.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/Antlr4Parser.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/Antlr4Parser.java
deleted file mode 100644
index ebe569c..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/Antlr4Parser.java
+++ /dev/null
@@ -1,39 +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.
- */
-package org.apache.groovy.parser;
-
-import org.apache.groovy.parser.antlr4.Antlr4PluginFactory;
-import org.codehaus.groovy.control.CompilerConfiguration;
-
-/**
- * The Antlr4 parser for creating a module node.
- *
- * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- * Created on    2016/08/14
- */
-public class Antlr4Parser extends AbstractParser {
-
-    @Override
-    protected CompilerConfiguration getCompilerConfiguration() {
-        CompilerConfiguration configuration = new CompilerConfiguration(CompilerConfiguration.DEFAULT);
-        configuration.setPluginFactory(new Antlr4PluginFactory());
-
-        return configuration;
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractLexer.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractLexer.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractLexer.java
deleted file mode 100644
index b3781b4..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractLexer.java
+++ /dev/null
@@ -1,32 +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.
- */
-package org.apache.groovy.parser.antlr4;
-
-import org.antlr.v4.runtime.CharStream;
-import org.antlr.v4.runtime.Lexer;
-
-/**
- * Because antlr4 does not support generating lexer with specified interface,
- * we have to create a super class for it and implement the interface.
- */
-public abstract class AbstractLexer extends Lexer implements SyntaxErrorReportable {
-    public AbstractLexer(CharStream input) {
-        super(input);
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractParser.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractParser.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractParser.java
deleted file mode 100644
index 95f493d..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractParser.java
+++ /dev/null
@@ -1,32 +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.
- */
-package org.apache.groovy.parser.antlr4;
-
-import org.antlr.v4.runtime.Parser;
-import org.antlr.v4.runtime.TokenStream;
-
-/**
- * Because antlr4 does not support generating parser with specified interface,
- * we have to create a super class for it and implement the interface.
- */
-public abstract class AbstractParser extends Parser implements SyntaxErrorReportable {
-    public AbstractParser(TokenStream input) {
-        super(input);
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4ParserPlugin.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4ParserPlugin.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4ParserPlugin.java
deleted file mode 100644
index 4d91d29..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4ParserPlugin.java
+++ /dev/null
@@ -1,45 +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.
- */
-package org.apache.groovy.parser.antlr4;
-
-import org.codehaus.groovy.ast.ModuleNode;
-import org.codehaus.groovy.control.CompilationFailedException;
-import org.codehaus.groovy.control.ParserPlugin;
-import org.codehaus.groovy.control.SourceUnit;
-import org.codehaus.groovy.syntax.ParserException;
-import org.codehaus.groovy.syntax.Reduction;
-
-/**
- * A parser plugin for the new parser
- *
- * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- * Created on    2016/08/14
- */
-public class Antlr4ParserPlugin implements ParserPlugin {
-    @Override
-    public Reduction parseCST(SourceUnit sourceUnit, java.io.Reader reader) throws CompilationFailedException {
-        return null;
-    }
-
-    @Override
-    public ModuleNode buildAST(SourceUnit sourceUnit, java.lang.ClassLoader classLoader, Reduction cst) throws ParserException {
-        AstBuilder builder = new AstBuilder(sourceUnit, classLoader);
-        return builder.buildAST();
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4PluginFactory.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4PluginFactory.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4PluginFactory.java
deleted file mode 100644
index 10309d0..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4PluginFactory.java
+++ /dev/null
@@ -1,35 +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.
- */
-package org.apache.groovy.parser.antlr4;
-
-import org.codehaus.groovy.control.ParserPlugin;
-import org.codehaus.groovy.control.ParserPluginFactory;
-
-/**
- * A parser plugin factory for the new parser
- *
- * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- * Created on    2016/08/14
- */
-public class Antlr4PluginFactory extends ParserPluginFactory {
-    @Override
-    public ParserPlugin createParserPlugin() {
-        return new Antlr4ParserPlugin();
-    }
-}


[30/50] [abbrv] groovy git commit: GROOVY-8177: Remedial work still needed for groovy-parser-antlr4 subproject

Posted by pa...@apache.org.
GROOVY-8177: Remedial work still needed for groovy-parser-antlr4 subproject


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/a87e465c
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/a87e465c
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/a87e465c

Branch: refs/heads/parrot
Commit: a87e465cce2bc1ebf55e3231e0256f2cdc9d4f1f
Parents: 931b6eb
Author: paulk <pa...@asert.com.au>
Authored: Mon May 8 10:22:08 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:12:31 2017 +1000

----------------------------------------------------------------------
 LICENSE                                         |  2 +-
 licenses/LICENSE-ALLJARJAR                      |  7 +++
 licenses/LICENSE-BINZIP                         |  7 +++
 licenses/LICENSE-JARJAR                         |  7 +++
 licenses/LICENSE-SDK                            |  7 +++
 licenses/antlr4-JARJAR.txt                      |  4 ++
 licenses/antlr4-license.txt                     | 28 ++++++++++
 notices/NOTICE-ALLJARJAR                        |  5 +-
 notices/NOTICE-BINZIP                           |  5 +-
 notices/NOTICE-GROOIDJARJAR                     |  5 +-
 notices/NOTICE-JARJAR                           |  7 ++-
 notices/NOTICE-SDK                              |  5 +-
 notices/antl2-JARJAR.txt                        |  2 -
 notices/antlr2-JARJAR.txt                       |  2 +
 notices/antlr4-JARJAR.txt                       |  2 +
 settings.gradle                                 |  1 +
 subprojects/groovy-parser-antlr4/README.adoc    | 59 ++++++++++++++++++++
 subprojects/groovy-parser-antlr4/README.md      | 36 ------------
 subprojects/groovy-parser-antlr4/build.gradle   | 20 +++++++
 .../apache/groovy/parser/antlr4/GroovyLexer.g4  | 59 ++++++++++----------
 .../apache/groovy/parser/antlr4/GroovyParser.g4 | 59 ++++++++++----------
 .../parser/antlr4/Antlr4PluginFactory.java      | 18 ++++++
 .../groovy/parser/antlr4/GroovyLangLexer.java   | 18 ++++++
 .../groovy/parser/antlr4/GroovydocManager.java  | 18 ++++++
 .../TryWithResourcesASTTransformation.java      | 18 ++++++
 .../test/resources/bugs/BUG-GROOVY-2324.groovy  | 18 ++++++
 .../test/resources/bugs/BUG-GROOVY-4438.groovy  | 18 ++++++
 .../test/resources/bugs/BUG-GROOVY-4757.groovy  | 18 ++++++
 .../test/resources/bugs/BUG-GROOVY-4762.groovy  | 18 ++++++
 .../test/resources/bugs/BUG-GROOVY-5318.groovy  | 18 ++++++
 .../test/resources/bugs/BUG-GROOVY-5652.groovy  | 18 ++++++
 .../test/resources/bugs/BUG-GROOVY-6038.groovy  | 18 ++++++
 .../test/resources/bugs/BUG-GROOVY-8150.groovy  | 18 ++++++
 .../test/resources/bugs/BUG-GROOVY-8161.groovy  | 18 ++++++
 .../src/test/resources/bugs/GROOVY-3898.groovy  | 18 ++++++
 .../core/AnnotationDeclaration_01.groovy        | 18 ++++++
 .../test/resources/core/Annotation_01.groovy    | 18 ++++++
 .../test/resources/core/Annotation_02.groovy    | 18 ++++++
 .../test/resources/core/Annotation_03.groovy    | 18 ++++++
 .../test/resources/core/Annotation_04.groovy    | 18 ++++++
 .../test/resources/core/Annotation_05.groovy    | 18 ++++++
 .../test/resources/core/Annotation_06.groovy    | 18 ++++++
 .../test/resources/core/Annotation_07.groovy    | 18 ++++++
 .../test/resources/core/Annotation_08.groovy    | 18 ++++++
 .../test/resources/core/Annotation_09.groovy    | 18 ++++++
 .../test/resources/core/Annotation_10x.groovy   | 18 ++++++
 .../src/test/resources/core/Array_01x.groovy    | 18 ++++++
 .../src/test/resources/core/Assert_01.groovy    | 18 ++++++
 .../src/test/resources/core/Assert_02x.groovy   | 18 ++++++
 .../src/test/resources/core/Assert_03x.groovy   | 18 ++++++
 .../resources/core/BreakingChange_01x.groovy    | 18 ++++++
 .../resources/core/BreakingChange_02x.groovy    | 18 ++++++
 .../resources/core/BreakingChange_03x.groovy    | 18 ++++++
 .../resources/core/BreakingChange_04x.groovy    | 18 ++++++
 .../resources/core/ClassDeclaration_01.groovy   | 18 ++++++
 .../resources/core/ClassDeclaration_02.groovy   | 18 ++++++
 .../resources/core/ClassDeclaration_03.groovy   | 18 ++++++
 .../resources/core/ClassDeclaration_04.groovy   | 18 ++++++
 .../resources/core/ClassDeclaration_05.groovy   | 18 ++++++
 .../resources/core/ClassDeclaration_06.groovy   | 18 ++++++
 .../resources/core/ClassDeclaration_07.groovy   | 18 ++++++
 .../src/test/resources/core/Closure_01.groovy   | 18 ++++++
 .../src/test/resources/core/Closure_02.groovy   | 18 ++++++
 .../src/test/resources/core/Closure_03.groovy   | 18 ++++++
 .../src/test/resources/core/Closure_04.groovy   | 18 ++++++
 .../src/test/resources/core/Closure_05.groovy   | 18 ++++++
 .../src/test/resources/core/Closure_06.groovy   | 18 ++++++
 .../src/test/resources/core/Closure_07.groovy   | 18 ++++++
 .../src/test/resources/core/Closure_08.groovy   | 18 ++++++
 .../src/test/resources/core/Closure_09.groovy   | 18 ++++++
 .../src/test/resources/core/Closure_10.groovy   | 18 ++++++
 .../test/resources/core/CodeBlock_01x.groovy    | 18 ++++++
 .../src/test/resources/core/Command_01.groovy   | 18 ++++++
 .../src/test/resources/core/Command_02.groovy   | 18 ++++++
 .../src/test/resources/core/Command_03.groovy   | 18 ++++++
 .../src/test/resources/core/Command_04.groovy   | 18 ++++++
 .../src/test/resources/core/Command_05.groovy   | 18 ++++++
 .../src/test/resources/core/Command_06x.groovy  | 18 ++++++
 .../src/test/resources/core/Comments_01.groovy  | 18 ++++++
 .../src/test/resources/core/Comments_02.groovy  | 18 ++++++
 .../resources/core/DefaultMethod_01x.groovy     | 18 ++++++
 .../resources/core/DefaultMethod_02x.groovy     | 18 ++++++
 .../src/test/resources/core/DoWhile_01x.groovy  | 18 ++++++
 .../src/test/resources/core/DoWhile_02x.groovy  | 18 ++++++
 .../src/test/resources/core/DoWhile_03x.groovy  | 18 ++++++
 .../src/test/resources/core/DoWhile_04x.groovy  | 18 ++++++
 .../resources/core/ElvisAssignment_01x.groovy   | 18 ++++++
 .../resources/core/EnumDeclaration_01.groovy    | 18 ++++++
 .../resources/core/EnumDeclaration_02.groovy    | 18 ++++++
 .../resources/core/EnumDeclaration_03.groovy    | 18 ++++++
 .../resources/core/EnumDeclaration_04.groovy    | 18 ++++++
 .../resources/core/EnumDeclaration_05.groovy    | 18 ++++++
 .../test/resources/core/Expression_01.groovy    | 18 ++++++
 .../test/resources/core/Expression_02.groovy    | 18 ++++++
 .../test/resources/core/Expression_03.groovy    | 18 ++++++
 .../test/resources/core/Expression_04.groovy    | 18 ++++++
 .../test/resources/core/Expression_05.groovy    | 18 ++++++
 .../test/resources/core/Expression_06.groovy    | 18 ++++++
 .../test/resources/core/Expression_07.groovy    | 18 ++++++
 .../test/resources/core/Expression_08.groovy    | 18 ++++++
 .../test/resources/core/Expression_09.groovy    | 18 ++++++
 .../test/resources/core/Expression_10.groovy    | 18 ++++++
 .../test/resources/core/Expression_11.groovy    | 18 ++++++
 .../test/resources/core/Expression_12.groovy    | 18 ++++++
 .../test/resources/core/Expression_13.groovy    | 18 ++++++
 .../test/resources/core/Expression_14.groovy    | 18 ++++++
 .../test/resources/core/Expression_15.groovy    | 18 ++++++
 .../test/resources/core/Expression_16.groovy    | 18 ++++++
 .../test/resources/core/Expression_17.groovy    | 18 ++++++
 .../test/resources/core/Expression_18.groovy    | 18 ++++++
 .../test/resources/core/Expression_19.groovy    | 18 ++++++
 .../test/resources/core/Expression_20.groovy    | 18 ++++++
 .../test/resources/core/Expression_21x.groovy   | 18 ++++++
 .../test/resources/core/Expression_22x.groovy   | 18 ++++++
 .../test/resources/core/Expression_23x.groovy   | 18 ++++++
 .../src/test/resources/core/For_01.groovy       | 18 ++++++
 .../src/test/resources/core/For_02.groovy       | 18 ++++++
 .../src/test/resources/core/For_03.groovy       | 18 ++++++
 .../src/test/resources/core/For_04x.groovy      | 18 ++++++
 .../src/test/resources/core/For_05x.groovy      | 18 ++++++
 .../src/test/resources/core/GString_01.groovy   | 18 ++++++
 .../src/test/resources/core/GString_02.groovy   | 18 ++++++
 .../src/test/resources/core/GString_03.groovy   | 18 ++++++
 .../src/test/resources/core/GString_04.groovy   | 18 ++++++
 .../src/test/resources/core/GString_05.groovy   | 18 ++++++
 .../src/test/resources/core/GString_06.groovy   | 18 ++++++
 .../test/resources/core/Groovydoc_01x.groovy    | 18 ++++++
 .../test/resources/core/IdenticalOp_01x.groovy  | 18 ++++++
 .../src/test/resources/core/IfElse_01.groovy    | 18 ++++++
 .../resources/core/ImportDeclaration_01.groovy  | 18 ++++++
 .../resources/core/ImportDeclaration_02.groovy  | 18 ++++++
 .../resources/core/ImportDeclaration_03.groovy  | 18 ++++++
 .../resources/core/ImportDeclaration_04.groovy  | 18 ++++++
 .../resources/core/ImportDeclaration_05.groovy  | 18 ++++++
 .../resources/core/ImportDeclaration_06.groovy  | 18 ++++++
 .../resources/core/ImportDeclaration_07.groovy  | 18 ++++++
 .../resources/core/ImportDeclaration_08.groovy  | 18 ++++++
 .../core/InterfaceDeclaration_01.groovy         | 18 ++++++
 .../core/InterfaceDeclaration_02.groovy         | 18 ++++++
 .../core/InterfaceDeclaration_03.groovy         | 18 ++++++
 .../src/test/resources/core/Label_01.groovy     | 18 ++++++
 .../src/test/resources/core/Lambda_01x.groovy   | 18 ++++++
 .../src/test/resources/core/List_01.groovy      | 18 ++++++
 .../src/test/resources/core/Literal_01.groovy   | 18 ++++++
 .../src/test/resources/core/Literal_02.groovy   | 18 ++++++
 .../src/test/resources/core/Literal_03.groovy   | 18 ++++++
 .../core/LocalVariableDeclaration_01.groovy     | 18 ++++++
 .../src/test/resources/core/Map_01.groovy       | 18 ++++++
 .../resources/core/MethodDeclaration_01.groovy  | 18 ++++++
 .../resources/core/MethodDeclaration_02.groovy  | 18 ++++++
 .../resources/core/MethodPointer_01x.groovy     | 18 ++++++
 .../resources/core/MethodReference_01x.groovy   | 18 ++++++
 .../core/NegativeRelationalOperators_01x.groovy | 18 ++++++
 .../core/NegativeRelationalOperators_02x.groovy | 18 ++++++
 .../resources/core/PackageDeclaration_01.groovy | 18 ++++++
 .../resources/core/PackageDeclaration_02.groovy | 18 ++++++
 .../resources/core/PackageDeclaration_03.groovy | 18 ++++++
 .../resources/core/PackageDeclaration_04.groovy | 18 ++++++
 .../resources/core/PackageDeclaration_05.groovy | 18 ++++++
 .../resources/core/PackageDeclaration_06.groovy | 18 ++++++
 .../src/test/resources/core/Return_01.groovy    | 18 ++++++
 .../test/resources/core/SafeIndex_01x.groovy    | 18 ++++++
 .../test/resources/core/SafeIndex_02x.groovy    | 18 ++++++
 .../test/resources/core/SafeIndex_03x.groovy    | 18 ++++++
 .../src/test/resources/core/Script_01x.groovy   | 18 ++++++
 .../src/test/resources/core/Switch_01.groovy    | 18 ++++++
 .../test/resources/core/Synchronized_01.groovy  | 18 ++++++
 .../src/test/resources/core/Throw_01.groovy     | 18 ++++++
 .../resources/core/TraitDeclaration_01.groovy   | 18 ++++++
 .../resources/core/TraitDeclaration_02.groovy   | 18 ++++++
 .../resources/core/TraitDeclaration_03.groovy   | 18 ++++++
 .../resources/core/TraitDeclaration_04.groovy   | 18 ++++++
 .../resources/core/TraitDeclaration_05.groovy   | 18 ++++++
 .../src/test/resources/core/TryCatch_01.groovy  | 18 ++++++
 .../resources/core/TryWithResources_01x.groovy  | 18 ++++++
 .../src/test/resources/core/Unicode_01.groovy   | 18 ++++++
 .../src/test/resources/core/While_01.groovy     | 18 ++++++
 .../src/test/resources/core/While_02x.groovy    | 18 ++++++
 .../resources/fail/AbstractMethod_01x.groovy    | 18 ++++++
 .../resources/fail/AbstractMethod_02x.groovy    | 18 ++++++
 .../resources/fail/AbstractMethod_03x.groovy    | 18 ++++++
 .../resources/fail/AbstractMethod_04x.groovy    | 18 ++++++
 .../resources/fail/AbstractMethod_05x.groovy    | 18 ++++++
 .../resources/fail/AbstractMethod_06x.groovy    | 18 ++++++
 .../src/test/resources/fail/Break_01x.groovy    | 18 ++++++
 .../src/test/resources/fail/Break_02x.groovy    | 18 ++++++
 .../resources/fail/ClassDeclaration_01x.groovy  | 18 ++++++
 .../fail/ClosureListExpression_01.groovy        | 18 ++++++
 .../fail/ClosureListExpression_02.groovy        | 18 ++++++
 .../fail/ClosureListExpression_03.groovy        | 18 ++++++
 .../fail/ClosureListExpression_04.groovy        | 18 ++++++
 .../fail/ConstructorDeclaration_01.groovy       | 18 ++++++
 .../src/test/resources/fail/Continue_01x.groovy | 18 ++++++
 .../src/test/resources/fail/Continue_02x.groovy | 18 ++++++
 .../src/test/resources/fail/DoWhile_01x.groovy  | 18 ++++++
 .../test/resources/fail/Expression_01.groovy    | 18 ++++++
 .../test/resources/fail/Expression_02.groovy    | 18 ++++++
 .../test/resources/fail/Expression_03.groovy    | 18 ++++++
 .../test/resources/fail/Expression_04.groovy    | 18 ++++++
 .../test/resources/fail/Expression_05.groovy    | 18 ++++++
 .../test/resources/fail/Expression_06.groovy    | 18 ++++++
 .../test/resources/fail/Expression_07.groovy    | 18 ++++++
 .../test/resources/fail/Expression_08.groovy    | 18 ++++++
 .../test/resources/fail/Expression_09.groovy    | 18 ++++++
 .../src/test/resources/fail/For_01.groovy       | 18 ++++++
 .../src/test/resources/fail/For_02.groovy       | 18 ++++++
 .../fail/InterfaceDeclaration_01.groovy         | 18 ++++++
 .../src/test/resources/fail/List_01.groovy      | 18 ++++++
 .../fail/LocalVariableDeclaration_01.groovy     | 18 ++++++
 .../resources/fail/MethodDeclaration_01.groovy  | 18 ++++++
 .../src/test/resources/fail/Modifier_01x.groovy | 18 ++++++
 .../src/test/resources/fail/Modifier_02x.groovy | 18 ++++++
 .../src/test/resources/fail/Modifier_03x.groovy | 18 ++++++
 .../src/test/resources/fail/Modifier_04x.groovy | 18 ++++++
 .../src/test/resources/fail/Modifier_05x.groovy | 18 ++++++
 .../src/test/resources/fail/Modifier_07.groovy  | 18 ++++++
 .../resources/fail/ParExpression_01x.groovy     | 18 ++++++
 .../resources/fail/ParExpression_02x.groovy     | 18 ++++++
 .../resources/fail/ParExpression_03x.groovy     | 18 ++++++
 .../test/resources/fail/Parentheses_01.groovy   | 18 ++++++
 .../src/test/resources/fail/Super_01x.groovy    | 18 ++++++
 .../src/test/resources/fail/Switch_01.groovy    | 18 ++++++
 .../src/test/resources/fail/This_01x.groovy     | 18 ++++++
 .../fail/UnexpectedCharacter_01x.groovy         | 18 ++++++
 .../src/test/resources/fail/Void_01x.groovy     | 18 ++++++
 .../src/test/resources/fail/Void_02x.groovy     | 18 ++++++
 226 files changed, 3914 insertions(+), 105 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index e7ea684..92f2ba3 100644
--- a/LICENSE
+++ b/LICENSE
@@ -218,7 +218,7 @@ The following class within this product:
     org.codehaus.groovy.tools.shell.completion.FileNameCompleter
 
 was derived from JLine 2.12, and the following patch:
-https://github.com/jline/jline2/pull/204
+https://github.com/jline/jline2/issues/90
 JLine2 is made available under a BSD License.
 For details, see licenses/jline2-license.
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/licenses/LICENSE-ALLJARJAR
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-ALLJARJAR b/licenses/LICENSE-ALLJARJAR
index 4d50ed9..4452273 100644
--- a/licenses/LICENSE-ALLJARJAR
+++ b/licenses/LICENSE-ALLJARJAR
@@ -210,6 +210,13 @@ See licenses/antlr2-license.txt for details.
 
 ------------------------------------------------------------------------
 
+ANTLR 4 License
+
+Antlr4 is released under a BSD 3-clause license.
+See licenses/antlr4-license.txt for details.
+
+------------------------------------------------------------------------
+
 ASM 4 License
 
 ASM 4 uses a 3-clause BSD license. For details, see licenses/asm-license.txt.

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/licenses/LICENSE-BINZIP
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-BINZIP b/licenses/LICENSE-BINZIP
index 939e067..bb6a7b6 100644
--- a/licenses/LICENSE-BINZIP
+++ b/licenses/LICENSE-BINZIP
@@ -210,6 +210,13 @@ See licenses/antlr2-license.txt for details.
 
 ------------------------------------------------------------------------
 
+ANTLR 4 License
+
+Antlr4 is released under a BSD 3-clause license.
+See licenses/antlr4-license.txt for details.
+
+------------------------------------------------------------------------
+
 ASM 4 License
 
 ASM 4 uses a 3-clause BSD license. For details, see licenses/asm-license.txt.

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/licenses/LICENSE-JARJAR
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-JARJAR b/licenses/LICENSE-JARJAR
index b301ada..afe4619 100644
--- a/licenses/LICENSE-JARJAR
+++ b/licenses/LICENSE-JARJAR
@@ -210,6 +210,13 @@ See licenses/antlr2-license.txt for details.
 
 ------------------------------------------------------------------------
 
+ANTLR 4 License
+
+Antlr4 is released under a BSD 3-clause license.
+See licenses/antlr4-license.txt for details.
+
+------------------------------------------------------------------------
+
 ASM 4 License
 
 ASM 4 uses a 3-clause BSD license. For details, see licenses/asm-license.txt.

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/licenses/LICENSE-SDK
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-SDK b/licenses/LICENSE-SDK
index 10e722c..cf1451e 100644
--- a/licenses/LICENSE-SDK
+++ b/licenses/LICENSE-SDK
@@ -210,6 +210,13 @@ See licenses/antlr2-license.txt for details.
 
 ------------------------------------------------------------------------
 
+ANTLR 4 License
+
+Antlr4 is released under a BSD 3-clause license.
+See licenses/antlr4-license.txt for details.
+
+------------------------------------------------------------------------
+
 ASM 4 License
 
 ASM 4 uses a 3-clause BSD license. For details, see licenses/asm-license.txt.

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/licenses/antlr4-JARJAR.txt
----------------------------------------------------------------------
diff --git a/licenses/antlr4-JARJAR.txt b/licenses/antlr4-JARJAR.txt
new file mode 100644
index 0000000..2e91292
--- /dev/null
+++ b/licenses/antlr4-JARJAR.txt
@@ -0,0 +1,4 @@
+ANTLR 4 License
+
+Antlr4 is released under a BSD 3-clause license.
+See licenses/antlr4-license.txt for details.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/licenses/antlr4-license.txt
----------------------------------------------------------------------
diff --git a/licenses/antlr4-license.txt b/licenses/antlr4-license.txt
new file mode 100644
index 0000000..b7660bb
--- /dev/null
+++ b/licenses/antlr4-license.txt
@@ -0,0 +1,28 @@
+ANTLR 4 License
+
+[The "BSD 3-clause license"]
+Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the copyright holder nor the names of its contributors
+    may be used to endorse or promote products derived from this software
+    without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/notices/NOTICE-ALLJARJAR
----------------------------------------------------------------------
diff --git a/notices/NOTICE-ALLJARJAR b/notices/NOTICE-ALLJARJAR
index 23fcbe3..450d991 100644
--- a/notices/NOTICE-ALLJARJAR
+++ b/notices/NOTICE-ALLJARJAR
@@ -4,9 +4,12 @@ Copyright 2003-2017 The Apache Software Foundation
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
-This product includes/uses ANTLR (http://www.antlr2.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.
+
 This product bundles icons from the famfamfam.com silk icons set
 http://www.famfamfam.com/lab/icons/silk/
 Licensed under the Creative Commons Attribution Licence v2.5

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/notices/NOTICE-BINZIP
----------------------------------------------------------------------
diff --git a/notices/NOTICE-BINZIP b/notices/NOTICE-BINZIP
index 843691c..dacb821 100644
--- a/notices/NOTICE-BINZIP
+++ b/notices/NOTICE-BINZIP
@@ -4,9 +4,12 @@ Copyright 2003-2017 The Apache Software Foundation
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
-This product includes/uses ANTLR (http://www.antlr2.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.
+
 This product bundles the JUnit jar (junit.org)
 which is available under the terms of the Eclipse Public License v1.0
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/notices/NOTICE-GROOIDJARJAR
----------------------------------------------------------------------
diff --git a/notices/NOTICE-GROOIDJARJAR b/notices/NOTICE-GROOIDJARJAR
index 58a255b..7ce0950 100644
--- a/notices/NOTICE-GROOIDJARJAR
+++ b/notices/NOTICE-GROOIDJARJAR
@@ -4,9 +4,12 @@ Copyright 2003-2017 The Apache Software Foundation
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
-This product includes/uses ANTLR (http://www.antlr2.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.
+
 This product embeds the OpenBeans jar within its grooid jar artifacts
 OpenBeans includes/uses files from Apache Harmony and the following notice applies
 Copyright 2006, 2010 The Apache Software Foundation.

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/notices/NOTICE-JARJAR
----------------------------------------------------------------------
diff --git a/notices/NOTICE-JARJAR b/notices/NOTICE-JARJAR
index ecb27f2..4c5bbd8 100644
--- a/notices/NOTICE-JARJAR
+++ b/notices/NOTICE-JARJAR
@@ -4,5 +4,8 @@ Copyright 2003-2017 The Apache Software Foundation
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
-This product includes/uses ANTLR (http://www.antlr2.org/)
-developed by Terence Parr 1989-2006
\ No newline at end of file
+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

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/notices/NOTICE-SDK
----------------------------------------------------------------------
diff --git a/notices/NOTICE-SDK b/notices/NOTICE-SDK
index f9f2573..5910cc8 100644
--- a/notices/NOTICE-SDK
+++ b/notices/NOTICE-SDK
@@ -4,9 +4,12 @@ Copyright 2003-2017 The Apache Software Foundation
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
-This product includes/uses ANTLR (http://www.antlr2.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.
+
 This product bundles the JUnit jar (junit.org)
 which is available under the terms of the Eclipse Public License v1.0
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/notices/antl2-JARJAR.txt
----------------------------------------------------------------------
diff --git a/notices/antl2-JARJAR.txt b/notices/antl2-JARJAR.txt
deleted file mode 100644
index 935eedd..0000000
--- a/notices/antl2-JARJAR.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This product includes/uses ANTLR (http://www.antlr2.org/)
-developed by Terence Parr 1989-2006

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/notices/antlr2-JARJAR.txt
----------------------------------------------------------------------
diff --git a/notices/antlr2-JARJAR.txt b/notices/antlr2-JARJAR.txt
new file mode 100644
index 0000000..da96f51
--- /dev/null
+++ b/notices/antlr2-JARJAR.txt
@@ -0,0 +1,2 @@
+This product includes/uses ANTLR2 (http://www.antlr2.org/)
+developed by Terence Parr 1989-2006

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/notices/antlr4-JARJAR.txt
----------------------------------------------------------------------
diff --git a/notices/antlr4-JARJAR.txt b/notices/antlr4-JARJAR.txt
new file mode 100644
index 0000000..41d715b
--- /dev/null
+++ b/notices/antlr4-JARJAR.txt
@@ -0,0 +1,2 @@
+This product includes/uses ANTLR4 (https://github.com/antlr/antlr4)
+Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/settings.gradle
----------------------------------------------------------------------
diff --git a/settings.gradle b/settings.gradle
index 5df4d51..56b0dc4 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -33,6 +33,7 @@ def subprojects = ['groovy-ant',
         'groovy-test',
         'groovy-testng',
         'groovy-xml',
+        'groovy-parser-antlr4',
         'groovy-macro'
 ]
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/README.adoc
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/README.adoc b/subprojects/groovy-parser-antlr4/README.adoc
new file mode 100644
index 0000000..4170426
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/README.adoc
@@ -0,0 +1,59 @@
+//////////////////////////////////////////
+
+  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 loop, standard loop(e.g. `for(int i = 0, j = 10; i < j; i++, j--) {..}`)
+* lambda expression
+* method reference and constructor reference
+* try-with-resources(i.e. ARM)
+* code block(i.e. `{..}`)
+* array initializer of Java style(e.g. `new int[] {1, 2, 3}`)
+* default method of interface
+* new operators: identity operators(`===`, `!==`), elvis assignment(`?=`), `!in`, `!instanceof`
+* safe index(e.g. `nullableVar?[1, 2]`)
+* runtime groovydoc(i.e. groovydoc with `@Groovydoc`), groovydoc attached to AST node as metadata
+
+=== How to enable the new parser
+
+* In the gradle build the property useAntlr4 has to be set to enable the build of the parser and the execution of all tests with it. Command line example:
+```
+./gradlew -PuseAntlr4=true bootstrapJar
+```
+* To enable the new parser automatically at runtime the system property groovy.antlr4 has to be set. Command line example:
+```
+export JAVA_OPTS="-Dgroovy.antlr4=true"
+groovy foo.groovy
+```
+* This system property also controls groovyc and has to be used in case it is used outside of this build, for example with:
+```
+groovyOptions.forkOptions.jvmArgs += ["-Dgroovy.antlr4=true"]
+```
+
+=== JVM system properties to control parsing
+
+* `groovy.antlr4.cache.threshold`: how frequently to clear DFA cache(default: 50). **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.extract.doc.comment`: whether to collect groovydoc while parsing groovy source code(default: false)
+
+*P.S. Parrot is based on the highly optimized version of antlr4(com.tunnelvisionlabs:antlr4), which is licensed under BSD.*
+ 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/README.md
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/README.md b/subprojects/groovy-parser-antlr4/README.md
deleted file mode 100644
index c21720e..0000000
--- a/subprojects/groovy-parser-antlr4/README.md
+++ /dev/null
@@ -1,36 +0,0 @@
-## 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 loop, standard loop(e.g. `for(int i = 0, j = 10; i < j; i++, j--) {..}`)
-* lambda expression
-* method reference and constructor reference
-* try-with-resources(i.e. ARM)
-* code block(i.e. `{..}`)
-* array initializer of Java style(e.g. `new int[] {1, 2, 3}`)
-* default method of interface
-* new operators: identity operators(`===`, `!==`), elvis assignment(`?=`), `!in`, `!instanceof`
-* safe index(e.g. `nullableVar?[1, 2]`)
-* runtime groovydoc(i.e. groovydoc with `@Groovydoc`), groovydoc attached to AST node as metadata
-
-**How to enable the new parser**
-* In the gradle build the property useAntlr4 has to be set to enable the build of the parser and the execution of all tests with it. Command line example:
-```
-./gradlew -PuseAntlr4=true bootstrapJar
-```
-* To enable the new parser automatically at runtime the system property groovy.antlr4 has to be set. Command line example:
-```
-export JAVA_OPTS="-Dgroovy.antlr4=true"
-groovy foo.groovy
-```
-* This system property also controls groovyc and has to be used in case it is used outside of this build, for example with:
-```
-groovyOptions.forkOptions.jvmArgs += ["-Dgroovy.antlr4=true"]
-```
-
-**JVM system properties to control parsing:**
-* `groovy.antlr4.cache.threshold`: how frequently to clear DFA cache(default: 50). **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.extract.doc.comment`: whether to collect groovydoc while parsing groovy source code(default: false)
-
-*P.S. Parrot is based on the highly optimized version of antlr4(com.tunnelvisionlabs:antlr4), which is licensed under BSD.*
- 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/build.gradle
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/build.gradle b/subprojects/groovy-parser-antlr4/build.gradle
index 54d07a4..7570dcf 100644
--- a/subprojects/groovy-parser-antlr4/build.gradle
+++ b/subprojects/groovy-parser-antlr4/build.gradle
@@ -1,3 +1,23 @@
+/*
+ *  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.
+ */
+if (!rootProject.hasProperty('useAntlr4')) return
+
 apply plugin: 'me.champeau.gradle.antlr4'
 
 def srcBase = "subprojects/groovy-parser-antlr4/src"

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyLexer.g4
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyLexer.g4 b/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyLexer.g4
index cdcfeea..7bcec42 100644
--- a/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyLexer.g4
+++ b/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyLexer.g4
@@ -1,36 +1,35 @@
 /*
- [The "BSD licence"]
- Copyright (c) 2013 Terence Parr, Sam Harwell
- Copyright (c) 2016 Daniel Sun
- All rights reserved.
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
- 3. The name of the author may not be used to endorse or promote products
-    derived from this software without specific prior written permission.
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/**
- * The Groovy grammar is based on the official grammar for Java(https://github.com/antlr/grammars-v4/blob/master/java/Java.g4)
+ * This file is adapted from the Antlr4 Java grammar which has the following license
+ *
+ *  Copyright (c) 2013 Terence Parr, Sam Harwell
+ *  All rights reserved.
+ *  [The "BSD licence"]
+ *
+ *    http://www.opensource.org/licenses/bsd-license.php
+ *
+ * Subsequent modifications by the Groovy community have been done under the Apache License v2:
  *
- * @author <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- * Created on   2016/08/14
+ *  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.
+ */
+
+/**
+ * The Groovy grammar is based on the official grammar for Java:
+ * https://github.com/antlr/grammars-v4/blob/master/java/Java.g4
  */
 lexer grammar GroovyLexer;
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4 b/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
index 6775320..6ddf17f 100644
--- a/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
+++ b/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
@@ -1,36 +1,35 @@
 /*
- [The "BSD licence"]
- Copyright (c) 2013 Terence Parr, Sam Harwell
- Copyright (c) 2016 Daniel Sun
- All rights reserved.
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
- 3. The name of the author may not be used to endorse or promote products
-    derived from this software without specific prior written permission.
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/**
- * The Groovy grammar is based on the official grammar for Java(https://github.com/antlr/grammars-v4/blob/master/java/Java.g4)
+ * This file is adapted from the Antlr4 Java grammar which has the following license
+ *
+ *  Copyright (c) 2013 Terence Parr, Sam Harwell
+ *  All rights reserved.
+ *  [The "BSD licence"]
+ *
+ *    http://www.opensource.org/licenses/bsd-license.php
+ *
+ * Subsequent modifications by the Groovy community have been done under the Apache License v2:
  *
- * @author <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- * Created on   2016/08/14
+ *  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.
+ */
+
+/**
+ * The Groovy grammar is based on the official grammar for Java:
+ * https://github.com/antlr/grammars-v4/blob/master/java/Java.g4
  */
 parser grammar GroovyParser;
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4PluginFactory.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4PluginFactory.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4PluginFactory.java
index 92e013f..10309d0 100644
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4PluginFactory.java
+++ b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4PluginFactory.java
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package org.apache.groovy.parser.antlr4;
 
 import org.codehaus.groovy.control.ParserPlugin;

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangLexer.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangLexer.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangLexer.java
index 8d20ad6..d3b7538 100644
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangLexer.java
+++ b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangLexer.java
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package org.apache.groovy.parser.antlr4;
 
 import org.antlr.v4.runtime.CharStream;

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovydocManager.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovydocManager.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovydocManager.java
index 20be29d..449b2e7 100644
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovydocManager.java
+++ b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovydocManager.java
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package org.apache.groovy.parser.antlr4;
 
 import groovy.lang.Groovydoc;

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/TryWithResourcesASTTransformation.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/TryWithResourcesASTTransformation.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/TryWithResourcesASTTransformation.java
index e342a3f..cbe3697 100644
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/TryWithResourcesASTTransformation.java
+++ b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/TryWithResourcesASTTransformation.java
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package org.apache.groovy.parser.antlr4;
 
 import org.codehaus.groovy.ast.ClassHelper;

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-2324.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-2324.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-2324.groovy
index 79cab4f..30e2f30 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-2324.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-2324.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 class Foo {}
 
 Foo bar

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4438.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4438.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4438.groovy
index c62dfec..41ee327 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4438.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4438.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 enum Outer {
     A, B
     enum Inner{X, Y}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4757.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4757.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4757.groovy
index cf2da99..1a7d2e5 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4757.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4757.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package bugs
 
 class Foo {

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4762.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4762.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4762.groovy
index 54e71f2..235f6a5 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4762.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-4762.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package bugs
 
 def get123() {2}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5318.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5318.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5318.groovy
index 089e97b..13cb623 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5318.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5318.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 def a= new java.util<Integer>.ArrayList<ArrayList<Integer>>()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5652.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5652.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5652.groovy
index 329a17a..e7c6b3f 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5652.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-5652.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package bugs
 
 def list = [[1,2],[3,4]] as List<List<Integer>>

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-6038.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-6038.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-6038.groovy
index 0feb6e0..f41c5e9 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-6038.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-6038.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import java.lang.annotation.*
 
 @Retention(RetentionPolicy.RUNTIME)

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8150.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8150.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8150.groovy
index 0c8b676..ac0cc9d 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8150.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8150.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 def a
 def b = [1]
 ((a)) = b
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
index c7913ed..0b54cda 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/BUG-GROOVY-8161.groovy
@@ -1,2 +1,20 @@
+/*
+ *  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.
+ */
 for (foo in []) {;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/bugs/GROOVY-3898.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/GROOVY-3898.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/GROOVY-3898.groovy
index 9f07edb..146b5e6 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/bugs/GROOVY-3898.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/bugs/GROOVY-3898.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package bugs
 
 int result = 1

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/AnnotationDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/AnnotationDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/AnnotationDeclaration_01.groovy
index 3c5662b..88f3a3d 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/AnnotationDeclaration_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/AnnotationDeclaration_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import org.codehaus.groovy.transform.GroovyASTTransformationClass
 
 import java.lang.annotation.Documented

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_01.groovy
index 6dbf1f7..c86b156 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_01.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 @Export package core

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_02.groovy
index d673313..8d624ae 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_02.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_02.groovy
@@ -1,2 +1,20 @@
+/*
+ *  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.
+ */
 @Export
 package core

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_03.groovy
index 644de35..4bea111 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_03.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_03.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 @Export
 @Version
 package core

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_04.groovy
index 5edeef2..a3e7d8c 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_04.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_04.groovy
@@ -1,2 +1,20 @@
+/*
+ *  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.
+ */
 @Export @Version
 package core

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_05.groovy
index 545d6d5..855b57f 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_05.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_05.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 @Test1 import java.util.Map

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_06.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_06.groovy
index 068d6c3..b53f38d 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_06.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_06.groovy
@@ -1,2 +1,20 @@
+/*
+ *  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.
+ */
 @Test1
 import java.util.Map

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_07.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_07.groovy
index bb777ca..bbb83e3 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_07.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_07.groovy
@@ -1,2 +1,20 @@
+/*
+ *  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.
+ */
 @Test1 @Test2
 import java.util.Map

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_08.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_08.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_08.groovy
index 60d51eb..7a2e4d0 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_08.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_08.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 @Test1 @Test2 @Test3
 import java.util.Map
 @Test1 @Test2 @Test3

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_09.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_09.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_09.groovy
index 98f565a..b5753c4 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_09.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_09.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 @Test1(12)
 @Test1(@Test1)
 @Test2(v=6)

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_10x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_10x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_10x.groovy
index 22cd289..1ee354b 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_10x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Annotation_10x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import java.lang.annotation.RetentionPolicy
 import java.lang.annotation.Retention
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Array_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Array_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Array_01x.groovy
index 2092db4..9af7957 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Array_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Array_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import groovy.transform.CompileStatic
 
 def testArrayInitializer() {

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_01.groovy
index f9a50e0..f790083 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 assert true
 assert true;
 assert true : ':(';

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_02x.groovy
index 887f0b9..659232d 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_02x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_02x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import org.codehaus.groovy.runtime.powerassert.PowerAssertionError
 
 testBinaryExpression()

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_03x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_03x.groovy
index 75d305a..71f4540 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_03x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Assert_03x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import org.codehaus.groovy.runtime.powerassert.PowerAssertionError
 
 testPostfixExpression()

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_01x.groovy
index 3f3b856..33bb86d 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package core
 
 class a<T> {

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_02x.groovy
index 62e90ed..3c38453 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_02x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/BreakingChange_02x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package core
 
 import java.util.concurrent.atomic.AtomicInteger


[34/50] [abbrv] groovy git commit: rename antlr4 parser to remove groovy- prefix since that is by convention for modules

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Annotation_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Annotation_03.groovy b/subprojects/parser-antlr4/src/test/resources/core/Annotation_03.groovy
new file mode 100644
index 0000000..4bea111
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Annotation_03.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+@Export
+@Version
+package core

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Annotation_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Annotation_04.groovy b/subprojects/parser-antlr4/src/test/resources/core/Annotation_04.groovy
new file mode 100644
index 0000000..a3e7d8c
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Annotation_04.groovy
@@ -0,0 +1,20 @@
+/*
+ *  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.
+ */
+@Export @Version
+package core

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Annotation_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Annotation_05.groovy b/subprojects/parser-antlr4/src/test/resources/core/Annotation_05.groovy
new file mode 100644
index 0000000..855b57f
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Annotation_05.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+@Test1 import java.util.Map

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Annotation_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Annotation_06.groovy b/subprojects/parser-antlr4/src/test/resources/core/Annotation_06.groovy
new file mode 100644
index 0000000..b53f38d
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Annotation_06.groovy
@@ -0,0 +1,20 @@
+/*
+ *  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.
+ */
+@Test1
+import java.util.Map

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Annotation_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Annotation_07.groovy b/subprojects/parser-antlr4/src/test/resources/core/Annotation_07.groovy
new file mode 100644
index 0000000..bbb83e3
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Annotation_07.groovy
@@ -0,0 +1,20 @@
+/*
+ *  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.
+ */
+@Test1 @Test2
+import java.util.Map

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Annotation_08.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Annotation_08.groovy b/subprojects/parser-antlr4/src/test/resources/core/Annotation_08.groovy
new file mode 100644
index 0000000..7a2e4d0
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Annotation_08.groovy
@@ -0,0 +1,28 @@
+/*
+ *  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.
+ */
+@Test1 @Test2 @Test3
+import java.util.Map
+@Test1 @Test2 @Test3
+import java.util.*
+@Test1 @Test2 @Test3
+import static java.lang.Math
+@Test1 @Test2 @Test3
+import static java.lang.Math.*
+@Test1 @Test2 @Test3
+import static java.lang.Math.pow

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Annotation_09.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Annotation_09.groovy b/subprojects/parser-antlr4/src/test/resources/core/Annotation_09.groovy
new file mode 100644
index 0000000..b5753c4
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Annotation_09.groovy
@@ -0,0 +1,32 @@
+/*
+ *  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.
+ */
+@Test1(12)
+@Test1(@Test1)
+@Test2(v=6)
+@Test3(v1=6, v2=8, v3=10)
+@Test4([1, 2, 3])
+@Test5(v=[1, 2, 3])
+@Test6(v1=[1, 2, 3], v2=[1], v3=6)
+package core
+
+@Grapes([
+        @Grab('xx:yy:1.0'), // xx
+        @Grab('zz:yy:1.0') /* zz */
+])
+import xx.yy.ZZ;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Annotation_10x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Annotation_10x.groovy b/subprojects/parser-antlr4/src/test/resources/core/Annotation_10x.groovy
new file mode 100644
index 0000000..1ee354b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Annotation_10x.groovy
@@ -0,0 +1,38 @@
+/*
+ *  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.
+ */
+import java.lang.annotation.RetentionPolicy
+import java.lang.annotation.Retention
+
+def closureClass = NestedAnnotationWithDefault.getAnnotation(AnnWithNestedAnnWithDefault).elem().elem()
+def closure = closureClass.newInstance(null, null)
+assert closure.call() == 3
+
+
+@AnnWithNestedAnnWithDefault(elem = @AnnWithDefaultValue())
+class NestedAnnotationWithDefault {}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AnnWithDefaultValue {
+    Class elem() default { 1 + 2 }
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AnnWithNestedAnnWithDefault {
+    AnnWithDefaultValue elem()
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Array_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Array_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/Array_01x.groovy
new file mode 100644
index 0000000..9af7957
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Array_01x.groovy
@@ -0,0 +1,104 @@
+/*
+ *  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.
+ */
+import groovy.transform.CompileStatic
+
+def testArrayInitializer() {
+    def x = new double[] {}
+    assert x.length == 0
+
+    def y = new double[][] {}
+    assert y.length == 0
+
+    def a = new int[] {1, 2}
+    assert a[0] == 1
+    assert a[1] == 2
+    assert a as List == [1, 2]
+
+    def b = new int[][] {
+        new int[] {1, 1.plus(1)},
+        new int[] {2.plus(1), 4}
+    }
+    assert b[0][0] == 1
+    assert b[0][1] == 2
+    assert b[1][0] == 3
+    assert b[1][1] == 4
+
+    def c = new String[] {
+        'a'
+        ,
+        'b'
+        ,
+        'c'
+        ,
+    }
+    assert c[0] == 'a'
+    assert c[1] == 'b'
+    assert c[2] == 'c'
+
+    assert new String[]
+            {
+                'a', 'b'
+            }
+    ==
+            ['a', 'b'] as String[]
+}
+testArrayInitializer();
+
+@CompileStatic
+def testArrayInitializerCS() {
+    def x = new double[] {}
+    assert x.length == 0
+
+    def y = new double[][] {}
+    assert y.length == 0
+
+    def a = new int[] {1, 2}
+    assert a[0] == 1
+    assert a[1] == 2
+    assert a as List == [1, 2]
+
+    def b = new int[][] {
+        new int[] {1, 1.plus(1)},
+        new int[] {2.plus(1), 4}
+    }
+    assert b[0][0] == 1
+    assert b[0][1] == 2
+    assert b[1][0] == 3
+    assert b[1][1] == 4
+
+    def c = new String[] {
+        'a'
+        ,
+        'b'
+        ,
+        'c'
+        ,
+    }
+    assert c[0] == 'a'
+    assert c[1] == 'b'
+    assert c[2] == 'c'
+
+    assert new String[]
+            {
+                'a', 'b'
+            }
+    ==
+    ['a', 'b'] as String[]
+}
+testArrayInitializerCS();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Assert_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Assert_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Assert_01.groovy
new file mode 100644
index 0000000..f790083
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Assert_01.groovy
@@ -0,0 +1,46 @@
+/*
+ *  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.
+ */
+assert true
+assert true;
+assert true : ':(';
+assert true , ':(';
+assert true :
+        ':('
+assert true ,
+        ':(';
+
+assert true:    \
+    'hello, world'
+
+assert true,    \
+    'hello, world'
+
+assert 1 \
+        + 2 * \
+        3 :    \
+        'hello, world'
+
+assert 1 \
+        + 2 * \
+\
+        3 :    \
+\
+\
+'hello, world'
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Assert_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Assert_02x.groovy b/subprojects/parser-antlr4/src/test/resources/core/Assert_02x.groovy
new file mode 100644
index 0000000..659232d
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Assert_02x.groovy
@@ -0,0 +1,55 @@
+/*
+ *  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.
+ */
+import org.codehaus.groovy.runtime.powerassert.PowerAssertionError
+
+testBinaryExpression()
+
+/***********************************/
+void testBinaryExpression() {
+    isRendered """
+assert a * b
+       | | |
+       0 0 1
+        """, {
+        def a = 0
+        def b = 1
+        assert a * b
+    }
+
+    isRendered """
+assert a[b]
+       |||
+       ||0
+       |false
+       [false]
+        """, {
+        def a = [false]
+        def b = 0
+        assert a[b]
+    }
+}
+
+static isRendered(String expectedRendering, Closure failingAssertion) {
+    try {
+        failingAssertion.call();
+        assert false, "assertion should have failed but didn't"
+    } catch (PowerAssertionError e) {
+        assert expectedRendering.trim() == e.message.trim()
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Assert_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Assert_03x.groovy b/subprojects/parser-antlr4/src/test/resources/core/Assert_03x.groovy
new file mode 100644
index 0000000..71f4540
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Assert_03x.groovy
@@ -0,0 +1,44 @@
+/*
+ *  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.
+ */
+import org.codehaus.groovy.runtime.powerassert.PowerAssertionError
+
+testPostfixExpression()
+
+/***********************************/
+
+void testPostfixExpression() {
+    isRendered """
+assert x++ == null
+       ||  |
+       |0  false
+       0
+        """, {
+        def x = 0
+        assert x++ == null
+    }
+}
+
+static isRendered(String expectedRendering, Closure failingAssertion) {
+    try {
+        failingAssertion.call();
+        assert false, "assertion should have failed but didn't"
+    } catch (PowerAssertionError e) {
+        assert expectedRendering.trim() == e.message.trim()
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_01x.groovy
new file mode 100644
index 0000000..33bb86d
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_01x.groovy
@@ -0,0 +1,42 @@
+/*
+ *  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.
+ */
+package core
+
+class a<T> {
+    int x = 1;
+}
+
+a b = new a()
+assert b.x == 1
+
+a<String> b2 = new a<String>()
+assert b2.x == 1
+
+a<String>[] b3 = new a<String>[0]
+assert b3.length == 0
+
+core.a b4 = new a()
+assert b4.x == 1
+
+core.a<String> b5 = new a<String>()
+assert b5.x == 1
+
+core.a<String>[] b6 = new a<String>[0]
+assert b6.length == 0
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_02x.groovy b/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_02x.groovy
new file mode 100644
index 0000000..3c38453
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_02x.groovy
@@ -0,0 +1,27 @@
+/*
+ *  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.
+ */
+package core
+
+import java.util.concurrent.atomic.AtomicInteger
+
+def inc(AtomicInteger x) { x.incrementAndGet() }
+def a = new AtomicInteger(0)
+
+inc a
+assert 1 == a.get()

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_03x.groovy b/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_03x.groovy
new file mode 100644
index 0000000..4f9e8d7
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_03x.groovy
@@ -0,0 +1,34 @@
+/*
+ *  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.
+ */
+package core
+
+class a {}
+a[] b
+b = new a[0]
+assert 0 == b.length
+
+a[] b2 = new a[0]
+assert 0 == b2.length
+
+core.a[] b3
+b3 = new a[0]
+assert 0 == b3.length
+
+core.a[] b4 = new a[0]
+assert 0 == b4.length
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_04x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_04x.groovy b/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_04x.groovy
new file mode 100644
index 0000000..477932b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/BreakingChange_04x.groovy
@@ -0,0 +1,44 @@
+/*
+ *  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.
+ */
+package core
+
+class B<T> {}
+B b
+b = new B()
+assert b instanceof B
+
+B<String> b2
+b2 = new B<String>()
+assert b2 instanceof B
+
+B<String>[] b3
+b3 = new B<String>[0]
+assert b3 instanceof B[]
+
+core.B b4
+b4 = new B()
+assert b4 instanceof B
+
+core.B<String> b5
+b5 = new B<String>()
+assert b5 instanceof B
+
+core.B<String>[] b6
+b6 = new B<String>[0]
+assert b6 instanceof B[]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_01.groovy
new file mode 100644
index 0000000..05c8bc3
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_01.groovy
@@ -0,0 +1,73 @@
+/*
+ *  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.
+ */
+package core
+
+class A {}
+class B<T> {}
+class C<T extends A> {}
+class D<T extends A & B> {}
+class E<T extends A & B & C> {}
+class F<T extends A & B & C> extends A {}
+class F2 extends A<T> {}
+class G1<T extends A & B & C> extends A implements X {}
+class G2<T extends A & B & C> extends A<T> implements X<T> {}
+class G3                      extends A<T> implements X<T> {}
+class G4                      extends A    implements X<T> {}
+class G5                      extends A    implements X    {}
+class H<T extends A & B & C> extends A implements X, Y {}
+class I<T extends A & B & C> extends A implements X, Y, Z {}
+public class J<T extends A & B & C> extends A implements X, Y, Z {}
+@Test2 public class K<T extends A & B & C> extends A implements X, Y, Z {}
+@Test2 @Test3 public class L<T extends A & B & C> extends A implements X, Y, Z {}
+
+@Test2
+@Test3
+@Test4(value={
+        def a = someMethod()
+        assert a.result() == 'abc'
+})
+@Test5(b=2, a=1)
+@Test6(a=2, b=1)
+public
+class M
+<
+        T extends
+A &
+B &
+C
+>
+        extends
+                A
+        implements
+                X,
+                Y,
+                Z
+{
+
+}
+
+class a {}
+
+class OutputTransforms {
+        final  static localTransforms = loadOutputTransforms()
+}
+
+class OutputTransforms2 {
+        @Lazy  static localTransforms = loadOutputTransforms()
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_02.groovy
new file mode 100644
index 0000000..a973737
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_02.groovy
@@ -0,0 +1,60 @@
+/*
+ *  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.
+ */
+class AA {
+    {
+        println 123
+    }
+}
+
+class BB {
+    static {
+        println '123'
+    }
+}
+
+class CC {
+    static
+    {
+        println '123'
+    }
+}
+
+class DD {
+    static {
+        println '123'
+    }
+
+    {
+        println 'abc'
+    }
+
+    static {
+        println '234'
+    }
+
+    {
+        println 'bcd'
+    }
+}
+
+class EE {{}}
+class FF {static {}}
+class GG {static {};{}}
+
+class Iterator implements java.util.Iterator {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_03.groovy b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_03.groovy
new file mode 100644
index 0000000..70ad9a0
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_03.groovy
@@ -0,0 +1,69 @@
+/*
+ *  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.
+ */
+import java.sql.SQLException
+
+class AAA {
+    private volatile XX xx;
+    private transient YY yy;
+
+    public AAA() {
+
+    }
+
+    public AAA(String name) {
+
+    }
+
+    @Test2
+    public AAA(String name, int age) throws Exception {
+
+    }
+
+    AAA(String name, int age, String title) throws Exception {
+
+    }
+
+    private AAA(String name, int age, String title, double income) throws Exception {
+
+    }
+
+    @Test2
+    public synchronized String sayHello(String name) {
+        return "Hello, $name";
+    }
+
+    @Test2
+    public <T> T sayHello2(T name) throws IOException, SQLException {
+        return "Hello, $name";
+    }
+
+    public static privateStaticMethod(){}
+
+    public void m(final int param) {}
+    public void m2(def param) {}
+    public void m3(final int param1, long param2, final String param3) {}
+
+    def "hello world"(p1, p2) {
+        println "$p1, $p2"
+    }
+
+    def run() {
+        this."hello world"('ab', 'bc')
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_04.groovy b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_04.groovy
new file mode 100644
index 0000000..78230e8
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_04.groovy
@@ -0,0 +1,40 @@
+/*
+ *  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.
+ */
+public class Person {
+    public static final SOME_CONSTANT = 'SOME_CONSTANT';
+    private String name = 'Daniel';
+    private int age;
+    @Test2
+    private String country = 'China',
+            location = 'Shanghai';
+
+    private String field, field2 = 'field2';
+    String someProperty;
+    String someProperty2 = 'someProperty2';
+    String someProperty3 = 'someProperty3',
+            someProperty4 = 'someProperty4';
+    String someProperty5, someProperty6 = 'someProperty6';
+    final String someProperty7 = 'someProperty7';
+    static final String someProperty8 = 'someProperty8';
+
+    @Test3
+    static final String someProperty9 = 'someProperty9';
+
+    protected static def protectedStaticDefField;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_05.groovy b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_05.groovy
new file mode 100644
index 0000000..25c3701
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_05.groovy
@@ -0,0 +1,38 @@
+/*
+ *  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.
+ */
+public class A extends B {
+    private int age;
+
+    public A() {
+        super()
+    }
+
+    public A(int age) {
+        this()
+    }
+
+    public A(String name) {
+        super(name);
+    }
+
+    public A(String name, int age) {
+        this(name);
+        this.age = age;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_06.groovy b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_06.groovy
new file mode 100644
index 0000000..34a9c2a
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_06.groovy
@@ -0,0 +1,101 @@
+/*
+ *  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.
+ */
+public class OuterA {
+    class InnerB {}
+}
+
+class OuterClazz {
+    enum InnerEnum implements SomeInterface {
+        A, B
+    }
+}
+
+
+class AA {
+    class Inner {
+        public def innerMethod() {}
+    }
+    private class PrivateInner {}
+    protected final class ProtectedFinalInner {
+        ProtectedFinalInner() {
+
+        }
+
+        ProtectedFinalInner(Integer a) {
+            new A() {
+                public int method() {
+                    1
+                }
+            }
+        }
+    }
+
+    public int method() {
+        0
+    }
+}
+
+
+
+interface A {
+    static enum B {
+        static interface C {
+        }
+    }
+}
+
+interface A2 {
+    static class B2 {
+        static enum C2 {
+        }
+    }
+}
+
+enum A4 {
+    static interface B4 {
+        static class C4 {
+        }
+    }
+}
+
+
+class A3 {
+    static class B3 {
+        static enum C3 {
+        }
+    }
+}
+
+class A5 {
+    static class B5 {
+        static class C5 {
+        }
+    }
+}
+
+interface A1 {
+    static interface B1 {
+        static enum C1 {
+        }
+    }
+}
+
+
+
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_07.groovy b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_07.groovy
new file mode 100644
index 0000000..4406289
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ClassDeclaration_07.groovy
@@ -0,0 +1,45 @@
+/*
+ *  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.
+ */
+new A() {}
+new A(1, '2') {
+    public void prt() {
+        new B() {}
+        new C() {
+            {
+                new D() {
+                    {
+                        new E() {}
+                        new F() {}
+                    }
+                }
+            }
+        }
+    }
+}
+
+class OuterAA {
+    public void method() {
+        new InnerBB() {}
+        new InnerCC() {{
+            new InnerDD() {}
+            new InnerEE() {}
+        }}
+        new InnerFF() {}
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Closure_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_01.groovy
new file mode 100644
index 0000000..ba93142
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_01.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+{->}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Closure_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_02.groovy
new file mode 100644
index 0000000..92fdd1c
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_02.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+{->12}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Closure_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_03.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_03.groovy
new file mode 100644
index 0000000..3e91329
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_03.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+{-> {->12}}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Closure_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_04.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_04.groovy
new file mode 100644
index 0000000..25e391b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_04.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+{->
+    12
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Closure_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_05.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_05.groovy
new file mode 100644
index 0000000..3223365
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_05.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+{int a ->
+    a
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Closure_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_06.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_06.groovy
new file mode 100644
index 0000000..5c7062b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_06.groovy
@@ -0,0 +1,27 @@
+/*
+ *  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.
+ */
+{int a,
+ long b, float[] c,
+ double[][] d, String e, Object[] f,
+ Object[][] g, Object[][][] h,
+ Object[]... i
+    ->
+
+    a
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Closure_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_07.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_07.groovy
new file mode 100644
index 0000000..c6f6c9f
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_07.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+{Object... i ->
+    i
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Closure_08.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_08.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_08.groovy
new file mode 100644
index 0000000..9a98f35
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_08.groovy
@@ -0,0 +1,34 @@
+/*
+ *  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.
+ */
+{ List<String> i, List<List<String>> j, List<List<List<String>>> k,
+  List<?> l, List<? extends Map> m, List<? super Map> n,
+  List<? extends Map<String, Object>> o, List<? super Map<String, Object>> p,
+  List<String>[] q,  List<? extends Map<String, Object>>[][] r,
+
+  List<
+        ? super
+                Map,
+        ? extends
+        Set,
+        List
+        > s,
+
+  List<? extends Map<String, Object>>[][]... t ->
+    i
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Closure_09.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_09.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_09.groovy
new file mode 100644
index 0000000..919a8a9
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_09.groovy
@@ -0,0 +1,34 @@
+/*
+ *  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.
+ */
+{ String i,
+  final String j, final def String k,
+  @Test2 final def String l,
+  @Test2
+  final
+
+  def
+          String m,
+        final n,
+        def
+          o,
+        p, q,
+        r, s,
+  @Test2 final def String... z ->
+    i
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Closure_10.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Closure_10.groovy b/subprojects/parser-antlr4/src/test/resources/core/Closure_10.groovy
new file mode 100644
index 0000000..024b334
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Closure_10.groovy
@@ -0,0 +1,22 @@
+/*
+ *  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.
+ */
+{ java.lang.Integer t, Integer u, int v, int[] w, int[][] x,
+    String y = 'y', long... z = 123 ->
+    i
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/CodeBlock_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/CodeBlock_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/CodeBlock_01x.groovy
new file mode 100644
index 0000000..d9dd10d
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/CodeBlock_01x.groovy
@@ -0,0 +1,42 @@
+/*
+ *  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.
+ */
+def m() {
+    int result = 0;
+    {
+        int i = 1;
+        result += i;
+    }
+    {
+        int i = 2;
+        result += i;
+
+        {
+            int j = 3;
+            result += j;
+        }
+        {
+            int j = 4;
+            result += j;
+        }
+
+    }
+    return { result }
+}
+
+assert m()() == 10
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Command_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Command_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Command_01.groovy
new file mode 100644
index 0000000..beadc8a
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Command_01.groovy
@@ -0,0 +1,36 @@
+/*
+ *  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.
+ */
+a 1
+a 1, 2
+a x: 1, y: 2
+a.b 1, 2
+z.a b(1), c(2)
+a.b x: 1, y: 2
+z.a x: b(1), y: c(2)
+a b(1), c(2)
+a x: b(1), y: c(2)
+z.a x: b(1, 3), y: c(2, 4)
+a b(1, 3), c(2, 4)
+obj.<Integer, Double>a b(1, 3), c(2, 4), d(3, 5)
+println a
+// println a = 1  // breaking change
+println a == 1
+
+result.addAll allElements()
+task someTask() {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Command_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Command_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/Command_02.groovy
new file mode 100644
index 0000000..a68c6d3
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Command_02.groovy
@@ -0,0 +1,29 @@
+/*
+ *  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.
+ */
+x y
+x y a b
+x y a.b
+x y a
+a b c() d e
+a b c()() d e
+a b c[x] d e
+a b c[x][y] d e
+a b c {x} d e
+(1 + 2).plus 3 plus 4
+[1, 2].subList 0, 1 plus 2

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Command_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Command_03.groovy b/subprojects/parser-antlr4/src/test/resources/core/Command_03.groovy
new file mode 100644
index 0000000..313fd8b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Command_03.groovy
@@ -0,0 +1,84 @@
+/*
+ *  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.
+ */
+println withPool {
+}
+
+println aa("bb", "cc") {
+}
+
+println this.aa("bb", "cc") {
+}
+
+println aa("bb", {println 123;}, "cc") {
+}
+
+aa("bb", "cc") {
+    println 1
+} { println 2 }
+
+cc  {
+    println 1
+} {
+    println 2
+}
+
+dd {
+    println 3
+}
+
+obj.cc  {
+    println 1
+} {
+    println 2
+}
+
+bb 1, 2, {println 123;}
+
+obj."some method" (groovy.xml.dom.DOMCategory) {
+}
+
+obj."some ${'method'}" (groovy.xml.dom.DOMCategory) {
+}
+obj.someMethod (groovy.xml.dom.DOMCategory) {
+}
+
+use (groovy.xml.dom.DOMCategory) {
+}
+
+['a','b','c'].inject('x') {
+    result, item -> item + result + item
+}
+
+println a."${hello}"('world') {
+}
+
+println a."${"$hello"}"('world') {
+}
+
+a."${"$hello"}" 'world', {
+}
+
+a.<String, Object>someMethod 'hello', 'world';
+
+a[x] b
+a[x] b c
+a[x] b c d
+
+"$x"(1, 2) a
+"$x" 1, 2  a

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Command_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Command_04.groovy b/subprojects/parser-antlr4/src/test/resources/core/Command_04.groovy
new file mode 100644
index 0000000..ba3b2c3
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Command_04.groovy
@@ -0,0 +1,25 @@
+/*
+ *  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.
+ */
+promise = promise.then { it * 2 } then { it * 3 } then { it + 6 }
+promise = promise.then { it * 2 } then { it * 3 } then { it + 6 } someProperty
+promise = promise.then { it * 2 } then { it * 3 } then { it + 6 } 'someProperty'
+promise = promise.then { it * 2 } then { it * 3 } then { it + 6 } "someProperty"
+promise = promise.then { it * 2 } then { it * 3 } then { it + 6 } "somePropert${'y'}"
+result = [1, 2, 3].size().plus 1 plus 2
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Command_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Command_05.groovy b/subprojects/parser-antlr4/src/test/resources/core/Command_05.groovy
new file mode 100644
index 0000000..06205a7
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Command_05.groovy
@@ -0,0 +1,77 @@
+/*
+ *  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.
+ */
+((int) 1 / 2)(1, 2) {} {} (2, 3, 4) {}
+(((int) 1 / 2))(1, 2) {} {} (2, 3, 4) {}
+(m())()
+((Integer)m())()
+
+((int) 1 / 2) 1, 2 {} {} (2, 3, 4) {}
+
+'m'() + /aa/() + $/bb/$() + "$m"() + /a${'x'}a/() + $/b${'x'}b/$() + 1.2('b') + 1('a') + 2() + null() + true() + false() + a() + {a,b->}(1, 2) + [1, 2]() + [a:1, b:2]() + new int[0]() + new Integer(1)()
+
+// cast expressions
+(int)(1 / 2)
+(Integer)(1 / 2)
+(java.lang.Integer)(1 / 2)
+
+
+
+1 + 1.("a" + "1")()
+1 + 1.(m())()
+1.("a" + "1")()
+1.("a" + "1")(123)
+1.("a" + "1") 123
+1.(m())()
+1.(m())(123)
+1.(m()) 123
+(1+1).("a"+1)()
+(1+1).("a"+1) a b c
+1+1.("a"+1)()
+
+x = a(1, 2)(3, 4) {} {} (5, 6) {} (7, 8)
+x = a(1, 2) {} (3, 4) {} {} (5, 6) {} (7, 8) {} {}
+x = obj.a(1, 2)(3, 4) {} {} (5, 6) {} (7, 8)
+x = obj.a(1, 2) {} (3, 4) {} {} (5, 6) {} (7, 8) {} {}
+x = {a, b -> }(1, 2)(3, 4) {} {} (5, 6) {} (7, 8)
+x = {a, b -> }(1, 2) {} (3, 4) {} {} (5, 6) {} (7, 8) {}
+x = {a, b -> }(1, 2) {} {} (3, 4) {} {} (5, 6) {} (7, 8) {} {}
+
+
+
+m 1, 2
+"m" 1, 2
+"$m" 1, 2
+
+("m") 1, 2
+("$m") 1, 2
+
+find x:
+        1 confirm right
+
+
+find x:
+        1,
+        y:
+                2 confirm right
+
+a b 1 2
+
+
+(obj.m1(1, 2)) m2(3, 4)
+obj.m1(1, 2) m2(3, 4)

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Command_06x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Command_06x.groovy b/subprojects/parser-antlr4/src/test/resources/core/Command_06x.groovy
new file mode 100644
index 0000000..64c94bb
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Command_06x.groovy
@@ -0,0 +1,26 @@
+/*
+ *  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.
+ */
+assert 11 == (1.plus 2 plus 3) + (2.plus 3) * (1.multiply 1) - ((1 - 1).intdiv 1 multiply 1) / (2.power 10)
+assert (Long)(1.plus 2 plus 3) instanceof Long
+assert [1, 2, 3] == [(1.plus 0), (1.plus 1), (1.plus 1 plus 1)]
+
+def m(a, b) {
+    return a + b
+}
+assert m((1.plus 2 plus 3), (1.multiply 1)) == 7

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Comments_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Comments_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Comments_01.groovy
new file mode 100644
index 0000000..b01ee37
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Comments_01.groovy
@@ -0,0 +1,46 @@
+/*
+ *  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.
+ */
+#!/usr/bin/env groovy
+/*
+ *  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.
+ */
+
+/**
+ * Created by Daniel.Sun on 2016/08/16.
+ */
+
+// this is a line comment
+
+println /* method name */ 1 /* one */ /* followed by plus */ + /* plus */ 2 /* two */
++3
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Comments_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Comments_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/Comments_02.groovy
new file mode 100644
index 0000000..dcb4b76
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Comments_02.groovy
@@ -0,0 +1,135 @@
+/*
+ *  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.
+ */
+/**
+ * test class Comments
+ */
+public class Comments {
+    /**
+     * test Comments.SOME_VAR
+     */
+    public static final String SOME_VAR = 'SOME_VAR';
+    /**
+     * test Comments.SOME_VAR2
+     */
+    public static final String SOME_VAR2 = 'SOME_VAR2';
+
+    public static final String SOME_VAR3 = 'SOME_VAR3';
+
+    /**
+     * test Comments.SOME_VAR4
+     */
+    // no groovydoc for SOME_VAR4
+    public static final String SOME_VAR4 = 'SOME_VAR4';
+
+
+    /**
+     * test Comments.constructor1
+     */
+    public Comments() {
+
+    }
+
+    /**
+     * test Comments.m1
+     */
+    def m1() {
+        // executing m1
+    }
+
+    /*
+     * test Comments.m2
+     */
+    private m2() {
+        // executing m2
+    }
+
+    /**
+     * test Comments.m3
+     */
+    public void m3() {
+        // executing m3
+    }
+
+    /**
+     * test class InnerClazz
+     */
+    static class InnerClazz {
+        /**
+         * test InnerClazz.SOME_VAR3
+         */
+        public static final String SOME_VAR3 = 'SOME_VAR3';
+        /**
+         * test InnerClazz.SOME_VAR4
+         */
+        public static final String SOME_VAR4 = 'SOME_VAR4';
+
+        /**
+         * test Comments.m4
+         */
+        public void m4() {
+            // executing m4
+        }
+
+        /**
+         * test Comments.m5
+         */
+        public void m5() {
+            // executing m5
+        }
+    }
+
+    /**
+     * test class InnerEnum
+     */
+    static enum InnerEnum {
+        /**
+         * InnerEnum.NEW
+         */
+        NEW,
+
+        /**
+         * InnerEnum.OLD
+         */
+        OLD
+    }
+
+    static enum InnerEnum2 {}
+}
+
+/**
+ * test class Comments2
+ */
+class Comments2 {
+    /*
+     * test Comments.SOME_VAR
+     */
+    public static final String SOME_VAR = 'SOME_VAR';
+}
+
+class Comments3 {}
+
+/**
+ * test someScriptMethod1
+ */
+void someScriptMethod1() {}
+
+/*
+ * test someScriptMethod2
+ */
+void someScriptMethod2() {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/DefaultMethod_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/DefaultMethod_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/DefaultMethod_01x.groovy
new file mode 100644
index 0000000..7f0c2b0
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/DefaultMethod_01x.groovy
@@ -0,0 +1,39 @@
+/*
+ *  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.
+ */
+
+interface Greetable {
+    String name();
+    default String hello() {
+        return 'hello'
+    }
+    default public String sayHello() {
+        return this.hello() + ', ' + this.name()
+    }
+}
+
+class Person implements Greetable {
+    @Override
+    public String name() {
+        return 'Daniel'
+    }
+}
+
+def p = new Person()
+assert 'hello, Daniel' == "${p.hello()}, ${p.name()}"
+assert 'hello, Daniel' == p.sayHello()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/DefaultMethod_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/DefaultMethod_02x.groovy b/subprojects/parser-antlr4/src/test/resources/core/DefaultMethod_02x.groovy
new file mode 100644
index 0000000..18e564b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/DefaultMethod_02x.groovy
@@ -0,0 +1,54 @@
+/*
+ *  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.
+ */
+interface A {
+    default String hello() {
+        return 'hello'
+    }
+    default String a() {
+        return 'a'
+    }
+    String b();
+}
+
+interface B extends A {
+    public String world();
+}
+
+class C implements B {
+    public static String haha() { return 'haha' }
+
+    public String world() {
+        return 'world'
+    }
+
+    public String name() {
+        return 'c'
+    }
+
+    public String a() {
+        return 'a1';
+    }
+
+    public String b() {
+        return 'b'
+    }
+}
+
+def c = new C()
+assert 'hello, world, c, a1, b, haha' == "${c.hello()}, ${c.world()}, ${c.name()}, ${c.a()}, ${c.b()}, ${C.haha()}"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/DoWhile_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/DoWhile_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/DoWhile_01x.groovy
new file mode 100644
index 0000000..ffdda82
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/DoWhile_01x.groovy
@@ -0,0 +1,25 @@
+/*
+ *  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.
+ */
+int i = 0;
+
+do {
+    i++
+} while (i < 5)
+
+assert i == 5

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/DoWhile_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/DoWhile_02x.groovy b/subprojects/parser-antlr4/src/test/resources/core/DoWhile_02x.groovy
new file mode 100644
index 0000000..5cec460
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/DoWhile_02x.groovy
@@ -0,0 +1,26 @@
+/*
+ *  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.
+ */
+int i = 0;
+
+do {
+    i++
+    if (i == 3) break;
+} while (i < 5)
+
+assert i == 3

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/DoWhile_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/DoWhile_03x.groovy b/subprojects/parser-antlr4/src/test/resources/core/DoWhile_03x.groovy
new file mode 100644
index 0000000..abddd24
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/DoWhile_03x.groovy
@@ -0,0 +1,29 @@
+/*
+ *  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.
+ */
+int i, j = 0;
+
+do {
+    i++
+    if (i == 4) break;
+
+    if (j == 3) continue;
+    j++
+} while (true)
+
+assert j == 3

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/DoWhile_04x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/DoWhile_04x.groovy b/subprojects/parser-antlr4/src/test/resources/core/DoWhile_04x.groovy
new file mode 100644
index 0000000..f32e88b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/DoWhile_04x.groovy
@@ -0,0 +1,32 @@
+/*
+ *  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.
+ */
+import groovy.transform.CompileStatic
+
+@CompileStatic
+def a() {
+    int i = 0;
+    int result = 0;
+   do {
+        result += 2
+    } while(i++ < 2)
+        result += 3
+
+    return result;
+}
+assert 9 == a()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/ElvisAssignment_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ElvisAssignment_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/ElvisAssignment_01x.groovy
new file mode 100644
index 0000000..17d1bab
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ElvisAssignment_01x.groovy
@@ -0,0 +1,56 @@
+/*
+ *  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.
+ */
+import groovy.transform.CompileStatic
+
+def elvisAssignment() {
+    def a = 2
+    a ?= 1
+    assert a == 2
+
+    a = null
+    a ?= 1
+    assert a == 1
+
+    a = null
+    a ?= a ?= 1
+    assert a == 1
+
+    a = null
+    assert (a ?= '2') == '2'
+}
+elvisAssignment();
+
+@CompileStatic
+def csElvisAssignment() {
+    def a = 2
+    a ?= 1
+    assert a == 2
+
+    a = null
+    a ?= 1
+    assert a == 1
+
+    a = null
+    a ?= a ?= 1
+    assert a == 1
+
+    a = null
+    assert (a ?= '2') == '2'
+}
+csElvisAssignment();


[14/50] [abbrv] groovy git commit: Set the default version of bytecode as 1.8

Posted by pa...@apache.org.
Set the default version of bytecode as 1.8


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/b469cbb6
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/b469cbb6
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/b469cbb6

Branch: refs/heads/parrot
Commit: b469cbb67d38e85ab62193b3e0da937fc732cab1
Parents: 07456a5
Author: sunlan <su...@apache.org>
Authored: Sat May 6 01:27:47 2017 +0800
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:09:10 2017 +1000

----------------------------------------------------------------------
 .../org/codehaus/groovy/classgen/asm/WriterController.java   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/b469cbb6/src/main/org/codehaus/groovy/classgen/asm/WriterController.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/asm/WriterController.java b/src/main/org/codehaus/groovy/classgen/asm/WriterController.java
index e8c5b61..e4cfdbe 100644
--- a/src/main/org/codehaus/groovy/classgen/asm/WriterController.java
+++ b/src/main/org/codehaus/groovy/classgen/asm/WriterController.java
@@ -65,7 +65,7 @@ public class WriterController {
     private StatementWriter statementWriter;
     private boolean fastPath = false;
     private TypeChooser typeChooser;
-    private int bytecodeVersion = Opcodes.V1_5;
+    private int bytecodeVersion = Opcodes.V1_8;
     private int lineNumber = -1;
     private int helperMethodIndex = 0;
     private List<String> superMethodNames = new ArrayList<String>();
@@ -130,10 +130,10 @@ public class WriterController {
 
     private static int chooseBytecodeVersion(final boolean invokedynamic, final String targetBytecode) {
         if (invokedynamic) {
-            if (CompilerConfiguration.JDK8.equals(targetBytecode)) {
-                return Opcodes.V1_8;
+            if (CompilerConfiguration.JDK7.equals(targetBytecode)) {
+                return Opcodes.V1_7;
             }
-            return Opcodes.V1_7;
+            return Opcodes.V1_8;
         } else {
             if (CompilerConfiguration.JDK4.equals(targetBytecode)) {
                 return Opcodes.V1_4;


[22/50] [abbrv] groovy git commit: exclude performance subproject from coverage

Posted by pa...@apache.org.
exclude performance subproject from coverage


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/55ee3c52
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/55ee3c52
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/55ee3c52

Branch: refs/heads/parrot
Commit: 55ee3c5226e77f460492f3dc05784d94b02ac8f1
Parents: ce35457
Author: paulk <pa...@asert.com.au>
Authored: Sun May 7 15:36:55 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:10:17 2017 +1000

----------------------------------------------------------------------
 gradle/jacoco/jacoco.gradle | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/55ee3c52/gradle/jacoco/jacoco.gradle
----------------------------------------------------------------------
diff --git a/gradle/jacoco/jacoco.gradle b/gradle/jacoco/jacoco.gradle
index 3929b55..0fddbe9 100644
--- a/gradle/jacoco/jacoco.gradle
+++ b/gradle/jacoco/jacoco.gradle
@@ -22,7 +22,9 @@ if (rootProject.hasProperty('coverage') && Boolean.valueOf(rootProject.getProper
     // are not specifically asking for code coverage
 
     allprojects {
-        apply plugin: 'jacoco'
+        if (!['performance'].contains(it.name)) {
+            apply plugin: 'jacoco'
+        }
 
         project.afterEvaluate {
             tasks.withType(JacocoReport) {


[28/50] [abbrv] groovy git commit: GROOVY-8177: Remedial work still needed for groovy-parser-antlr4 subproject

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_21x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_21x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_21x.groovy
index 506ccb8..c983dc9 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_21x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_21x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 new int[5]
 new int[5][]
 new int[5][6][]

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_22x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_22x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_22x.groovy
index 77a3306..e744a27 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_22x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_22x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 int j = 0
 ++j++
 assert j == 1

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_23x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_23x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_23x.groovy
index ab7f763..2f3007d 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_23x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Expression_23x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 def a
     =
         1 + 2

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/For_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/For_01.groovy
index 53c4911..b1cbefb 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/For_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 for (i in someList) {}
 
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/For_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/For_02.groovy
index 6979940..5a2b795 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_02.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/For_02.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 for (int i = 0; true; false) {}
 for (int i = 0; true; false) {
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/For_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/For_03.groovy
index f9ff466..d37aef3 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_03.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/For_03.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 outer:
 for (def i in [1, 2]) {
     for (def j in [1, 2, 3, 4, 5]) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/For_04x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_04x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/For_04x.groovy
index 1afb389..dcd7b57 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_04x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/For_04x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import groovy.transform.CompileStatic
 
 @CompileStatic

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/For_05x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_05x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/For_05x.groovy
index 959d2c0..dd63224 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/For_05x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/For_05x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import groovy.transform.CompileStatic
 
 @CompileStatic

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_01.groovy
index 0d4e777..d233bab 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 "abc${'123'}def"
 "${'123'}def"
 "${'123'}"

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_02.groovy
index c27bfef..2e69232 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_02.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_02.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 /abc${'123'}def $a.b.c,d${->12}/
 $/${-12}abc${'123'}def $a.b.c,d${->12}/$
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_03.groovy
index f535731..731986b 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_03.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_03.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 def a = """hello${a}
 world
 """

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_04.groovy
index 00a8c02..1d7b1c2 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_04.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_04.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 "At $date"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_05.groovy
index 67e5f5e..e49c060 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_05.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_05.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 """At $date"""
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_06.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_06.groovy
index e1446b9..18d5770 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_06.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_06.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 /At $date/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Groovydoc_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Groovydoc_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Groovydoc_01x.groovy
index c4c14c8..9bbf9f5 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Groovydoc_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Groovydoc_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 /**
  * @Groovydoc
  * class AA

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/IdenticalOp_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/IdenticalOp_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/IdenticalOp_01x.groovy
index bc8fff0..9110bb4 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/IdenticalOp_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/IdenticalOp_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 def x = []
 def y = []
 assert y !== x

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/IfElse_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/IfElse_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/IfElse_01.groovy
index d58c302..94687b8 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/IfElse_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/IfElse_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 if (true)
     assert true, ':('
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_01.groovy
index 2d8aaeb..f0ed391 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_01.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 import java.util.Map
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_02.groovy
index d420d29..f32f0c8 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_02.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_02.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 import java.util.Map;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_03.groovy
index bbd6f42..c308f92 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_03.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_03.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import java.util.Map
 import java.util.HashMap;
 import java.io.InputStream

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_04.groovy
index c9e8698..d54207f 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_04.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_04.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package core;
 import java.util.Map
 import java.util.HashMap;

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_05.groovy
index 9537b2d..238549a 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_05.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_05.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 import java.util.*
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_06.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_06.groovy
index ab53935..176714c 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_06.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_06.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import java.util.*
 import java.math.BigDecimal
 import java.io.*
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_07.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_07.groovy
index 5afff4e..36b6215 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_07.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_07.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package core;
 import java.util.*
 import java.math.BigDecimal;

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_08.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_08.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_08.groovy
index b2ed424..c6f8d2e 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_08.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_08.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 #!/usr/bin/env groovy
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_01.groovy
index 7ad0fa7..992926c 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package core
 
 interface A1 {}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_02.groovy
index 6305e5a..a6e49ba 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_02.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_02.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package core
 
 import java.sql.SQLException

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_03.groovy
index 4d555db..9c78681 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_03.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_03.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 interface Koo {
     class Inner {}
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Label_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Label_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Label_01.groovy
index dfefa51..9e9645b 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Label_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Label_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 a: assert true;
 a: assert true
 a:

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Lambda_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Lambda_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Lambda_01x.groovy
index 138711d..5c147ac 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Lambda_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Lambda_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 assert 9 == [1, 2, 3].stream().map(e -> e + 1).reduce(0, (r, e) -> r + e)
 assert 9 == [1, 2, 3].stream().map(e -> {e + 1}).reduce(0, (r, e) -> r + e)
 assert 9 == [1, 2, 3].stream().map((e) -> e + 1).reduce(0, (r, e) -> r + e)

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/List_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/List_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/List_01.groovy
index bf97184..f7c122e 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/List_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/List_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 []
 [
         

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_01.groovy
index d1238c2..c3a1f3a 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 null
 true
 false

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_02.groovy
index 88a9a5f..de55750 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_02.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_02.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 '123'
 'abc'
 'a1b2c3'

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_03.groovy
index ad2b25e..865596b 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_03.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_03.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 /\123 \/ abc \u1234 \r\n\$/
 
 $/\123 \/ abc \u1234 \r\n/$

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/LocalVariableDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/LocalVariableDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/LocalVariableDeclaration_01.groovy
index 52e817a..7db2948 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/LocalVariableDeclaration_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/LocalVariableDeclaration_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import groovy.transform.Field
 
 int a;

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Map_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Map_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Map_01.groovy
index 7ed1a05..bcc0f3e 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Map_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Map_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 [a: 1, b: 2, c: 3]
 [(a): 1, (b**2): x, c: 2 + 3]
 ['a': '1', 'b': 2, 'c': '3']

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodDeclaration_01.groovy
index f27965a..e7220e0 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodDeclaration_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodDeclaration_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 int plus(int a, int b) {
         return a + b;
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodDeclaration_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodDeclaration_02.groovy
index 97b731b..91879a9 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodDeclaration_02.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodDeclaration_02.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 final int plus(int a, int b) {
         return a + b;
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodPointer_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodPointer_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodPointer_01x.groovy
index 3438cde..eaddb93 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodPointer_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodPointer_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 def shell = new GroovyShell()
 assert shell.evaluate("x = String.&toUpperCase; x('abc')") == "ABC"
 assert shell.evaluate("x = 'abc'.&toUpperCase; x()") == "ABC"

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodReference_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodReference_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodReference_01x.groovy
index 2c5f1ce..a31b5b8 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodReference_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodReference_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import java.util.stream.Collectors
 
 // class::staticMethod

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/NegativeRelationalOperators_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/NegativeRelationalOperators_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/NegativeRelationalOperators_01x.groovy
index 8bb735c..7c91cd3 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/NegativeRelationalOperators_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/NegativeRelationalOperators_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 assert 'a' instanceof String
 assert 'a' !instanceof Integer
 assert 1 !instanceof String

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/NegativeRelationalOperators_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/NegativeRelationalOperators_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/NegativeRelationalOperators_02x.groovy
index 4f01810..1400f9f 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/NegativeRelationalOperators_02x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/NegativeRelationalOperators_02x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import groovy.transform.CompileStatic
 
 @CompileStatic

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_01.groovy
index c0c3a65..17619c2 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_01.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 package com.groovyhelp.core
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_02.groovy
index f8181bc..ec6d67f 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_02.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_02.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 package com.groovyhelp.core

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_03.groovy
index c4d5a5a..6114f1c 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_03.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_03.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 package com.groovyhelp.core;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_04.groovy
index 8f0fe40..88b48aa 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_04.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_04.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 #!/usr/bin/env groovy
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_05.groovy
index c0c5d62..c60b3c3 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_05.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_05.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 #!/usr/bin/env groovy
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_06.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_06.groovy
index c555fd0..313cc8f 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_06.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_06.groovy
@@ -1 +1,19 @@
+/*
+ *  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.
+ */
 package def.in.as.trait;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Return_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Return_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Return_01.groovy
index 17ad319..2f0f983 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Return_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Return_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 return
 return;
 return 1;

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_01x.groovy
index 2d1c584..1cbcf66 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 assert null == null?[1];
 assert null == null?[1]?[1, 2];
 assert null == null?[1]?[1, 2]?[1, 2, 3];

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_02x.groovy
index 3a91ac2..aa13c83 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_02x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_02x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import groovy.transform.*
 
 class SomeContainer {

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_03x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_03x.groovy
index 320ed4f..d94d414 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_03x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_03x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import groovy.transform.*
 
 @CompileStatic

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Script_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Script_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Script_01x.groovy
index 2bc3c15..0e47db0 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Script_01x.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Script_01x.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 protected String getGroovySql() {
     return "abc"
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Switch_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Switch_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Switch_01.groovy
index 6719de8..f26d15b 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Switch_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Switch_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 switch (a) {
     case 1:
         break;

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Synchronized_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Synchronized_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Synchronized_01.groovy
index a3cbffe..bc1bc88 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Synchronized_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Synchronized_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 synchronized ('a')
 {
     assert true

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/Throw_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Throw_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Throw_01.groovy
index 3e67db8..f78903c 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Throw_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Throw_01.groovy
@@ -1,2 +1,20 @@
+/*
+ *  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.
+ */
 throw e;
 throw e
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_01.groovy
index 2495e32..b5ed026 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_01.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_01.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 package core
 
 trait A {}

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_02.groovy
index c4b2dba..6820b1f 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_02.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_02.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 trait AA {
     {
         println 123

http://git-wip-us.apache.org/repos/asf/groovy/blob/a87e465c/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_03.groovy
index c4bde4e..2a68103 100644
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_03.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_03.groovy
@@ -1,3 +1,21 @@
+/*
+ *  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.
+ */
 import java.sql.SQLException
 
 trait AAA {


[08/50] [abbrv] groovy git commit: fixes groovy/groovy-website#99

Posted by pa...@apache.org.
fixes groovy/groovy-website#99


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/cbd74135
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/cbd74135
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/cbd74135

Branch: refs/heads/parrot
Commit: cbd74135336c754885e695998c54f286f322ac5a
Parents: adad2a0
Author: John Wagenleitner <jw...@apache.org>
Authored: Sun Apr 30 10:19:44 2017 -0700
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:04:48 2017 +1000

----------------------------------------------------------------------
 src/spec/test/SyntaxTest.groovy | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/cbd74135/src/spec/test/SyntaxTest.groovy
----------------------------------------------------------------------
diff --git a/src/spec/test/SyntaxTest.groovy b/src/spec/test/SyntaxTest.groovy
index e68f018..40bfc15 100644
--- a/src/spec/test/SyntaxTest.groovy
+++ b/src/spec/test/SyntaxTest.groovy
@@ -501,8 +501,8 @@ class SyntaxTest extends CompilableTestSupport {
             $$ escaped dollar sign
             \ backslash
             / forward slash
-            $/ escaped forward slash
-            $/$ escaped dollar slashy string delimiter
+            $$/ escaped dollar forward slash
+            $/$ escaped closing dollar slashy
         /$
 
         assert [
@@ -512,10 +512,9 @@ class SyntaxTest extends CompilableTestSupport {
             '$ escaped dollar sign',
             '\\ backslash',
             '/ forward slash',
-                '$/ escaped forward slash',
-                '/$ escaped dollar slashy string delimiter'
-
-                ].each { dollarSlashy.contains(it) }
+            '$/ escaped dollar forward slash',
+            '/$ escaped closing dollar slashy'
+        ].every { dollarSlashy.contains(it) }
         // end::dollar_slashy_1[]
     }
 


[49/50] [abbrv] groovy git commit: accidental double-up of license header due to shebang on first line

Posted by pa...@apache.org.
accidental double-up of license header due to shebang on first line


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/62842594
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/62842594
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/62842594

Branch: refs/heads/parrot
Commit: 62842594299c32549e66d377f5602e692177b958
Parents: 255893f
Author: paulk <pa...@asert.com.au>
Authored: Wed May 10 11:56:54 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:26:03 2017 +1000

----------------------------------------------------------------------
 .../src/test/resources/core/Comments_01.groovy    | 18 ------------------
 .../resources/core/ImportDeclaration_08.groovy    | 18 ------------------
 .../resources/core/PackageDeclaration_04.groovy   | 18 ------------------
 .../resources/core/PackageDeclaration_05.groovy   | 18 ------------------
 4 files changed, 72 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/62842594/subprojects/parser-antlr4/src/test/resources/core/Comments_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Comments_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Comments_01.groovy
index b01ee37..c38c6fb 100644
--- a/subprojects/parser-antlr4/src/test/resources/core/Comments_01.groovy
+++ b/subprojects/parser-antlr4/src/test/resources/core/Comments_01.groovy
@@ -1,21 +1,3 @@
-/*
- *  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.
- */
 #!/usr/bin/env groovy
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one

http://git-wip-us.apache.org/repos/asf/groovy/blob/62842594/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_08.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_08.groovy b/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_08.groovy
index c6f8d2e..b2ed424 100644
--- a/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_08.groovy
+++ b/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_08.groovy
@@ -1,21 +1,3 @@
-/*
- *  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.
- */
 #!/usr/bin/env groovy
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one

http://git-wip-us.apache.org/repos/asf/groovy/blob/62842594/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_04.groovy b/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_04.groovy
index 88b48aa..8f0fe40 100644
--- a/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_04.groovy
+++ b/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_04.groovy
@@ -1,21 +1,3 @@
-/*
- *  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.
- */
 #!/usr/bin/env groovy
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one

http://git-wip-us.apache.org/repos/asf/groovy/blob/62842594/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_05.groovy b/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_05.groovy
index c60b3c3..c0c5d62 100644
--- a/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_05.groovy
+++ b/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_05.groovy
@@ -1,21 +1,3 @@
-/*
- *  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.
- */
 #!/usr/bin/env groovy
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one


[25/50] [abbrv] groovy git commit: Refine README(requires JDK1.8)

Posted by pa...@apache.org.
Refine README(requires JDK1.8)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/bce50a35
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/bce50a35
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/bce50a35

Branch: refs/heads/parrot
Commit: bce50a3595e88c3aebe4f0f94d545bf42aa8012a
Parents: 8ed3fba
Author: sunlan <su...@apache.org>
Authored: Mon May 8 00:29:52 2017 +0800
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:11:03 2017 +1000

----------------------------------------------------------------------
 README.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/bce50a35/README.adoc
----------------------------------------------------------------------
diff --git a/README.adoc b/README.adoc
index ea98923..7dae55d 100644
--- a/README.adoc
+++ b/README.adoc
@@ -84,7 +84,7 @@ Build is image:{build-icon}[build status, link={groovy-ci}].
 
 To build you will need:
 
-* {jdk}[JDK 1.7+]
+* {jdk}[JDK 1.8+]
 
 To build everything using Gradle:
 


[36/50] [abbrv] groovy git commit: rename antlr4 parser to remove groovy- prefix since that is by convention for modules

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangLexer.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangLexer.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangLexer.java
new file mode 100644
index 0000000..d3b7538
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangLexer.java
@@ -0,0 +1,63 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4;
+
+import org.antlr.v4.runtime.CharStream;
+import org.antlr.v4.runtime.Lexer;
+import org.antlr.v4.runtime.LexerNoViableAltException;
+import org.antlr.v4.runtime.atn.ATN;
+import org.antlr.v4.runtime.atn.LexerATNSimulator;
+import org.apache.groovy.parser.antlr4.internal.AtnManager;
+
+/**
+ * The lexer for Groovy programming language, which is based on the lexer generated by Antlr4
+ *
+ * @author <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
+ * Created on 2016/08/14
+ */
+public class GroovyLangLexer extends GroovyLexer {
+    public GroovyLangLexer(CharStream input) {
+        super(input);
+
+        this.setInterpreter(new PositionAdjustingLexerATNSimulator(this, new AtnManager(this).getATN()));
+    }
+
+    @Override
+    public void recover(LexerNoViableAltException e) {
+        throw e; // if some lexical error occurred, stop parsing!
+    }
+
+    @Override
+    protected void rollbackOneChar() {
+        ((PositionAdjustingLexerATNSimulator) getInterpreter()).resetAcceptPosition(getInputStream(), _tokenStartCharIndex - 1, _tokenStartLine, _tokenStartCharPositionInLine - 1);
+    }
+
+    private static class PositionAdjustingLexerATNSimulator extends LexerATNSimulator {
+        public PositionAdjustingLexerATNSimulator(Lexer recog, ATN atn) {
+            super(recog, atn);
+        }
+
+        protected void resetAcceptPosition(CharStream input, int index, int line, int charPositionInLine) {
+            input.seek(index);
+            this.line = line;
+            this.charPositionInLine = charPositionInLine;
+            this.consume(input);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangParser.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangParser.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangParser.java
new file mode 100644
index 0000000..fa33c6e
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangParser.java
@@ -0,0 +1,38 @@
+/*
+ *  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.
+ */
+
+package org.apache.groovy.parser.antlr4;
+
+import org.antlr.v4.runtime.TokenStream;
+import org.antlr.v4.runtime.atn.ParserATNSimulator;
+import org.apache.groovy.parser.antlr4.internal.AtnManager;
+
+/**
+ * The parser for Groovy programming language, which is based on the parser generated by Antlr4
+ *
+ * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
+ * Created on    2016/08/14
+ */
+public class GroovyLangParser extends GroovyParser {
+    public GroovyLangParser(TokenStream input) {
+        super(input);
+
+        this.setInterpreter(new ParserATNSimulator(this, new AtnManager(this).getATN()));
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovySyntaxError.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovySyntaxError.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovySyntaxError.java
new file mode 100644
index 0000000..7ca8bba
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovySyntaxError.java
@@ -0,0 +1,53 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4;
+
+/**
+ * Represents a syntax error of groovy program
+ */
+public class GroovySyntaxError extends AssertionError {
+    public static final int LEXER = 0;
+    public static final int PARSER = 1;
+    private int source;
+    private int line;
+    private int column;
+
+    public GroovySyntaxError(String message, int source, int line, int column) {
+        super(message, null);
+
+        if (source != LEXER && source != PARSER) {
+            throw new IllegalArgumentException("Invalid syntax error source: " + source);
+        }
+
+        this.source = source;
+        this.line = line;
+        this.column = column;
+    }
+
+    public int getSource() {
+        return source;
+    }
+    public int getLine() {
+        return line;
+    }
+
+    public int getColumn() {
+        return column;
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovydocManager.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovydocManager.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovydocManager.java
new file mode 100644
index 0000000..449b2e7
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovydocManager.java
@@ -0,0 +1,183 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4;
+
+import groovy.lang.Groovydoc;
+import org.antlr.v4.runtime.ParserRuleContext;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.antlr.v4.runtime.tree.TerminalNode;
+import org.codehaus.groovy.GroovyBugError;
+import org.codehaus.groovy.ast.ASTNode;
+import org.codehaus.groovy.ast.AnnotatedNode;
+import org.codehaus.groovy.ast.AnnotationNode;
+import org.codehaus.groovy.ast.ClassHelper;
+import org.codehaus.groovy.ast.expr.ConstantExpression;
+
+import java.util.List;
+
+import static org.codehaus.groovy.runtime.DefaultGroovyMethods.asBoolean;
+
+/**
+ * A utilities for managing groovydoc, e.g.
+ * 1) extracting groovydoc from groovy AST;
+ * 2) TODO extracting tags from groovydoc;
+ * 3) attach groovydoc to AST node as metadata
+ */
+public class GroovydocManager {
+    public static final String DOC_COMMENT = "_DOC_COMMENT"; // keys for meta data
+    private static final String DOC_COMMENT_PREFIX = "/**";
+    private static final String EXTRACT_DOC_COMMENT = "groovy.extract.doc.comment";
+    private static final String TRUE_STR = "true";
+    private static final boolean EXTRACTING_DOC_COMMENT_ENABLED;
+    private static final String VALUE = "value";
+    private static final String RUNTIME_GROOVYDOC_PATTERN = "(?s)/[*][*]\\s+(\\s+[*]\\s*)*@Groovydoc\\b.+?[*]/";
+    private AstBuilder astBuilder;
+
+    static {
+        boolean edce;
+        try {
+            edce = TRUE_STR.equals(System.getProperty(EXTRACT_DOC_COMMENT));
+        } catch (Exception e) {
+            edce = false;
+        }
+
+        EXTRACTING_DOC_COMMENT_ENABLED = edce;
+    }
+
+    public GroovydocManager(AstBuilder astBuilder) {
+        this.astBuilder = astBuilder;
+    }
+
+    /**
+     * Attach doc comment to member node as meta data
+     *
+     */
+    public void handle(ASTNode node, GroovyParser.GroovyParserRuleContext ctx) {
+        if (!asBoolean(node) || !asBoolean(ctx)) {
+            return;
+        }
+
+        String docCommentNodeText = this.findDocCommentByNode(ctx);
+        if (null == docCommentNodeText) {
+            return;
+        }
+
+        attachDocCommentAsMetaData(node, docCommentNodeText);
+        attachGroovydocAnnotation(node, docCommentNodeText);
+    }
+
+    /*
+     * Attach doc comment to member node as meta data
+     */
+    private void attachDocCommentAsMetaData(ASTNode node, String docCommentNodeText) {
+        if (!EXTRACTING_DOC_COMMENT_ENABLED) {
+            return;
+        }
+
+        node.putNodeMetaData(DOC_COMMENT, docCommentNodeText);
+    }
+
+    /*
+     * Attach Groovydoc annotation to the target element
+     */
+    private void attachGroovydocAnnotation(ASTNode node, String docCommentNodeText) {
+        if (!(node instanceof AnnotatedNode)) {
+            return;
+        }
+
+        if (!docCommentNodeText.matches(RUNTIME_GROOVYDOC_PATTERN)) {
+            return;
+        }
+
+        AnnotatedNode annotatedNode = (AnnotatedNode) node;
+        AnnotationNode annotationNode = new AnnotationNode(ClassHelper.make(Groovydoc.class));
+        annotationNode.addMember(VALUE, new ConstantExpression(docCommentNodeText));
+        annotatedNode.addAnnotation(annotationNode);
+    }
+
+    private String findDocCommentByNode(ParserRuleContext node) {
+        if (!asBoolean(node)) {
+            return null;
+        }
+
+        if (node instanceof GroovyParser.ClassBodyContext) {
+            return null;
+        }
+
+        ParserRuleContext parentContext = node.getParent();
+
+        if (!asBoolean(parentContext)) {
+            return null;
+        }
+
+        String docCommentNodeText = null;
+        boolean sameTypeNodeBefore = false;
+        for (ParseTree child : parentContext.children) {
+
+            if (node == child) {
+                // if no doc comment node found and no siblings of same type before the node,
+                // try to find doc comment node of its parent
+                if (!asBoolean((Object) docCommentNodeText) && !sameTypeNodeBefore) {
+                    return findDocCommentByNode(parentContext);
+                }
+
+                return docCommentNodeText;
+            }
+
+            if (node.getClass() == child.getClass()) { // e.g. ClassBodyDeclarationContext == ClassBodyDeclarationContext
+                docCommentNodeText = null;
+                sameTypeNodeBefore = true;
+                continue;
+            }
+
+            if (!(child instanceof GroovyParser.NlsContext || child instanceof GroovyParser.SepContext)) {
+                continue;
+            }
+
+            // doc comments are treated as NL
+            List<? extends TerminalNode> nlList =
+                    child instanceof GroovyParser.NlsContext
+                            ? ((GroovyParser.NlsContext) child).NL()
+                            : ((GroovyParser.SepContext) child).NL();
+
+            int nlListSize = nlList.size();
+            if (0 == nlListSize) {
+                continue;
+            }
+
+            for (int i = nlListSize - 1; i >= 0; i--) {
+                String text = nlList.get(i).getText();
+
+                if (text.matches("\\s+")) {
+                    continue;
+                }
+
+                if (text.startsWith(DOC_COMMENT_PREFIX)) {
+                    docCommentNodeText = text;
+                } else {
+                    docCommentNodeText = null;
+                }
+
+                break;
+            }
+        }
+
+        throw new GroovyBugError("node can not be found: " + node.getText()); // The exception should never be thrown!
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierManager.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierManager.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierManager.java
new file mode 100644
index 0000000..a45e36c
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierManager.java
@@ -0,0 +1,198 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4;
+
+import org.codehaus.groovy.ast.AnnotatedNode;
+import org.codehaus.groovy.ast.AnnotationNode;
+import org.codehaus.groovy.ast.ConstructorNode;
+import org.codehaus.groovy.ast.MethodNode;
+import org.codehaus.groovy.ast.Parameter;
+import org.codehaus.groovy.ast.expr.VariableExpression;
+import org.objectweb.asm.Opcodes;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import static org.apache.groovy.parser.antlr4.GroovyParser.*;
+import static org.codehaus.groovy.runtime.DefaultGroovyMethods.asBoolean;
+
+/**
+ * Process modifiers for AST nodes
+ * <p>
+ * Created by Daniel.Sun on 2016/08/27.
+ */
+class ModifierManager {
+    private static final Map<Class, List<Integer>> INVALID_MODIFIERS_MAP = Collections.unmodifiableMap(new HashMap<Class, List<Integer>>() {
+        {
+            put(ConstructorNode.class, Arrays.asList(STATIC, FINAL, ABSTRACT, NATIVE));
+            put(MethodNode.class, Arrays.asList(VOLATILE/*, TRANSIENT*/));
+        }
+    });
+    private AstBuilder astBuilder;
+    private List<ModifierNode> modifierNodeList;
+
+    public ModifierManager(AstBuilder astBuilder, List<ModifierNode> modifierNodeList) {
+        this.astBuilder = astBuilder;
+        this.validate(modifierNodeList);
+        this.modifierNodeList = Collections.unmodifiableList(asBoolean((Object) modifierNodeList) ? modifierNodeList : Collections.emptyList());
+    }
+
+    private void validate(List<ModifierNode> modifierNodeList) {
+        Map<ModifierNode, Integer> modifierNodeCounter = new LinkedHashMap<>(modifierNodeList.size());
+        int visibilityModifierCnt = 0;
+
+        for (ModifierNode modifierNode : modifierNodeList) {
+            Integer cnt = modifierNodeCounter.get(modifierNode);
+
+            if (null == cnt) {
+                modifierNodeCounter.put(modifierNode, 1);
+            } else if (1 == cnt && !modifierNode.isRepeatable()) {
+                throw astBuilder.createParsingFailedException("Cannot repeat modifier[" + modifierNode.getText() + "]", modifierNode);
+            }
+
+            if (modifierNode.isVisibilityModifier()) {
+                visibilityModifierCnt++;
+
+                if (visibilityModifierCnt > 1) {
+                    throw astBuilder.createParsingFailedException("Cannot specify modifier[" + modifierNode.getText() + "] when access scope has already been defined", modifierNode);
+                }
+            }
+        }
+    }
+
+    public void validate(MethodNode methodNode) {
+        validate(INVALID_MODIFIERS_MAP.get(MethodNode.class), methodNode);
+    }
+
+    public void validate(ConstructorNode constructorNode) {
+        validate(INVALID_MODIFIERS_MAP.get(ConstructorNode.class), constructorNode);
+    }
+
+    private void validate(List<Integer> invalidModifierList, MethodNode methodNode) {
+        modifierNodeList.forEach(e -> {
+            if (invalidModifierList.contains(e.getType())) {
+                throw astBuilder.createParsingFailedException(methodNode.getClass().getSimpleName().replace("Node", "") + " has an incorrect modifier '" + e + "'.", methodNode);
+            }
+        });
+    }
+
+    // t    1: class modifiers value; 2: class member modifiers value
+    private int calcModifiersOpValue(int t) {
+        int result = 0;
+
+        for (ModifierNode modifierNode : modifierNodeList) {
+            result |= modifierNode.getOpcode();
+        }
+
+        if (!this.containsVisibilityModifier()) {
+            if (1 == t) {
+                result |= Opcodes.ACC_SYNTHETIC | Opcodes.ACC_PUBLIC;
+            } else if (2 == t) {
+                result |= Opcodes.ACC_PUBLIC;
+            }
+        }
+
+        return result;
+    }
+
+    public int getClassModifiersOpValue() {
+        return this.calcModifiersOpValue(1);
+    }
+
+    public int getClassMemberModifiersOpValue() {
+        return this.calcModifiersOpValue(2);
+    }
+
+    public List<AnnotationNode> getAnnotations() {
+        return modifierNodeList.stream()
+                .filter(ModifierNode::isAnnotation)
+                .map(ModifierNode::getAnnotationNode)
+                .collect(Collectors.toList());
+    }
+
+    public boolean contains(int modifierType) {
+        return modifierNodeList.stream().anyMatch(e -> modifierType == e.getType());
+    }
+
+    public Optional<ModifierNode> get(int modifierType) {
+        return modifierNodeList.stream().filter(e -> modifierType == e.getType()).findFirst();
+    }
+
+    public boolean containsAnnotations() {
+        return modifierNodeList.stream().anyMatch(ModifierNode::isAnnotation);
+    }
+
+    public boolean containsVisibilityModifier() {
+        return modifierNodeList.stream().anyMatch(ModifierNode::isVisibilityModifier);
+    }
+
+    public boolean containsNonVisibilityModifier() {
+        return modifierNodeList.stream().anyMatch(ModifierNode::isNonVisibilityModifier);
+    }
+
+    public Parameter processParameter(Parameter parameter) {
+        modifierNodeList.forEach(e -> {
+            parameter.setModifiers(parameter.getModifiers() | e.getOpcode());
+
+            if (e.isAnnotation()) {
+                parameter.addAnnotation(e.getAnnotationNode());
+            }
+        });
+
+        return parameter;
+    }
+
+    public int clearVisibilityModifiers(int modifiers) {
+        return modifiers & ~Opcodes.ACC_PUBLIC & ~Opcodes.ACC_PROTECTED & ~Opcodes.ACC_PRIVATE;
+    }
+
+    public MethodNode processMethodNode(MethodNode mn) {
+        modifierNodeList.forEach(e -> {
+            mn.setModifiers((e.isVisibilityModifier() ? clearVisibilityModifiers(mn.getModifiers()) : mn.getModifiers()) | e.getOpcode());
+
+            if (e.isAnnotation()) {
+                mn.addAnnotation(e.getAnnotationNode());
+            }
+        });
+
+        return mn;
+    }
+
+    public VariableExpression processVariableExpression(VariableExpression ve) {
+        modifierNodeList.forEach(e -> {
+            ve.setModifiers(ve.getModifiers() | e.getOpcode());
+
+            // local variable does not attach annotations
+        });
+
+        return ve;
+    }
+
+    public <T extends AnnotatedNode> T attachAnnotations(T node) {
+        this.getAnnotations().forEach(node::addAnnotation);
+
+        return node;
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierNode.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierNode.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierNode.java
new file mode 100644
index 0000000..5d1007b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierNode.java
@@ -0,0 +1,164 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4;
+
+import org.codehaus.groovy.ast.ASTNode;
+import org.codehaus.groovy.ast.AnnotationNode;
+import org.objectweb.asm.Opcodes;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+import static org.apache.groovy.parser.antlr4.GroovyParser.*;
+import static org.codehaus.groovy.runtime.DefaultGroovyMethods.asBoolean;
+
+/**
+ * Represents a modifier, which is better to place in the package org.codehaus.groovy.ast
+ * <p>
+ * Created by Daniel.Sun on 2016/08/23.
+ */
+public class ModifierNode extends ASTNode {
+    private Integer type;
+    private Integer opcode; // ASM opcode
+    private String text;
+    private AnnotationNode annotationNode;
+    private boolean repeatable;
+
+    public static final int ANNOTATION_TYPE = -999;
+    public static final Map<Integer, Integer> MODIFIER_OPCODE_MAP = Collections.unmodifiableMap(new HashMap<Integer, Integer>() {
+        {
+            put(ANNOTATION_TYPE, 0);
+            put(DEF, 0);
+
+            put(NATIVE, Opcodes.ACC_NATIVE);
+            put(SYNCHRONIZED, Opcodes.ACC_SYNCHRONIZED);
+            put(TRANSIENT, Opcodes.ACC_TRANSIENT);
+            put(VOLATILE, Opcodes.ACC_VOLATILE);
+
+            put(PUBLIC, Opcodes.ACC_PUBLIC);
+            put(PROTECTED, Opcodes.ACC_PROTECTED);
+            put(PRIVATE, Opcodes.ACC_PRIVATE);
+            put(STATIC, Opcodes.ACC_STATIC);
+            put(ABSTRACT, Opcodes.ACC_ABSTRACT);
+            put(FINAL, Opcodes.ACC_FINAL);
+            put(STRICTFP, Opcodes.ACC_STRICT);
+            put(DEFAULT, 0); // no flag for specifying a default method in the JVM spec, hence no ACC_DEFAULT flag in ASM
+        }
+    });
+
+    public ModifierNode(Integer type) {
+        this.type = type;
+        this.opcode = MODIFIER_OPCODE_MAP.get(type);
+        this.repeatable = ANNOTATION_TYPE == type; // Only annotations are repeatable
+
+        if (!asBoolean((Object) this.opcode)) {
+            throw new IllegalArgumentException("Unsupported modifier type: " + type);
+        }
+    }
+
+    /**
+     * @param type the modifier type, which is same as the token type
+     * @param text text of the ast node
+     */
+    public ModifierNode(Integer type, String text) {
+        this(type);
+        this.text = text;
+    }
+
+    /**
+     * @param annotationNode the annotation node
+     * @param text           text of the ast node
+     */
+    public ModifierNode(AnnotationNode annotationNode, String text) {
+        this(ModifierNode.ANNOTATION_TYPE, text);
+        this.annotationNode = annotationNode;
+
+        if (!asBoolean(annotationNode)) {
+            throw new IllegalArgumentException("annotationNode can not be null");
+        }
+    }
+
+    /**
+     * Check whether the modifier is not an imagined modifier(annotation, def)
+     */
+    public boolean isModifier() {
+        return !this.isAnnotation() && !this.isDef();
+    }
+
+    public boolean isVisibilityModifier() {
+        return Objects.equals(PUBLIC, this.type)
+                || Objects.equals(PROTECTED, this.type)
+                || Objects.equals(PRIVATE, this.type);
+    }
+
+    public boolean isNonVisibilityModifier() {
+        return this.isModifier() && !this.isVisibilityModifier();
+    }
+
+    public boolean isAnnotation() {
+        return Objects.equals(ANNOTATION_TYPE, this.type);
+    }
+
+    public boolean isDef() {
+        return Objects.equals(DEF, this.type);
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public Integer getOpcode() {
+        return opcode;
+    }
+
+    public boolean isRepeatable() {
+        return repeatable;
+    }
+
+    @Override
+    public String getText() {
+        return text;
+    }
+
+    public AnnotationNode getAnnotationNode() {
+        return annotationNode;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        ModifierNode that = (ModifierNode) o;
+        return Objects.equals(type, that.type) &&
+                Objects.equals(text, that.text) &&
+                Objects.equals(annotationNode, that.annotationNode);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(type, text, annotationNode);
+    }
+
+    @Override
+    public String toString() {
+        return this.text;
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/PositionInfo.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/PositionInfo.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/PositionInfo.java
new file mode 100644
index 0000000..b59aabb
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/PositionInfo.java
@@ -0,0 +1,73 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4;
+
+import java.util.Objects;
+
+/**
+ * Created by Daniel on 2017/4/22.
+ */
+public class PositionInfo {
+    private int line;
+    private int column;
+
+    public PositionInfo(int line, int column) {
+        this.line = line;
+        this.column = column;
+    }
+
+    public int getLine() {
+        return line;
+    }
+
+    public void setLine(int line) {
+        this.line = line;
+    }
+
+    public int getColumn() {
+        return column;
+    }
+
+    public void setColumn(int column) {
+        this.column = column;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        PositionInfo that = (PositionInfo) o;
+        return line == that.line &&
+                column == that.column;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(line, column);
+    }
+
+    @Override
+    public String toString() {
+        if (-1 == line || -1 == column) {
+            return "";
+        }
+
+        return " @ line " + line + ", column " + column;
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SemanticPredicates.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SemanticPredicates.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SemanticPredicates.java
new file mode 100644
index 0000000..eb3dbd9
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SemanticPredicates.java
@@ -0,0 +1,152 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4;
+
+import org.antlr.v4.runtime.CharStream;
+import org.antlr.v4.runtime.Token;
+import org.antlr.v4.runtime.TokenStream;
+
+import java.util.Collections;
+import java.util.Set;
+
+import static org.apache.groovy.parser.antlr4.GroovyParser.*;
+
+/**
+ * Some semantic predicates for altering the behaviour of the lexer and parser
+ *
+ * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
+ * Created on    2016/08/20
+ */
+public class SemanticPredicates {
+    public static boolean isFollowedByWhiteSpaces(CharStream cs) {
+        for (int index = 1, c = cs.LA(index); !('\r' == c || '\n' == c || CharStream.EOF == c); index++, c = cs.LA(index)) {
+            if (String.valueOf((char) c).matches("\\S+?")) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    public static boolean isFollowedBy(CharStream cs, char... chars) {
+        int c1 = cs.LA(1);
+
+        for (char c : chars) {
+            if (c1 == c) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    public static boolean isFollowedByJavaLetterInGString(CharStream cs) {
+        int c1 = cs.LA(1);
+
+        if ('$' == c1) { // single $ is not a valid identifier
+            return false;
+        }
+
+        String str1 = String.valueOf((char) c1);
+
+        if (str1.matches("[a-zA-Z_{]")) {
+            return true;
+        }
+
+        if (str1.matches("[^\u0000-\u007F\uD800-\uDBFF]")
+                && Character.isJavaIdentifierPart(c1)) {
+            return true;
+        }
+
+        int c2 = cs.LA(2);
+        String str2 = String.valueOf((char) c2);
+
+        if (str1.matches("[\uD800-\uDBFF]")
+                && str2.matches("[\uDC00-\uDFFF]")
+                && Character.isJavaIdentifierPart(Character.toCodePoint((char) c1, (char) c2))) {
+
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Check whether following a method name of command expression.
+     * Method name should not end with "2: arguments" and "3: closure"
+     *
+     * @param t the type of pathExpression
+     * @return
+     */
+    public static boolean isFollowingMethodName(int t) {
+        return !(2 == t || 3 == t);
+    }
+
+    /**
+     * Distinguish between method declaration and method call/constructor declaration
+     */
+    public static boolean isInvalidMethodDeclaration(TokenStream ts) {
+        int tokenType = ts.LT(1).getType();
+
+        return (Identifier == tokenType || CapitalizedIdentifier == tokenType || StringLiteral == tokenType)
+                && LPAREN == (ts.LT(2).getType());
+    }
+
+    private static final Set<Integer> MODIFIER_SET =
+            Collections.unmodifiableSet(ModifierNode.MODIFIER_OPCODE_MAP.keySet());
+    /**
+     * Distinguish between local variable declaration and method call, e.g. `a b`
+     */
+    public static boolean isInvalidLocalVariableDeclaration(TokenStream ts) {
+        int index = 2;
+        Token token;
+        int tokenType;
+        int tokenType2 = ts.LT(index).getType();
+        int tokenType3;
+
+        if (DOT == tokenType2) {
+            int tokeTypeN = tokenType2;
+
+            do {
+                index = index + 2;
+                tokeTypeN = ts.LT(index).getType();
+            } while (DOT == tokeTypeN);
+
+            if (LT == tokeTypeN || LBRACK == tokeTypeN) {
+                return false;
+            }
+
+            index = index - 1;
+            tokenType2 = ts.LT(index + 1).getType();
+        } else {
+            index = 1;
+        }
+
+        token = ts.LT(index);
+        tokenType = token.getType();
+        tokenType3 = ts.LT(index + 2).getType();
+
+        return //VOID == tokenType ||
+                !(BuiltInPrimitiveType == tokenType || MODIFIER_SET.contains(tokenType))
+                    && Character.isLowerCase(token.getText().codePointAt(0))
+                    && !(ASSIGN == tokenType3 || (LT == tokenType2 || LBRACK == tokenType2));
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SyntaxErrorReportable.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SyntaxErrorReportable.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SyntaxErrorReportable.java
new file mode 100644
index 0000000..021e2f5
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SyntaxErrorReportable.java
@@ -0,0 +1,58 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4;
+
+/**
+ * A SyntaxErrorReportable is a recognizer that can report syntax error
+ */
+public interface SyntaxErrorReportable {
+    default void require(boolean condition, String msg, int offset, boolean toAttachPositionInfo) {
+        if (condition) {
+            return;
+        }
+
+        this.throwSyntaxError(msg, offset, toAttachPositionInfo);
+    }
+    default void require(boolean condition, String msg, boolean toAttachPositionInfo) {
+        require(condition, msg, 0, toAttachPositionInfo);
+    }
+    default void require(boolean condition, String msg, int offset) {
+        require(condition, msg, offset,false);
+    }
+    default void require(boolean condition, String msg) {
+        require(condition, msg, false);
+    }
+
+    default void throwSyntaxError(String msg, int offset, boolean toAttachPositionInfo) {
+        PositionInfo positionInfo = this.genPositionInfo(offset);
+        throw new GroovySyntaxError(msg + (toAttachPositionInfo ? positionInfo.toString() : ""),
+                this.getSyntaxErrorSource(),
+                positionInfo.getLine(),
+                positionInfo.getColumn()
+        );
+    }
+
+    int getSyntaxErrorSource();
+    default PositionInfo genPositionInfo(int offset) {
+        return new PositionInfo(getErrorLine(), getErrorColumn() + offset);
+    }
+
+    int getErrorLine();
+    int getErrorColumn();
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/TryWithResourcesASTTransformation.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/TryWithResourcesASTTransformation.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/TryWithResourcesASTTransformation.java
new file mode 100644
index 0000000..cbe3697
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/TryWithResourcesASTTransformation.java
@@ -0,0 +1,370 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4;
+
+import org.codehaus.groovy.ast.ClassHelper;
+import org.codehaus.groovy.ast.Parameter;
+import org.codehaus.groovy.ast.expr.ArgumentListExpression;
+import org.codehaus.groovy.ast.expr.BinaryExpression;
+import org.codehaus.groovy.ast.expr.BooleanExpression;
+import org.codehaus.groovy.ast.expr.ConstantExpression;
+import org.codehaus.groovy.ast.expr.DeclarationExpression;
+import org.codehaus.groovy.ast.expr.MethodCallExpression;
+import org.codehaus.groovy.ast.expr.VariableExpression;
+import org.codehaus.groovy.ast.stmt.BlockStatement;
+import org.codehaus.groovy.ast.stmt.CatchStatement;
+import org.codehaus.groovy.ast.stmt.EmptyStatement;
+import org.codehaus.groovy.ast.stmt.ExpressionStatement;
+import org.codehaus.groovy.ast.stmt.IfStatement;
+import org.codehaus.groovy.ast.stmt.Statement;
+import org.codehaus.groovy.ast.stmt.ThrowStatement;
+import org.codehaus.groovy.ast.stmt.TryCatchStatement;
+import org.codehaus.groovy.syntax.Types;
+import org.objectweb.asm.Opcodes;
+
+import java.util.Collections;
+import java.util.List;
+
+import static org.codehaus.groovy.runtime.DefaultGroovyMethods.asBoolean;
+
+/**
+ * Transform try-with-resources to try-catch-finally
+ * Reference JLS "14.20.3. try-with-resources"(https://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html)
+ *
+ * @author <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
+ *         Created on 2016/11/04
+ */
+public class TryWithResourcesASTTransformation {
+    private AstBuilder astBuilder;
+
+    public TryWithResourcesASTTransformation(AstBuilder astBuilder) {
+        this.astBuilder = astBuilder;
+    }
+
+    /**
+     * Reference JLS "14.20.3. try-with-resources"(https://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html)
+     *
+     * @param tryCatchStatement the try-with-resources statement to transform
+     * @return try-catch-finally statement, which contains no resources clause
+     */
+    public Statement transform(TryCatchStatement tryCatchStatement) {
+        if (!asBoolean(tryCatchStatement.getResourceStatements())) {
+            return tryCatchStatement;
+        }
+
+        if (this.isBasicTryWithResourcesStatement(tryCatchStatement)) {
+            return this.transformBasicTryWithResourcesStatement(tryCatchStatement);
+        } else {
+            return this.transformExtendedTryWithResourcesStatement(tryCatchStatement);
+        }
+    }
+
+    private boolean isBasicTryWithResourcesStatement(TryCatchStatement tryCatchStatement) {
+        if (EmptyStatement.INSTANCE.equals(tryCatchStatement.getFinallyStatement())
+                && !asBoolean(tryCatchStatement.getCatchStatements())) {
+            return true;
+        }
+
+        return false;
+    }
+
+    private ExpressionStatement makeVariableDeclarationFinal(ExpressionStatement variableDeclaration) {
+        if (!asBoolean(variableDeclaration)) {
+            return variableDeclaration;
+        }
+
+        if (!(variableDeclaration.getExpression() instanceof DeclarationExpression)) {
+            throw new IllegalArgumentException("variableDeclaration is not a declaration statement");
+        }
+
+        DeclarationExpression declarationExpression = (DeclarationExpression) variableDeclaration.getExpression();
+        if (!(declarationExpression.getLeftExpression() instanceof VariableExpression)) {
+            throw astBuilder.createParsingFailedException("The expression statement is not a variable delcaration statement", variableDeclaration);
+        }
+
+        VariableExpression variableExpression = (VariableExpression) declarationExpression.getLeftExpression();
+        variableExpression.setModifiers(variableExpression.getModifiers() | Opcodes.ACC_FINAL);
+
+        return variableDeclaration;
+    }
+
+    private int primaryExcCnt = 0;
+    private String genPrimaryExcName() {
+        return "__$$primaryExc" + primaryExcCnt++;
+    }
+
+    /*
+     *   try ResourceSpecification
+     *       Block
+     *   Catchesopt
+     *   Finallyopt
+     *
+     *   **The above AST should be transformed to the following AST**
+     *
+     *   try {
+     *       try ResourceSpecification
+     *           Block
+     *   }
+     *   Catchesopt
+     *   Finallyopt
+     */
+    private Statement transformExtendedTryWithResourcesStatement(TryCatchStatement tryCatchStatement) {
+        /*
+         *  try ResourceSpecification
+         *      Block
+         */
+        TryCatchStatement newTryWithResourcesStatement =
+                new TryCatchStatement(
+                        tryCatchStatement.getTryStatement(),
+                        EmptyStatement.INSTANCE);
+        tryCatchStatement.getResourceStatements().forEach(newTryWithResourcesStatement::addResource);
+
+
+        /*
+         *   try {
+         *       << the following try-with-resources has been transformed >>
+         *       try ResourceSpecification
+         *           Block
+         *   }
+         *   Catchesopt
+         *   Finallyopt
+         */
+        TryCatchStatement newTryCatchStatement =
+                new TryCatchStatement(
+                        astBuilder.createBlockStatement(this.transform(newTryWithResourcesStatement)),
+                        tryCatchStatement.getFinallyStatement());
+
+        tryCatchStatement.getCatchStatements().forEach(newTryCatchStatement::addCatch);
+
+        return newTryCatchStatement;
+    }
+
+    /*
+     *   try (VariableModifiersopt R Identifier = Expression ...)
+     *      Block
+     *
+     *  **The above AST should be transformed to the following AST**
+     *
+     *   {
+     *       final VariableModifiers_minus_final R Identifier = Expression;
+     *       Throwable #primaryExc = null;
+     *
+     *       try ResourceSpecification_tail
+     *           Block
+     *       catch (Throwable #t) {
+     *           #primaryExc = #t;
+     *           throw #t;
+     *       } finally {
+     *           if (Identifier != null) {
+     *               if (#primaryExc != null) {
+     *                   try {
+     *                       Identifier.close();
+     *                   } catch (Throwable #suppressedExc) {
+     *                       #primaryExc.addSuppressed(#suppressedExc);
+     *                   }
+     *               } else {
+     *                   Identifier.close();
+     *               }
+     *           }
+     *       }
+     *   }
+     *
+     */
+    private Statement transformBasicTryWithResourcesStatement(TryCatchStatement tryCatchStatement) {
+        // { ... }
+        BlockStatement blockStatement = new BlockStatement();
+
+        // final VariableModifiers_minus_final R Identifier = Expression;
+        ExpressionStatement firstResourceStatement =
+                this.makeVariableDeclarationFinal(
+                        tryCatchStatement.getResourceStatement(0));
+        astBuilder.appendStatementsToBlockStatement(blockStatement, firstResourceStatement);
+
+        // Throwable #primaryExc = null;
+        String primaryExcName = this.genPrimaryExcName();
+        ExpressionStatement primaryExcDeclarationStatement =
+                new ExpressionStatement(
+                        new DeclarationExpression(
+                                new VariableExpression(primaryExcName, ClassHelper.make(Throwable.class)),
+                                org.codehaus.groovy.syntax.Token.newSymbol(Types.ASSIGN, -1, -1),
+                                new ConstantExpression(null)
+                        )
+                );
+        astBuilder.appendStatementsToBlockStatement(blockStatement, primaryExcDeclarationStatement);
+
+
+        // The generated try-catch-finally statement
+        String firstResourceIdentifierName =
+                ((DeclarationExpression) tryCatchStatement.getResourceStatement(0).getExpression()).getLeftExpression().getText();
+
+        TryCatchStatement newTryCatchStatement =
+                new TryCatchStatement(
+                        tryCatchStatement.getTryStatement(),
+                        this.createFinallyBlockForNewTryCatchStatement(primaryExcName, firstResourceIdentifierName));
+
+        List<ExpressionStatement> resourceStatements = tryCatchStatement.getResourceStatements();
+        // 2nd, 3rd, ..., n'th resources declared in resources
+        List<ExpressionStatement> tailResourceStatements = resourceStatements.subList(1, resourceStatements.size());
+        tailResourceStatements.stream().forEach(newTryCatchStatement::addResource);
+
+        newTryCatchStatement.addCatch(this.createCatchBlockForOuterNewTryCatchStatement(primaryExcName));
+        astBuilder.appendStatementsToBlockStatement(blockStatement, this.transform(newTryCatchStatement));
+
+        return blockStatement;
+    }
+
+    /*
+     *   catch (Throwable #t) {
+     *       #primaryExc = #t;
+     *       throw #t;
+     *   }
+     *
+     */
+    private CatchStatement createCatchBlockForOuterNewTryCatchStatement(String primaryExcName) {
+        // { ... }
+        BlockStatement blockStatement = new BlockStatement();
+        String tExcName = this.genTExcName();
+
+        // #primaryExc = #t;
+        ExpressionStatement primaryExcAssignStatement =
+                new ExpressionStatement(
+                        new BinaryExpression(
+                                new VariableExpression(primaryExcName),
+                                org.codehaus.groovy.syntax.Token.newSymbol(Types.ASSIGN, -1, -1),
+                                new VariableExpression(tExcName)));
+        astBuilder.appendStatementsToBlockStatement(blockStatement, primaryExcAssignStatement);
+
+        // throw #t;
+        ThrowStatement throwTExcStatement = new ThrowStatement(new VariableExpression(tExcName));
+        astBuilder.appendStatementsToBlockStatement(blockStatement, throwTExcStatement);
+
+        // Throwable #t
+        Parameter tExcParameter = new Parameter(ClassHelper.make(Throwable.class), tExcName);
+
+        return new CatchStatement(tExcParameter, blockStatement);
+    }
+
+    private int tExcCnt = 0;
+    private String genTExcName() {
+        return "__$$t" + tExcCnt++;
+    }
+
+    /*
+     *   finally {
+     *       if (Identifier != null) {
+     *           if (#primaryExc != null) {
+     *              try {
+     *                  Identifier.close();
+     *              } catch (Throwable #suppressedExc) {
+     *                  #primaryExc.addSuppressed(#suppressedExc);
+     *              }
+     *           } else {
+     *               Identifier.close();
+     *           }
+     *       }
+     *   }
+     *
+     * We can simplify the above code to a Groovy version as follows:
+     *
+     *   finally {
+     *      if (#primaryExc != null)
+     *         try {
+     *             Identifier?.close();
+     *         } catch (Throwable #suppressedExc) {
+     *             #primaryExc.addSuppressed(#suppressedExc);
+     *         }
+     *      else
+     *          Identifier?.close();
+     *
+     *   }
+     *
+     */
+    private BlockStatement createFinallyBlockForNewTryCatchStatement(String primaryExcName, String firstResourceIdentifierName) {
+        BlockStatement finallyBlock = new BlockStatement();
+
+        // primaryExc != null
+        BooleanExpression conditionExpression =
+                new BooleanExpression(
+                        new BinaryExpression(
+                                new VariableExpression(primaryExcName),
+                                org.codehaus.groovy.syntax.Token.newSymbol(Types.COMPARE_NOT_EQUAL, -1, -1),
+                                new ConstantExpression(null)));
+
+        // try-catch statement
+        TryCatchStatement newTryCatchStatement =
+                new TryCatchStatement(
+                        astBuilder.createBlockStatement(this.createCloseResourceStatement(firstResourceIdentifierName)), // { Identifier?.close(); }
+                        EmptyStatement.INSTANCE);
+
+
+        String suppressedExcName = this.genSuppressedExcName();
+        newTryCatchStatement.addCatch(
+                // catch (Throwable #suppressedExc) { .. }
+                new CatchStatement(
+                        new Parameter(ClassHelper.make(Throwable.class), suppressedExcName),
+                        astBuilder.createBlockStatement(this.createAddSuppressedStatement(primaryExcName, suppressedExcName)) // #primaryExc.addSuppressed(#suppressedExc);
+                )
+        );
+
+        // if (#primaryExc != null) { ... }
+        IfStatement ifStatement =
+                new IfStatement(
+                        conditionExpression,
+                        newTryCatchStatement,
+                        this.createCloseResourceStatement(firstResourceIdentifierName) // Identifier?.close();
+                );
+        astBuilder.appendStatementsToBlockStatement(finallyBlock, ifStatement);
+
+        return astBuilder.createBlockStatement(finallyBlock);
+    }
+
+    private int suppressedExcCnt = 0;
+    private String genSuppressedExcName() {
+        return "__$$suppressedExc" + suppressedExcCnt++;
+    }
+
+    /*
+     *  Identifier?.close();
+     */
+    private ExpressionStatement createCloseResourceStatement(String firstResourceIdentifierName) {
+        MethodCallExpression closeMethodCallExpression =
+                new MethodCallExpression(new VariableExpression(firstResourceIdentifierName), "close", new ArgumentListExpression());
+
+        closeMethodCallExpression.setImplicitThis(false);
+        closeMethodCallExpression.setSafe(true);
+
+        return new ExpressionStatement(closeMethodCallExpression);
+    }
+
+    /*
+     *  #primaryExc.addSuppressed(#suppressedExc);
+     */
+    private ExpressionStatement createAddSuppressedStatement(String primaryExcName, String suppressedExcName) {
+        MethodCallExpression addSuppressedMethodCallExpression =
+                new MethodCallExpression(
+                        new VariableExpression(primaryExcName),
+                        "addSuppressed",
+                        new ArgumentListExpression(Collections.singletonList(new VariableExpression(suppressedExcName))));
+        addSuppressedMethodCallExpression.setImplicitThis(false);
+        addSuppressedMethodCallExpression.setSafe(true);
+
+        return new ExpressionStatement(addSuppressedMethodCallExpression);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/internal/AtnManager.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/internal/AtnManager.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/internal/AtnManager.java
new file mode 100644
index 0000000..02cc152
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/internal/AtnManager.java
@@ -0,0 +1,107 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4.internal;
+
+import org.antlr.v4.runtime.atn.ATN;
+import org.apache.groovy.parser.antlr4.GroovyLangLexer;
+import org.apache.groovy.parser.antlr4.GroovyLangParser;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+/**
+ * Manage ATN for lexer and parser to avoid memory leak
+ *
+ * @author <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
+ * Created on 2016/08/14
+ */
+public class AtnManager {
+    public static final ReentrantReadWriteLock RRWL = new ReentrantReadWriteLock(true);
+    private static final String CACHE_THRESHOLD_NAME = "groovy.antlr4.cache.threshold";
+    private static final int CACHE_THRESHOLD;
+    private final Class ownerClass;
+    private final ATN atn;
+    private static final Map<Class, AtnWrapper> ATN_MAP =
+            Collections.unmodifiableMap(new HashMap<Class, AtnWrapper>() {
+                {
+                    put(GroovyLangLexer.class, new AtnWrapper(GroovyLangLexer._ATN));
+                    put(GroovyLangParser.class, new AtnWrapper(GroovyLangParser._ATN));
+                }
+            });
+
+    static {
+        int t = 50;
+
+        try {
+            t = Integer.parseInt(System.getProperty(CACHE_THRESHOLD_NAME));
+
+            // cache threshold should be at least 50 for better performance
+            t = t < 50 ? 50 : t;
+        } catch (Exception e) {
+            // ignored
+        }
+
+        CACHE_THRESHOLD = t;
+    }
+
+    public AtnManager(GroovyLangLexer lexer) {
+        this.ownerClass = lexer.getClass();
+        this.atn = GroovyLangLexer._ATN; //getAtnWrapper(this.ownerClass).checkAndClear();
+    }
+
+    public AtnManager(GroovyLangParser parser) {
+        this.ownerClass = parser.getClass();
+        this.atn = getAtnWrapper(this.ownerClass).checkAndClear();
+    }
+
+    public ATN getATN() {
+        return this.atn;
+    }
+
+    private AtnWrapper getAtnWrapper(Class ownerClass) {
+        return ATN_MAP.get(ownerClass);
+    }
+
+    private static class AtnWrapper {
+        private final ATN atn;
+        private final AtomicLong counter = new AtomicLong(0);
+
+        public AtnWrapper(ATN atn) {
+            this.atn = atn;
+        }
+
+        public ATN checkAndClear() {
+            if (0 != counter.incrementAndGet() % CACHE_THRESHOLD) {
+                return atn;
+            }
+
+            RRWL.writeLock().lock();
+            try {
+                atn.clearDFA();
+            } finally {
+                RRWL.writeLock().unlock();
+            }
+
+            return atn;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/internal/DescriptiveErrorStrategy.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/internal/DescriptiveErrorStrategy.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/internal/DescriptiveErrorStrategy.java
new file mode 100644
index 0000000..12081ed
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/internal/DescriptiveErrorStrategy.java
@@ -0,0 +1,110 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4.internal;
+
+import org.antlr.v4.runtime.BailErrorStrategy;
+import org.antlr.v4.runtime.FailedPredicateException;
+import org.antlr.v4.runtime.InputMismatchException;
+import org.antlr.v4.runtime.NoViableAltException;
+import org.antlr.v4.runtime.Parser;
+import org.antlr.v4.runtime.ParserRuleContext;
+import org.antlr.v4.runtime.RecognitionException;
+import org.antlr.v4.runtime.Token;
+import org.antlr.v4.runtime.TokenStream;
+import org.antlr.v4.runtime.atn.PredictionMode;
+import org.antlr.v4.runtime.misc.NotNull;
+import org.antlr.v4.runtime.misc.ParseCancellationException;
+
+/**
+ * Provide friendly error messages when parsing errors occurred.
+ *
+ * @author <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
+ *         Created on 2016/10/19
+ */
+public class DescriptiveErrorStrategy extends BailErrorStrategy {
+    @Override
+    public void recover(Parser recognizer, RecognitionException e) {
+        for (ParserRuleContext context = recognizer.getContext(); context != null; context = context.getParent()) {
+            context.exception = e;
+        }
+
+        if (PredictionMode.LL.equals(recognizer.getInterpreter().getPredictionMode())) {
+            if (e instanceof NoViableAltException) {
+                this.reportNoViableAlternative(recognizer, (NoViableAltException) e);
+            } else if (e instanceof InputMismatchException) {
+                this.reportInputMismatch(recognizer, (InputMismatchException) e);
+            } else if (e instanceof FailedPredicateException) {
+                this.reportFailedPredicate(recognizer, (FailedPredicateException) e);
+            }
+        }
+
+        throw new ParseCancellationException(e);
+    }
+
+    @Override
+    public Token recoverInline(Parser recognizer)
+            throws RecognitionException {
+
+        this.recover(recognizer, new InputMismatchException(recognizer)); // stop parsing
+        return null;
+    }
+
+    protected String createNoViableAlternativeErrorMessage(Parser recognizer, NoViableAltException e) {
+        TokenStream tokens = recognizer.getInputStream();
+        String input;
+        if (tokens != null) {
+            if (e.getStartToken().getType() == Token.EOF) input = "<EOF>";
+            else input = tokens.getText(e.getStartToken(), e.getOffendingToken());
+        } else {
+            input = "<unknown input>";
+        }
+
+        return "Unexpected input: " + escapeWSAndQuote(input);
+    }
+
+    @Override
+    protected void reportNoViableAlternative(@NotNull Parser recognizer,
+                                             @NotNull NoViableAltException e) {
+
+        notifyErrorListeners(recognizer, this.createNoViableAlternativeErrorMessage(recognizer, e), e);
+    }
+
+    protected String createInputMismatchErrorMessage(@NotNull Parser recognizer,
+                                                     @NotNull InputMismatchException e) {
+        return "Unexpected input: " + getTokenErrorDisplay(e.getOffendingToken(recognizer)) +
+                "; Expecting " + e.getExpectedTokens().toString(recognizer.getVocabulary());
+    }
+
+    protected void reportInputMismatch(@NotNull Parser recognizer,
+                                       @NotNull InputMismatchException e) {
+
+        notifyErrorListeners(recognizer, this.createInputMismatchErrorMessage(recognizer, e), e);
+    }
+
+
+    protected String createFailedPredicateErrorMessage(@NotNull Parser recognizer,
+                                                       @NotNull FailedPredicateException e) {
+        return e.getMessage();
+    }
+
+    protected void reportFailedPredicate(@NotNull Parser recognizer,
+                                         @NotNull FailedPredicateException e) {
+        notifyErrorListeners(recognizer, this.createFailedPredicateErrorMessage(recognizer, e), e);
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java
new file mode 100644
index 0000000..739a737
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java
@@ -0,0 +1,149 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4.util;
+
+import groovy.lang.Closure;
+import org.codehaus.groovy.runtime.StringGroovyMethods;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+/**
+ * Utilities for handling strings
+ *
+ * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
+ * Created on    2016/08/20
+ */
+public class StringUtils {
+    public static String replaceHexEscapes(String text) {
+        Pattern p = Pattern.compile("(\\\\*)\\\\u+([0-9abcdefABCDEF]{4})");
+	    return StringGroovyMethods.replaceAll((CharSequence) text, p, new Closure<Void>(null, null) {
+		    Object doCall(String _0, String _1, String _2) {
+				if (isLengthOdd(_1)) {
+					return _0;
+				}
+
+			    return _1 + new String(Character.toChars(Integer.parseInt(_2, 16)));
+		    }
+	    });
+    }
+
+	public static String replaceOctalEscapes(String text) {
+	    Pattern p = Pattern.compile("(\\\\*)\\\\([0-3]?[0-7]?[0-7])");
+	    return StringGroovyMethods.replaceAll((CharSequence) text, p, new Closure<Void>(null, null) {
+		    Object doCall(String _0, String _1, String _2) {
+				if (isLengthOdd(_1)) {
+					return _0;
+				}
+
+			    return _1 + new String(Character.toChars(Integer.parseInt(_2, 8)));
+		    }
+	    });
+    }
+
+    private static Map<Character, Character> STANDARD_ESCAPES = new HashMap<Character, Character>() {
+		{
+			this.put('b', '\b');
+			this.put('t', '\t');
+			this.put('n', '\n');
+			this.put('f', '\f');
+			this.put('r', '\r');
+		}
+	};
+
+	public static String replaceStandardEscapes(String text) {
+	    Pattern p = Pattern.compile("(\\\\*)\\\\([btnfr\"'])");
+
+	    String result = StringGroovyMethods.replaceAll((CharSequence) text, p, new Closure<Void>(null, null) {
+							Object doCall(String _0, String _1, String _2) {
+								if (isLengthOdd(_1)) {
+									return _0;
+								}
+
+								Character character = STANDARD_ESCAPES.get(_2.charAt(0));
+								return _1 + (character != null ? character : _2);
+							}
+						});
+
+		return result.replace("\\\\", "\\");
+    }
+
+	public static final int NONE_SLASHY = 0;
+	public static final int SLASHY = 1;
+	public static final int DOLLAR_SLASHY = 2;
+
+	public static String replaceEscapes(String text, int slashyType) {
+		if (slashyType == SLASHY || slashyType == DOLLAR_SLASHY) {
+			text = StringUtils.replaceHexEscapes(text);
+			text = StringUtils.replaceLineEscape(text);
+
+			if (slashyType == SLASHY) {
+				text = text.replace("\\/", "/");
+			}
+
+			if (slashyType == DOLLAR_SLASHY) {
+				text = text.replace("$$", "$");
+				text = text.replace("$/", "/");
+			}
+
+		} else if (slashyType == NONE_SLASHY) {
+			text = StringUtils.replaceEscapes(text);
+		} else {
+			throw new IllegalArgumentException("Invalid slashyType: " + slashyType);
+		}
+
+		return text;
+	}
+
+	private static String replaceEscapes(String text) {
+		text = text.replace("\\$", "$");
+
+		text = StringUtils.replaceLineEscape(text);
+
+        return StringUtils.replaceStandardEscapes(replaceHexEscapes(replaceOctalEscapes(text)));
+    }
+
+	private static String replaceLineEscape(String text) {
+		Pattern p = Pattern.compile("(\\\\*)\\\\\r?\n");
+		text = StringGroovyMethods.replaceAll((CharSequence) text, p, new Closure<Void>(null, null) {
+			Object doCall(String _0, String _1) {
+				if (isLengthOdd(_1)) {
+					return _0;
+				}
+
+				return _1;
+			}
+		});
+
+		return text;
+	}
+
+	private static boolean isLengthOdd(String str) {
+		return null != str && str.length() % 2 == 1;
+	}
+
+	public static String removeCR(String text) {
+        return text.replace("\r\n", "\n");
+    }
+
+	public static long countChar(String text, char c) {
+		return text.chars().filter(e -> c == e).count();
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy b/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
new file mode 100644
index 0000000..480d2ab
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
@@ -0,0 +1,368 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4
+
+import org.codehaus.groovy.ast.ClassNode
+import org.codehaus.groovy.ast.FieldNode
+import org.codehaus.groovy.ast.MethodNode
+import org.codehaus.groovy.ast.Parameter
+import org.codehaus.groovy.ast.PropertyNode
+import org.codehaus.groovy.ast.stmt.AssertStatement
+import org.codehaus.groovy.ast.stmt.ExpressionStatement
+import org.codehaus.groovy.syntax.Token
+
+import static org.apache.groovy.parser.antlr4.TestUtils.doTest
+import static org.apache.groovy.parser.antlr4.TestUtils.doRunAndTest
+
+/**
+ * Some basic test cases for the new parser
+ *
+ * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
+ * Created on    2016/08/14
+ */
+class GroovyParserTest extends GroovyTestCase {
+
+    void setUp() {}
+
+    void tearDown() {}
+
+    void "test groovy core - Comments"() {
+        doTest('core/Comments_01.groovy', [ExpressionStatement]);
+        doTestAttachedComments();
+    }
+
+    private static doTestAttachedComments() {
+        def (newAST, oldAST) = doTest('core/Comments_02.groovy');
+        List<ClassNode> classes = new ArrayList<>(newAST.classes).sort { c1, c2 -> c1.name <=> c2.name };
+        List<MethodNode> methods = new ArrayList<>(newAST.methods).sort { m1, m2 -> m1.name <=> m2.name };
+
+        assert classes[0].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '')            == '/** * test class Comments */'
+        assert classes[0].fields[0].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '')  == '/**     * test Comments.SOME_VAR     */'
+        assert classes[0].fields[1].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '')  == '/**     * test Comments.SOME_VAR2     */'
+        assert classes[0].fields[2].nodeMetaData[GroovydocManager.DOC_COMMENT] == null
+        assert classes[0].fields[3].nodeMetaData[GroovydocManager.DOC_COMMENT] == null
+        assert classes[0].declaredConstructors[0].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '') == '/**     * test Comments.constructor1     */'
+        assert classes[0].methods[0].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '') == '/**     * test Comments.m1     */'
+        assert classes[0].methods[1].nodeMetaData[GroovydocManager.DOC_COMMENT] == null
+        assert classes[0].methods[2].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '') == '/**     * test Comments.m3     */'
+
+        assert classes[1].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '')            == '/**     * test class InnerClazz     */'
+        assert classes[1].fields[0].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '')  == '/**         * test InnerClazz.SOME_VAR3         */'
+        assert classes[1].fields[1].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '')  == '/**         * test InnerClazz.SOME_VAR4         */'
+        assert classes[1].methods[0].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '') == '/**         * test Comments.m4         */'
+        assert classes[1].methods[1].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '') == '/**         * test Comments.m5         */'
+
+        assert classes[2].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '')            == '/**     * test class InnerEnum     */'
+        assert classes[2].fields[0].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '')  == '/**         * InnerEnum.NEW         */'
+        assert classes[2].fields[1].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '')  == '/**         * InnerEnum.OLD         */'
+
+        assert classes[3].nodeMetaData[GroovydocManager.DOC_COMMENT] == null
+
+        assert classes[4].fields[0].nodeMetaData[GroovydocManager.DOC_COMMENT] == null
+
+        assert classes[5].nodeMetaData[GroovydocManager.DOC_COMMENT] == null
+
+        assert methods[0].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '') == '/** * test someScriptMethod1 */'
+        assert methods[1].nodeMetaData[GroovydocManager.DOC_COMMENT] == null
+    }
+
+    void "test groovy core - PackageDeclaration"() {
+        doTest('core/PackageDeclaration_01.groovy');
+        doTest('core/PackageDeclaration_02.groovy');
+        doTest('core/PackageDeclaration_03.groovy');
+        doTest('core/PackageDeclaration_04.groovy');
+        doTest('core/PackageDeclaration_05.groovy');
+        doTest('core/PackageDeclaration_06.groovy');
+    }
+
+    void "test groovy core - ImportDeclaration"() {
+        doTest('core/ImportDeclaration_01.groovy');
+        doTest('core/ImportDeclaration_02.groovy');
+        doTest('core/ImportDeclaration_03.groovy');
+        doTest('core/ImportDeclaration_04.groovy');
+        doTest('core/ImportDeclaration_05.groovy');
+        doTest('core/ImportDeclaration_06.groovy');
+        doTest('core/ImportDeclaration_07.groovy');
+        doTest('core/ImportDeclaration_08.groovy');
+    }
+
+    void "test groovy core - Annotation"() {
+        doTest('core/Annotation_01.groovy');
+        doTest('core/Annotation_02.groovy');
+        doTest('core/Annotation_03.groovy');
+        doTest('core/Annotation_04.groovy');
+        doTest('core/Annotation_05.groovy');
+        doTest('core/Annotation_06.groovy');
+        doTest('core/Annotation_07.groovy');
+        doTest('core/Annotation_08.groovy');
+        doTest('core/Annotation_09.groovy');
+        doRunAndTest('core/Annotation_10x.groovy');
+    }
+
+    void "test groovy core - Literal"() {
+        doTest('core/Literal_01.groovy');
+        doTest('core/Literal_02.groovy', [ExpressionStatement]);
+        doTest('core/Literal_03.groovy');
+    }
+
+    void "test groovy core - GString"() {
+        doTest('core/GString_01.groovy');
+        doTest('core/GString_02.groovy');
+        doTest('core/GString_03.groovy');
+        doTest('core/GString_04.groovy');
+        doTest('core/GString_05.groovy');
+        doTest('core/GString_06.groovy');
+    }
+
+    void "test groovy core - Closure"() {
+        doTest('core/Closure_01.groovy');
+        doTest('core/Closure_02.groovy');
+        doTest('core/Closure_03.groovy');
+        doTest('core/Closure_04.groovy');
+        doTest('core/Closure_05.groovy', [Parameter]);
+        doTest('core/Closure_06.groovy', [Parameter]);
+        doTest('core/Closure_07.groovy', [Parameter]);
+        doTest('core/Closure_08.groovy', [Parameter]);
+        doTest('core/Closure_09.groovy', [Parameter]);
+        doTest('core/Closure_10.groovy', [Parameter]);
+    }
+
+    void "test groovy core - Lambda"() {
+        doRunAndTest('core/Lambda_01x.groovy');
+    }
+
+    void "test groovy core - MethodReference"() {
+        doRunAndTest('core/MethodReference_01x.groovy');
+    }
+
+    void "test groovy core - MethodPointer"() {
+        doRunAndTest('core/MethodPointer_01x.groovy');
+    }
+
+    void "test groovy core - ElvisAssignment"() {
+        doRunAndTest('core/ElvisAssignment_01x.groovy');
+    }
+
+    void "test groovy core - List"() {
+        doTest('core/List_01.groovy');
+    }
+
+    void "test groovy core - Map"() {
+        doTest('core/Map_01.groovy');
+    }
+
+    void "test groovy core - Expression"() {
+        doTest('core/Expression_01.groovy');
+        doTest('core/Expression_02.groovy');
+        doTest('core/Expression_03.groovy');
+        doTest('core/Expression_04.groovy');
+        doTest('core/Expression_05.groovy');
+        doTest('core/Expression_06.groovy');
+        doTest('core/Expression_07.groovy');
+        doTest('core/Expression_08.groovy');
+        doTest('core/Expression_09.groovy');
+        doTest('core/Expression_10.groovy');
+        doTest('core/Expression_11.groovy');
+        doTest('core/Expression_12.groovy');
+        doTest('core/Expression_13.groovy');
+        doTest('core/Expression_14.groovy');
+        doTest('core/Expression_15.groovy');
+        doTest('core/Expression_16.groovy', [Parameter, ExpressionStatement]);
+        doTest('core/Expression_17.groovy');
+        doTest('core/Expression_18.groovy');
+        doTest('core/Expression_19.groovy');
+        doTest('core/Expression_20.groovy');
+        doRunAndTest('core/Expression_21x.groovy');
+        doTest('core/Expression_22x.groovy');
+        doRunAndTest('core/Expression_22x.groovy');
+        doRunAndTest('core/Expression_23x.groovy');
+    }
+
+    void "test groovy core - IdenticalOp"() {
+        doRunAndTest('core/IdenticalOp_01x.groovy');
+    }
+
+    void "test groovy core - Assert"() {
+        doTest('core/Assert_01.groovy');
+        doRunAndTest('core/Assert_02x.groovy');
+        doRunAndTest('core/Assert_03x.groovy');
+    }
+
+    void "test groovy core - IfElse"() {
+        doTest('core/IfElse_01.groovy', [AssertStatement]);
+    }
+
+    void "test groovy core - For"() {
+        doTest('core/For_01.groovy', [AssertStatement]);
+        doTest('core/For_02.groovy');
+        doTest('core/For_03.groovy');
+        doRunAndTest('core/For_04x.groovy');
+        doRunAndTest('core/For_05x.groovy');
+    }
+
+    void "test groovy core - While"() {
+        doTest('core/While_01.groovy');
+        doRunAndTest('core/While_02x.groovy');
+    }
+
+    void "test groovy core - CodeBlock"() {
+        doRunAndTest('core/CodeBlock_01x.groovy');
+    }
+
+    void "test groovy core - DoWhile"() {
+        doRunAndTest('core/DoWhile_01x.groovy');
+        doRunAndTest('core/DoWhile_02x.groovy');
+        doRunAndTest('core/DoWhile_03x.groovy');
+        doRunAndTest('core/DoWhile_04x.groovy');
+    }
+
+
+    void "test groovy core - TryCatch"() {
+        doTest('core/TryCatch_01.groovy');
+    }
+
+    void "test groovy core - TryWithResources"() {
+        doRunAndTest('core/TryWithResources_01x.groovy');
+    }
+
+    void "test groovy core - SafeIndex"() {
+        doRunAndTest('core/SafeIndex_01x.groovy');
+        doRunAndTest('core/SafeIndex_02x.groovy');
+        doRunAndTest('core/SafeIndex_03x.groovy');
+    }
+
+    void "test groovy core - NegativeRelationalOperators"() {
+        doRunAndTest('core/NegativeRelationalOperators_01x.groovy');
+        doRunAndTest('core/NegativeRelationalOperators_02x.groovy');
+    }
+
+    void "test groovy core - DefaultMethod"() {
+        doRunAndTest('core/DefaultMethod_01x.groovy');
+        doRunAndTest('core/DefaultMethod_02x.groovy');
+    }
+
+
+    void "test groovy core - Switch"() {
+        doTest('core/Switch_01.groovy');
+    }
+
+    void "test groovy core - Synchronized"() {
+        doTest('core/Synchronized_01.groovy');
+    }
+
+    void "test groovy core - Return"() {
+        doTest('core/Return_01.groovy');
+    }
+
+    void "test groovy core - Throw"() {
+        doTest('core/Throw_01.groovy');
+    }
+
+    void "test groovy core - Label"() {
+        doTest('core/Label_01.groovy');
+    }
+
+    void "test groovy core - LocalVariableDeclaration"() {
+        doTest('core/LocalVariableDeclaration_01.groovy', [Token]); // [class org.codehaus.groovy.syntax.Token][startLine]:: 9 != 8
+    }
+
+    void "test groovy core - MethodDeclaration"() {
+        doTest('core/MethodDeclaration_01.groovy');
+        doTest('core/MethodDeclaration_02.groovy');
+    }
+
+    void "test groovy core - ClassDeclaration"() {
+        doTest('core/ClassDeclaration_01.groovy');
+        doTest('core/ClassDeclaration_02.groovy');
+        doTest('core/ClassDeclaration_03.groovy');
+        doTest('core/ClassDeclaration_04.groovy', [PropertyNode, FieldNode]);
+        doTest('core/ClassDeclaration_05.groovy', [ExpressionStatement]);
+        doTest('core/ClassDeclaration_06.groovy');
+        doTest('core/ClassDeclaration_07.groovy');
+    }
+
+    void "test groovy core - InterfaceDeclaration"() {
+        doTest('core/InterfaceDeclaration_01.groovy');
+        doTest('core/InterfaceDeclaration_02.groovy');
+        doTest('core/InterfaceDeclaration_03.groovy');
+    }
+
+    void "test groovy core - EnumDeclaration"() {
+        doTest('core/EnumDeclaration_01.groovy');
+        doTest('core/EnumDeclaration_02.groovy', [ExpressionStatement]);
+        doTest('core/EnumDeclaration_03.groovy');
+        doTest('core/EnumDeclaration_04.groovy');
+        doTest('core/EnumDeclaration_05.groovy');
+    }
+
+    void "test groovy core - TraitDeclaration"() {
+        doTest('core/TraitDeclaration_01.groovy');
+        doTest('core/TraitDeclaration_02.groovy');
+        doTest('core/TraitDeclaration_03.groovy');
+        doTest('core/TraitDeclaration_04.groovy', [PropertyNode, FieldNode]);
+        doTest('core/TraitDeclaration_05.groovy');
+    }
+
+    void "test groovy core - AnnotationDeclaration"() {
+        doTest('core/AnnotationDeclaration_01.groovy');
+    }
+
+    void "test groovy core - Command"() {
+        doTest('core/Command_01.groovy');
+        doTest('core/Command_02.groovy');
+        doTest('core/Command_03.groovy', [ExpressionStatement, Parameter]);
+        doTest('core/Command_04.groovy', [ExpressionStatement]);
+        doTest('core/Command_05.groovy');
+        doRunAndTest('core/Command_06x.groovy')
+    }
+
+    void "test groovy core - Unicode"() {
+        doTest('core/Unicode_01.groovy');
+    }
+
+    void "test groovy core - BreakingChanges"() {
+        doRunAndTest('core/BreakingChange_01x.groovy');
+        doRunAndTest('core/BreakingChange_02x.groovy');
+        doRunAndTest('core/BreakingChange_03x.groovy');
+        doRunAndTest('core/BreakingChange_04x.groovy');
+    }
+
+    void "test groovy core - Array"() {
+        doRunAndTest('core/Array_01x.groovy');
+    }
+
+    void "test groovy core - Groovydoc"() {
+        doRunAndTest('core/Groovydoc_01x.groovy');
+    }
+
+    void "test groovy core - Script"() {
+        doRunAndTest('core/Script_01x.groovy');
+    }
+
+    void "test groovy core - BUG"() {
+        doRunAndTest('bugs/BUG-GROOVY-4757.groovy');
+        doRunAndTest('bugs/GROOVY-3898.groovy');
+        doRunAndTest('bugs/BUG-GROOVY-5652.groovy');
+        doRunAndTest('bugs/BUG-GROOVY-4762.groovy');
+        doRunAndTest('bugs/BUG-GROOVY-4438.groovy');
+        doRunAndTest('bugs/BUG-GROOVY-6038.groovy');
+        doRunAndTest('bugs/BUG-GROOVY-2324.groovy');
+        doTest('bugs/BUG-GROOVY-8161.groovy');
+    }
+}


[15/50] [abbrv] groovy git commit: remove some noise from findbugs processing

Posted by pa...@apache.org.
remove some noise from findbugs processing


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/dd4fed36
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/dd4fed36
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/dd4fed36

Branch: refs/heads/parrot
Commit: dd4fed36244144ece1cf530028f708572a709453
Parents: 79d1e03
Author: paulk <pa...@asert.com.au>
Authored: Sat May 6 16:51:18 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:09:11 2017 +1000

----------------------------------------------------------------------
 gradle/quality.gradle | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/dd4fed36/gradle/quality.gradle
----------------------------------------------------------------------
diff --git a/gradle/quality.gradle b/gradle/quality.gradle
index 987348e..e57b552 100644
--- a/gradle/quality.gradle
+++ b/gradle/quality.gradle
@@ -138,6 +138,10 @@ allprojects {
             html.enabled = true
         }
         maxHeapSize = '2g'
+        // hack to exclude html files since include by itself doesn't work
+        def temp = classes
+        temp.include '**/*.class'
+        classes = files(temp.files)
     }
 }
 


[16/50] [abbrv] groovy git commit: remove JUnitTestCase check - it was removed in checkstyle 6.2

Posted by pa...@apache.org.
remove JUnitTestCase check - it was removed in checkstyle 6.2


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/79d1e030
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/79d1e030
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/79d1e030

Branch: refs/heads/parrot
Commit: 79d1e03094755436327c25d2cdd806421cfb3758
Parents: bd353a6
Author: paulk <pa...@asert.com.au>
Authored: Sat May 6 13:05:03 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:09:11 2017 +1000

----------------------------------------------------------------------
 config/checkstyle/checkstyle.xml | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/79d1e030/config/checkstyle/checkstyle.xml
----------------------------------------------------------------------
diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml
index 34aebe1..2a44790 100644
--- a/config/checkstyle/checkstyle.xml
+++ b/config/checkstyle/checkstyle.xml
@@ -154,7 +154,6 @@
         <module name="UpperEll"/>
         <!-- off for now - to allow parentheses which add clarity -->
         <!--<module name="UnnecessaryParentheses"/>-->
-        <module name="JUnitTestCase"/>
         <module name="FinalClass"/>
         <!-- good to have but pollutes coverage -->
         <!--<module name="HideUtilityClassConstructor"/>-->


[33/50] [abbrv] groovy git commit: rename antlr4 parser to remove groovy- prefix since that is by convention for modules

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_01.groovy
new file mode 100644
index 0000000..ed0f67d
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_01.groovy
@@ -0,0 +1,62 @@
+/*
+ *  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.
+ */
+enum AAAA {}
+public enum AAAA2 {}
+public enum AAAA3 implements A {}
+@Test2
+public enum AAAA4 implements A,B {}
+enum BBBB {A}
+enum CCCC {A, B}
+enum DDDD {A, B,}
+enum EEEE {
+    A,
+    B}
+enum FFFF {
+    A,
+    B,}
+enum GGGG
+{A,
+B,}
+
+enum E1 {
+    A(111,'aa'), B(222,'bb')
+}
+
+@Test2
+enum E2 {
+    A2,
+    B2,C2,
+    D2
+    private void a() {}
+    def c;
+}
+
+enum E3 {
+    A(1), B(2)
+
+    public static final String SOME_CONSTANT = '123';
+    private String name;
+    private int age = 2;
+    String title = "title"
+    public E9(int x) {}
+}
+
+
+
+enum e {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_02.groovy
new file mode 100644
index 0000000..a5768db
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_02.groovy
@@ -0,0 +1,70 @@
+/*
+ *  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.
+ */
+enum E {
+    A() {}, B(1) {{}},
+    C(1, 2) {
+        public void prt() {
+            println "$x, $y"
+        }
+
+        void prt2() {
+            println "$x, $y"
+        }
+
+        @Test2 prt3() {
+            println "$x, $y"
+        }
+
+        private void prt4() {
+            println "$x, $y"
+        }
+
+        private prt5() {
+            println "$x, $y"
+        }
+    },
+    D {
+        void hello() {}
+    }
+
+    protected int x;
+    protected int y;
+
+    E() {}
+    E(int x) {
+        this.x = x;
+    }
+    E(int x, y) {
+        this(x)
+        this.y = y;
+    }
+
+    void prt() {
+        println "123"
+    }
+}
+
+enum F {
+    @Test2
+    A
+}
+
+enum G implements I<T> {
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_03.groovy b/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_03.groovy
new file mode 100644
index 0000000..27d3621
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_03.groovy
@@ -0,0 +1,24 @@
+/*
+ *  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.
+ */
+enum H {
+    SOME_ENUM_CONSTANT0(a: "0"),
+    SOME_ENUM_CONSTANT1(a: "0") {},
+    SOME_ENUM_CONSTANT2(a: "1", b: "2"),
+    SOME_ENUM_CONSTANT3(c: "3", d: "4") {}
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_04.groovy b/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_04.groovy
new file mode 100644
index 0000000..b923828
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_04.groovy
@@ -0,0 +1,22 @@
+/*
+ *  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.
+ */
+enum ListEnum1 {
+    ONE([111, 222])
+    ListEnum1(Object listArg){}
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_05.groovy b/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_05.groovy
new file mode 100644
index 0000000..bdeb296
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/EnumDeclaration_05.groovy
@@ -0,0 +1,22 @@
+/*
+ *  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.
+ */
+enum ListEnum1 {
+    ONE([111, 222]) {}
+    ListEnum1(Object listArg){}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_01.groovy
new file mode 100644
index 0000000..575439a
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_01.groovy
@@ -0,0 +1,248 @@
+/*
+ *  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.
+ */
+-1
+-12
+-123
+
+-1.2
+-1.2f
+-1.2F
+-1.2d
+-1.2D
+-1.2g
+-1.2G
+
+-0x1234567890abcdef
+-0X1234567890ABCDEF
+-0x1234567890abcdefi
+-0x1234567890abcdefl
+-0x1234567890abcdefg
+-0x1234567890abcdefI
+-0x1234567890abcdefL
+-0x1234567890abcdefG
+-0xabcdef
+-0xABCDEF
+-0xABCDEF
+-0xabcdef
+-0xABCDEF
+
+-01234567
+-01234567
+-01234567
+-01234567i
+-01234567l
+-01234567g
+-01234567I
+-01234567L
+-01234567G
+
+-1__2
+-2_12_3
+-2__12__3
+-2__12__3.1__2
+-2__12__3.1__2
+-12e10
+-12e-10
+-12e10
+-12e-10
+-12.12e10
+-12.12e-10
+-12.12e10
+-12.12e-10
+-12.12e-10f
+-12.12e-10d
+-12.12e-10g
+-12e-10F
+-120e-10D
+-11F
+-12D
+-1.1F
+-1.2D
+-12e-10G
+-12.1__2e-10f
+-12.1_2e-10d
+-1__12_2.12e-10g
+-0xab__cdef
+-0xAB__CD_EF
+-012__34567L
+
+-0b010101
+-0B10101011
+
++1
++12
++123
+
++1.2
++1.2f
++1.2F
++1.2d
++1.2D
++1.2g
++1.2G
+
++0x1234567890abcdef
++0X1234567890ABCDEF
++0x1234567890abcdefi
++0x1234567890abcdefl
++0x1234567890abcdefg
++0x1234567890abcdefI
++0x1234567890abcdefL
++0x1234567890abcdefG
++0xabcdef
++0xABCDEF
++0xABCDEF
++0xabcdef
++0xABCDEF
+
++01234567
++01234567
++01234567
++01234567i
++01234567l
++01234567g
++01234567I
++01234567L
++01234567G
+
++1__2
++2_12_3
++2__12__3
++2__12__3.1__2
++2__12__3.1__2
++12e10
++12e-10
++12e10
++12e-10
++12.12e10
++12.12e-10
++12.12e10
++12.12e-10
++12.12e-10f
++12.12e-10d
++12.12e-10g
++12e-10F
++120e-10D
++11F
++12D
++1.1F
++1.2D
++12e-10G
++12.1__2e-10f
++12.1_2e-10d
++1__12_2.12e-10g
++0xab__cdef
++0xAB__CD_EF
++012__34567L
+
++0b010101
++0B10101011
+
+~1
+~12
+~123
+
+~1.2
+~1.2f
+~1.2F
+~1.2d
+~1.2D
+~1.2g
+~1.2G
+
+~0x1234567890abcdef
+~0X1234567890ABCDEF
+~0x1234567890abcdefi
+~0x1234567890abcdefl
+~0x1234567890abcdefg
+~0x1234567890abcdefI
+~0x1234567890abcdefL
+~0x1234567890abcdefG
+~0xabcdef
+~0xABCDEF
+~0xABCDEF
+~0xabcdef
+~0xABCDEF
+
+~01234567
+~01234567
+~01234567
+~01234567i
+~01234567l
+~01234567g
+~01234567I
+~01234567L
+~01234567G
+
+~1__2
+~2_12_3
+~2__12__3
+~2__12__3.1__2
+~2__12__3.1__2
+~12e10
+~12e-10
+~12e10
+~12e-10
+~12.12e10
+~12.12e-10
+~12.12e10
+~12.12e-10
+~12.12e-10f
+~12.12e-10d
+~12.12e-10g
+~12e-10F
+~120e-10D
+~11F
+~12D
+~1.1F
+~1.2D
+~12e-10G
+~12.1__2e-10f
+~12.1_2e-10d
+~1__12_2.12e-10g
+~0xab__cdef
+~0xAB__CD_EF
+~012__34567L
+
+~0b010101
+~0B10101011
+
+!true
+!false
+
++a
+-a
+
+++a
+--a
+
+int[]
+String[]
+String[][]
+
+
+1
+2147483647
+2147483648
+9223372036854775807
+9223372036854775808
+-1
+-2147483648
+-2147483649
+-9223372036854775808

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_02.groovy
new file mode 100644
index 0000000..5a65f87
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_02.groovy
@@ -0,0 +1,24 @@
+/*
+ *  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.
+ */
+assert (1)
+assert (
+        1)
+assert (
+        1
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_03.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_03.groovy
new file mode 100644
index 0000000..f5c3819
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_03.groovy
@@ -0,0 +1,49 @@
+/*
+ *  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.
+ */
+1 + 2 + 3
+'a' + 'b' + 'c'
+10 - 2 + 3 - 5 + 6 + 7
+++a + 1 - --b - 6 + ++c + 'a' + 2 - 3
+++a +
+        1 -
+        --b -
+        6 +
+        ++c +
+        'a' +
+        2 *
+        3 +
+        a++ -
+        a--
+
+1 * 2 / 3 % 4
+1 *
+        2 /
+        3 %
+        4
+
+
+1 ** 2 ** 3
+1 **
+        2 **
+        3
+
+1 + 2 * 3 - 4 / 5 + 6 % 7 - 8 ** 9
+
+
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_04.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_04.groovy
new file mode 100644
index 0000000..e8c72e0
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_04.groovy
@@ -0,0 +1,80 @@
+/*
+ *  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.
+ */
+a = 1
+a = b = 1
+left >>>= 16
+left >>= 8
+left <<= 2
+sum += sup
+cantlive -= you
+times *= me
+times **= me
+slash /= nstore
+your |= me
+here %= sometimes
+water ^= oil
+a &= that
+
+a = e f g h
+a = b *= c += d %= e f g h
+
+obj.name = '123'
+m().result = 123
+map[a] = 1
+map['a'] = 1
+map["$a"] = 1
+map[a.b] = 1
+map[a()] = 1
+map[obj.a()] = 1
+map[a().result] = 1
+map[a + b] = 1
+obj.prop[0][1] = 'a'
+this = someValue;
+super = someValue;
+
+list[0] = 1
+list[1, 2] = [11, 22]
+
+(a)         = [1]
+(a)         = x++
+(a)         = (SomeType)x++
+(a)         = obj.m()
+(a)         = [1]
+(a)         = [1] + [2]
+(a, b)      = [1, 2]
+(a, b, c)   = [1, 2, 3]
+
+(obj) =
+        a =
+              b =
+                left >>>=
+                        left >>=
+                                left <<=
+                                        sum +=
+                                                cantlive -=
+                                                        times *=
+                                                                times **=
+                                                                        slash /=
+                                                                                your |=
+                                                                                        here %=
+                                                                                                water ^=
+                                                                                                        a &=
+                                                                                                                that =
+                                                                                                                        x y z
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_05.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_05.groovy
new file mode 100644
index 0000000..d195b10
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_05.groovy
@@ -0,0 +1,58 @@
+/*
+ *  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.
+ */
+true ?: 'a'
+
+true
+?: 'a'
+
+true
+?:
+'a'
+
+true ? 'a' : 'b'
+
+true ?
+        'a'
+        :
+        'b'
+
+true ?
+        'a'
+        :
+        true ?: 'b'
+
+true ?
+        'a'
+        :
+        true ? 'b' : 'c'
+
+true ?: true ?: 'a'
+
+1 == 2 ?: 3
+1 == 2 ? 3 : 4
+
+1 == 2 || 1 != 3 && !(1 == 6)
+    ? 2 > 3 && 3 >= 1
+        ? 4 < 5 && 2 <= 9 ?: 6 ^ 8 | 9 & 10
+        : 8 * 2 / (3 % 4 + 6) - 2
+    : 9
+
+
+bar = 0 ? "moo"         \
+              : "cow"

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_06.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_06.groovy
new file mode 100644
index 0000000..debea2c
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_06.groovy
@@ -0,0 +1,24 @@
+/*
+ *  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.
+ */
+true && false || true && false || true
+true &&
+        false ||
+        true &&
+        false ||
+        true

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_07.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_07.groovy
new file mode 100644
index 0000000..9474f18
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_07.groovy
@@ -0,0 +1,27 @@
+/*
+ *  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.
+ */
+1 | 2 ^ 3 & 4 | 5 ^ 6 & 7 | 8
+1 |
+        2 ^
+        3 &
+        4 |
+        5 ^
+        6 &
+        7 |
+        8
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_08.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_08.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_08.groovy
new file mode 100644
index 0000000..108e1b0
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_08.groovy
@@ -0,0 +1,24 @@
+/*
+ *  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.
+ */
+a =~ /abc/
+a =~
+        /abc/
+b ==~ /abc/
+b ==~
+        /abc/

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_09.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_09.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_09.groovy
new file mode 100644
index 0000000..98b7e95
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_09.groovy
@@ -0,0 +1,34 @@
+/*
+ *  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.
+ */
+1 == 1 != 2 == 3 != 4 <=> 5 == 6 != 7
+1 ==
+        1 !=
+        2 ==
+        3 !=
+        4 <=>
+        5 ==
+        6 !=
+        7
+2 == 3 != 4 <=> 5
+
+
+        2 ==
+        3 !=
+        4 <=>
+        5

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_10.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_10.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_10.groovy
new file mode 100644
index 0000000..bdd8c7a
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_10.groovy
@@ -0,0 +1,43 @@
+/*
+ *  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.
+ */
+1 < 2
+1 <
+        2
+2 <= 2
+2 <=
+        2
+2 >= 2
+2 >=
+        2
+2 > 1
+2 >
+        1
+1 in [1, 2, 3]
+1 in
+        [1, 2, 3]
+
+'abc' instanceof String
+'abc' instanceof
+        String
+'abc' as String
+'abc' as
+        String
+
+
+1 < 2 && 2 <= 2 | 2 >= 2 && (2 > 1 || 1 == 1) & (1 != 2 || 1 ^ 2 && 1 <=> 2) && 1 in [1, 2, 3] && 'abc' as String || 'abc' instanceof String
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_11.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_11.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_11.groovy
new file mode 100644
index 0000000..2030a4a
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_11.groovy
@@ -0,0 +1,34 @@
+/*
+ *  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.
+ */
+1 << 2
+1 <<
+        2
+1 >> 2
+1 >>
+        2
+1 >>> 3
+1 >>>
+        3
+
+1..2
+1..
+        2
+1..<2
+1..<
+        2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_12.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_12.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_12.groovy
new file mode 100644
index 0000000..d7c4042
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_12.groovy
@@ -0,0 +1,35 @@
+/*
+ *  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.
+ */
+!true
+!
+        true
+~1
+~
+        1
+(String)'abc'
+(int) obj.someMethod()
+(int) (obj.someMethod())
+(int) 1 / 2
+1 / (int) 2
+(int) a++
+(int) a--
+(int) ++a
+(int) --a
+(int) ~123
+(boolean) !false
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_13.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_13.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_13.groovy
new file mode 100644
index 0000000..b092c64
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_13.groovy
@@ -0,0 +1,63 @@
+/*
+ *  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.
+ */
+!5
+~5
+-5
++5
+-a
++a
+
+5+5
++(+5)
+-(-5)
++(-5)
+-(+5)
+
+5 + 10
+5 - 10
+5 * 10
+5 / 10
+5 % 10
+5 ** 10
+
+5--
+5++
+--5
+++5
+
+5 >> 10
+5 >>> 10
+5 << 10
+5 > 10
+5 < 10
+
+5 ^ 10
+
+5 | 10
+5 & 10
+
+5 || 10
+5 && 10
+5 ==  10
+5 !=  10
+5 <=>  10
+
+5..10
+5..10
+5..<10 > 1..3

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_14.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_14.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_14.groovy
new file mode 100644
index 0000000..f7f1ef0
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_14.groovy
@@ -0,0 +1,40 @@
+/*
+ *  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.
+ */
+a = java.lang.Integer
+a = java.lang.Integer.class
+a = Integer
+a = Integer.class
+a = void
+a = void.class
+a = boolean
+a = boolean.class
+a = byte
+a = byte.class
+a = char
+a = char.class
+a = short
+a = short.class
+a = int
+a = int.class
+a = float
+a = float.class
+a = long
+a = long.class
+a = double
+a = double.class
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_15.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_15.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_15.groovy
new file mode 100644
index 0000000..bab67fa
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_15.groovy
@@ -0,0 +1,145 @@
+/*
+ *  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.
+ */
+person.@name
+person.child.@name
+person.@name.count
+person.&sayHello
+person.child.&sayHello
+person?.child
+person?.@child
+person*.child
+person*.@child
+person.'name'
+person.@'name'
+person?.'name'
+person?.@'name'
+person*.'child'
+person*.@'child'
+person.&'sayHello'
+person.new
+person.@new
+person?.new
+person?.@new
+person*.new
+person*.@new
+person.&new
+person."$name"
+person.@"$name"
+person?."$name"
+person?.@"$name"
+person*."$name"
+person*.@"$name"
+person.&"$methodName"
+person.("$firstname" + "$lastname")
+person.@("$firstname" + "$lastname")
+person?.("$firstname" + "$lastname")
+person?.@("$firstname" + "$lastname")
+person*.("$firstname" + "$lastname")
+person*.@("$firstname" + "$lastname")
+person.&("$method" + "$name")
+
+a.b?.c[1, 2, 3]*.d
+a[1, *[2, 3]]*.b
+a[*[2, 3]]*.b
+
+person
+*.
+child
+*.
+@child
+?.
+child
+?.
+@child
+.
+child
+        .
+@name
+.&
+length
+
+a.b()
+a.'b'()
+a."$b"()
+a?.b()
+a*.b()
+a()
+'a'()
+"$a"()
+
+obj.a
+    .b()
+    ?.c()
+    *.d()
+
+obj.a(1, 2)
+a(1, 2)
+
+obj.a(x: 1, y: 2)
+a(x: 1, y: 2)
+
+a.@b()
+a.@b(1, 2, 3)
+a?.@b()
+a?.@b(1, 2, 3)
+a*.@b()
+a*.@b(1, 2, 3)
+
+a.<Integer>b(1, 2)
+
+a
+        .
+<Integer>b(1, 2)
+
+a.<Integer, String>b(1, '2')
+a?.<Integer, String>b(1, '2')
+a*.<Integer, String>b(1, '2')
+obj?.a*.<
+        Integer,
+        String
+        >b(1, '2')
+
+String[] codes = [
+        className + '.' + propertyName + '.typeMismatch.error',
+        className + '.' + propertyName + '.typeMismatch',
+        classAsPropertyName + '.' + propertyName + '.typeMismatch.error',
+        classAsPropertyName + '.' + propertyName + '.typeMismatch',
+        bindingResult.resolveMessageCodes('typeMismatch', propertyName)
+].flatten() as String[]
+
+
+person*.child[1, 2 + 6, *[3, 4]]*.@child*.@child()?.@child().@child()?.child?.@child.child.getChild().getChild(1, 2).getChild(name: 'a', age: 2).'child'."$child".('chi' + 'ld').@name.class.&equals
+
+
+(obj.x)()
+(obj.@x)()
+
+
+static.unused = { -> }
+
+ResolveOptions resolveOptions = new ResolveOptions()\
+            .setConfs(['default'] as String[])\
+            .setOutputReport(false)\
+            .setValidate(args.containsKey('validate') ? args.validate : false)
+
+new A("b") C.d()
+
+m()()
+
+a = {a,b-> }()

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_16.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_16.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_16.groovy
new file mode 100644
index 0000000..58e7b0a
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_16.groovy
@@ -0,0 +1,40 @@
+/*
+ *  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
+super
+this.name
+super.name
+
+
+def x = {->}()
+x = {a, b -> a + b }(1, 2)
+
+void()
+void(1, 2)
+void(1, 2) {
+
+}
+void(x: 1, y: 2)
+void(x: 1, y: 2) {
+
+}
+
+use(String) {
+}
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_17.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_17.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_17.groovy
new file mode 100644
index 0000000..89309fb
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_17.groovy
@@ -0,0 +1,159 @@
+/*
+ *  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.
+ */
+a.m(x: 1, y: 2) {
+    println('named arguments');
+}
+
+a.m(x: 1, y: 2, z: 3) {
+    println('named arguments');
+} {
+    println('named arguments');
+}
+
+
+a.m(x: 1, y: 2, z: 3)
+
+{
+    println('named arguments');
+}
+
+{
+    println('named arguments');
+}
+
+
+
+a.m(1, 2) {
+    println('normal arguments');
+}
+
+a.m(1, 2, 3) {
+    println('normal arguments');
+} {
+    println('normal arguments');
+}
+
+a.m(1, 2, 3)
+
+{
+    println('normal arguments');
+}
+
+
+{
+    println('normal arguments');
+}
+
+
+
+
+m {
+    println('closure arguments');
+}
+
+m {
+    println('closure arguments');
+} {
+    println('closure arguments');
+}
+
+m {
+    println('closure arguments');
+} {
+    println('closure arguments');
+} {
+    println('closure arguments');
+}
+
+
+m
+
+{
+    println('closure arguments');
+}
+
+{
+    println('closure arguments');
+}
+
+{
+    println('closure arguments');
+}
+
+'m' {
+    println('closure arguments');
+}
+
+
+1 {
+
+}
+1.1 {
+
+}
+
+-1 {
+
+}
+
+-1.1 {
+
+}
+
+1()
+1.1()
+1(1, 2, 3)
+1.1(1, 2, 3)
+-1()
+-1.1()
+-1(1, 2, 3)
+-1.1(1, 2, 3)
+
+1(1, 2) {
+
+}
+
+1.1(1, 2) {
+
+}
+
+-1(1, 2) {
+
+}
+
+-1.1(1, 2) {
+
+}
+
+hello(x: 1, y: 2, z: 3)
+hello('a', 'b')
+hello(x: 1, 'a', y: 2, 'b', z: 3)
+hello('c', x: 1, 'a', y: 2, 'b', z: 3)
+
+
+A[x: 1, y: 2]
+A[*: someMap]
+A[*: someMap, z: 3]
+A[w: 0, *: someMap]
+A[*: [x: 1, y: 2]]
+A[*: [x: 1, y: 2], z: 3]
+A[w: 0, *: [x: 1, y: 2]]
+
+SomeMethod(a, b)
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_18.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_18.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_18.groovy
new file mode 100644
index 0000000..5a8cc37
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_18.groovy
@@ -0,0 +1,44 @@
+/*
+ *  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.
+ */
+1 > 2 ? 'y' : 'n'
+1 >= 2 ? 'y' : 'n'
+1 < 2 ? 'y' : 'n'
+1 <= 2 ? 'y' : 'n'
+1 == 2 ? 'y' : 'n'
+1 != 2 ? 'y' : 'n'
+
+p29 = 1 > 2 ? /ab/ : /cd/
+p30=++a == b[2].next()
+p31=a <=> b == a.compareTo(b)
+p32 = 1 in [1, 2, 3] == 1 instanceof Integer
+p33 = 1-2+3
+p34 = 1+2-3
+p35 = 1*2/3
+p36 = 1/2*3
+p37 = 1*2%3
+p38 = 1%2*3
+p39 = 1/2%3
+p40 = 1%2/3
+p41 = 1+2+3
+p42 = 1-2-3
+p43 = 1*2*3
+p44 = 1/2/3
+p45 = 1%2%3
+p46 = 1-2*3+4/5-6%7-8-9+10/11*12-13+14+15-16%17%18/19/20*21*22
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_19.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_19.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_19.groovy
new file mode 100644
index 0000000..3f893a6
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_19.groovy
@@ -0,0 +1,50 @@
+/*
+ *  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.
+ */
+List list = new ArrayList();
+List list2 = new java.util.ArrayList();
+List<String> list3 = new ArrayList<String>();
+List<String> list4 = new java.util.ArrayList<String>();
+List<String> list5 = new ArrayList<>();
+//List<String> list6 = new java.util.ArrayList<>(); // the old parser can not parse "new java.util.ArrayList<>()"
+def x = new A<EE, TT>();
+int[] a = new int[10];
+int[][] b = new int[length()][2 * 8];
+ArrayList[] c = new ArrayList[10];
+ArrayList[][] cc = new ArrayList[10][size()];
+java.util.ArrayList[] d = new java.util.ArrayList[10];
+ArrayList[] e = new ArrayList<String>[10];
+java.util.ArrayList[] f = new java.util.ArrayList<String>[10];
+java.util.ArrayList[] g = new java.util.ArrayList<String>[size()];
+
+int[][] h = new int[10][];
+int[][][] i = new int[10][][];
+ArrayList[][] j = new ArrayList[10][];
+ArrayList[][] k = new ArrayList<String>[10][];
+
+def bb = new A.B();
+def bb2 = new A.B[0];
+
+new
+    A
+        ('x', 'y');
+
+
+new a();
+new $a();
+new as.def.in.trait.a();

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_20.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_20.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_20.groovy
new file mode 100644
index 0000000..7249e85
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_20.groovy
@@ -0,0 +1,20 @@
+/*
+ *  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.
+ */
+@Test2(pre={ super(xx);})
+class XX {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_21x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_21x.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_21x.groovy
new file mode 100644
index 0000000..c983dc9
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_21x.groovy
@@ -0,0 +1,24 @@
+/*
+ *  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.
+ */
+new int[5]
+new int[5][]
+new int[5][6][]
+new int[5][6][7][]
+new int[5][6][7][][]
+new int[5][6][7][][][]

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_22x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_22x.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_22x.groovy
new file mode 100644
index 0000000..e744a27
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_22x.groovy
@@ -0,0 +1,29 @@
+/*
+ *  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.
+ */
+int j = 0
+++j++
+assert j == 1
+
+int i = 0
+((i++)++)++
+assert i == 1
+++(++(++i))
+assert i == 2
+++(++(++i++)++)++
+assert i == 3

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Expression_23x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Expression_23x.groovy b/subprojects/parser-antlr4/src/test/resources/core/Expression_23x.groovy
new file mode 100644
index 0000000..2f3007d
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Expression_23x.groovy
@@ -0,0 +1,115 @@
+/*
+ *  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.
+ */
+def a
+    =
+        1 + 2
+assert 3 == a
+
+a
+    +=
+        2
+assert 5 == a
+
+int b
+    =
+        1,
+    c
+        =
+            2
+assert 1 == b
+assert 2 == c
+
+def (int x, int y)
+    =
+        [1, 2]
+assert 1 == x
+assert 2 == y
+(x)
+    =
+        [3]
+assert 3 == x
+
+@SuppressWarnings(value
+        =
+        "all")
+def m(p1
+        =
+            1,
+      p2
+        =
+            2,
+      int... p3
+                =
+                    [3]) {
+    return p1 + p2 + p3[0]
+}
+assert 6 == m()
+
+def w
+    =
+        1
+            <<
+                2
+assert 4 == w
+assert 'a'
+            instanceof
+                        String
+assert 1
+            <
+                2
+
+assert 1
+            ==
+                1
+
+assert 'a'
+            ==~
+                /a/
+assert true
+            &
+                true
+assert true
+            ^
+                false
+assert true
+            |
+                true
+
+assert true
+            &&
+                true
+
+assert true
+            ||
+                true
+
+
+def z =
+        9
+            /
+                3
+                    *
+                        2
+assert 6 == z
+
+def r =
+         3
+            %
+                2
+assert 1 == r
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/For_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/For_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/For_01.groovy
new file mode 100644
index 0000000..b1cbefb
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/For_01.groovy
@@ -0,0 +1,73 @@
+/*
+ *  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.
+ */
+for (i in someList) {}
+
+
+for (i in someList) {
+    break;
+}
+
+for (i in someList)
+{
+    break;
+}
+
+for (int i in someList) {
+    break;
+}
+
+for (String i in someList) {
+    break;
+}
+
+for (final String i in someList) {
+    break;
+}
+
+for (@Test2 String i in someList) {
+    break;
+}
+
+
+for (int i : someList) {}
+
+for (int i : someList) {
+    break;
+}
+
+for (int i : someList)
+{
+    break;
+}
+
+for (int i : someList) {
+    break;
+}
+
+for (String i : someList) {
+    break;
+}
+
+for (final String i : someList) {
+    break;
+}
+
+for (@Test2 String i : someList) {
+    break;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/For_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/For_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/For_02.groovy
new file mode 100644
index 0000000..5a2b795
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/For_02.groovy
@@ -0,0 +1,54 @@
+/*
+ *  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.
+ */
+for (int i = 0; true; false) {}
+for (int i = 0; true; false) {
+
+}
+for (int i = 0; true; false)
+{
+}
+for (int i = 0;
+     true;
+     false)
+{
+}
+for(;;) {
+
+}
+for(int i = 0;;) {
+
+}
+for(;true;) {
+
+}
+for(;;false) {
+
+}
+
+for (int i = 0; i < 10; i++) {
+
+}
+
+for (i = 0; i < 10; i++) {
+
+}
+
+for(;;) {
+    continue;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/For_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/For_03.groovy b/subprojects/parser-antlr4/src/test/resources/core/For_03.groovy
new file mode 100644
index 0000000..d37aef3
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/For_03.groovy
@@ -0,0 +1,55 @@
+/*
+ *  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.
+ */
+outer:
+for (def i in [1, 2]) {
+    for (def j in [1, 2, 3, 4, 5]) {
+        if (j == 1) {
+            break outer;
+        } else if (j == 2) {
+            continue outer;
+        }
+
+        if (j == 3) {
+            continue;
+        }
+
+        if (j == 4) {
+            break;
+        }
+    }
+}
+
+
+for (;;)
+    int number = 1
+
+
+int i
+for (i = 0; i < 5; i++);
+
+
+
+
+for (Object child in children()) {
+    if (child instanceof String) {
+        break
+    } else {
+        continue
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/For_04x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/For_04x.groovy b/subprojects/parser-antlr4/src/test/resources/core/For_04x.groovy
new file mode 100644
index 0000000..dcd7b57
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/For_04x.groovy
@@ -0,0 +1,54 @@
+/*
+ *  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.
+ */
+import groovy.transform.CompileStatic
+
+@CompileStatic
+def testCS() {
+    int result = 0
+    for (def (int i, int j) = [0, 0]; i < 5 && j < 5; i = i + 2, j++) {
+        result += i;
+        result += j;
+    }
+    assert 9 == result
+
+    result = 0
+    for (int i = 0, j = 0; i < 5 && j < 5; i = i + 2, j++) {
+        result += i;
+        result += j;
+    }
+    assert 9 == result
+}
+testCS()
+
+def test() {
+    int result = 0
+    for ((i, j) = [0, 0]; i < 5 && j < 5; i = i + 2, j++) {
+        result += i;
+        result += j;
+    }
+    assert 9 == result
+
+    result = 0
+    for (int i = 0, j = 0; i < 5 && j < 5; i = i + 2, j++) {
+        result += i;
+        result += j;
+    }
+    assert 9 == result
+}
+test()

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/For_05x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/For_05x.groovy b/subprojects/parser-antlr4/src/test/resources/core/For_05x.groovy
new file mode 100644
index 0000000..dd63224
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/For_05x.groovy
@@ -0,0 +1,56 @@
+/*
+ *  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.
+ */
+import groovy.transform.CompileStatic
+
+@CompileStatic
+def testCS() {
+    int result = 0
+    for (int i = 0, n = 5; i < n; i++) {
+        result += i
+    }
+    assert 10 == result
+
+    result = 0;
+    int i;
+    int j;
+    for (i = 1, j = 5; i < j; i++, j--) {
+        result += i;
+        result += j;
+    }
+    assert 12 == result
+}
+testCS();
+
+def test() {
+    int result = 0
+    for (int i = 0, n = 5; i < n; i++) {
+        result += i
+    }
+    assert 10 == result
+
+    result = 0;
+    int i;
+    int j;
+    for (i = 1, j = 5; i < j; i++, j--) {
+        result += i;
+        result += j;
+    }
+    assert 12 == result
+}
+test();

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/GString_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/GString_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/GString_01.groovy
new file mode 100644
index 0000000..d233bab
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/GString_01.groovy
@@ -0,0 +1,48 @@
+/*
+ *  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.
+ */
+"abc${'123'}def"
+"${'123'}def"
+"${'123'}"
+"a:$a"
+"a:$a.b.c"
+"$a.b.c"
+"$a.b.c,d"
+"${12}a${}c${34}"
+"${->12}"
+"${12}${->12}${'12'}"
+"""abc${'123'}def"""
+"""${'123'}def"""
+"""${'123'}"""
+"""a:$a"""
+"""a:$a.b.c"""
+"""$a.b.c"""
+"""$a.b.c,d"""
+"""${12}a${}c${34}"""
+"""${->12}"""
+"""${12}${->12}${'12'}"""
+"""${12}${->12}${'12'}${a=1;return a;}"""
+
+
+"${}"
+"${;}"
+"${;;}"
+"${;;;}"
+
+"${a b}"
+"${obj.a b}"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/GString_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/GString_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/GString_02.groovy
new file mode 100644
index 0000000..2e69232
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/GString_02.groovy
@@ -0,0 +1,77 @@
+/*
+ *  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.
+ */
+/abc${'123'}def $a.b.c,d${->12}/
+$/${-12}abc${'123'}def $a.b.c,d${->12}/$
+
+def p1=/ab/
+def p2=/a${c}b/
+p3=/a${c}b/
+p4=/a${c}b/*2
+p5=!/a${c}b/
+p6= ~/a${c}b/
+p7=~/a${c}b/
+p8==~/a${c}b/
+p9=/a${c}b/ + /a${c}b/
+p10=/ab/
+p11=/ab/*2
+p12=!/ab/
+p13= ~/ab/
+p14=~/ab/
+p15==~/ab/
+p16=/ab/ + /ab/
+p17=/ab/ == /cd/
+p18=/a${c}b/ == /c${f}d/
+p19=/ab/ != /cd/
+p20=/a${c}b/ != /c${f}d/
+p27=1?:/cd/
+p28=1?:/a${c}b/
+p29=1>2?/ab/:/cd/
+p30=1>2?/c${f}d/:/c${f}d/
+p29=true?
+        /ab/:
+        /cd/
+p30=true?
+        /c${f}d/:
+        /c${f}d/
+p31=/A/ && /B/
+p32=/a${b}/ && /c${d}/
+p33=/A/ || /B/
+p34=/a${b}/ || /c${d}/
+p39=/$a/
+p40=/^a+$/
+p41=/$0+/
+p42=/$2a+/
+p43=/$$2a+/
+p44=/^$|$|^$$2a+$/
+p45=/
+    hello, world!
+/
+p46=/hello\
+world/
+p47=/hello\
+    \/
+world/
+p48=/^hello\
+    \/$|^
+world$/
+p49=/ $x $ /
+p50=/$x\
+    $
+/
+p51=/$$/

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/GString_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/GString_03.groovy b/subprojects/parser-antlr4/src/test/resources/core/GString_03.groovy
new file mode 100644
index 0000000..731986b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/GString_03.groovy
@@ -0,0 +1,67 @@
+/*
+ *  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.
+ */
+def a = """hello${a}
+world
+"""
+
+a = """
+hello
+${a}
+world
+"""
+
+a =~ $/(${123}hello) \/
+            ${a}world\1
+ \u9fa5 \r
+/$
+a =~ $/\
+    x  $
+    $$
+    $/
+/$
+a =~ $/\
+    $x  $
+    $$
+    $/
+/$
+a = $/
+            Hello name,
+            today we're date.
+
+            $ dollar sign
+            $$ escaped dollar sign
+            \ backslash
+            / forward slash
+            $/ escaped forward slash
+            $/$ escaped dollar slashy string delimiter
+        /$
+
+a = $/
+            Hello $name,
+            today we're ${date}.
+
+            $ dollar sign
+            $$ escaped dollar sign
+            \ backslash
+            / forward slash
+            $/ escaped forward slash
+            $/$ escaped dollar slashy string delimiter
+        /$
+a = $/$$VAR/$
+a = $/$$ $VAR/$

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/GString_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/GString_04.groovy b/subprojects/parser-antlr4/src/test/resources/core/GString_04.groovy
new file mode 100644
index 0000000..1d7b1c2
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/GString_04.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+"At $date"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/GString_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/GString_05.groovy b/subprojects/parser-antlr4/src/test/resources/core/GString_05.groovy
new file mode 100644
index 0000000..e49c060
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/GString_05.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+"""At $date"""
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/GString_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/GString_06.groovy b/subprojects/parser-antlr4/src/test/resources/core/GString_06.groovy
new file mode 100644
index 0000000..18d5770
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/GString_06.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+/At $date/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Groovydoc_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Groovydoc_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/Groovydoc_01x.groovy
new file mode 100644
index 0000000..9bbf9f5
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Groovydoc_01x.groovy
@@ -0,0 +1,70 @@
+/*
+ *  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.
+ */
+/**
+ * @Groovydoc
+ * class AA
+ */
+class AA {
+    /**
+     * @Groovydoc
+     * field SOME_FIELD
+     */
+    public static final int SOME_FIELD = 1;
+
+    /**
+     * @Groovydoc
+     * constructor AA
+     */
+    public AA() {
+
+    }
+
+    /**
+     * @Groovydoc
+     * method m
+     */
+    public void m() {
+
+    }
+
+    /**
+     * @Groovydoc
+     * class InnerClass
+     */
+    class InnerClass {
+
+    }
+
+
+}
+
+/**
+ * @Groovydoc
+ * annotation BB
+ */
+@interface BB {
+
+}
+
+assert AA.class.getAnnotation(groovy.lang.Groovydoc).value().contains('class AA')
+assert AA.class.getMethod('m', new Class[0]).getAnnotation(groovy.lang.Groovydoc).value().contains('method m')
+assert AA.class.getConstructor().getAnnotation(groovy.lang.Groovydoc).value().contains('constructor AA')
+assert AA.class.getField('SOME_FIELD').getAnnotation(groovy.lang.Groovydoc).value().contains('field SOME_FIELD')
+assert AA.class.getDeclaredClasses().find {it.simpleName.contains('InnerClass')}.getAnnotation(groovy.lang.Groovydoc).value().contains('class InnerClass')
+assert BB.class.getAnnotation(groovy.lang.Groovydoc).value().contains('annotation BB')
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/IdenticalOp_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/IdenticalOp_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/IdenticalOp_01x.groovy
new file mode 100644
index 0000000..9110bb4
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/IdenticalOp_01x.groovy
@@ -0,0 +1,28 @@
+/*
+ *  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.
+ */
+def x = []
+def y = []
+assert y !== x
+
+assert 'a' === 'a'
+assert 'a' !== new String('a')
+assert null === null
+assert true === true
+assert false === false
+assert 0 == 0 && 'a' === 'a' && 1 != 2 && 'a' !== new String('a') && 1 == 1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/IfElse_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/IfElse_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/IfElse_01.groovy
new file mode 100644
index 0000000..94687b8
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/IfElse_01.groovy
@@ -0,0 +1,62 @@
+/*
+ *  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.
+ */
+if (true)
+    assert true, ':('
+
+if (true) assert true, ':('
+
+if (true)
+    assert true, ':('
+else
+    assert false, ':('
+
+if (true) assert true, ':('
+else
+    assert false, ':('
+
+if (true) assert true, ':('
+else assert false, ':('
+
+if (true) assert true, ':(' else assert false, ':('
+
+
+if (false)
+    int number = 1
+
+
+if(true) 1; else 0
+
+if(true) 1 else 0
+
+if(true) 1; else 0;
+
+if(true)
+    1;
+else
+    0
+
+if(true)
+    1
+else
+    0
+
+if(true)
+    1;
+else
+    0;

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_01.groovy
new file mode 100644
index 0000000..f0ed391
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_01.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+import java.util.Map
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_02.groovy
new file mode 100644
index 0000000..f32f0c8
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_02.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+import java.util.Map;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_03.groovy b/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_03.groovy
new file mode 100644
index 0000000..c308f92
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_03.groovy
@@ -0,0 +1,22 @@
+/*
+ *  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.
+ */
+import java.util.Map
+import java.util.HashMap;
+import java.io.InputStream
+import java.io.BufferedInputStream;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_04.groovy b/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_04.groovy
new file mode 100644
index 0000000..d54207f
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_04.groovy
@@ -0,0 +1,23 @@
+/*
+ *  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.
+ */
+package core;
+import java.util.Map
+import java.util.HashMap;
+import java.io.InputStream
+import java.io.BufferedInputStream;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_05.groovy b/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_05.groovy
new file mode 100644
index 0000000..238549a
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_05.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+import java.util.*
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_06.groovy b/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_06.groovy
new file mode 100644
index 0000000..176714c
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_06.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+import java.util.*
+import java.math.BigDecimal
+import java.io.*
\ No newline at end of file


[11/50] [abbrv] groovy git commit: Fix some tests which have not been covered by Parrot before

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy
new file mode 100644
index 0000000..d577c4b
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy
@@ -0,0 +1,7 @@
+package fail
+
+class A {
+    String foo() {}
+    def foo() {}
+}
+new A()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy
new file mode 100644
index 0000000..6f93556
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy
@@ -0,0 +1 @@
+[].for(1;2;3){println "in loop"}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy
new file mode 100644
index 0000000..ff953b9
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy
@@ -0,0 +1 @@
+def x = (1;2;3)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy
new file mode 100644
index 0000000..59beda7
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy
@@ -0,0 +1 @@
+[].bar(1;2;3)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy
new file mode 100644
index 0000000..738e0ac
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy
@@ -0,0 +1,10 @@
+class Crasher {
+    public void m() {
+        def fields = [1,2,3]
+        def expectedFieldNames = ["patentnumber", "status"].
+                for (int i=0; i<fields.size(); i++) {
+                    Object f = fields[i]
+                    System.out.println(f);
+                }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy
new file mode 100644
index 0000000..1990412
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy
@@ -0,0 +1 @@
+class Foo { static final Foo() {}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy
new file mode 100644
index 0000000..30fc526
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy
@@ -0,0 +1,3 @@
+interface Foo {
+    def doit( String param = "Groovy", int o )
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy
new file mode 100644
index 0000000..438d97f
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy
@@ -0,0 +1,5 @@
+{ ->
+    def say(String msg) {
+        println(msg)
+    }
+}()

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_07.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_07.groovy
new file mode 100644
index 0000000..320d66e
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_07.groovy
@@ -0,0 +1 @@
+volatile x() {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_01x.groovy
new file mode 100644
index 0000000..1d1b56a
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_01x.groovy
@@ -0,0 +1,3 @@
+class MyClass {
+    void field
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_02x.groovy
new file mode 100644
index 0000000..fe9848d
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_02x.groovy
@@ -0,0 +1,5 @@
+class MyClass {
+    def foo() {
+        void bar = null
+    }
+}


[40/50] [abbrv] groovy git commit: rename antlr4 parser to remove groovy- prefix since that is by convention for modules

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_05.groovy
deleted file mode 100644
index 238549a..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_05.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-import java.util.*
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_06.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_06.groovy
deleted file mode 100644
index 176714c..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_06.groovy
+++ /dev/null
@@ -1,21 +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.
- */
-import java.util.*
-import java.math.BigDecimal
-import java.io.*
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_07.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_07.groovy
deleted file mode 100644
index 36b6215..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_07.groovy
+++ /dev/null
@@ -1,24 +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.
- */
-package core;
-import java.util.*
-import java.math.BigDecimal;
-import java.io.*
-import static java.lang.Math.*
-import static java.lang.Math.pow

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_08.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_08.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_08.groovy
deleted file mode 100644
index c6f8d2e..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/ImportDeclaration_08.groovy
+++ /dev/null
@@ -1,46 +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.
- */
-#!/usr/bin/env groovy
-/*
- *  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.
- */
-package core;
-
-import java.util.*
-import java.math.BigDecimal;
-import java.io.*
-import java.sql.Blob as Bb
-import static java.lang.Math.*;
-import static java.lang.Math.pow as pw
-import def.in.as.trait.*;

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_01.groovy
deleted file mode 100644
index 992926c..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_01.groovy
+++ /dev/null
@@ -1,54 +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.
- */
-package core
-
-interface A1 {}
-interface A2<T> {}
-interface A3<T extends A> {}
-interface A4<T extends A & B> {}
-interface A5<T extends A & B & C> {}
-interface A6<T extends A & B & C> extends A {}
-interface A62 extends A<T> {}
-interface A7<T extends A & B & C> extends A, B {}
-interface A8<T extends A & B & C> extends A, B, C {}
-@Test2 interface A9<T extends A & B & C> extends A, B, C {}
-@Test2 @Test3 public interface A10<T extends A & B & C> extends A, B, C {}
-
-@Test2
-@Test3
-@Test4
-public
-interface A11
-<
-        T extends
-A &
-B &
-C
->
-extends
-A,
-B,
-C
-        {
-
-        }
-
-interface Iterator extends java.util.Iterator {}
-
-interface i {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_02.groovy
deleted file mode 100644
index a6e49ba..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_02.groovy
+++ /dev/null
@@ -1,60 +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.
- */
-package core
-
-import java.sql.SQLException
-
-public interface AA1 {
-        int a;
-        long b;
-        double c;
-        char d;
-        short e;
-        byte f;
-        float g;
-        boolean h;
-        String i;
-
-        public static final NAME = "AA1"
-
-        @Test3
-        public static final NAME2 = "AA1"
-
-        void sayHello();
-        abstract void sayHello2();
-        public void sayHello3();
-        public abstract void sayHello4();
-        @Test2
-        public abstract void sayHello5();
-
-        @Test2
-        public abstract void sayHello6() throws IOException, SQLException;
-
-        @Test2
-        @Test3
-        public abstract <T> T sayHello7() throws IOException, SQLException;
-
-        @Test2
-        @Test3
-        public abstract <T extends A> T sayHello8() throws IOException, SQLException;
-
-        @Test2
-        @Test3
-        public abstract <T extends A & B> T sayHello9() throws IOException, SQLException;
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_03.groovy
deleted file mode 100644
index 9c78681..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/InterfaceDeclaration_03.groovy
+++ /dev/null
@@ -1,25 +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.
- */
-interface Koo {
-    class Inner {}
-}
-
-interface Koo2 {
-    public static final Inner INNER = new Inner() {}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Label_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Label_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Label_01.groovy
deleted file mode 100644
index 9e9645b..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Label_01.groovy
+++ /dev/null
@@ -1,33 +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.
- */
-a: assert true;
-a: assert true
-a:
-assert true;
-a:
-assert true
-
-
-before:
-setup:
-int a = 1
-int b = 1
-expect:
-a == b
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Lambda_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Lambda_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Lambda_01x.groovy
deleted file mode 100644
index 5c147ac..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Lambda_01x.groovy
+++ /dev/null
@@ -1,66 +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.
- */
-assert 9 == [1, 2, 3].stream().map(e -> e + 1).reduce(0, (r, e) -> r + e)
-assert 9 == [1, 2, 3].stream().map(e -> {e + 1}).reduce(0, (r, e) -> r + e)
-assert 9 == [1, 2, 3].stream().map((e) -> e + 1).reduce(0, (r, e) -> r + e)
-assert 9 == [1, 2, 3].stream().map((e) -> e + 1).reduce(0, (r, e) -> {r + e})
-assert 32 == ((e) -> e + 1)(2) + ((e, f) -> e + f)(2, 3) + ((e, f, g) -> e * f * g)(2, 3, 4)
-
-assert 24 == ((e, f, g) -> {e * f * g})(2, 3, 4)
-assert 24 == ((int e, int f, int g) -> {
-    int tmpE = e;
-    int tmpF = f;
-    int tmpG = g;
-    return tmpE * tmpF * tmpG;
-})(2, 3, 4)
-assert 24 == ((int e, int f, int g=4) -> {
-    int tmpE = e;
-    int tmpF = f;
-    int tmpG = g;
-    return tmpE * tmpF * tmpG;
-})(2, 3)
-
-def list = [2, 3, 1]
-Collections.sort(list, (n1, n2) -> n1 <=> n2)
-assert [1, 2, 3] == list
-
-assert 1 == (e -> e)(1)
-assert 2 == (() -> 2)()
-
-def lambda = e -> e;
-assert 1 == lambda(1)
-
-lambda = e -> e + 1;
-assert 2 == lambda(1)
-
-int sum = 0;
-[1, 2, 3].forEach(e -> {
-    sum += e
-})
-assert 6 == sum;
-
-def c = { (e) -> e * 2 }
-assert 6 == c()(3)
-
-c = { (e) -> { e * 2 } }
-assert 6 == c()(3)
-
-assert ['1', '2', '3'] == [0, 1, 2].collect(e -> String.valueOf e + 1)
-assert [3, 4, 5] == ['0', '1', '2'].collect(e -> Integer.parseInt e plus 1 plus 2)
-assert [4] == ['0'].collect(e -> e.length() plus 1 plus 2)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/List_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/List_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/List_01.groovy
deleted file mode 100644
index f7c122e..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/List_01.groovy
+++ /dev/null
@@ -1,33 +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.
- */
-[]
-[
-        
-]
-[1, 2, 3]
-[1, 2, 3,]
-[[1, 2, 3], 2, 3]
-[
-        [1,
-         2,
-         3],
-        2,
-        3]
-
-[1, *[2, 3, 4], 5, 6, *[7, 8], *[9]]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_01.groovy
deleted file mode 100644
index c3a1f3a..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_01.groovy
+++ /dev/null
@@ -1,97 +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.
- */
-null
-true
-false
-
-
-1
-12
-123
-
-1.2
-1.2f
-1.2F
-1.2d
-1.2D
-1.2g
-1.2G
-
-0x1234567890abcdef
-0X1234567890ABCDEF
-0x1234567890abcdefi
-0x1234567890abcdefl
-0x1234567890abcdefg
-0x1234567890abcdefI
-0x1234567890abcdefL
-0x1234567890abcdefG
-0xabcdef
-0xABCDEF
-0xABCDEF
-0xabcdef
-0xABCDEF
-
-01234567
-01234567
-01234567
-01234567i
-01234567l
-01234567g
-01234567I
-01234567L
-01234567G
-
-1__2
-2_12_3
-2__12__3
-2__12__3.1__2
-2__12__3.1__2
-12e10
-12e-10
-12e10
-12e-10
-12.12e10
-12.12e-10
-12.12e10
-12.12e-10
-12.12e-10f
-12.12e-10d
-12.12e-10g
-12e-10F
-120e-10D
-11F
-12D
-1.1F
-1.2D
-12e-10G
-12.1__2e-10f
-12.1_2e-10d
-1__12_2.12e-10g
-0xab__cdef
-0xAB__CD_EF
-012__34567L
-
-0b010101
-0B10101011
-0B10101011i
-0B10101011I
-0B10101011l
-0B10101011L
-0B10101011g
-0B10101011G
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_02.groovy
deleted file mode 100644
index de55750..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_02.groovy
+++ /dev/null
@@ -1,66 +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.
- */
-'123'
-'abc'
-'a1b2c3'
-'a\tb\tc'
-'a\nb\r\nc'
-'$a$b$c'
-'$1$2$3'
-'$1$2\$3'
-'\$1\$2\$3\
-  hello world\
-'
-"\$1\$2\$3\
-  hello world\
-"
-' nested "double quotes" '
-" nested 'quotes' "
-' \6 1 digit is escaped'
-' \665 2 digits are escaped, \'5\' is a character.'
-' \3666 3 digits are escaped'
-' \166 '
-" \166 "
-' \u1234 '
-
-'''abc'''
-'''123'''
-'''
-            ''hello world''
-            'hello'
-            ''world'
-            'hi''
-            \
-            \t\r\n
-            $\$
-            \u1234
-            \123
-'''
-
-"""
-            ''hello world''
-            'hello'
-            ''world'
-            'hi''
-            \
-            \t\r\n
-            \$
-            \u1234
-            \123
-"""

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_03.groovy
deleted file mode 100644
index 865596b..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Literal_03.groovy
+++ /dev/null
@@ -1,21 +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.
- */
-/\123 \/ abc \u1234 \r\n\$/
-
-$/\123 \/ abc \u1234 \r\n/$

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/LocalVariableDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/LocalVariableDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/LocalVariableDeclaration_01.groovy
deleted file mode 100644
index 7db2948..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/LocalVariableDeclaration_01.groovy
+++ /dev/null
@@ -1,128 +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.
- */
-import groovy.transform.Field
-
-int a;
-int b = 1;
-int c =
-        1;
-final d = 1;
-@Test2 e = 1;
-@Test2 final f = 1;
-final
-@Test2 g = 1;
-
-int h, i = 1;
-int j,
-        k =
-                1;
-int l =
-        2,
-    m =
-            1;
-int n =
-        1
-int o =
-        2,
-    p =
-            1
-
-List list = [1, 2 + 6, [1, 2 + 3]]
-List list2 =
-        [
-                1,
-         2 +
-                6,
-                [1,
-                 2 +
-                         3]
-        ]
-
-def (int x, int y) = [1, 2]
-
-@Test2
-def
-        (int q,
-                int r) =
-                        [1, 2]
-
-def (int s, int t) = otherTuple
-
-def (int w, z) = [1, 2]
-def (a2, int b2) = [1, 2]
-
-def (u, v) = [1, 2]
-
-def (int c2, String d2, java.lang.Double e2) = [1, '2', 3.3D]
-
-def cc = {
-        String bb = 'Test'
-        return bb;
-}
-
-int xx = b c d e
-
-@Field static List list = [1, 2, 3]
-
-if (false)
-        def a = 5
-
-if(false)
-        def a, b = 10
-
-if(false)
-        def a = 9, b = 10
-
-if (false)
-        def a = 5
-else
-        def b = 2
-
-if(false)
-        def a, b = 10
-else
-        def a, b = 8
-
-if(false)
-        def a = 9, b = 10
-else
-        def a = 6, b = 8
-
-while(false)
-        def a = 5
-
-while(false)
-        def a, b = 10
-
-while(false)
-        def a = 9, b = 10
-
-for(;;)
-        def a = 5
-
-for(;;)
-        def a, b = 10
-
-for(;;)
-        def a = 9, b = 10
-
-
-
-Class<String>[] c
-Class<?>[] c2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Map_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Map_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Map_01.groovy
deleted file mode 100644
index bcc0f3e..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Map_01.groovy
+++ /dev/null
@@ -1,47 +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.
- */
-[a: 1, b: 2, c: 3]
-[(a): 1, (b**2): x, c: 2 + 3]
-['a': '1', 'b': 2, 'c': '3']
-[1: 2, 2: 3, 3: 4]
-[1.1: 2, 2.2: 3, 3.3: 4]
-[
-        (a)
-        :
-                1
-        ,
-        (
-                b**2
-        )
-        :
-                x
-        ,
-        c
-        :
-                2 +
-                        3
-]
-
-[(a): '1', *: [(a + 1): 1, (b): 2], *: ['a': 1 + 2]]
-
-[:]
-[
-        :
-]
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodDeclaration_01.groovy
deleted file mode 100644
index e7220e0..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodDeclaration_01.groovy
+++ /dev/null
@@ -1,50 +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.
- */
-int plus(int a, int b) {
-        return a + b;
-}
-
-int plus2(int a,
-          int b)
-{
-        return a + b;
-}
-
-int plus3(int a,
-          int b)
-throws
-        Exception1,
-        Exception2
-{
-        return a + b;
-}
-
-def <T> T someMethod() {}
-def <T extends List> T someMethod2() {}
-def <T extends A & B> T someMethod3() {}
-
-static m(a) {}
-static m2(a, b) {}
-static m3(a, b, c) {}
-static Object m4(a, b, c) {}
-
-private String relativePath() { '' }
-def foo() {}
-
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodDeclaration_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodDeclaration_02.groovy
deleted file mode 100644
index 91879a9..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodDeclaration_02.groovy
+++ /dev/null
@@ -1,59 +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.
- */
-final int plus(int a, int b) {
-        return a + b;
-}
-
-final plus(int a, int b) {
-        return a + b;
-}
-
-@Test2 plus(int a, int b) {
-        return a + b;
-}
-
-@Test2
-int plus(int a, int b) {
-        return a + b;
-}
-
-@Test2
-final int plus(int a, int b) {
-        return a + b;
-}
-
-@Test2
-@Test3
-synchronized final int plus(int a, int b) {
-        return a + b;
-}
-
-
-public void someMethod (java.lang.Class<String> clazz) {}
-public void someMethod2 (java.lang.Class clazz) {}
-public boolean someMethod3 (java.util.List<String> list) {
-        list instanceof java.util.List
-}
-
-/* return element i,j of infinite matrix A */
-def A(i, j) {
-        return 1.0D / ((i+j) * (i + j + 1.0D) / 2.0D  + i + 1.0D)
-}
-
-String m(Integer a, ... params) {}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodPointer_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodPointer_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodPointer_01x.groovy
deleted file mode 100644
index eaddb93..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodPointer_01x.groovy
+++ /dev/null
@@ -1,23 +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.
- */
-def shell = new GroovyShell()
-assert shell.evaluate("x = String.&toUpperCase; x('abc')") == "ABC"
-assert shell.evaluate("x = 'abc'.&toUpperCase; x()") == "ABC"
-assert shell.evaluate("x = Integer.&parseInt; x('123')") == 123
-assert shell.evaluate("x = 3.&parseInt; x('123')") == 123
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodReference_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodReference_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodReference_01x.groovy
deleted file mode 100644
index a31b5b8..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/MethodReference_01x.groovy
+++ /dev/null
@@ -1,103 +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.
- */
-import java.util.stream.Collectors
-
-// class::staticMethod
-assert ['1', '2', '3'] == [1, 2, 3].stream().map(Integer::toString).collect(Collectors.toList())
-
-// class::instanceMethod
-assert ['A', 'B', 'C'] == ['a', 'b', 'c'].stream().map(String::toUpperCase).collect(Collectors.toList())
-
-
-
-def robot = new Robot();
-
-// instance::instanceMethod
-assert ['Hi, Jochen', 'Hi, Paul', 'Hi, Daniel'] == [new Person('Jochen'), new Person('Paul'), new Person('Daniel')].stream().map(robot::greet).collect(Collectors.toList())
-
-// class::staticMethod
-assert ['Jochen', 'Paul', 'Daniel'] == [new Person('Jochen'), new Person('Paul'), new Person('Daniel')].stream().map(Person::getText).collect(Collectors.toList())
-assert ['Jochen', 'Paul', 'Daniel'] == [new Person('Jochen'), new Person('Paul'), new Person('Daniel')].stream().map(BasePerson::getText).collect(Collectors.toList())
-
-// instance::staticMethod
-assert ['J', 'P', 'D'] == [new Person('Jochen'), new Person('Paul'), new Person('Daniel')].stream().map(robot::firstCharOfName).collect(Collectors.toList())
-
-// class::instanceMethod
-assert ['Jochen', 'Paul', 'Daniel'] == [new Person('Jochen'), new Person('Paul'), new Person('Daniel')].stream().map(Person::getName).collect(Collectors.toList())
-
-
-// ----------------------------------
-class BasePerson {
-    public static String getText(Person p) {
-        return p.name;
-    }
-}
-
-class Person extends BasePerson {
-    private String name;
-
-    public Person(String name) {
-        this.name = name
-    }
-
-    public String getName() {
-        return this.name;
-    }
-
-}
-class Robot {
-    public String greet(Person p) {
-        return "Hi, ${p.name}"
-    }
-
-    public static char firstCharOfName(Person p) {
-        return p.getName().charAt(0);
-    }
-}
-
-def mr = String::toUpperCase
-assert 'ABC' == mr('abc')
-assert 'ABC' == String::toUpperCase('abc')
-
-assert new HashSet() == HashSet::new()
-assert new String() == String::new()
-assert 1 == Integer::new(1)
-assert new String[0] == String[]::new(0)
-assert new String[0] == String[]::new('0')
-assert new String[1][2] == String[][]::new(1, 2)
-assert new String[1][2][3] == String[][][]::new(1, 2, 3)
-
-assert [new String[1], new String[2], new String[3]] == [1, 2, 3].stream().map(String[]::new).collect(Collectors.toList())
-assert [1, 2, 3] as String[] == [1, 2, 3].stream().map(String::valueOf).toArray(String[]::new)
-
-
-def a = String[][]::new(1, 2)
-def b = new String[1][2]
-assert a.class == b.class && a == b
-
-a = String[][][]::new(1, 2)
-b = new String[1][2][]
-assert a.class == b.class && a == b
-
-a = String[][][][]::new(1, 2)
-b = new String[1][2][][]
-assert a.class == b.class && a == b
-
-
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/NegativeRelationalOperators_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/NegativeRelationalOperators_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/NegativeRelationalOperators_01x.groovy
deleted file mode 100644
index 7c91cd3..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/NegativeRelationalOperators_01x.groovy
+++ /dev/null
@@ -1,39 +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.
- */
-assert 'a' instanceof String
-assert 'a' !instanceof Integer
-assert 1 !instanceof String
-assert null !instanceof String
-assert 1 in [1, 2]
-assert 3 !in [1, 2]
-assert 3 !in ['1', '2']
-assert '3' !in [1, 2]
-assert '3' !in ['1', '2']
-assert null !in ['1', '2']
-assert null !in [1, 2]
-
-boolean interesting = false
-assert !interesting
-
-boolean instanceofboolean = false
-assert !instanceofboolean
-
-assert 1 !in[2, 3]
-assert 1 !in([2, 3])
-assert 1 !in{return [2, 3]}()

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/NegativeRelationalOperators_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/NegativeRelationalOperators_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/NegativeRelationalOperators_02x.groovy
deleted file mode 100644
index 1400f9f..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/NegativeRelationalOperators_02x.groovy
+++ /dev/null
@@ -1,36 +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.
- */
-import groovy.transform.CompileStatic
-
-@CompileStatic
-def cs() {
-    assert 'a' instanceof String
-    assert 'a' !instanceof Integer
-    assert 1 !instanceof String
-    assert null !instanceof String
-    assert 1 in [1, 2]
-    assert 3 !in [1, 2]
-    assert 3 !in ['1', '2']
-    assert '3' !in [1, 2]
-    assert '3' !in ['1', '2']
-    assert null !in ['1', '2']
-    assert null !in [1, 2]
-}
-
-cs();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_01.groovy
deleted file mode 100644
index 17619c2..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_01.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-package com.groovyhelp.core
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_02.groovy
deleted file mode 100644
index ec6d67f..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_02.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-package com.groovyhelp.core

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_03.groovy
deleted file mode 100644
index 6114f1c..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_03.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-package com.groovyhelp.core;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_04.groovy
deleted file mode 100644
index 88b48aa..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_04.groovy
+++ /dev/null
@@ -1,38 +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.
- */
-#!/usr/bin/env groovy
-/*
- *  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.
- */
-package com.groovyhelp.core;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_05.groovy
deleted file mode 100644
index c60b3c3..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_05.groovy
+++ /dev/null
@@ -1,41 +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.
- */
-#!/usr/bin/env groovy
-/*
- *  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.
- */
-package com.groovyhelp.core;
-/**
- * Created by Daniel.Sun on 2016/08/17.
- */
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_06.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_06.groovy
deleted file mode 100644
index 313cc8f..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/PackageDeclaration_06.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-package def.in.as.trait;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Return_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Return_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Return_01.groovy
deleted file mode 100644
index 2f0f983..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Return_01.groovy
+++ /dev/null
@@ -1,26 +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.
- */
-return
-return;
-return 1;
-return 2
-return
-3;
-return
-4
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_01x.groovy
deleted file mode 100644
index 1cbcf66..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_01x.groovy
+++ /dev/null
@@ -1,28 +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.
- */
-assert null == null?[1];
-assert null == null?[1]?[1, 2];
-assert null == null?[1]?[1, 2]?[1, 2, 3];
-
-def a = null;
-assert null == a?[1, 2];
-
-def f() {return null}
-assert null == f()?[1];
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_02x.groovy
deleted file mode 100644
index aa13c83..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_02x.groovy
+++ /dev/null
@@ -1,65 +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.
- */
-import groovy.transform.*
-
-class SomeContainer {
-    public Object getAt(int i) {
-        return "123";
-    }
-
-    public void putAt(int i, Object obj) {
-    }
-}
-
-def safe() {
-    List list = null;
-    assert null == list?[1];
-    list?[1] = 'a';
-    assert null == list?[1];
-
-    Map map = null;
-    assert null == map?[1];
-    map?[1] = 'a';
-    assert null == map?[1];
-
-    SomeContainer sc = null;
-    assert null == sc?[1];
-    sc?[1] = 'a';
-    assert null == sc?[1];
-}
-safe();
-
-@CompileStatic
-def csSafe() {
-    List list = null;
-    assert null == list?[1];
-    list?[1] = 'a';
-    assert null == list?[1];
-
-    Map map = null;
-    assert null == map?[1];
-    map?[1] = 'a';
-    assert null == map?[1];
-
-    SomeContainer sc = null;
-    assert null == sc?[1];
-    sc?[1] = 'a';
-    assert null == sc?[1];
-}
-csSafe();

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_03x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_03x.groovy
deleted file mode 100644
index d94d414..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/SafeIndex_03x.groovy
+++ /dev/null
@@ -1,298 +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.
- */
-import groovy.transform.*
-
-@CompileStatic
-def csObjArray() {
-    String[] array = ['a', 'b'];
-    assert 'b' == array?[1];
-
-    array?[1] = 'c';
-    assert 'c' == array?[1];
-
-    array = null;
-    assert null == array?[1];
-
-    array?[1] = 'c';
-    assert null == array?[1];
-}
-csObjArray();
-
-def objArray() {
-    String[] array = ['a', 'b'];
-    assert 'b' == array?[1];
-
-    array?[1] = 'c';
-    assert 'c' == array?[1];
-
-    array = null;
-    assert null == array?[1];
-
-    array?[1] = 'c';
-    assert null == array?[1];
-}
-objArray();
-
-@CompileStatic
-def csBooleanArray() {
-    boolean[] array = [true, false];
-    assert false == array?[1];
-
-    array?[1] = true;
-    assert true == array?[1];
-
-    array = null;
-    assert null == array?[1];
-
-    array?[1] = true;
-    assert null == array?[1];
-}
-csBooleanArray();
-
-def booleanArray() {
-    boolean[] array = [true, false];
-    assert false == array?[1];
-
-    array?[1] = true;
-    assert true == array?[1];
-
-    array = null;
-    assert null == array?[1];
-
-    array?[1] = true;
-    assert null == array?[1];
-}
-booleanArray();
-
-@CompileStatic
-def csCharArray() {
-    char[] array = ['a' as char, 'b' as char];
-    assert ('b' as char) == array?[1];
-
-    array?[1] = 'c';
-    assert ('c' as char) == array?[1];
-
-    array = null;
-    assert null == array?[1];
-
-    array?[1] = 'c';
-    assert null == array?[1];
-}
-csCharArray();
-
-def charArray() {
-    char[] array = ['a' as char, 'b' as char];
-    assert ('b' as char) == array?[1];
-
-    array?[1] = 'c';
-    assert ('c' as char) == array?[1];
-
-    array = null;
-    assert null == array?[1];
-
-    array?[1] = 'c';
-    assert null == array?[1];
-}
-charArray();
-
-@CompileStatic
-def csByteArray() {
-    byte[] array = [1 as byte, 2 as byte];
-    assert (2 as byte) == array?[1];
-
-    array?[1] = 3 as byte;
-    assert (3 as byte) == array?[1];
-
-    array = null;
-    assert null == array?[1];
-
-    array?[1] = 3 as byte;
-    assert null == array?[1];
-}
-csByteArray();
-
-def byteArray() {
-    byte[] array = [1 as byte, 2 as byte];
-    assert (2 as byte) == array?[1];
-
-    array?[1] = 3 as byte;
-    assert (3 as byte) == array?[1];
-
-    array = null;
-    assert null == array?[1];
-
-    array?[1] = 3 as byte;
-    assert null == array?[1];
-}
-byteArray();
-
-@CompileStatic
-def csShortArray() {
-    short[] array = [1 as short, 2 as short];
-    assert (2 as short) == array?[1];
-
-    array?[1] = 3 as short;
-    assert (3 as short) == array?[1];
-
-    array = null;
-    assert null == array?[1];
-
-    array?[1] = 3 as short;
-    assert null == array?[1];
-}
-csShortArray();
-
-def shortArray() {
-    short[] array = [1 as short, 2 as short];
-    assert (2 as short) == array?[1];
-
-    array?[1] = 3 as short;
-    assert (3 as short) == array?[1];
-
-    array = null;
-    assert null == array?[1];
-
-    array?[1] = 3 as short;
-    assert null == array?[1];
-}
-shortArray();
-
-@CompileStatic
-def csIntArray() {
-    int[] array = [1, 2];
-    assert 2 == array?[1];
-
-    array?[1] = 3;
-    assert 3 == array?[1];
-
-    array = null;
-    assert null == array?[1];
-
-    array?[1] = 3;
-    assert null == array?[1];
-}
-csIntArray();
-
-def intArray() {
-    int[] array = [1, 2];
-    assert 2 == array?[1];
-
-    array?[1] = 3;
-    assert 3 == array?[1];
-
-    array = null;
-    assert null == array?[1];
-
-    array?[1] = 3;
-    assert null == array?[1];
-}
-intArray();
-
-@CompileStatic
-def csLongArray() {
-    long[] array = [1L, 2L];
-    assert 2L == array?[1];
-
-    array?[1] = 3L;
-    assert 3L == array?[1];
-
-    array = null;
-    assert null == array?[1];
-
-    array?[1] = 3L;
-    assert null == array?[1];
-}
-csLongArray();
-
-def longArray() {
-    long[] array = [1L, 2L];
-    assert 2L == array?[1];
-
-    array?[1] = 3L;
-    assert 3L == array?[1];
-
-    array = null;
-    assert null == array?[1];
-
-    array?[1] = 3L;
-    assert null == array?[1];
-}
-longArray();
-
-@CompileStatic
-def csFloatArray() {
-    float[] array = [1.1f, 2.2f];
-    assert 2.2f == array?[1];
-
-    array?[1] = 3.3f;
-    assert 3.3f == array?[1];
-
-    array = null;
-    assert null == array?[1];
-
-    array?[1] = 3.3f;
-    assert null == array?[1];
-}
-csFloatArray();
-
-def floatArray() {
-    float[] array = [1.1f, 2.2f];
-    assert 2.2f == array?[1];
-
-    array?[1] = 3.3f;
-    assert 3.3f == array?[1];
-
-    array = null;
-    assert null == array?[1];
-
-    array?[1] = 3.3f;
-    assert null == array?[1];
-}
-floatArray();
-
-@CompileStatic
-def csDoubleArray() {
-    double[] array = [1.1d, 2.2d];
-    assert 2.2d == array?[1];
-
-    array?[1] = 3.3d;
-    assert 3.3d == array?[1];
-
-    array = null;
-    assert null == array?[1];
-
-    array?[1] = 3.3d;
-    assert null == array?[1];
-}
-csDoubleArray();
-
-def doubleArray() {
-    double[] array = [1.1d, 2.2d];
-    assert 2.2d == array?[1];
-
-    array?[1] = 3.3d;
-    assert 3.3d == array?[1];
-
-    array = null;
-    assert null == array?[1];
-
-    array?[1] = 3.3d;
-    assert null == array?[1];
-}
-doubleArray();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Script_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Script_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Script_01x.groovy
deleted file mode 100644
index 0e47db0..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Script_01x.groovy
+++ /dev/null
@@ -1,23 +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.
- */
-protected String getGroovySql() {
-    return "abc"
-}
-
-assert "abc" == getGroovySql()

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Switch_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Switch_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Switch_01.groovy
deleted file mode 100644
index f26d15b..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Switch_01.groovy
+++ /dev/null
@@ -1,78 +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.
- */
-switch (a) {
-    case 1:
-        break;
-    case 2:
-        break;
-}
-
-switch (a) {
-    case 1:
-        break;
-    case 2:
-        break;
-    default:
-        break;
-}
-
-switch (a) {
-    case 1:
-    case 2:
-        break;
-    case 3:
-        break;
-    default:
-        break;
-}
-
-switch (a) {
-    case 1:
-    case 2 + 3:
-        break;
-    case 3:
-        break;
-    case 4 + 2:
-    case 5:
-    default:
-        break;
-}
-
-switch (a) {
-    case 1:
-    case 2 + 3: break;
-    case 3: break;
-    case 4 + 2:
-    case 5:
-    default: break;
-}
-
-switch (a) {case 1:
-    case 2 + 3: break;
-    case 3: break;
-    case 4 + 2:
-    case 5:
-    default: break;}
-
-switch (a) {
-    case 1:
-        int x = 1;
-    default:
-        int y = 2;
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Synchronized_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Synchronized_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Synchronized_01.groovy
deleted file mode 100644
index bc1bc88..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Synchronized_01.groovy
+++ /dev/null
@@ -1,54 +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.
- */
-synchronized ('a')
-{
-    assert true
-}
-
-synchronized ('a') {
-    assert true
-}
-
-synchronized ('a') {assert true
-}
-
-synchronized ('a') {assert true}
-
-synchronized ('a') {assert true;}
-
-synchronized ('a') {
-    assert true
-    assert true
-}
-
-synchronized ('a') {
-    assert true;
-    assert true
-}
-
-synchronized ('a') {
-    assert true; assert true
-}
-
-synchronized ('a') {assert true; assert true
-}
-
-synchronized ('a') {assert true; assert true}
-
-synchronized ('a') {assert true; assert true;}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Throw_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Throw_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Throw_01.groovy
deleted file mode 100644
index f78903c..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Throw_01.groovy
+++ /dev/null
@@ -1,20 +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.
- */
-throw e;
-throw e
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_01.groovy
deleted file mode 100644
index b5ed026..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_01.groovy
+++ /dev/null
@@ -1,60 +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.
- */
-package core
-
-trait A {}
-trait B<T> {}
-trait C<T extends A> {}
-trait D<T extends A & B> {}
-trait E<T extends A & B & C> {}
-trait F<T extends A & B & C> extends A {}
-trait F2 extends A<T> {}
-trait G1<T extends A & B & C> extends A implements X {}
-trait G2<T extends A & B & C> extends A<T> implements X<T> {}
-trait G3                      extends A<T> implements X<T> {}
-trait G4                      extends A    implements X<T> {}
-trait G5                      extends A    implements X    {}
-trait G2<T extends A & B & C> extends A<T> implements X<T> {}
-trait H<T extends A & B & C> extends A implements X, Y {}
-trait I<T extends A & B & C> extends A implements X, Y, Z {}
-public trait J<T extends A & B & C> extends A implements X, Y, Z {}
-@Test2 public trait K<T extends A & B & C> extends A implements X, Y, Z {}
-@Test2 @Test3 public trait L<T extends A & B & C> extends A implements X, Y, Z {}
-
-@Test2
-@Test3
-public
-trait M
-<
-        T extends
-        A &
-        B &
-        C
->
-extends
-A
-implements
-X,
-Y,
-Z
-        {
-
-        }
-
-trait t {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_02.groovy
deleted file mode 100644
index 6820b1f..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_02.groovy
+++ /dev/null
@@ -1,58 +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.
- */
-trait AA {
-    {
-        println 123
-    }
-}
-
-trait BB {
-    static {
-        println '123'
-    }
-}
-
-trait CC {
-    static
-    {
-        println '123'
-    }
-}
-
-trait DD {
-    static {
-        println '123'
-    }
-
-    {
-        println 'abc'
-    }
-
-    static {
-        println '234'
-    }
-
-    {
-        println 'bcd'
-    }
-}
-
-trait EE {{}}
-trait FF {static {}}
-trait GG {static {};{}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_03.groovy
deleted file mode 100644
index 2a68103..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_03.groovy
+++ /dev/null
@@ -1,66 +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.
- */
-import java.sql.SQLException
-
-trait AAA {
-    public AAA() {
-
-    }
-
-    public AAA(String name) {
-
-    }
-
-    @Test2
-    public AAA(String name, int age) throws Exception {
-
-    }
-
-    AAA(String name, int age, String title) throws Exception {
-
-    }
-
-    private AAA(String name, int age, String title, double income) throws Exception {
-
-    }
-
-    @Test2
-    public String sayHello(String name) {
-        return "Hello, $name";
-    }
-
-    @Test2
-    public <T> T sayHello2(T name) throws IOException, SQLException {
-        return "Hello, $name";
-    }
-
-    public static privateStaticMethod(){}
-
-    public void m(final int param) {}
-    public void m2(def param) {}
-    public void m3(final int param1, long param2, final String param3) {}
-
-    def "hello world"(p1, p2) {
-        println "$p1, $p2"
-    }
-
-    def run() {
-        this."hello world"('ab', 'bc')
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_04.groovy
deleted file mode 100644
index 7cd679c..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_04.groovy
+++ /dev/null
@@ -1,46 +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.
- */
-public trait Person {
-    public static final SOME_CONSTANT = 'SOME_CONSTANT';
-    private String name = 'Daniel';
-    private int age;
-    @Test2
-    private String country = 'China',
-            location = 'Shanghai';
-
-    private String field, field2 = 'field2';
-    String someProperty;
-    String someProperty2 = 'someProperty2';
-    String someProperty3 = 'someProperty3',
-            someProperty4 = 'someProperty4';
-    String someProperty5, someProperty6 = 'someProperty6';
-    final String someProperty7 = 'someProperty7';
-    static final String someProperty8 = 'someProperty8';
-
-    @Test3
-    static final String someProperty9 = 'someProperty9';
-
-    protected static def protectedStaticDefField;
-}
-
-trait xx {
-    class yy {
-        enum zz {}
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_05.groovy
deleted file mode 100644
index 625074e..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/TraitDeclaration_05.groovy
+++ /dev/null
@@ -1,41 +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.
- */
-trait SwimmingAbility {
-    def swim() {
-        prt("swimming..")
-    }
-
-    abstract String prt(String msg);
-}
-
-trait FlyingAbility {
-    def fly() {
-        println "flying.."
-    }
-}
-
-class Duck implements SwimmingAbility, FlyingAbility {
-    String prt(String msg) {
-        println msg + " happily";
-    }
-}
-
-def duck = new Duck()
-duck.swim()
-duck.fly()

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/TryCatch_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/TryCatch_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/TryCatch_01.groovy
deleted file mode 100644
index d09e1c3..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/TryCatch_01.groovy
+++ /dev/null
@@ -1,130 +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.
- */
-import java.sql.SQLException
-
-try {
-    assert true;
-} finally {
-    return 0;
-}
-
-try {
-    assert true;
-} catch(Exception e) {
-    assert false;
-}
-
-try {
-    assert true;
-} catch(Exception
-            e) {
-    assert false;
-}
-
-try {
-    assert true;
-} catch(e) {
-    assert false;
-}
-
-try {
-    assert true;
-} catch(e) {
-    assert false;
-} catch(t) {
-    assert false;
-}
-
-try {
-    assert true;
-} catch(final e) {
-    assert false;
-}
-
-try {
-    assert true;
-} catch(final Exception e) {
-    assert false;
-}
-
-try {
-    assert true;
-} catch(IOException e) {
-    assert false;
-} catch(Exception e) {
-    assert false;
-}
-
-try {
-    assert true;
-} catch(IOException e) {
-    assert false;
-} catch(Exception e) {
-    assert false;
-} finally {
-    return 0;
-}
-
-try
-{
-    assert true;
-}
-catch(IOException e)
-{
-    assert false;
-}
-catch(Exception e)
-{
-    assert false;
-}
-finally
-{
-    return 0;
-}
-
-try {
-    assert true;
-} catch(Exception e) {
-    assert false;
-} finally {
-    return 0;
-}
-
-try {
-    assert true;
-} catch(NullPointerException | IOException e) {
-    assert false;
-} finally {
-    return 0;
-}
-
-try {
-    assert true;
-} catch(NullPointerException | IOException e) {
-    assert false;
-}
-
-try {
-    assert true;
-} catch(NullPointerException |
-        IOException |
-        SQLException
-                e) {
-    assert false;
-}


[19/50] [abbrv] groovy git commit: GROOVY-8135: SecureASTCustomizer whitelist does not work (closes #538)

Posted by pa...@apache.org.
GROOVY-8135: SecureASTCustomizer whitelist does not work (closes #538)

For arrays we should get componentType instead of type


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/ce35457a
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/ce35457a
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/ce35457a

Branch: refs/heads/parrot
Commit: ce35457ae14be60b034b7d0fda69b4aed6f2e0a2
Parents: 518dca1
Author: Sargis Harutyunyan <sa...@webbfontaine.com>
Authored: Sat May 6 23:34:42 2017 +0400
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:10:17 2017 +1000

----------------------------------------------------------------------
 .../customizers/SecureASTCustomizer.java        |  7 ++++++-
 .../customizers/SecureASTCustomizerTest.groovy  | 21 ++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/ce35457a/src/main/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java b/src/main/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java
index b3d39f7..79b5455 100644
--- a/src/main/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java
+++ b/src/main/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java
@@ -698,7 +698,8 @@ public class SecureASTCustomizer extends CompilationCustomizer {
                         assertImportIsAllowed(expression.getType().getName());
                     } else if (expression instanceof MethodCallExpression) {
                         MethodCallExpression expr = (MethodCallExpression) expression;
-                        final String typename = expr.getObjectExpression().getType().getName();
+                        ClassNode objectExpressionType = expr.getObjectExpression().getType();
+                        final String typename = getExpressionType(objectExpressionType).getName();
                         assertImportIsAllowed(typename);
                         assertStaticImportIsAllowed(expr.getMethodAsString(), typename);
                     } else if (expression instanceof StaticMethodCallExpression) {
@@ -718,6 +719,10 @@ public class SecureASTCustomizer extends CompilationCustomizer {
             }
         }
 
+        private ClassNode getExpressionType(ClassNode objectExpressionType) {
+            return objectExpressionType.isArray() ? getExpressionType(objectExpressionType.getComponentType()) : objectExpressionType;
+        }
+
         /**
          * Checks that a given token is either in the whitelist or not in the blacklist.
          *

http://git-wip-us.apache.org/repos/asf/groovy/blob/ce35457a/src/test/org/codehaus/groovy/control/customizers/SecureASTCustomizerTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/control/customizers/SecureASTCustomizerTest.groovy b/src/test/org/codehaus/groovy/control/customizers/SecureASTCustomizerTest.groovy
index 56832ce..35ce09a 100644
--- a/src/test/org/codehaus/groovy/control/customizers/SecureASTCustomizerTest.groovy
+++ b/src/test/org/codehaus/groovy/control/customizers/SecureASTCustomizerTest.groovy
@@ -459,4 +459,25 @@ class SecureASTCustomizerTest extends GroovyTestCase {
             '''
         }
     }
+
+    // GROOVY-8135
+    void testStarImportsWhiteListWithIndirectImportCheckEnabled() {
+        SecureASTCustomizer customizer = new SecureASTCustomizer()
+        customizer.setIndirectImportCheckEnabled(true)
+
+        List<String> starImportsWhitelist = new ArrayList<String>()
+        starImportsWhitelist.add("java.lang")
+        customizer.setStarImportsWhitelist(starImportsWhitelist)
+
+        CompilerConfiguration cc = new CompilerConfiguration()
+        cc.addCompilationCustomizers(customizer)
+
+        ClassLoader parent = getClass().getClassLoader()
+        GroovyClassLoader loader = new GroovyClassLoader(parent, cc)
+        loader.parseClass("Object object = new Object()")
+        loader.parseClass("Object object = new Object(); object.hashCode()")
+        loader.parseClass("Object[] array = new Object[0]; array.size()")
+        loader.parseClass("Object[][] array = new Object[0][0]; array.size()")
+    }
+
 }


[37/50] [abbrv] groovy git commit: rename antlr4 parser to remove groovy- prefix since that is by convention for modules

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
new file mode 100644
index 0000000..e0708f7
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
@@ -0,0 +1,4317 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4;
+
+import groovy.lang.IntRange;
+import org.antlr.v4.runtime.ANTLRErrorListener;
+import org.antlr.v4.runtime.ANTLRInputStream;
+import org.antlr.v4.runtime.CommonTokenStream;
+import org.antlr.v4.runtime.RecognitionException;
+import org.antlr.v4.runtime.Recognizer;
+import org.antlr.v4.runtime.Token;
+import org.antlr.v4.runtime.atn.PredictionMode;
+import org.antlr.v4.runtime.misc.ParseCancellationException;
+import org.antlr.v4.runtime.tree.ParseTree;
+import org.antlr.v4.runtime.tree.TerminalNode;
+import org.apache.groovy.parser.antlr4.internal.AtnManager;
+import org.apache.groovy.parser.antlr4.internal.DescriptiveErrorStrategy;
+import org.apache.groovy.parser.antlr4.util.StringUtils;
+import org.codehaus.groovy.GroovyBugError;
+import org.codehaus.groovy.antlr.EnumHelper;
+import org.codehaus.groovy.ast.ASTNode;
+import org.codehaus.groovy.ast.AnnotationNode;
+import org.codehaus.groovy.ast.ClassHelper;
+import org.codehaus.groovy.ast.ClassNode;
+import org.codehaus.groovy.ast.ConstructorNode;
+import org.codehaus.groovy.ast.EnumConstantClassNode;
+import org.codehaus.groovy.ast.FieldNode;
+import org.codehaus.groovy.ast.GenericsType;
+import org.codehaus.groovy.ast.ImportNode;
+import org.codehaus.groovy.ast.InnerClassNode;
+import org.codehaus.groovy.ast.MethodNode;
+import org.codehaus.groovy.ast.ModuleNode;
+import org.codehaus.groovy.ast.PackageNode;
+import org.codehaus.groovy.ast.Parameter;
+import org.codehaus.groovy.ast.PropertyNode;
+import org.codehaus.groovy.ast.expr.AnnotationConstantExpression;
+import org.codehaus.groovy.ast.expr.ArgumentListExpression;
+import org.codehaus.groovy.ast.expr.ArrayExpression;
+import org.codehaus.groovy.ast.expr.AttributeExpression;
+import org.codehaus.groovy.ast.expr.BinaryExpression;
+import org.codehaus.groovy.ast.expr.BitwiseNegationExpression;
+import org.codehaus.groovy.ast.expr.BooleanExpression;
+import org.codehaus.groovy.ast.expr.CastExpression;
+import org.codehaus.groovy.ast.expr.ClassExpression;
+import org.codehaus.groovy.ast.expr.ClosureExpression;
+import org.codehaus.groovy.ast.expr.ClosureListExpression;
+import org.codehaus.groovy.ast.expr.ConstantExpression;
+import org.codehaus.groovy.ast.expr.ConstructorCallExpression;
+import org.codehaus.groovy.ast.expr.DeclarationExpression;
+import org.codehaus.groovy.ast.expr.ElvisOperatorExpression;
+import org.codehaus.groovy.ast.expr.EmptyExpression;
+import org.codehaus.groovy.ast.expr.Expression;
+import org.codehaus.groovy.ast.expr.GStringExpression;
+import org.codehaus.groovy.ast.expr.LambdaExpression;
+import org.codehaus.groovy.ast.expr.ListExpression;
+import org.codehaus.groovy.ast.expr.MapEntryExpression;
+import org.codehaus.groovy.ast.expr.MapExpression;
+import org.codehaus.groovy.ast.expr.MethodCallExpression;
+import org.codehaus.groovy.ast.expr.MethodPointerExpression;
+import org.codehaus.groovy.ast.expr.MethodReferenceExpression;
+import org.codehaus.groovy.ast.expr.NamedArgumentListExpression;
+import org.codehaus.groovy.ast.expr.NotExpression;
+import org.codehaus.groovy.ast.expr.PostfixExpression;
+import org.codehaus.groovy.ast.expr.PrefixExpression;
+import org.codehaus.groovy.ast.expr.PropertyExpression;
+import org.codehaus.groovy.ast.expr.RangeExpression;
+import org.codehaus.groovy.ast.expr.SpreadExpression;
+import org.codehaus.groovy.ast.expr.SpreadMapExpression;
+import org.codehaus.groovy.ast.expr.TernaryExpression;
+import org.codehaus.groovy.ast.expr.TupleExpression;
+import org.codehaus.groovy.ast.expr.UnaryMinusExpression;
+import org.codehaus.groovy.ast.expr.UnaryPlusExpression;
+import org.codehaus.groovy.ast.expr.VariableExpression;
+import org.codehaus.groovy.ast.stmt.AssertStatement;
+import org.codehaus.groovy.ast.stmt.BlockStatement;
+import org.codehaus.groovy.ast.stmt.BreakStatement;
+import org.codehaus.groovy.ast.stmt.CaseStatement;
+import org.codehaus.groovy.ast.stmt.CatchStatement;
+import org.codehaus.groovy.ast.stmt.ContinueStatement;
+import org.codehaus.groovy.ast.stmt.DoWhileStatement;
+import org.codehaus.groovy.ast.stmt.EmptyStatement;
+import org.codehaus.groovy.ast.stmt.ExpressionStatement;
+import org.codehaus.groovy.ast.stmt.ForStatement;
+import org.codehaus.groovy.ast.stmt.IfStatement;
+import org.codehaus.groovy.ast.stmt.ReturnStatement;
+import org.codehaus.groovy.ast.stmt.Statement;
+import org.codehaus.groovy.ast.stmt.SwitchStatement;
+import org.codehaus.groovy.ast.stmt.SynchronizedStatement;
+import org.codehaus.groovy.ast.stmt.ThrowStatement;
+import org.codehaus.groovy.ast.stmt.TryCatchStatement;
+import org.codehaus.groovy.ast.stmt.WhileStatement;
+import org.codehaus.groovy.control.CompilationFailedException;
+import org.codehaus.groovy.control.CompilePhase;
+import org.codehaus.groovy.control.SourceUnit;
+import org.codehaus.groovy.control.messages.SyntaxErrorMessage;
+import org.codehaus.groovy.runtime.IOGroovyMethods;
+import org.codehaus.groovy.runtime.StringGroovyMethods;
+import org.codehaus.groovy.syntax.Numbers;
+import org.codehaus.groovy.syntax.SyntaxException;
+import org.codehaus.groovy.syntax.Types;
+import org.objectweb.asm.Opcodes;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.reflect.Field;
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.logging.Logger;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static org.apache.groovy.parser.antlr4.GroovyLangParser.*;
+import static org.codehaus.groovy.runtime.DefaultGroovyMethods.asBoolean;
+import static org.codehaus.groovy.runtime.DefaultGroovyMethods.last;
+
+/**
+ * Building the AST from the parse tree generated by Antlr4
+ *
+ * @author <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
+ *         Created on 2016/08/14
+ */
+public class AstBuilder extends GroovyParserBaseVisitor<Object> implements GroovyParserVisitor<Object> {
+
+    public AstBuilder(SourceUnit sourceUnit, ClassLoader classLoader) {
+        this.sourceUnit = sourceUnit;
+        this.moduleNode = new ModuleNode(sourceUnit);
+        this.classLoader = classLoader; // unused for the time being
+
+        this.lexer = new GroovyLangLexer(
+                new ANTLRInputStream(
+                        this.readSourceCode(sourceUnit)));
+        this.parser = new GroovyLangParser(
+                new CommonTokenStream(this.lexer));
+
+        this.parser.setErrorHandler(new DescriptiveErrorStrategy());
+
+        this.tryWithResourcesASTTransformation = new TryWithResourcesASTTransformation(this);
+        this.groovydocManager = new GroovydocManager(this);
+    }
+
+    private GroovyParserRuleContext buildCST() {
+        GroovyParserRuleContext result;
+
+        // parsing have to wait util clearing is complete.
+        AtnManager.RRWL.readLock().lock();
+        try {
+            result = buildCST(PredictionMode.SLL);
+        } catch (Throwable t) {
+            // if some syntax error occurred in the lexer, no need to retry the powerful LL mode
+            if (t instanceof GroovySyntaxError && GroovySyntaxError.LEXER == ((GroovySyntaxError) t).getSource()) {
+                throw t;
+            }
+
+            result = buildCST(PredictionMode.LL);
+        } finally {
+            AtnManager.RRWL.readLock().unlock();
+        }
+
+        return result;
+    }
+
+    private GroovyParserRuleContext buildCST(PredictionMode predictionMode) {
+        parser.getInterpreter().setPredictionMode(predictionMode);
+
+        if (PredictionMode.SLL.equals(predictionMode)) {
+            this.removeErrorListeners();
+        } else {
+            ((CommonTokenStream) parser.getInputStream()).reset();
+            this.addErrorListeners();
+        }
+
+        return parser.compilationUnit();
+    }
+
+    public ModuleNode buildAST() {
+        try {
+            return (ModuleNode) this.visit(this.buildCST());
+        } catch (Throwable t) {
+            CompilationFailedException cfe;
+
+            if (t instanceof CompilationFailedException) {
+                cfe = (CompilationFailedException) t;
+            } else if (t instanceof ParseCancellationException) {
+                cfe = createParsingFailedException(t.getCause());
+            } else {
+                cfe = createParsingFailedException(t);
+            }
+
+//            LOGGER.log(Level.SEVERE, "Failed to build AST", cfe);
+
+            throw cfe;
+        }
+    }
+
+    @Override
+    public ModuleNode visitCompilationUnit(CompilationUnitContext ctx) {
+        this.visit(ctx.packageDeclaration());
+
+        ctx.statement().stream()
+                .map(this::visit)
+//                .filter(e -> e instanceof Statement)
+                .forEach(e -> {
+                    if (e instanceof DeclarationListStatement) { // local variable declaration
+                        ((DeclarationListStatement) e).getDeclarationStatements().forEach(moduleNode::addStatement);
+                    } else if (e instanceof Statement) {
+                        moduleNode.addStatement((Statement) e);
+                    } else if (e instanceof MethodNode) { // script method
+                        moduleNode.addMethod((MethodNode) e);
+                    }
+                });
+
+        this.classNodeList.forEach(moduleNode::addClass);
+
+        if (this.isPackageInfoDeclaration()) {
+            this.addPackageInfoClassNode();
+        } else {
+            // if groovy source file only contains blank(including EOF), add "return null" to the AST
+            if (this.isBlankScript(ctx)) {
+                this.addEmptyReturnStatement();
+            }
+        }
+
+        this.configureScriptClassNode();
+
+        return moduleNode;
+    }
+
+    @Override
+    public PackageNode visitPackageDeclaration(PackageDeclarationContext ctx) {
+        String packageName = this.visitQualifiedName(ctx.qualifiedName());
+        moduleNode.setPackageName(packageName + DOT_STR);
+
+        PackageNode packageNode = moduleNode.getPackage();
+
+        this.visitAnnotationsOpt(ctx.annotationsOpt()).forEach(packageNode::addAnnotation);
+
+        return this.configureAST(packageNode, ctx);
+    }
+
+    @Override
+    public ImportNode visitImportDeclaration(ImportDeclarationContext ctx) {
+        ImportNode importNode;
+
+        boolean hasStatic = asBoolean(ctx.STATIC());
+        boolean hasStar = asBoolean(ctx.MUL());
+        boolean hasAlias = asBoolean(ctx.alias);
+
+        List<AnnotationNode> annotationNodeList = this.visitAnnotationsOpt(ctx.annotationsOpt());
+
+        if (hasStatic) {
+            if (hasStar) { // e.g. import static java.lang.Math.*
+                String qualifiedName = this.visitQualifiedName(ctx.qualifiedName());
+                ClassNode type = ClassHelper.make(qualifiedName);
+
+
+                moduleNode.addStaticStarImport(type.getText(), type, annotationNodeList);
+
+                importNode = last(moduleNode.getStaticStarImports().values());
+            } else { // e.g. import static java.lang.Math.pow
+                List<GroovyParserRuleContext> identifierList = new LinkedList<>(ctx.qualifiedName().qualifiedNameElement());
+                int identifierListSize = identifierList.size();
+                String name = identifierList.get(identifierListSize - 1).getText();
+                ClassNode classNode =
+                        ClassHelper.make(
+                                identifierList.stream()
+                                        .limit(identifierListSize - 1)
+                                        .map(ParseTree::getText)
+                                        .collect(Collectors.joining(DOT_STR)));
+                String alias = hasAlias
+                        ? ctx.alias.getText()
+                        : name;
+
+                moduleNode.addStaticImport(classNode, name, alias, annotationNodeList);
+
+                importNode = last(moduleNode.getStaticImports().values());
+            }
+        } else {
+            if (hasStar) { // e.g. import java.util.*
+                String qualifiedName = this.visitQualifiedName(ctx.qualifiedName());
+
+                moduleNode.addStarImport(qualifiedName + DOT_STR, annotationNodeList);
+
+                importNode = last(moduleNode.getStarImports());
+            } else { // e.g. import java.util.Map
+                String qualifiedName = this.visitQualifiedName(ctx.qualifiedName());
+                String name = last(ctx.qualifiedName().qualifiedNameElement()).getText();
+                ClassNode classNode = ClassHelper.make(qualifiedName);
+                String alias = hasAlias
+                        ? ctx.alias.getText()
+                        : name;
+
+                moduleNode.addImport(alias, classNode, annotationNodeList);
+
+                importNode = last(moduleNode.getImports());
+            }
+        }
+
+        return this.configureAST(importNode, ctx);
+    }
+
+    // statement {    --------------------------------------------------------------------
+    @Override
+    public AssertStatement visitAssertStatement(AssertStatementContext ctx) {
+        Expression conditionExpression = (Expression) this.visit(ctx.ce);
+        BooleanExpression booleanExpression =
+                this.configureAST(
+                        new BooleanExpression(conditionExpression), conditionExpression);
+
+        if (!asBoolean(ctx.me)) {
+            return this.configureAST(
+                    new AssertStatement(booleanExpression), ctx);
+        }
+
+        return this.configureAST(new AssertStatement(booleanExpression,
+                        (Expression) this.visit(ctx.me)),
+                ctx);
+    }
+
+    @Override
+    public AssertStatement visitAssertStmtAlt(AssertStmtAltContext ctx) {
+        return this.configureAST(this.visitAssertStatement(ctx.assertStatement()), ctx);
+    }
+
+    @Override
+    public IfStatement visitIfElseStmtAlt(IfElseStmtAltContext ctx) {
+        Expression conditionExpression = this.visitParExpression(ctx.parExpression());
+        BooleanExpression booleanExpression =
+                this.configureAST(
+                        new BooleanExpression(conditionExpression), conditionExpression);
+
+        Statement ifBlock =
+                this.unpackStatement(
+                        (Statement) this.visit(ctx.tb));
+        Statement elseBlock =
+                this.unpackStatement(
+                        asBoolean(ctx.ELSE())
+                                ? (Statement) this.visit(ctx.fb)
+                                : EmptyStatement.INSTANCE);
+
+        return this.configureAST(new IfStatement(booleanExpression, ifBlock, elseBlock), ctx);
+    }
+
+    @Override
+    public Statement visitLoopStmtAlt(LoopStmtAltContext ctx) {
+        return this.configureAST((Statement) this.visit(ctx.loopStatement()), ctx);
+    }
+
+    @Override
+    public ForStatement visitForStmtAlt(ForStmtAltContext ctx) {
+        Pair<Parameter, Expression> controlPair = this.visitForControl(ctx.forControl());
+
+        Statement loopBlock = this.unpackStatement((Statement) this.visit(ctx.statement()));
+
+        return this.configureAST(
+                new ForStatement(controlPair.getKey(), controlPair.getValue(), asBoolean(loopBlock) ? loopBlock : EmptyStatement.INSTANCE),
+                ctx);
+    }
+
+    @Override
+    public Pair<Parameter, Expression> visitForControl(ForControlContext ctx) {
+        if (asBoolean(ctx.enhancedForControl())) { // e.g. for(int i in 0..<10) {}
+            return this.visitEnhancedForControl(ctx.enhancedForControl());
+        }
+
+        if (asBoolean(ctx.classicalForControl())) { // e.g. for(int i = 0; i < 10; i++) {}
+            return this.visitClassicalForControl(ctx.classicalForControl());
+        }
+
+        throw createParsingFailedException("Unsupported for control: " + ctx.getText(), ctx);
+    }
+
+    @Override
+    public Expression visitForInit(ForInitContext ctx) {
+        if (!asBoolean(ctx)) {
+            return EmptyExpression.INSTANCE;
+        }
+
+        if (asBoolean(ctx.localVariableDeclaration())) {
+            DeclarationListStatement declarationListStatement = this.visitLocalVariableDeclaration(ctx.localVariableDeclaration());
+            List<?> declarationExpressionList = declarationListStatement.getDeclarationExpressions();
+
+            if (declarationExpressionList.size() == 1) {
+                return this.configureAST((Expression) declarationExpressionList.get(0), ctx);
+            } else {
+                return this.configureAST(new ClosureListExpression((List<Expression>) declarationExpressionList), ctx);
+            }
+        }
+
+        if (asBoolean(ctx.expressionList())) {
+            return this.translateExpressionList(ctx.expressionList());
+        }
+
+        throw createParsingFailedException("Unsupported for init: " + ctx.getText(), ctx);
+    }
+
+    @Override
+    public Expression visitForUpdate(ForUpdateContext ctx) {
+        if (!asBoolean(ctx)) {
+            return EmptyExpression.INSTANCE;
+        }
+
+        return this.translateExpressionList(ctx.expressionList());
+    }
+
+    private Expression translateExpressionList(ExpressionListContext ctx) {
+        List<Expression> expressionList = this.visitExpressionList(ctx);
+
+        if (expressionList.size() == 1) {
+            return this.configureAST(expressionList.get(0), ctx);
+        } else {
+            return this.configureAST(new ClosureListExpression(expressionList), ctx);
+        }
+    }
+
+    @Override
+    public Pair<Parameter, Expression> visitEnhancedForControl(EnhancedForControlContext ctx) {
+        Parameter parameter = this.configureAST(
+                new Parameter(this.visitType(ctx.type()), this.visitVariableDeclaratorId(ctx.variableDeclaratorId()).getName()),
+                ctx.variableDeclaratorId());
+
+        // FIXME Groovy will ignore variableModifier of parameter in the for control
+        // In order to make the new parser behave same with the old one, we do not process variableModifier*
+
+        return new Pair<>(parameter, (Expression) this.visit(ctx.expression()));
+    }
+
+    @Override
+    public Pair<Parameter, Expression> visitClassicalForControl(ClassicalForControlContext ctx) {
+        ClosureListExpression closureListExpression = new ClosureListExpression();
+
+        closureListExpression.addExpression(this.visitForInit(ctx.forInit()));
+        closureListExpression.addExpression(asBoolean(ctx.expression()) ? (Expression) this.visit(ctx.expression()) : EmptyExpression.INSTANCE);
+        closureListExpression.addExpression(this.visitForUpdate(ctx.forUpdate()));
+
+        return new Pair<>(ForStatement.FOR_LOOP_DUMMY, closureListExpression);
+    }
+
+    @Override
+    public WhileStatement visitWhileStmtAlt(WhileStmtAltContext ctx) {
+        Expression conditionExpression = this.visitParExpression(ctx.parExpression());
+        BooleanExpression booleanExpression =
+                this.configureAST(
+                        new BooleanExpression(conditionExpression), conditionExpression);
+
+        Statement loopBlock = this.unpackStatement((Statement) this.visit(ctx.statement()));
+
+        return this.configureAST(
+                new WhileStatement(booleanExpression, asBoolean(loopBlock) ? loopBlock : EmptyStatement.INSTANCE),
+                ctx);
+    }
+
+    @Override
+    public DoWhileStatement visitDoWhileStmtAlt(DoWhileStmtAltContext ctx) {
+        Expression conditionExpression = this.visitParExpression(ctx.parExpression());
+
+        BooleanExpression booleanExpression =
+                this.configureAST(
+                        new BooleanExpression(conditionExpression),
+                        conditionExpression
+                );
+
+        Statement loopBlock = this.unpackStatement((Statement) this.visit(ctx.statement()));
+
+        return this.configureAST(
+                new DoWhileStatement(booleanExpression, asBoolean(loopBlock) ? loopBlock : EmptyStatement.INSTANCE),
+                ctx);
+    }
+
+    @Override
+    public Statement visitTryCatchStmtAlt(TryCatchStmtAltContext ctx) {
+        return this.configureAST(this.visitTryCatchStatement(ctx.tryCatchStatement()), ctx);
+    }
+
+    @Override
+    public Statement visitTryCatchStatement(TryCatchStatementContext ctx) {
+        TryCatchStatement tryCatchStatement =
+                new TryCatchStatement((Statement) this.visit(ctx.block()),
+                        this.visitFinallyBlock(ctx.finallyBlock()));
+
+        if (asBoolean(ctx.resources())) {
+            this.visitResources(ctx.resources()).forEach(tryCatchStatement::addResource);
+        }
+
+        ctx.catchClause().stream().map(this::visitCatchClause)
+                .reduce(new LinkedList<CatchStatement>(), (r, e) -> {
+                    r.addAll(e); // merge several LinkedList<CatchStatement> instances into one LinkedList<CatchStatement> instance
+                    return r;
+                })
+                .forEach(tryCatchStatement::addCatch);
+
+        return this.configureAST(
+                tryWithResourcesASTTransformation.transform(
+                        this.configureAST(tryCatchStatement, ctx)),
+                ctx);
+    }
+
+
+    @Override
+    public List<ExpressionStatement> visitResources(ResourcesContext ctx) {
+        return this.visitResourceList(ctx.resourceList());
+    }
+
+    @Override
+    public List<ExpressionStatement> visitResourceList(ResourceListContext ctx) {
+        return ctx.resource().stream().map(this::visitResource).collect(Collectors.toList());
+    }
+
+    @Override
+    public ExpressionStatement visitResource(ResourceContext ctx) {
+        if (asBoolean(ctx.localVariableDeclaration())) {
+            List<ExpressionStatement> declarationStatements = this.visitLocalVariableDeclaration(ctx.localVariableDeclaration()).getDeclarationStatements();
+
+            if (declarationStatements.size() > 1) {
+                throw createParsingFailedException("Multi resources can not be declared in one statement", ctx);
+            }
+
+            return declarationStatements.get(0);
+        } else if (asBoolean(ctx.expression())) {
+            Expression expression = (Expression) this.visit(ctx.expression());
+            if (!(expression instanceof BinaryExpression
+                    && Types.ASSIGN == ((BinaryExpression) expression).getOperation().getType()
+                    && ((BinaryExpression) expression).getLeftExpression() instanceof VariableExpression)) {
+
+                throw createParsingFailedException("Only variable declarations are allowed to declare resource", ctx);
+            }
+
+            BinaryExpression assignmentExpression = (BinaryExpression) expression;
+
+            return this.configureAST(
+                    new ExpressionStatement(
+                            this.configureAST(
+                                    new DeclarationExpression(
+                                            this.configureAST(
+                                                    new VariableExpression(assignmentExpression.getLeftExpression().getText()),
+                                                    assignmentExpression.getLeftExpression()
+                                            ),
+                                            assignmentExpression.getOperation(),
+                                            assignmentExpression.getRightExpression()
+                                    ), ctx)
+                    ), ctx);
+        }
+
+        throw createParsingFailedException("Unsupported resource declaration: " + ctx.getText(), ctx);
+    }
+
+    /**
+     * Multi-catch(1..*) clause will be unpacked to several normal catch clauses, so the return type is List
+     *
+     * @param ctx the parse tree
+     * @return
+     */
+    @Override
+    public List<CatchStatement> visitCatchClause(CatchClauseContext ctx) {
+        // FIXME Groovy will ignore variableModifier of parameter in the catch clause
+        // In order to make the new parser behave same with the old one, we do not process variableModifier*
+
+        return this.visitCatchType(ctx.catchType()).stream()
+                .map(e -> this.configureAST(
+                        new CatchStatement(
+                                // FIXME The old parser does not set location info for the parameter of the catch clause.
+                                // we could make it better
+                                //this.configureAST(new Parameter(e, this.visitIdentifier(ctx.identifier())), ctx.Identifier()),
+
+                                new Parameter(e, this.visitIdentifier(ctx.identifier())),
+                                this.visitBlock(ctx.block())),
+                        ctx.block()))
+                .collect(Collectors.toList());
+    }
+
+    @Override
+    public List<ClassNode> visitCatchType(CatchTypeContext ctx) {
+        if (!asBoolean(ctx)) {
+            return Collections.singletonList(ClassHelper.OBJECT_TYPE);
+        }
+
+        return ctx.qualifiedClassName().stream()
+                .map(this::visitQualifiedClassName)
+                .collect(Collectors.toList());
+    }
+
+
+    @Override
+    public Statement visitFinallyBlock(FinallyBlockContext ctx) {
+        if (!asBoolean(ctx)) {
+            return EmptyStatement.INSTANCE;
+        }
+
+        return this.configureAST(
+                this.createBlockStatement((Statement) this.visit(ctx.block())),
+                ctx);
+    }
+
+    @Override
+    public SwitchStatement visitSwitchStmtAlt(SwitchStmtAltContext ctx) {
+        return this.configureAST(this.visitSwitchStatement(ctx.switchStatement()), ctx);
+    }
+
+    public SwitchStatement visitSwitchStatement(SwitchStatementContext ctx) {
+        List<Statement> statementList =
+                ctx.switchBlockStatementGroup().stream()
+                        .map(this::visitSwitchBlockStatementGroup)
+                        .reduce(new LinkedList<>(), (r, e) -> {
+                            r.addAll(e);
+                            return r;
+                        });
+
+        List<CaseStatement> caseStatementList = new LinkedList<>();
+        List<Statement> defaultStatementList = new LinkedList<>();
+
+        statementList.forEach(e -> {
+            if (e instanceof CaseStatement) {
+                caseStatementList.add((CaseStatement) e);
+            } else if (isTrue(e, IS_SWITCH_DEFAULT)) {
+                defaultStatementList.add(e);
+            }
+        });
+
+        int defaultStatementListSize = defaultStatementList.size();
+        if (defaultStatementListSize > 1) {
+            throw createParsingFailedException("switch statement should have only one default case, which should appear at last", defaultStatementList.get(0));
+        }
+
+        if (defaultStatementListSize > 0 && last(statementList) instanceof CaseStatement) {
+            throw createParsingFailedException("default case should appear at last", defaultStatementList.get(0));
+        }
+
+        return this.configureAST(
+                new SwitchStatement(
+                        this.visitParExpression(ctx.parExpression()),
+                        caseStatementList,
+                        defaultStatementListSize == 0 ? EmptyStatement.INSTANCE : defaultStatementList.get(0)
+                ),
+                ctx);
+
+    }
+
+
+    @Override
+    @SuppressWarnings({"unchecked"})
+    public List<Statement> visitSwitchBlockStatementGroup(SwitchBlockStatementGroupContext ctx) {
+        int labelCnt = ctx.switchLabel().size();
+        List<Token> firstLabelHolder = new ArrayList<>(1);
+
+        return (List<Statement>) ctx.switchLabel().stream()
+                .map(e -> (Object) this.visitSwitchLabel(e))
+                .reduce(new ArrayList<Statement>(4), (r, e) -> {
+                    List<Statement> statementList = (List<Statement>) r;
+                    Pair<Token, Expression> pair = (Pair<Token, Expression>) e;
+
+                    boolean isLast = labelCnt - 1 == statementList.size();
+
+                    switch (pair.getKey().getType()) {
+                        case CASE: {
+                            if (!asBoolean(statementList)) {
+                                firstLabelHolder.add(pair.getKey());
+                            }
+
+                            statementList.add(
+                                    this.configureAST(
+                                            new CaseStatement(
+                                                    pair.getValue(),
+
+                                                    // check whether processing the last label. if yes, block statement should be attached.
+                                                    isLast ? this.visitBlockStatements(ctx.blockStatements())
+                                                            : EmptyStatement.INSTANCE
+                                            ),
+                                            firstLabelHolder.get(0)));
+
+                            break;
+                        }
+                        case DEFAULT: {
+
+                            BlockStatement blockStatement = this.visitBlockStatements(ctx.blockStatements());
+                            blockStatement.putNodeMetaData(IS_SWITCH_DEFAULT, true);
+
+                            statementList.add(
+                                    // this.configureAST(blockStatement, pair.getKey())
+                                    blockStatement
+                            );
+
+                            break;
+                        }
+                    }
+
+                    return statementList;
+                });
+
+    }
+
+    @Override
+    public Pair<Token, Expression> visitSwitchLabel(SwitchLabelContext ctx) {
+        if (asBoolean(ctx.CASE())) {
+            return new Pair<>(ctx.CASE().getSymbol(), (Expression) this.visit(ctx.expression()));
+        } else if (asBoolean(ctx.DEFAULT())) {
+            return new Pair<>(ctx.DEFAULT().getSymbol(), EmptyExpression.INSTANCE);
+        }
+
+        throw createParsingFailedException("Unsupported switch label: " + ctx.getText(), ctx);
+    }
+
+
+    @Override
+    public SynchronizedStatement visitSynchronizedStmtAlt(SynchronizedStmtAltContext ctx) {
+        return this.configureAST(
+                new SynchronizedStatement(this.visitParExpression(ctx.parExpression()), this.visitBlock(ctx.block())),
+                ctx);
+    }
+
+
+    @Override
+    public ExpressionStatement visitExpressionStmtAlt(ExpressionStmtAltContext ctx) {
+        return (ExpressionStatement) this.visit(ctx.statementExpression());
+    }
+
+    @Override
+    public ReturnStatement visitReturnStmtAlt(ReturnStmtAltContext ctx) {
+        return this.configureAST(new ReturnStatement(asBoolean(ctx.expression())
+                        ? (Expression) this.visit(ctx.expression())
+                        : ConstantExpression.EMPTY_EXPRESSION),
+                ctx);
+    }
+
+    @Override
+    public ThrowStatement visitThrowStmtAlt(ThrowStmtAltContext ctx) {
+        return this.configureAST(
+                new ThrowStatement((Expression) this.visit(ctx.expression())),
+                ctx);
+    }
+
+    @Override
+    public Statement visitLabeledStmtAlt(LabeledStmtAltContext ctx) {
+        Statement statement = (Statement) this.visit(ctx.statement());
+
+        statement.addStatementLabel(this.visitIdentifier(ctx.identifier()));
+
+        return statement; // this.configureAST(statement, ctx);
+    }
+
+    @Override
+    public BreakStatement visitBreakStatement(BreakStatementContext ctx) {
+        String label = asBoolean(ctx.identifier())
+                ? this.visitIdentifier(ctx.identifier())
+                : null;
+
+        return this.configureAST(new BreakStatement(label), ctx);
+    }
+
+    @Override
+    public BreakStatement visitBreakStmtAlt(BreakStmtAltContext ctx) {
+        return this.configureAST(this.visitBreakStatement(ctx.breakStatement()), ctx);
+    }
+
+    @Override
+    public ContinueStatement visitContinueStatement(ContinueStatementContext ctx) {
+        String label = asBoolean(ctx.identifier())
+                ? this.visitIdentifier(ctx.identifier())
+                : null;
+
+        return this.configureAST(new ContinueStatement(label), ctx);
+
+    }
+
+    @Override
+    public ContinueStatement visitContinueStmtAlt(ContinueStmtAltContext ctx) {
+        return this.configureAST(this.visitContinueStatement(ctx.continueStatement()), ctx);
+    }
+
+    @Override
+    public ImportNode visitImportStmtAlt(ImportStmtAltContext ctx) {
+        return this.configureAST(this.visitImportDeclaration(ctx.importDeclaration()), ctx);
+    }
+
+    @Override
+    public ClassNode visitTypeDeclarationStmtAlt(TypeDeclarationStmtAltContext ctx) {
+        return this.configureAST(this.visitTypeDeclaration(ctx.typeDeclaration()), ctx);
+    }
+
+
+    @Override
+    public Statement visitLocalVariableDeclarationStmtAlt(LocalVariableDeclarationStmtAltContext ctx) {
+        return this.configureAST(this.visitLocalVariableDeclaration(ctx.localVariableDeclaration()), ctx);
+    }
+
+    @Override
+    public MethodNode visitMethodDeclarationStmtAlt(MethodDeclarationStmtAltContext ctx) {
+        return this.configureAST(this.visitMethodDeclaration(ctx.methodDeclaration()), ctx);
+    }
+
+    // } statement    --------------------------------------------------------------------
+
+    @Override
+    public ClassNode visitTypeDeclaration(TypeDeclarationContext ctx) {
+        if (asBoolean(ctx.classDeclaration())) { // e.g. class A {}
+            ctx.classDeclaration().putNodeMetaData(TYPE_DECLARATION_MODIFIERS, this.visitClassOrInterfaceModifiersOpt(ctx.classOrInterfaceModifiersOpt()));
+            return this.configureAST(this.visitClassDeclaration(ctx.classDeclaration()), ctx);
+        }
+
+        throw createParsingFailedException("Unsupported type declaration: " + ctx.getText(), ctx);
+    }
+
+    private void initUsingGenerics(ClassNode classNode) {
+        if (classNode.isUsingGenerics()) {
+            return;
+        }
+
+        if (!classNode.isEnum()) {
+            classNode.setUsingGenerics(classNode.getSuperClass().isUsingGenerics());
+        }
+
+        if (!classNode.isUsingGenerics() && asBoolean((Object) classNode.getInterfaces())) {
+            for (ClassNode anInterface : classNode.getInterfaces()) {
+                classNode.setUsingGenerics(classNode.isUsingGenerics() || anInterface.isUsingGenerics());
+
+                if (classNode.isUsingGenerics())
+                    break;
+            }
+        }
+    }
+
+    @Override
+    public ClassNode visitClassDeclaration(ClassDeclarationContext ctx) {
+        String packageName = moduleNode.getPackageName();
+        packageName = asBoolean((Object) packageName) ? packageName : "";
+
+        List<ModifierNode> modifierNodeList = ctx.getNodeMetaData(TYPE_DECLARATION_MODIFIERS);
+        Objects.requireNonNull(modifierNodeList, "modifierNodeList should not be null");
+
+        ModifierManager modifierManager = new ModifierManager(this, modifierNodeList);
+        int modifiers = modifierManager.getClassModifiersOpValue();
+
+        boolean syntheticPublic = ((modifiers & Opcodes.ACC_SYNTHETIC) != 0);
+        modifiers &= ~Opcodes.ACC_SYNTHETIC;
+
+        final ClassNode outerClass = classNodeStack.peek();
+        ClassNode classNode;
+        String className = this.visitIdentifier(ctx.identifier());
+        if (asBoolean(ctx.ENUM())) {
+            classNode =
+                    EnumHelper.makeEnumNode(
+                            asBoolean(outerClass) ? className : packageName + className,
+                            modifiers, null, outerClass);
+        } else {
+            if (asBoolean(outerClass)) {
+                classNode =
+                        new InnerClassNode(
+                                outerClass,
+                                outerClass.getName() + "$" + className,
+                                modifiers | (outerClass.isInterface() ? Opcodes.ACC_STATIC : 0),
+                                ClassHelper.OBJECT_TYPE);
+            } else {
+                classNode =
+                        new ClassNode(
+                                packageName + className,
+                                modifiers,
+                                ClassHelper.OBJECT_TYPE);
+            }
+
+        }
+
+        this.configureAST(classNode, ctx);
+        classNode.putNodeMetaData(CLASS_NAME, className);
+        classNode.setSyntheticPublic(syntheticPublic);
+
+        if (asBoolean(ctx.TRAIT())) {
+            classNode.addAnnotation(new AnnotationNode(ClassHelper.make(GROOVY_TRANSFORM_TRAIT)));
+        }
+        classNode.addAnnotations(modifierManager.getAnnotations());
+        classNode.setGenericsTypes(this.visitTypeParameters(ctx.typeParameters()));
+
+        boolean isInterface = asBoolean(ctx.INTERFACE()) && !asBoolean(ctx.AT());
+        boolean isInterfaceWithDefaultMethods = false;
+
+        // declaring interface with default method
+        if (isInterface && this.containsDefaultMethods(ctx)) {
+            isInterfaceWithDefaultMethods = true;
+            classNode.addAnnotation(new AnnotationNode(ClassHelper.make(GROOVY_TRANSFORM_TRAIT)));
+            classNode.putNodeMetaData(IS_INTERFACE_WITH_DEFAULT_METHODS, true);
+        }
+
+        if (asBoolean(ctx.CLASS()) || asBoolean(ctx.TRAIT()) || isInterfaceWithDefaultMethods) { // class OR trait OR interface with default methods
+            classNode.setSuperClass(this.visitType(ctx.sc));
+            classNode.setInterfaces(this.visitTypeList(ctx.is));
+
+            this.initUsingGenerics(classNode);
+        } else if (isInterface) { // interface(NOT annotation)
+            classNode.setModifiers(classNode.getModifiers() | Opcodes.ACC_INTERFACE | Opcodes.ACC_ABSTRACT);
+
+            classNode.setSuperClass(ClassHelper.OBJECT_TYPE);
+            classNode.setInterfaces(this.visitTypeList(ctx.scs));
+
+            this.initUsingGenerics(classNode);
+
+            this.hackMixins(classNode);
+        } else if (asBoolean(ctx.ENUM())) { // enum
+            classNode.setModifiers(classNode.getModifiers() | Opcodes.ACC_ENUM | Opcodes.ACC_FINAL);
+
+            classNode.setInterfaces(this.visitTypeList(ctx.is));
+
+            this.initUsingGenerics(classNode);
+        } else if (asBoolean(ctx.AT())) { // annotation
+            classNode.setModifiers(classNode.getModifiers() | Opcodes.ACC_INTERFACE | Opcodes.ACC_ABSTRACT | Opcodes.ACC_ANNOTATION);
+
+            classNode.addInterface(ClassHelper.Annotation_TYPE);
+
+            this.hackMixins(classNode);
+        } else {
+            throw createParsingFailedException("Unsupported class declaration: " + ctx.getText(), ctx);
+        }
+
+        // we put the class already in output to avoid the most inner classes
+        // will be used as first class later in the loader. The first class
+        // there determines what GCL#parseClass for example will return, so we
+        // have here to ensure it won't be the inner class
+        if (asBoolean(ctx.CLASS()) || asBoolean(ctx.TRAIT())) {
+            classNodeList.add(classNode);
+        }
+
+        int oldAnonymousInnerClassCounter = this.anonymousInnerClassCounter;
+        classNodeStack.push(classNode);
+        ctx.classBody().putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
+        this.visitClassBody(ctx.classBody());
+        classNodeStack.pop();
+        this.anonymousInnerClassCounter = oldAnonymousInnerClassCounter;
+
+        if (!(asBoolean(ctx.CLASS()) || asBoolean(ctx.TRAIT()))) {
+            classNodeList.add(classNode);
+        }
+
+        groovydocManager.handle(classNode, ctx);
+
+        return classNode;
+    }
+
+    @SuppressWarnings({"unchecked"})
+    private boolean containsDefaultMethods(ClassDeclarationContext ctx) {
+        List<MethodDeclarationContext> methodDeclarationContextList =
+                (List<MethodDeclarationContext>) ctx.classBody().classBodyDeclaration().stream()
+                .map(ClassBodyDeclarationContext::memberDeclaration)
+                .filter(Objects::nonNull)
+                .map(e -> (Object) e.methodDeclaration())
+                .filter(Objects::nonNull).reduce(new LinkedList<MethodDeclarationContext>(), (r, e) -> {
+                    MethodDeclarationContext methodDeclarationContext = (MethodDeclarationContext) e;
+
+                    if (createModifierManager(methodDeclarationContext).contains(DEFAULT)) {
+                        ((List) r).add(methodDeclarationContext);
+                    }
+
+                    return r;
+        });
+
+        return !methodDeclarationContextList.isEmpty();
+    }
+
+    @Override
+    public Void visitClassBody(ClassBodyContext ctx) {
+        ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);
+        Objects.requireNonNull(classNode, "classNode should not be null");
+
+        if (asBoolean(ctx.enumConstants())) {
+            ctx.enumConstants().putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
+            this.visitEnumConstants(ctx.enumConstants());
+        }
+
+        ctx.classBodyDeclaration().forEach(e -> {
+            e.putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
+            this.visitClassBodyDeclaration(e);
+        });
+
+        return null;
+    }
+
+    @Override
+    public List<FieldNode> visitEnumConstants(EnumConstantsContext ctx) {
+        ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);
+        Objects.requireNonNull(classNode, "classNode should not be null");
+
+        return ctx.enumConstant().stream()
+                .map(e -> {
+                    e.putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
+                    return this.visitEnumConstant(e);
+                })
+                .collect(Collectors.toList());
+    }
+
+    @Override
+    public FieldNode visitEnumConstant(EnumConstantContext ctx) {
+        ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);
+        Objects.requireNonNull(classNode, "classNode should not be null");
+
+        InnerClassNode anonymousInnerClassNode = null;
+        if (asBoolean(ctx.anonymousInnerClassDeclaration())) {
+            ctx.anonymousInnerClassDeclaration().putNodeMetaData(ANONYMOUS_INNER_CLASS_SUPER_CLASS, classNode);
+            anonymousInnerClassNode = this.visitAnonymousInnerClassDeclaration(ctx.anonymousInnerClassDeclaration());
+        }
+
+        FieldNode enumConstant =
+                EnumHelper.addEnumConstant(
+                        classNode,
+                        this.visitIdentifier(ctx.identifier()),
+                        createEnumConstantInitExpression(ctx.arguments(), anonymousInnerClassNode));
+
+        this.visitAnnotationsOpt(ctx.annotationsOpt()).forEach(enumConstant::addAnnotation);
+
+        groovydocManager.handle(enumConstant, ctx);
+
+        return this.configureAST(enumConstant, ctx);
+    }
+
+    private Expression createEnumConstantInitExpression(ArgumentsContext ctx, InnerClassNode anonymousInnerClassNode) {
+        if (!asBoolean(ctx) && !asBoolean(anonymousInnerClassNode)) {
+            return null;
+        }
+
+        TupleExpression argumentListExpression = (TupleExpression) this.visitArguments(ctx);
+        List<Expression> expressions = argumentListExpression.getExpressions();
+
+        if (expressions.size() == 1) {
+            Expression expression = expressions.get(0);
+
+            if (expression instanceof NamedArgumentListExpression) { // e.g. SOME_ENUM_CONSTANT(a: "1", b: "2")
+                List<MapEntryExpression> mapEntryExpressionList = ((NamedArgumentListExpression) expression).getMapEntryExpressions();
+                ListExpression listExpression =
+                        new ListExpression(
+                                mapEntryExpressionList.stream()
+                                        .map(e -> (Expression) e)
+                                        .collect(Collectors.toList()));
+
+                if (asBoolean(anonymousInnerClassNode)) {
+                    listExpression.addExpression(
+                            this.configureAST(
+                                    new ClassExpression(anonymousInnerClassNode),
+                                    anonymousInnerClassNode));
+                }
+
+                if (mapEntryExpressionList.size() > 1) {
+                    listExpression.setWrapped(true);
+                }
+
+                return this.configureAST(listExpression, ctx);
+            }
+
+            if (!asBoolean(anonymousInnerClassNode)) {
+                if (expression instanceof ListExpression) {
+                    ListExpression listExpression = new ListExpression();
+                    listExpression.addExpression(expression);
+
+                    return this.configureAST(listExpression, ctx);
+                }
+
+                return expression;
+            }
+
+            ListExpression listExpression = new ListExpression();
+
+            if (expression instanceof ListExpression) {
+                ((ListExpression) expression).getExpressions().forEach(listExpression::addExpression);
+            } else {
+                listExpression.addExpression(expression);
+            }
+
+            listExpression.addExpression(
+                    this.configureAST(
+                            new ClassExpression(anonymousInnerClassNode),
+                            anonymousInnerClassNode));
+
+            return this.configureAST(listExpression, ctx);
+        }
+
+        ListExpression listExpression = new ListExpression(expressions);
+        if (asBoolean(anonymousInnerClassNode)) {
+            listExpression.addExpression(
+                    this.configureAST(
+                            new ClassExpression(anonymousInnerClassNode),
+                            anonymousInnerClassNode));
+        }
+
+        if (asBoolean(ctx)) {
+            listExpression.setWrapped(true);
+        }
+
+        return asBoolean(ctx)
+                ? this.configureAST(listExpression, ctx)
+                : this.configureAST(listExpression, anonymousInnerClassNode);
+    }
+
+
+    @Override
+    public Void visitClassBodyDeclaration(ClassBodyDeclarationContext ctx) {
+        ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);
+        Objects.requireNonNull(classNode, "classNode should not be null");
+
+        if (asBoolean(ctx.memberDeclaration())) {
+            ctx.memberDeclaration().putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
+            this.visitMemberDeclaration(ctx.memberDeclaration());
+        } else if (asBoolean(ctx.block())) {
+            Statement statement = this.visitBlock(ctx.block());
+
+            if (asBoolean(ctx.STATIC())) { // e.g. static { }
+                classNode.addStaticInitializerStatements(Collections.singletonList(statement), false);
+            } else { // e.g.  { }
+                classNode.addObjectInitializerStatements(
+                        this.configureAST(
+                                this.createBlockStatement(statement),
+                                statement));
+            }
+        }
+
+        return null;
+    }
+
+    @Override
+    public Void visitMemberDeclaration(MemberDeclarationContext ctx) {
+        ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);
+        Objects.requireNonNull(classNode, "classNode should not be null");
+
+        if (asBoolean(ctx.methodDeclaration())) {
+            ctx.methodDeclaration().putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
+            this.visitMethodDeclaration(ctx.methodDeclaration());
+        } else if (asBoolean(ctx.fieldDeclaration())) {
+            ctx.fieldDeclaration().putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
+            this.visitFieldDeclaration(ctx.fieldDeclaration());
+        } else if (asBoolean(ctx.classDeclaration())) {
+            ctx.classDeclaration().putNodeMetaData(TYPE_DECLARATION_MODIFIERS, this.visitModifiersOpt(ctx.modifiersOpt()));
+            ctx.classDeclaration().putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
+            this.visitClassDeclaration(ctx.classDeclaration());
+        }
+
+        return null;
+    }
+
+    @Override
+    public GenericsType[] visitTypeParameters(TypeParametersContext ctx) {
+        if (!asBoolean(ctx)) {
+            return null;
+        }
+
+        return ctx.typeParameter().stream()
+                .map(this::visitTypeParameter)
+                .toArray(GenericsType[]::new);
+    }
+
+    @Override
+    public GenericsType visitTypeParameter(TypeParameterContext ctx) {
+        return this.configureAST(
+                new GenericsType(
+                        ClassHelper.make(this.visitClassName(ctx.className())),
+                        this.visitTypeBound(ctx.typeBound()),
+                        null
+                ),
+                ctx);
+    }
+
+    @Override
+    public ClassNode[] visitTypeBound(TypeBoundContext ctx) {
+        if (!asBoolean(ctx)) {
+            return null;
+        }
+
+        return ctx.type().stream()
+                .map(this::visitType)
+                .toArray(ClassNode[]::new);
+    }
+
+    @Override
+    public Void visitFieldDeclaration(FieldDeclarationContext ctx) {
+        ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);
+        Objects.requireNonNull(classNode, "classNode should not be null");
+
+        ctx.variableDeclaration().putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
+        this.visitVariableDeclaration(ctx.variableDeclaration());
+
+        return null;
+    }
+
+    private ConstructorCallExpression checkThisAndSuperConstructorCall(Statement statement) {
+        if (!(statement instanceof BlockStatement)) { // method code must be a BlockStatement
+            return null;
+        }
+
+        BlockStatement blockStatement = (BlockStatement) statement;
+        List<Statement> statementList = blockStatement.getStatements();
+
+        for (int i = 0, n = statementList.size(); i < n; i++) {
+            Statement s = statementList.get(i);
+            if (s instanceof ExpressionStatement) {
+                Expression expression = ((ExpressionStatement) s).getExpression();
+                if ((expression instanceof ConstructorCallExpression) && 0 != i) {
+                    return (ConstructorCallExpression) expression;
+                }
+            }
+        }
+
+        return null;
+    }
+
+    private ModifierManager createModifierManager(MethodDeclarationContext ctx) {
+        List<ModifierNode> modifierNodeList = Collections.emptyList();
+
+        if (asBoolean(ctx.modifiers())) {
+            modifierNodeList = this.visitModifiers(ctx.modifiers());
+        } else if (asBoolean(ctx.modifiersOpt())) {
+            modifierNodeList = this.visitModifiersOpt(ctx.modifiersOpt());
+        }
+
+        return new ModifierManager(this, modifierNodeList);
+    }
+
+    private void validateParametersOfMethodDeclaration(Parameter[] parameters, ClassNode classNode) {
+        if (!classNode.isInterface()) {
+            return;
+        }
+
+        Arrays.stream(parameters).forEach(e -> {
+            if (e.hasInitialExpression()) {
+                throw createParsingFailedException("Cannot specify default value for method parameter '" + e.getName() + " = " + e.getInitialExpression().getText() + "' inside an interface", e);
+            }
+        });
+    }
+
+    @Override
+    public MethodNode visitMethodDeclaration(MethodDeclarationContext ctx) {
+        ModifierManager modifierManager = createModifierManager(ctx);
+        String methodName = this.visitMethodName(ctx.methodName());
+        ClassNode returnType = this.visitReturnType(ctx.returnType());
+        Parameter[] parameters = this.visitFormalParameters(ctx.formalParameters());
+        ClassNode[] exceptions = this.visitQualifiedClassNameList(ctx.qualifiedClassNameList());
+
+        anonymousInnerClassesDefinedInMethodStack.push(new LinkedList<>());
+        Statement code = this.visitMethodBody(ctx.methodBody());
+        List<InnerClassNode> anonymousInnerClassList = anonymousInnerClassesDefinedInMethodStack.pop();
+
+        MethodNode methodNode;
+        // if classNode is not null, the method declaration is for class declaration
+        ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);
+        if (asBoolean(classNode)) {
+            validateParametersOfMethodDeclaration(parameters, classNode);
+
+            methodNode = createConstructorOrMethodNodeForClass(ctx, modifierManager, methodName, returnType, parameters, exceptions, code, classNode);
+        } else { // script method declaration
+            methodNode = createScriptMethodNode(modifierManager, methodName, returnType, parameters, exceptions, code);
+        }
+        anonymousInnerClassList.forEach(e -> e.setEnclosingMethod(methodNode));
+
+        methodNode.setGenericsTypes(this.visitTypeParameters(ctx.typeParameters()));
+        methodNode.setSyntheticPublic(
+                this.isSyntheticPublic(
+                        this.isAnnotationDeclaration(classNode),
+                        classNode instanceof EnumConstantClassNode,
+                        asBoolean(ctx.returnType()),
+                        modifierManager));
+
+        if (modifierManager.contains(STATIC)) {
+            Arrays.stream(methodNode.getParameters()).forEach(e -> e.setInStaticContext(true));
+            methodNode.getVariableScope().setInStaticContext(true);
+        }
+
+        this.configureAST(methodNode, ctx);
+
+        validateMethodDeclaration(ctx, methodNode, modifierManager, classNode);
+
+        groovydocManager.handle(methodNode, ctx);
+
+        return methodNode;
+    }
+
+    private void validateMethodDeclaration(MethodDeclarationContext ctx, MethodNode methodNode, ModifierManager modifierManager, ClassNode classNode) {
+        boolean isAbstractMethod = methodNode.isAbstract();
+        boolean hasMethodBody = asBoolean(methodNode.getCode());
+
+        if (9 == ctx.ct) { // script
+            if (isAbstractMethod || !hasMethodBody) { // method should not be declared abstract in the script
+                throw createParsingFailedException("You can not define a " + (isAbstractMethod ? "abstract" : "") + " method[" + methodNode.getName() + "] " + (!hasMethodBody ? "without method body" : "") + " in the script. Try " + (isAbstractMethod ? "removing the 'abstract'" : "") + (isAbstractMethod && !hasMethodBody ? " and" : "") + (!hasMethodBody ? " adding a method body" : ""), methodNode);
+            }
+        } else {
+            if (!isAbstractMethod && !hasMethodBody) { // non-abstract method without body in the non-script(e.g. class, enum, trait) is not allowed!
+                throw createParsingFailedException("You defined a method[" + methodNode.getName() + "] without body. Try adding a method body, or declare it abstract", methodNode);
+            }
+
+            boolean isInterfaceOrAbstractClass = asBoolean(classNode) && classNode.isAbstract() && !classNode.isAnnotationDefinition();
+            if (isInterfaceOrAbstractClass && !modifierManager.contains(DEFAULT) && isAbstractMethod && hasMethodBody) {
+                throw createParsingFailedException("You defined an abstract method[" + methodNode.getName() + "] with body. Try removing the method body" + (classNode.isInterface() ? ", or declare it default" : ""), methodNode);
+            }
+        }
+
+        modifierManager.validate(methodNode);
+
+        if (methodNode instanceof ConstructorNode) {
+            modifierManager.validate((ConstructorNode) methodNode);
+        }
+    }
+
+    private MethodNode createScriptMethodNode(ModifierManager modifierManager, String methodName, ClassNode returnType, Parameter[] parameters, ClassNode[] exceptions, Statement code) {
+        MethodNode methodNode;
+        methodNode =
+                new MethodNode(
+                        methodName,
+                        modifierManager.contains(PRIVATE) ? Opcodes.ACC_PRIVATE : Opcodes.ACC_PUBLIC,
+                        returnType,
+                        parameters,
+                        exceptions,
+                        code);
+
+        modifierManager.processMethodNode(methodNode);
+        return methodNode;
+    }
+
+    private MethodNode createConstructorOrMethodNodeForClass(MethodDeclarationContext ctx, ModifierManager modifierManager, String methodName, ClassNode returnType, Parameter[] parameters, ClassNode[] exceptions, Statement code, ClassNode classNode) {
+        MethodNode methodNode;
+        String className = classNode.getNodeMetaData(CLASS_NAME);
+        int modifiers = modifierManager.getClassMemberModifiersOpValue();
+
+        if (!asBoolean(ctx.returnType())
+                && asBoolean(ctx.methodBody())
+                && methodName.equals(className)) { // constructor declaration
+
+            methodNode = createConstructorNodeForClass(methodName, parameters, exceptions, code, classNode, modifiers);
+        } else { // class memeber method declaration
+            methodNode = createMethodNodeForClass(ctx, modifierManager, methodName, returnType, parameters, exceptions, code, classNode, modifiers);
+        }
+
+        modifierManager.attachAnnotations(methodNode);
+        return methodNode;
+    }
+
+    private MethodNode createMethodNodeForClass(MethodDeclarationContext ctx, ModifierManager modifierManager, String methodName, ClassNode returnType, Parameter[] parameters, ClassNode[] exceptions, Statement code, ClassNode classNode, int modifiers) {
+        MethodNode methodNode;
+        if (asBoolean(ctx.elementValue())) { // the code of annotation method
+            code = this.configureAST(
+                    new ExpressionStatement(
+                            this.visitElementValue(ctx.elementValue())),
+                    ctx.elementValue());
+
+        }
+
+        modifiers |= !modifierManager.contains(STATIC) && (classNode.isInterface() || (isTrue(classNode, IS_INTERFACE_WITH_DEFAULT_METHODS) && !modifierManager.contains(DEFAULT))) ? Opcodes.ACC_ABSTRACT : 0;
+
+        checkWhetherMethodNodeWithSameSignatureExists(classNode, methodName, parameters, ctx);
+
+        methodNode = classNode.addMethod(methodName, modifiers, returnType, parameters, exceptions, code);
+
+        methodNode.setAnnotationDefault(asBoolean(ctx.elementValue()));
+        return methodNode;
+    }
+
+    private void checkWhetherMethodNodeWithSameSignatureExists(ClassNode classNode, String methodName, Parameter[] parameters, MethodDeclarationContext ctx) {
+        MethodNode sameSigMethodNode = classNode.getDeclaredMethod(methodName, parameters);
+
+        if (null == sameSigMethodNode) {
+            return;
+        }
+
+        throw createParsingFailedException("The method " +  sameSigMethodNode.getText() + " duplicates another method of the same signature", ctx);
+    }
+
+    private ConstructorNode createConstructorNodeForClass(String methodName, Parameter[] parameters, ClassNode[] exceptions, Statement code, ClassNode classNode, int modifiers) {
+        ConstructorCallExpression thisOrSuperConstructorCallExpression = this.checkThisAndSuperConstructorCall(code);
+        if (asBoolean(thisOrSuperConstructorCallExpression)) {
+            throw createParsingFailedException(thisOrSuperConstructorCallExpression.getText() + " should be the first statement in the constructor[" + methodName + "]", thisOrSuperConstructorCallExpression);
+        }
+
+        return classNode.addConstructor(
+                modifiers,
+                parameters,
+                exceptions,
+                code);
+    }
+
+    @Override
+    public String visitMethodName(MethodNameContext ctx) {
+        if (asBoolean(ctx.identifier())) {
+            return this.visitIdentifier(ctx.identifier());
+        }
+
+        if (asBoolean(ctx.stringLiteral())) {
+            return this.visitStringLiteral(ctx.stringLiteral()).getText();
+        }
+
+        throw createParsingFailedException("Unsupported method name: " + ctx.getText(), ctx);
+    }
+
+    @Override
+    public ClassNode visitReturnType(ReturnTypeContext ctx) {
+        if (!asBoolean(ctx)) {
+            return ClassHelper.OBJECT_TYPE;
+        }
+
+        if (asBoolean(ctx.type())) {
+            return this.visitType(ctx.type());
+        }
+
+        if (asBoolean(ctx.VOID())) {
+            return ClassHelper.VOID_TYPE;
+        }
+
+        throw createParsingFailedException("Unsupported return type: " + ctx.getText(), ctx);
+    }
+
+    @Override
+    public Statement visitMethodBody(MethodBodyContext ctx) {
+        if (!asBoolean(ctx)) {
+            return null;
+        }
+
+        return this.configureAST(this.visitBlock(ctx.block()), ctx);
+    }
+
+    @Override
+    public DeclarationListStatement visitLocalVariableDeclaration(LocalVariableDeclarationContext ctx) {
+        return this.configureAST(this.visitVariableDeclaration(ctx.variableDeclaration()), ctx);
+    }
+
+    private ModifierManager createModifierManager(VariableDeclarationContext ctx) {
+        List<ModifierNode> modifierNodeList = Collections.emptyList();
+
+        if (asBoolean(ctx.variableModifiers())) {
+            modifierNodeList = this.visitVariableModifiers(ctx.variableModifiers());
+        } else if (asBoolean(ctx.variableModifiersOpt())) {
+            modifierNodeList = this.visitVariableModifiersOpt(ctx.variableModifiersOpt());
+        } else if (asBoolean(ctx.modifiers())) {
+            modifierNodeList = this.visitModifiers(ctx.modifiers());
+        } else if (asBoolean(ctx.modifiersOpt())) {
+            modifierNodeList = this.visitModifiersOpt(ctx.modifiersOpt());
+        }
+
+        return new ModifierManager(this, modifierNodeList);
+    }
+
+    private DeclarationListStatement createMultiAssignmentDeclarationListStatement(VariableDeclarationContext ctx, ModifierManager modifierManager) {
+        if (!modifierManager.contains(DEF)) {
+            throw createParsingFailedException("keyword def is required to declare tuple, e.g. def (int a, int b) = [1, 2]", ctx);
+        }
+
+        return this.configureAST(
+                new DeclarationListStatement(
+                        this.configureAST(
+                                modifierManager.attachAnnotations(
+                                        new DeclarationExpression(
+                                                new ArgumentListExpression(
+                                                        this.visitTypeNamePairs(ctx.typeNamePairs()).stream()
+                                                                .peek(e -> modifierManager.processVariableExpression((VariableExpression) e))
+                                                                .collect(Collectors.toList())
+                                                ),
+                                                this.createGroovyTokenByType(ctx.ASSIGN().getSymbol(), Types.ASSIGN),
+                                                this.visitVariableInitializer(ctx.variableInitializer())
+                                        )
+                                ),
+                                ctx
+                        )
+                ),
+                ctx
+        );
+    }
+
+    @Override
+    public DeclarationListStatement visitVariableDeclaration(VariableDeclarationContext ctx) {
+        ModifierManager modifierManager = this.createModifierManager(ctx);
+
+        if (asBoolean(ctx.typeNamePairs())) { // e.g. def (int a, int b) = [1, 2]
+            return this.createMultiAssignmentDeclarationListStatement(ctx, modifierManager);
+        }
+
+        ClassNode variableType = this.visitType(ctx.type());
+        ctx.variableDeclarators().putNodeMetaData(VARIABLE_DECLARATION_VARIABLE_TYPE, variableType);
+        List<DeclarationExpression> declarationExpressionList = this.visitVariableDeclarators(ctx.variableDeclarators());
+
+        // if classNode is not null, the variable declaration is for class declaration. In other words, it is a field declaration
+        ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);
+
+        if (asBoolean(classNode)) {
+            return createFieldDeclarationListStatement(ctx, modifierManager, variableType, declarationExpressionList, classNode);
+        }
+
+        declarationExpressionList.forEach(e -> {
+            VariableExpression variableExpression = (VariableExpression) e.getLeftExpression();
+
+            modifierManager.processVariableExpression(variableExpression);
+            modifierManager.attachAnnotations(e);
+        });
+
+        int size = declarationExpressionList.size();
+        if (size > 0) {
+            DeclarationExpression declarationExpression = declarationExpressionList.get(0);
+
+            if (1 == size) {
+                this.configureAST(declarationExpression, ctx);
+            } else {
+                // Tweak start of first declaration
+                declarationExpression.setLineNumber(ctx.getStart().getLine());
+                declarationExpression.setColumnNumber(ctx.getStart().getCharPositionInLine() + 1);
+            }
+        }
+
+        return this.configureAST(new DeclarationListStatement(declarationExpressionList), ctx);
+    }
+
+    private DeclarationListStatement createFieldDeclarationListStatement(VariableDeclarationContext ctx, ModifierManager modifierManager, ClassNode variableType, List<DeclarationExpression> declarationExpressionList, ClassNode classNode) {
+        declarationExpressionList.forEach(e -> {
+            VariableExpression variableExpression = (VariableExpression) e.getLeftExpression();
+
+            int modifiers = modifierManager.getClassMemberModifiersOpValue();
+
+            Expression initialValue = EmptyExpression.INSTANCE.equals(e.getRightExpression()) ? null : e.getRightExpression();
+            Object defaultValue = findDefaultValueByType(variableType);
+
+            if (classNode.isInterface()) {
+                if (!asBoolean(initialValue)) {
+                    initialValue = !asBoolean(defaultValue) ? null : new ConstantExpression(defaultValue);
+                }
+
+                modifiers |= Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC | Opcodes.ACC_FINAL;
+            }
+
+            if (classNode.isInterface() || modifierManager.containsVisibilityModifier()) {
+                FieldNode fieldNode =
+                        classNode.addField(
+                                variableExpression.getName(),
+                                modifiers,
+                                variableType,
+                                initialValue);
+                modifierManager.attachAnnotations(fieldNode);
+
+                groovydocManager.handle(fieldNode, ctx);
+
+                this.configureAST(fieldNode, ctx);
+            } else {
+                PropertyNode propertyNode =
+                        classNode.addProperty(
+                                variableExpression.getName(),
+                                modifiers | Opcodes.ACC_PUBLIC,
+                                variableType,
+                                initialValue,
+                                null,
+                                null);
+
+                FieldNode fieldNode = propertyNode.getField();
+                fieldNode.setModifiers(modifiers & ~Opcodes.ACC_PUBLIC | Opcodes.ACC_PRIVATE);
+                fieldNode.setSynthetic(!classNode.isInterface());
+                modifierManager.attachAnnotations(fieldNode);
+
+                groovydocManager.handle(fieldNode, ctx);
+                groovydocManager.handle(propertyNode, ctx);
+
+                this.configureAST(fieldNode, ctx);
+                this.configureAST(propertyNode, ctx);
+            }
+
+        });
+
+        return null;
+    }
+
+    @Override
+    public List<Expression> visitTypeNamePairs(TypeNamePairsContext ctx) {
+        return ctx.typeNamePair().stream().map(this::visitTypeNamePair).collect(Collectors.toList());
+    }
+
+    @Override
+    public VariableExpression visitTypeNamePair(TypeNamePairContext ctx) {
+        return this.configureAST(
+                new VariableExpression(
+                        this.visitVariableDeclaratorId(ctx.variableDeclaratorId()).getName(),
+                        this.visitType(ctx.type())),
+                ctx);
+    }
+
+    @Override
+    public List<DeclarationExpression> visitVariableDeclarators(VariableDeclaratorsContext ctx) {
+        ClassNode variableType = ctx.getNodeMetaData(VARIABLE_DECLARATION_VARIABLE_TYPE);
+        Objects.requireNonNull(variableType, "variableType should not be null");
+
+        return ctx.variableDeclarator().stream()
+                .map(e -> {
+                    e.putNodeMetaData(VARIABLE_DECLARATION_VARIABLE_TYPE, variableType);
+                    return this.visitVariableDeclarator(e);
+//                    return this.configureAST(this.visitVariableDeclarator(e), ctx);
+                })
+                .collect(Collectors.toList());
+    }
+
+    @Override
+    public DeclarationExpression visitVariableDeclarator(VariableDeclaratorContext ctx) {
+        ClassNode variableType = ctx.getNodeMetaData(VARIABLE_DECLARATION_VARIABLE_TYPE);
+        Objects.requireNonNull(variableType, "variableType should not be null");
+
+        org.codehaus.groovy.syntax.Token token;
+        if (asBoolean(ctx.ASSIGN())) {
+            token = createGroovyTokenByType(ctx.ASSIGN().getSymbol(), Types.ASSIGN);
+        } else {
+            token = new org.codehaus.groovy.syntax.Token(Types.ASSIGN, ASSIGN_STR, ctx.start.getLine(), 1);
+        }
+
+        return this.configureAST(
+                new DeclarationExpression(
+                        this.configureAST(
+                                new VariableExpression(
+                                        this.visitVariableDeclaratorId(ctx.variableDeclaratorId()).getName(),
+                                        variableType
+                                ),
+                                ctx.variableDeclaratorId()),
+                        token,
+                        this.visitVariableInitializer(ctx.variableInitializer())),
+                ctx);
+    }
+
+    @Override
+    public Expression visitVariableInitializer(VariableInitializerContext ctx) {
+        if (!asBoolean(ctx)) {
+            return EmptyExpression.INSTANCE;
+        }
+
+        if (asBoolean(ctx.statementExpression())) {
+            return this.configureAST(
+                    ((ExpressionStatement) this.visit(ctx.statementExpression())).getExpression(),
+                    ctx);
+        }
+
+        if (asBoolean(ctx.standardLambda())) {
+            return this.configureAST(this.visitStandardLambda(ctx.standardLambda()), ctx);
+        }
+
+        throw createParsingFailedException("Unsupported variable initializer: " + ctx.getText(), ctx);
+    }
+
+    @Override
+    public List<Expression> visitVariableInitializers(VariableInitializersContext ctx) {
+        if (!asBoolean(ctx)) {
+            return Collections.emptyList();
+        }
+
+        return ctx.variableInitializer().stream()
+                        .map(this::visitVariableInitializer)
+                        .collect(Collectors.toList());
+    }
+
+    @Override
+    public List<Expression> visitArrayInitializer(ArrayInitializerContext ctx) {
+        if (!asBoolean(ctx)) {
+            return Collections.emptyList();
+        }
+
+        return this.visitVariableInitializers(ctx.variableInitializers());
+    }
+
+    @Override
+    public Statement visitBlock(BlockContext ctx) {
+        if (!asBoolean(ctx)) {
+            return this.createBlockStatement();
+        }
+
+        return this.configureAST(
+                this.visitBlockStatementsOpt(ctx.blockStatementsOpt()),
+                ctx);
+    }
+
+
+    @Override
+    public ExpressionStatement visitNormalExprAlt(NormalExprAltContext ctx) {
+        return this.configureAST(new ExpressionStatement((Expression) this.visit(ctx.expression())), ctx);
+    }
+
+    @Override
+    public ExpressionStatement visitCommandExprAlt(CommandExprAltContext ctx) {
+        return this.configureAST(new ExpressionStatement(this.visitCommandExpression(ctx.commandExpression())), ctx);
+    }
+
+    @Override
+    public Expression visitCommandExpression(CommandExpressionContext ctx) {
+        Expression baseExpr = this.visitPathExpression(ctx.pathExpression());
+        Expression arguments = this.visitEnhancedArgumentList(ctx.enhancedArgumentList());
+
+        MethodCallExpression methodCallExpression;
+        if (baseExpr instanceof PropertyExpression) { // e.g. obj.a 1, 2
+            methodCallExpression =
+                    this.configureAST(
+                            this.createMethodCallExpression(
+                                    (PropertyExpression) baseExpr, arguments),
+                            arguments);
+
+        } else if (baseExpr instanceof MethodCallExpression && !isTrue(baseExpr, IS_INSIDE_PARENTHESES)) { // e.g. m {} a, b  OR  m(...) a, b
+            if (asBoolean(arguments)) {
+                // The error should never be thrown.
+                throw new GroovyBugError("When baseExpr is a instance of MethodCallExpression, which should follow NO argumentList");
+            }
+
+            methodCallExpression = (MethodCallExpression) baseExpr;
+        } else if (
+                !isTrue(baseExpr, IS_INSIDE_PARENTHESES)
+                        && (baseExpr instanceof VariableExpression /* e.g. m 1, 2 */
+                        || baseExpr instanceof GStringExpression /* e.g. "$m" 1, 2 */
+                        || (baseExpr instanceof ConstantExpression && isTrue(baseExpr, IS_STRING)) /* e.g. "m" 1, 2 */)
+                ) {
+            methodCallExpression =
+                    this.configureAST(
+                            this.createMethodCallExpression(baseExpr, arguments),
+                            arguments);
+        } else { // e.g. a[x] b, new A() b, etc.
+            methodCallExpression =
+                    this.configureAST(
+                            new MethodCallExpression(
+                                    baseExpr,
+                                    CALL_STR,
+                                    arguments
+                            ),
+                            arguments
+                    );
+
+            methodCallExpression.setImplicitThis(false);
+        }
+
+        if (!asBoolean(ctx.commandArgument())) {
+            return this.configureAST(methodCallExpression, ctx);
+        }
+
+        return this.configureAST(
+                (Expression) ctx.commandArgument().stream()
+                        .map(e -> (Object) e)
+                        .reduce(methodCallExpression,
+                                (r, e) -> {
+                                    CommandArgumentContext commandArgumentContext = (CommandArgumentContext) e;
+                                    commandArgumentContext.putNodeMetaData(CMD_EXPRESSION_BASE_EXPR, r);
+
+                                    return this.visitCommandArgument(commandArgumentContext);
+                                }
+                        ),
+                ctx);
+    }
+
+    @Override
+    public Expression visitCommandArgument(CommandArgumentContext ctx) {
+        // e.g. x y a b     we call "x y" as the base expression
+        Expression baseExpr = ctx.getNodeMetaData(CMD_EXPRESSION_BASE_EXPR);
+
+        Expression primaryExpr = (Expression) this.visit(ctx.primary());
+
+        if (asBoolean(ctx.enhancedArgumentList())) { // e.g. x y a b
+            if (baseExpr instanceof PropertyExpression) { // the branch should never reach, because a.b.c will be parsed as a path expression, not a method call
+                throw createParsingFailedException("Unsupported command argument: " + ctx.getText(), ctx);
+            }
+
+            // the following code will process "a b" of "x y a b"
+            MethodCallExpression methodCallExpression =
+                    new MethodCallExpression(
+                            baseExpr,
+                            this.createConstantExpression(primaryExpr),
+                            this.visitEnhancedArgumentList(ctx.enhancedArgumentList())
+                    );
+            methodCallExpression.setImplicitThis(false);
+
+            return this.configureAST(methodCallExpression, ctx);
+        } else if (asBoolean(ctx.pathElement())) { // e.g. x y a.b
+            Expression pathExpression =
+                    this.createPathExpression(
+                            this.configureAST(
+                                    new PropertyExpression(baseExpr, this.createConstantExpression(primaryExpr)),
+                                    primaryExpr
+                            ),
+                            ctx.pathElement()
+                    );
+
+            return this.configureAST(pathExpression, ctx);
+        }
+
+        // e.g. x y a
+        return this.configureAST(
+                new PropertyExpression(
+                        baseExpr,
+                        primaryExpr instanceof VariableExpression
+                                ? this.createConstantExpression(primaryExpr)
+                                : primaryExpr
+                ),
+                primaryExpr
+        );
+    }
+
+
+    // expression {    --------------------------------------------------------------------
+
+    @Override
+    public ClassNode visitCastParExpression(CastParExpressionContext ctx) {
+        return this.visitType(ctx.type());
+    }
+
+    @Override
+    public Expression visitParExpression(ParExpressionContext ctx) {
+        Expression expression;
+
+        if (asBoolean(ctx.statementExpression())) {
+            expression = ((ExpressionStatement) this.visit(ctx.statementExpression())).getExpression();
+        } else if (asBoolean(ctx.standardLambda())) {
+            expression = this.visitStandardLambda(ctx.standardLambda());
+        } else {
+            throw createParsingFailedException("Unsupported parentheses expression: " + ctx.getText(), ctx);
+        }
+
+        expression.putNodeMetaData(IS_INSIDE_PARENTHESES, true);
+
+        Integer insideParenLevel = expression.getNodeMetaData(INSIDE_PARENTHESES_LEVEL);
+        if (asBoolean((Object) insideParenLevel)) {
+            insideParenLevel++;
+        } else {
+            insideParenLevel = 1;
+        }
+        expression.putNodeMetaData(INSIDE_PARENTHESES_LEVEL, insideParenLevel);
+
+        return this.configureAST(expression, ctx);
+    }
+
+    @Override
+    public Expression visitPathExpression(PathExpressionContext ctx) {
+        return this.configureAST(
+                this.createPathExpression((Expression) this.visit(ctx.primary()), ctx.pathElement()),
+                ctx);
+    }
+
+    @Override
+    public Expression visitPathElement(PathElementContext ctx) {
+        Expression baseExpr = ctx.getNodeMetaData(PATH_EXPRESSION_BASE_EXPR);
+        Objects.requireNonNull(baseExpr, "baseExpr is required!");
+
+        if (asBoolean(ctx.namePart())) {
+            Expression namePartExpr = this.visitNamePart(ctx.namePart());
+            GenericsType[] genericsTypes = this.visitNonWildcardTypeArguments(ctx.nonWildcardTypeArguments());
+
+
+            if (asBoolean(ctx.DOT())) {
+                if (asBoolean(ctx.AT())) { // e.g. obj.@a
+                    return this.configureAST(new AttributeExpression(baseExpr, namePartExpr), ctx);
+                } else { // e.g. obj.p
+                    PropertyExpression propertyExpression = new PropertyExpression(baseExpr, namePartExpr);
+                    propertyExpression.putNodeMetaData(PATH_EXPRESSION_BASE_EXPR_GENERICS_TYPES, genericsTypes);
+
+                    return this.configureAST(propertyExpression, ctx);
+                }
+            } else if (asBoolean(ctx.SAFE_DOT())) {
+                if (asBoolean(ctx.AT())) { // e.g. obj?.@a
+                    return this.configureAST(new AttributeExpression(baseExpr, namePartExpr, true), ctx);
+                } else { // e.g. obj?.p
+                    PropertyExpression propertyExpression = new PropertyExpression(baseExpr, namePartExpr, true);
+                    propertyExpression.putNodeMetaData(PATH_EXPRESSION_BASE_EXPR_GENERICS_TYPES, genericsTypes);
+
+                    return this.configureAST(propertyExpression, ctx);
+                }
+            } else if (asBoolean(ctx.METHOD_POINTER())) { // e.g. obj.&m
+                return this.configureAST(new MethodPointerExpression(baseExpr, namePartExpr), ctx);
+            } else if (asBoolean(ctx.METHOD_REFERENCE())) { // e.g. obj::m
+                return this.configureAST(new MethodReferenceExpression(baseExpr, namePartExpr), ctx);
+            } else if (asBoolean(ctx.SPREAD_DOT())) {
+                if (asBoolean(ctx.AT())) { // e.g. obj*.@a
+                    AttributeExpression attributeExpression = new AttributeExpression(baseExpr, namePartExpr, true);
+
+                    attributeExpression.setSpreadSafe(true);
+
+                    return this.configureAST(attributeExpression, ctx);
+                } else { // e.g. obj*.p
+                    PropertyExpression propertyExpression = new PropertyExpression(baseExpr, namePartExpr, true);
+                    propertyExpression.putNodeMetaData(PATH_EXPRESSION_BASE_EXPR_GENERICS_TYPES, genericsTypes);
+
+                    propertyExpression.setSpreadSafe(true);
+
+                    return this.configureAST(propertyExpression, ctx);
+                }
+            }
+        }
+
+        if (asBoolean(ctx.indexPropertyArgs())) { // e.g. list[1, 3, 5]
+            Pair<Token, Expression> pair = this.visitIndexPropertyArgs(ctx.indexPropertyArgs());
+
+            return this.configureAST(
+                    new BinaryExpression(baseExpr, createGroovyToken(pair.getKey()), pair.getValue(), asBoolean(ctx.indexPropertyArgs().QUESTION())),
+                    ctx);
+        }
+
+        if (asBoolean(ctx.namedPropertyArgs())) { // this is a special way to new instance, e.g. Person(name: 'Daniel.Sun', location: 'Shanghai')
+            List<MapEntryExpression> mapEntryExpressionList =
+                    this.visitNamedPropertyArgs(ctx.namedPropertyArgs());
+
+            Expression right;
+            if (mapEntryExpressionList.size() == 1) {
+                MapEntryExpression mapEntryExpression = mapEntryExpressionList.get(0);
+
+                if (mapEntryExpression.getKeyExpression() instanceof SpreadMapExpression) {
+                    right = mapEntryExpression.getKeyExpression();
+                } else {
+                    right = mapEntryExpression;
+                }
+            } else {
+                ListExpression listExpression =
+                        this.configureAST(
+                                new ListExpression(
+                                        mapEntryExpressionList.stream()
+                                                .map(
+                                                        e -> {
+                                                            if (e.getKeyExpression() instanceof SpreadMapExpression) {
+                                                                return e.getKeyExpression();
+                                                            }
+
+                                                            return e;
+                                                        }
+                                                )
+                                                .collect(Collectors.toList())),
+                                ctx.namedPropertyArgs()
+                        );
+                listExpression.setWrapped(true);
+                right = listExpression;
+            }
+
+            return this.configureAST(
+                    new BinaryExpression(baseExpr, createGroovyToken(ctx.namedPropertyArgs().LBRACK().getSymbol()), right),
+                    ctx);
+        }
+
+        if (asBoolean(ctx.arguments())) {
+            Expression argumentsExpr = this.visitArguments(ctx.arguments());
+
+            if (isTrue(baseExpr, IS_INSIDE_PARENTHESES)) { // e.g. (obj.x)(), (obj.@x)()
+                MethodCallExpression methodCallExpression =
+                        new MethodCallExpression(
+                                baseExpr,
+                                CALL_STR,
+                                argumentsExpr
+                        );
+
+                methodCallExpression.setImplicitThis(false);
+
+                return this.configureAST(methodCallExpression, ctx);
+            }
+
+            if (baseExpr instanceof AttributeExpression) { // e.g. obj.@a(1, 2)
+                AttributeExpression attributeExpression = (AttributeExpression) baseExpr;
+                attributeExpression.setSpreadSafe(false); // whether attributeExpression is spread safe or not, we must reset it as false
+
+                MethodCallExpression methodCallExpression =
+                        new MethodCallExpression(
+                                attributeExpression,
+                                CALL_STR,
+                                argumentsExpr
+                        );
+
+                return this.configureAST(methodCallExpression, ctx);
+            }
+
+            if (baseExpr instanceof PropertyExpression) { // e.g. obj.a(1, 2)
+                MethodCallExpression methodCallExpression =
+                        this.createMethodCallExpression((PropertyExpression) baseExpr, argumentsExpr);
+
+                return this.configureAST(methodCallExpression, ctx);
+            }
+
+            if (baseExpr instanceof VariableExpression) { // void and primitive type AST node must be an instance of VariableExpression
+                String baseExprText = baseExpr.getText();
+                if (VOID_STR.equals(baseExprText)) { // e.g. void()
+                    MethodCallExpression methodCallExpression =
+                            new MethodCallExpression(
+                                    this.createConstantExpression(baseExpr),
+                                    CALL_STR,
+                                    argumentsExpr
+                            );
+
+                    methodCallExpression.setImplicitThis(false);
+
+                    return this.configureAST(methodCallExpression, ctx);
+                } else if (PRIMITIVE_TYPE_SET.contains(baseExprText)) { // e.g. int(), long(), float(), etc.
+                    throw createParsingFailedException("Primitive type literal: " + baseExprText + " cannot be used as a method name", ctx);
+                }
+            }
+
+            if (baseExpr instanceof VariableExpression
+                    || baseExpr instanceof GStringExpression
+                    || (baseExpr instanceof ConstantExpression && isTrue(baseExpr, IS_STRING))) { // e.g. m(), "$m"(), "m"()
+
+                String baseExprText = base

<TRUNCATED>

[38/50] [abbrv] groovy git commit: rename antlr4 parser to remove groovy- prefix since that is by convention for modules

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyLexer.g4
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyLexer.g4 b/subprojects/parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyLexer.g4
new file mode 100644
index 0000000..7bcec42
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyLexer.g4
@@ -0,0 +1,882 @@
+/*
+ * This file is adapted from the Antlr4 Java grammar which has the following license
+ *
+ *  Copyright (c) 2013 Terence Parr, Sam Harwell
+ *  All rights reserved.
+ *  [The "BSD licence"]
+ *
+ *    http://www.opensource.org/licenses/bsd-license.php
+ *
+ * Subsequent modifications by the Groovy community have been done under the Apache License v2:
+ *
+ *  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.
+ */
+
+/**
+ * The Groovy grammar is based on the official grammar for Java:
+ * https://github.com/antlr/grammars-v4/blob/master/java/Java.g4
+ */
+lexer grammar GroovyLexer;
+
+options {
+    superClass = AbstractLexer;
+}
+
+@header {
+    import static org.apache.groovy.parser.antlr4.SemanticPredicates.*;
+    import java.util.Deque;
+    import java.util.ArrayDeque;
+    import java.util.Map;
+    import java.util.HashMap;
+    import java.util.Set;
+    import java.util.HashSet;
+    import java.util.Collections;
+    import java.util.Arrays;
+}
+
+@members {
+    private long tokenIndex     = 0;
+    private int  lastTokenType  = 0;
+
+    /**
+     * Record the index and token type of the current token while emitting tokens.
+     */
+    @Override
+    public void emit(Token token) {
+        this.tokenIndex++;
+
+        int tokenType = token.getType();
+        if (Token.DEFAULT_CHANNEL == token.getChannel()) {
+            this.lastTokenType = tokenType;
+        }
+
+        if (RollBackOne == tokenType) {
+            this.rollbackOneChar();
+        }
+
+        super.emit(token);
+    }
+
+    private static final Set<Integer> REGEX_CHECK_SET =
+                                            Collections.unmodifiableSet(
+                                                new HashSet<>(Arrays.asList(Identifier, CapitalizedIdentifier, NullLiteral, BooleanLiteral, THIS, RPAREN, RBRACK, RBRACE, IntegerLiteral, FloatingPointLiteral, StringLiteral, GStringEnd, INC, DEC)));
+    private boolean isRegexAllowed() {
+        if (REGEX_CHECK_SET.contains(this.lastTokenType)) {
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * just a hook, which will be overrided by GroovyLangLexer
+     */
+    protected void rollbackOneChar() {}
+
+    private static class Paren {
+        private String text;
+        private int lastTokenType;
+        private int line;
+        private int column;
+
+        public Paren(String text, int lastTokenType, int line, int column) {
+            this.text = text;
+            this.lastTokenType = lastTokenType;
+            this.line = line;
+            this.column = column;
+        }
+
+        public String getText() {
+            return this.text;
+        }
+
+        public int getLastTokenType() {
+            return this.lastTokenType;
+        }
+
+        public int getLine() {
+            return line;
+        }
+
+        public int getColumn() {
+            return column;
+        }
+
+        @Override
+        public int hashCode() {
+            return (int) (text.hashCode() * line + column);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (!(obj instanceof Paren)) {
+                return false;
+            }
+
+            Paren other = (Paren) obj;
+
+            return this.text.equals(other.text) && (this.line == other.line && this.column == other.column);
+        }
+    }
+
+    private static final Map<String, String> PAREN_MAP = Collections.unmodifiableMap(new HashMap<String, String>() {
+        {
+            put("(", ")");
+            put("[", "]");
+            put("{", "}");
+        }
+    });
+
+    private final Deque<Paren> parenStack = new ArrayDeque<>(32);
+    private void enterParen() {
+        parenStack.push(new Paren(getText(), this.lastTokenType, getLine(), getCharPositionInLine() + 1));
+    }
+    private void exitParen() {
+        Paren paren = parenStack.peek();
+        String text = getText();
+
+        require(null != paren, "Too many '" + text + "'");
+        require(text.equals(PAREN_MAP.get(paren.getText())),
+                "'" + paren.getText() + "'" + new PositionInfo(paren.getLine(), paren.getColumn()) + " can not match '" + text + "'");
+
+        parenStack.pop();
+    }
+    private boolean isInsideParens() {
+        Paren paren = parenStack.peek();
+
+        // We just care about "(" and "[", inside which the new lines will be ignored.
+        // Notice: the new lines between "{" and "}" can not be ignored.
+        if (null == paren) {
+            return false;
+        }
+        return ("(".equals(paren.getText()) && TRY != paren.getLastTokenType()) // we don't treat try-paren(i.e. try (....)) as parenthesis
+                    || "[".equals(paren.getText());
+    }
+    private void ignoreTokenInsideParens() {
+        if (!this.isInsideParens()) {
+            return;
+        }
+
+        this.setChannel(Token.HIDDEN_CHANNEL);
+    }
+    private void ignoreMultiLineCommentConditionally() {
+        if (!this.isInsideParens() && isFollowedByWhiteSpaces(_input)) {
+            return;
+        }
+
+        this.setChannel(Token.HIDDEN_CHANNEL);
+    }
+
+    @Override
+    public int getSyntaxErrorSource() {
+        return GroovySyntaxError.LEXER;
+    }
+
+    @Override
+    public int getErrorLine() {
+        return getLine();
+    }
+
+    @Override
+    public int getErrorColumn() {
+        return getCharPositionInLine() + 1;
+    }
+}
+
+
+// §3.10.5 String Literals
+
+StringLiteral
+    :   '"'      DqStringCharacter*?           '"'
+    |   '\''     SqStringCharacter*?           '\''
+
+    |   '/'      { this.isRegexAllowed() && _input.LA(1) != '*' }?
+                 SlashyStringCharacter+?       '/'
+
+    |   '"""'    TdqStringCharacter*?          '"""'
+    |   '\'\'\'' TsqStringCharacter*?          '\'\'\''
+    |   '$/'     DollarSlashyStringCharacter+? '/$'
+    ;
+
+// Groovy gstring
+GStringBegin
+    :   '"' DqStringCharacter*? DOLLAR -> pushMode(DQ_GSTRING_MODE), pushMode(GSTRING_TYPE_SELECTOR_MODE)
+    ;
+TdqGStringBegin
+    :   '"""'   TdqStringCharacter*? DOLLAR -> type(GStringBegin), pushMode(TDQ_GSTRING_MODE), pushMode(GSTRING_TYPE_SELECTOR_MODE)
+    ;
+SlashyGStringBegin
+    :   '/' { this.isRegexAllowed() && _input.LA(1) != '*' }? SlashyStringCharacter*? DOLLAR { isFollowedByJavaLetterInGString(_input) }? -> type(GStringBegin), pushMode(SLASHY_GSTRING_MODE), pushMode(GSTRING_TYPE_SELECTOR_MODE)
+    ;
+DollarSlashyGStringBegin
+    :   '$/' DollarSlashyStringCharacter*? DOLLAR { isFollowedByJavaLetterInGString(_input) }? -> type(GStringBegin), pushMode(DOLLAR_SLASHY_GSTRING_MODE), pushMode(GSTRING_TYPE_SELECTOR_MODE)
+    ;
+
+mode DQ_GSTRING_MODE;
+GStringEnd
+    :   '"'     -> popMode
+    ;
+GStringPart
+    :   DOLLAR  -> pushMode(GSTRING_TYPE_SELECTOR_MODE)
+    ;
+GStringCharacter
+    :   DqStringCharacter -> more
+    ;
+
+mode TDQ_GSTRING_MODE;
+TdqGStringEnd
+    :   '"""'    -> type(GStringEnd), popMode
+    ;
+TdqGStringPart
+    :   DOLLAR   -> type(GStringPart), pushMode(GSTRING_TYPE_SELECTOR_MODE)
+    ;
+TdqGStringCharacter
+    :   TdqStringCharacter -> more
+    ;
+
+mode SLASHY_GSTRING_MODE;
+SlashyGStringEnd
+    :   '$'? '/'  -> type(GStringEnd), popMode
+    ;
+SlashyGStringPart
+    :   DOLLAR { isFollowedByJavaLetterInGString(_input) }?   -> type(GStringPart), pushMode(GSTRING_TYPE_SELECTOR_MODE)
+    ;
+SlashyGStringCharacter
+    :   SlashyStringCharacter -> more
+    ;
+
+mode DOLLAR_SLASHY_GSTRING_MODE;
+DollarSlashyGStringEnd
+    :   '/$'      -> type(GStringEnd), popMode
+    ;
+DollarSlashyGStringPart
+    :   DOLLAR { isFollowedByJavaLetterInGString(_input) }?   -> type(GStringPart), pushMode(GSTRING_TYPE_SELECTOR_MODE)
+    ;
+DollarSlashyGStringCharacter
+    :   DollarSlashyStringCharacter -> more
+    ;
+
+mode GSTRING_TYPE_SELECTOR_MODE;
+GStringLBrace
+    :   '{' { this.enterParen();  } -> type(LBRACE), popMode, pushMode(DEFAULT_MODE)
+    ;
+GStringIdentifier
+    :   IdentifierInGString -> type(Identifier), popMode, pushMode(GSTRING_PATH_MODE)
+    ;
+
+
+mode GSTRING_PATH_MODE;
+GStringPathPart
+    :   '.' IdentifierInGString
+    ;
+RollBackOne
+    :   . {
+            // a trick to handle GStrings followed by EOF properly
+            if (EOF == _input.LA(1) && ('"' == _input.LA(-1) || '/' == _input.LA(-1))) {
+                setType(GStringEnd);
+            } else {
+                setChannel(HIDDEN);
+            }
+          } -> popMode
+    ;
+
+
+mode DEFAULT_MODE;
+// character in the double quotation string. e.g. "a"
+fragment
+DqStringCharacter
+    :   ~["\\$]
+    |   EscapeSequence
+    ;
+
+// character in the single quotation string. e.g. 'a'
+fragment
+SqStringCharacter
+    :   ~['\\]
+    |   EscapeSequence
+    ;
+
+// character in the triple double quotation string. e.g. """a"""
+fragment TdqStringCharacter
+    :   ~["\\$]
+    |   '"' { !(_input.LA(1) == '"' && _input.LA(2) == '"') }?
+    |   EscapeSequence
+    ;
+
+// character in the triple single quotation string. e.g. '''a'''
+fragment TsqStringCharacter
+    :   ~['\\]
+    |   '\'' { !(_input.LA(1) == '\'' && _input.LA(2) == '\'') }?
+    |   EscapeSequence
+    ;
+
+// character in the slashy string. e.g. /a/
+fragment SlashyStringCharacter
+    :   SlashEscape
+    |   '$' { !isFollowedByJavaLetterInGString(_input) }?
+    |   ~[/$\u0000]
+    ;
+
+// character in the collar slashy string. e.g. $/a/$
+fragment DollarSlashyStringCharacter
+    :   SlashEscape | DollarSlashEscape | DollarDollarEscape
+    |   '/' { _input.LA(1) != '$' }?
+    |   '$' { !isFollowedByJavaLetterInGString(_input) }?
+    |   ~[/$\u0000]
+    ;
+
+// Groovy keywords
+AS              : 'as';
+DEF             : 'def';
+IN              : 'in';
+TRAIT           : 'trait';
+
+
+// §3.9 Keywords
+BuiltInPrimitiveType
+    :   BOOLEAN
+    |   CHAR
+    |   BYTE
+    |   SHORT
+    |   INT
+    |   LONG
+    |   FLOAT
+    |   DOUBLE
+    ;
+
+ABSTRACT      : 'abstract';
+ASSERT        : 'assert';
+
+fragment
+BOOLEAN       : 'boolean';
+
+BREAK         : 'break';
+
+fragment
+BYTE          : 'byte';
+
+CASE          : 'case';
+CATCH         : 'catch';
+
+fragment
+CHAR          : 'char';
+
+CLASS         : 'class';
+CONST         : 'const';
+CONTINUE      : 'continue';
+DEFAULT       : 'default';
+DO            : 'do';
+
+fragment
+DOUBLE        : 'double';
+
+ELSE          : 'else';
+ENUM          : 'enum';
+EXTENDS       : 'extends';
+FINAL         : 'final';
+FINALLY       : 'finally';
+
+fragment
+FLOAT         : 'float';
+
+
+FOR           : 'for';
+IF            : 'if';
+GOTO          : 'goto';
+IMPLEMENTS    : 'implements';
+IMPORT        : 'import';
+INSTANCEOF    : 'instanceof';
+
+fragment
+INT           : 'int';
+
+INTERFACE     : 'interface';
+
+fragment
+LONG          : 'long';
+
+NATIVE        : 'native';
+NEW           : 'new';
+PACKAGE       : 'package';
+PRIVATE       : 'private';
+PROTECTED     : 'protected';
+PUBLIC        : 'public';
+RETURN        : 'return';
+
+fragment
+SHORT         : 'short';
+
+
+STATIC        : 'static';
+STRICTFP      : 'strictfp';
+SUPER         : 'super';
+SWITCH        : 'switch';
+SYNCHRONIZED  : 'synchronized';
+THIS          : 'this';
+THROW         : 'throw';
+THROWS        : 'throws';
+TRANSIENT     : 'transient';
+TRY           : 'try';
+VOID          : 'void';
+VOLATILE      : 'volatile';
+WHILE         : 'while';
+
+
+// §3.10.1 Integer Literals
+
+IntegerLiteral
+    :   DecimalIntegerLiteral
+    |   HexIntegerLiteral
+    |   OctalIntegerLiteral
+    |   BinaryIntegerLiteral
+    ;
+
+fragment
+DecimalIntegerLiteral
+    :   DecimalNumeral IntegerTypeSuffix?
+    ;
+
+fragment
+HexIntegerLiteral
+    :   HexNumeral IntegerTypeSuffix?
+    ;
+
+fragment
+OctalIntegerLiteral
+    :   OctalNumeral IntegerTypeSuffix?
+    ;
+
+fragment
+BinaryIntegerLiteral
+    :   BinaryNumeral IntegerTypeSuffix?
+    ;
+
+fragment
+IntegerTypeSuffix
+    :   [lLiIgG]
+    ;
+
+fragment
+DecimalNumeral
+    :   '0'
+    |   NonZeroDigit (Digits? | Underscores Digits)
+    ;
+
+fragment
+Digits
+    :   Digit (DigitOrUnderscore* Digit)?
+    ;
+
+fragment
+Digit
+    :   '0'
+    |   NonZeroDigit
+    ;
+
+fragment
+NonZeroDigit
+    :   [1-9]
+    ;
+
+fragment
+DigitOrUnderscore
+    :   Digit
+    |   '_'
+    ;
+
+fragment
+Underscores
+    :   '_'+
+    ;
+
+fragment
+HexNumeral
+    :   '0' [xX] HexDigits
+    ;
+
+fragment
+HexDigits
+    :   HexDigit (HexDigitOrUnderscore* HexDigit)?
+    ;
+
+fragment
+HexDigit
+    :   [0-9a-fA-F]
+    ;
+
+fragment
+HexDigitOrUnderscore
+    :   HexDigit
+    |   '_'
+    ;
+
+fragment
+OctalNumeral
+    :   '0' Underscores? OctalDigits
+    ;
+
+fragment
+OctalDigits
+    :   OctalDigit (OctalDigitOrUnderscore* OctalDigit)?
+    ;
+
+fragment
+OctalDigit
+    :   [0-7]
+    ;
+
+fragment
+OctalDigitOrUnderscore
+    :   OctalDigit
+    |   '_'
+    ;
+
+fragment
+BinaryNumeral
+    :   '0' [bB] BinaryDigits
+    ;
+
+fragment
+BinaryDigits
+    :   BinaryDigit (BinaryDigitOrUnderscore* BinaryDigit)?
+    ;
+
+fragment
+BinaryDigit
+    :   [01]
+    ;
+
+fragment
+BinaryDigitOrUnderscore
+    :   BinaryDigit
+    |   '_'
+    ;
+
+// §3.10.2 Floating-Point Literals
+
+FloatingPointLiteral
+    :   DecimalFloatingPointLiteral
+    |   HexadecimalFloatingPointLiteral
+    ;
+
+fragment
+DecimalFloatingPointLiteral
+    :   Digits '.' Digits ExponentPart? FloatTypeSuffix?
+    |   Digits ExponentPart FloatTypeSuffix?
+    |   Digits FloatTypeSuffix
+    ;
+
+fragment
+ExponentPart
+    :   ExponentIndicator SignedInteger
+    ;
+
+fragment
+ExponentIndicator
+    :   [eE]
+    ;
+
+fragment
+SignedInteger
+    :   Sign? Digits
+    ;
+
+fragment
+Sign
+    :   [+-]
+    ;
+
+fragment
+FloatTypeSuffix
+    :   [fFdDgG]
+    ;
+
+fragment
+HexadecimalFloatingPointLiteral
+    :   HexSignificand BinaryExponent FloatTypeSuffix?
+    ;
+
+fragment
+HexSignificand
+    :   HexNumeral '.'?
+    |   '0' [xX] HexDigits? '.' HexDigits
+    ;
+
+fragment
+BinaryExponent
+    :   BinaryExponentIndicator SignedInteger
+    ;
+
+fragment
+BinaryExponentIndicator
+    :   [pP]
+    ;
+
+// §3.10.3 Boolean Literals
+
+BooleanLiteral
+    :   'true'
+    |   'false'
+    ;
+
+
+// §3.10.6 Escape Sequences for Character and String Literals
+
+fragment
+EscapeSequence
+    :   '\\' [btnfr"'\\]
+    |   OctalEscape
+    |   UnicodeEscape
+    |   DollarEscape
+    |   LineEscape
+    ;
+
+
+fragment
+OctalEscape
+    :   '\\' OctalDigit
+    |   '\\' OctalDigit OctalDigit
+    |   '\\' ZeroToThree OctalDigit OctalDigit
+    ;
+
+// Groovy allows 1 or more u's after the backslash
+fragment
+UnicodeEscape
+    :   '\\' 'u'+ HexDigit HexDigit HexDigit HexDigit
+    ;
+
+fragment
+ZeroToThree
+    :   [0-3]
+    ;
+
+// Groovy Escape Sequences
+
+fragment
+DollarEscape
+    :   '\\' DOLLAR
+    ;
+
+fragment
+LineEscape
+    :   '\\' '\r'? '\n'
+    ;
+
+fragment
+SlashEscape
+    :   '\\' '/'
+    ;
+
+fragment
+DollarSlashEscape
+    :   '$/$'
+    ;
+
+fragment
+DollarDollarEscape
+    :   '$$'
+    ;
+// §3.10.7 The Null Literal
+
+NullLiteral
+    :   'null'
+    ;
+
+// Groovy Operators
+
+RANGE_INCLUSIVE     : '..';
+RANGE_EXCLUSIVE     : '..<';
+SPREAD_DOT          : '*.';
+SAFE_DOT            : '?.';
+ELVIS               : '?:';
+METHOD_POINTER      : '.&';
+METHOD_REFERENCE    : '::';
+REGEX_FIND          : '=~';
+REGEX_MATCH         : '==~';
+POWER               : '**';
+POWER_ASSIGN        : '**=';
+SPACESHIP           : '<=>';
+IDENTICAL           : '===';
+NOT_IDENTICAL       : '!==';
+ARROW               : '->';
+
+// !internalPromise will be parsed as !in ternalPromise, so semantic predicates are necessary
+NOT_INSTANCEOF      : '!instanceof' { isFollowedBy(_input, ' ', '\t', '\r', '\n') }?;
+NOT_IN              : '!in'         { isFollowedBy(_input, ' ', '\t', '\r', '\n', '[', '(', '{') }?;
+
+fragment
+DOLLAR              : '$';
+
+
+// §3.11 Separators
+
+LPAREN          : '('  { this.enterParen();     } -> pushMode(DEFAULT_MODE);
+RPAREN          : ')'  { this.exitParen();      } -> popMode;
+LBRACE          : '{'  { this.enterParen();     } -> pushMode(DEFAULT_MODE);
+RBRACE          : '}'  { this.exitParen();      } -> popMode;
+LBRACK          : '['  { this.enterParen();     } -> pushMode(DEFAULT_MODE);
+RBRACK          : ']'  { this.exitParen();      } -> popMode;
+
+SEMI            : ';';
+COMMA           : ',';
+DOT             : '.';
+
+// §3.12 Operators
+
+ASSIGN          : '=';
+GT              : '>';
+LT              : '<';
+NOT             : '!';
+BITNOT          : '~';
+QUESTION        : '?';
+COLON           : ':';
+EQUAL           : '==';
+LE              : '<=';
+GE              : '>=';
+NOTEQUAL        : '!=';
+AND             : '&&';
+OR              : '||';
+INC             : '++';
+DEC             : '--';
+ADD             : '+';
+SUB             : '-';
+MUL             : '*';
+DIV             : '/';
+BITAND          : '&';
+BITOR           : '|';
+XOR             : '^';
+MOD             : '%';
+
+
+ADD_ASSIGN      : '+=';
+SUB_ASSIGN      : '-=';
+MUL_ASSIGN      : '*=';
+DIV_ASSIGN      : '/=';
+AND_ASSIGN      : '&=';
+OR_ASSIGN       : '|=';
+XOR_ASSIGN      : '^=';
+MOD_ASSIGN      : '%=';
+LSHIFT_ASSIGN   : '<<=';
+RSHIFT_ASSIGN   : '>>=';
+URSHIFT_ASSIGN  : '>>>=';
+ELVIS_ASSIGN    : '?=';
+
+
+// §3.8 Identifiers (must appear after all keywords in the grammar)
+CapitalizedIdentifier
+    :   [A-Z] JavaLetterOrDigit*
+
+    // FIXME REMOVE THE FOLLOWING ALTERNATIVE. Groovy's identifier can be unicode escape(e.g. def \u4e00\u9fa5 = '123'), which will impact the performance and is pointless to support IMO
+    |   [A-Z] (JavaLetterOrDigit | UnicodeEscape)*
+    ;
+
+Identifier
+    :   JavaLetter JavaLetterOrDigit*
+
+    // FIXME REMOVE THE FOLLOWING ALTERNATIVE. Groovy's identifier can be unicode escape(e.g. def \u4e00\u9fa5 = '123'), which will impact the performance and is pointless to support IMO
+    |   (JavaLetter | UnicodeEscape) (JavaLetterOrDigit | UnicodeEscape)*
+    ;
+
+fragment
+IdentifierInGString
+    :   JavaLetterInGString JavaLetterOrDigitInGString*
+    ;
+
+fragment
+JavaLetterInGString
+    :   [a-zA-Z_] // these are the "java letters" below 0x7F, except for $
+    |   // covers all characters above 0x7F which are not a surrogate
+        ~[\u0000-\u007F\uD800-\uDBFF]
+        {Character.isJavaIdentifierStart(_input.LA(-1))}?
+    |   // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
+        [\uD800-\uDBFF] [\uDC00-\uDFFF]
+        {Character.isJavaIdentifierStart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}?
+    ;
+
+fragment
+JavaLetterOrDigitInGString
+    :   [a-zA-Z0-9_] // these are the "java letters or digits" below 0x7F, except for $
+    |   // covers all characters above 0x7F which are not a surrogate
+        ~[\u0000-\u007F\uD800-\uDBFF]
+        {Character.isJavaIdentifierPart(_input.LA(-1))}?
+    |   // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
+        [\uD800-\uDBFF] [\uDC00-\uDFFF]
+        {Character.isJavaIdentifierPart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}?
+    ;
+
+
+fragment
+JavaLetter
+    :   [a-zA-Z$_] // these are the "java letters" below 0x7F
+    |   // covers all characters above 0x7F which are not a surrogate
+        ~[\u0000-\u007F\uD800-\uDBFF]
+        {Character.isJavaIdentifierStart(_input.LA(-1))}?
+    |   // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
+        [\uD800-\uDBFF] [\uDC00-\uDFFF]
+        {Character.isJavaIdentifierStart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}?
+    ;
+
+fragment
+JavaLetterOrDigit
+    :   [a-zA-Z0-9$_] // these are the "java letters or digits" below 0x7F
+    |   // covers all characters above 0x7F which are not a surrogate
+        ~[\u0000-\u007F\uD800-\uDBFF]
+        {Character.isJavaIdentifierPart(_input.LA(-1))}?
+    |   // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
+        [\uD800-\uDBFF] [\uDC00-\uDFFF]
+        {Character.isJavaIdentifierPart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}?
+    ;
+
+//
+// Additional symbols not defined in the lexical specification
+//
+
+AT : '@';
+ELLIPSIS : '...';
+
+//
+// Whitespace, line escape and comments
+//
+WS  :  ([ \t\u000C]+ | LineEscape+)     -> skip
+    ;
+
+
+// Inside (...) and [...] but not {...}, ignore newlines.
+NL  : '\r'? '\n'            { this.ignoreTokenInsideParens(); }
+    ;
+
+// Multiple-line comments(including groovydoc comments)
+ML_COMMENT
+    :   '/*' .*? '*/'       { this.ignoreMultiLineCommentConditionally(); } -> type(NL)
+    ;
+
+// Single-line comments
+SL_COMMENT
+    :   '//' ~[\r\n\uFFFF]* { this.ignoreTokenInsideParens(); }             -> type(NL)
+    ;
+
+// Script-header comments.
+// The very first characters of the file may be "#!".  If so, ignore the first line.
+SH_COMMENT
+    :   '#!' { 0 == this.tokenIndex }?<fail={"Shebang comment should appear at the first line"}> ~[\r\n\uFFFF]* -> skip
+    ;
+
+// Unexpected characters will be handled by groovy parser later.
+UNEXPECTED_CHAR
+    :   .
+    ;

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4 b/subprojects/parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
new file mode 100644
index 0000000..6ddf17f
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
@@ -0,0 +1,1270 @@
+/*
+ * This file is adapted from the Antlr4 Java grammar which has the following license
+ *
+ *  Copyright (c) 2013 Terence Parr, Sam Harwell
+ *  All rights reserved.
+ *  [The "BSD licence"]
+ *
+ *    http://www.opensource.org/licenses/bsd-license.php
+ *
+ * Subsequent modifications by the Groovy community have been done under the Apache License v2:
+ *
+ *  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.
+ */
+
+/**
+ * The Groovy grammar is based on the official grammar for Java:
+ * https://github.com/antlr/grammars-v4/blob/master/java/Java.g4
+ */
+parser grammar GroovyParser;
+
+options {
+    tokenVocab = GroovyLexer;
+    contextSuperClass = GroovyParserRuleContext;
+    superClass = AbstractParser;
+}
+
+@header {
+    import java.util.Map;
+    import org.codehaus.groovy.util.ListHashMap;
+    import org.apache.groovy.parser.antlr4.SemanticPredicates;
+    import org.codehaus.groovy.GroovyBugError;
+}
+
+@members {
+
+    public static class GroovyParserRuleContext extends ParserRuleContext {
+        private Map metaDataMap = null;
+
+        public GroovyParserRuleContext() {}
+
+        public GroovyParserRuleContext(ParserRuleContext parent, int invokingStateNumber) {
+            super(parent, invokingStateNumber);
+        }
+
+        /**
+         * Gets the node meta data.
+         *
+         * @param key - the meta data key
+         * @return the node meta data value for this key
+         */
+        public <T> T getNodeMetaData(Object key) {
+            if (metaDataMap == null) {
+                return (T) null;
+            }
+            return (T) metaDataMap.get(key);
+        }
+
+        /**
+         * Sets the node meta data.
+         *
+         * @param key - the meta data key
+         * @param value - the meta data value
+         * @throws GroovyBugError if key is null or there is already meta
+         *                        data under that key
+         */
+        public void setNodeMetaData(Object key, Object value) {
+            if (key==null) throw new GroovyBugError("Tried to set meta data with null key on "+this+".");
+            if (metaDataMap == null) {
+                metaDataMap = new ListHashMap();
+            }
+            Object old = metaDataMap.put(key,value);
+            if (old!=null) throw new GroovyBugError("Tried to overwrite existing meta data "+this+".");
+        }
+
+        /**
+         * Sets the node meta data but allows overwriting values.
+         *
+         * @param key   - the meta data key
+         * @param value - the meta data value
+         * @return the old node meta data value for this key
+         * @throws GroovyBugError if key is null
+         */
+        public Object putNodeMetaData(Object key, Object value) {
+            if (key == null) throw new GroovyBugError("Tried to set meta data with null key on " + this + ".");
+            if (metaDataMap == null) {
+                metaDataMap = new ListHashMap();
+            }
+            return metaDataMap.put(key, value);
+        }
+    }
+
+    @Override
+    public int getSyntaxErrorSource() {
+        return GroovySyntaxError.PARSER;
+    }
+
+    @Override
+    public int getErrorLine() {
+        Token token = _input.LT(-1);
+
+        if (null == token) {
+            return -1;
+        }
+
+        return token.getLine();
+    }
+
+    @Override
+    public int getErrorColumn() {
+        Token token = _input.LT(-1);
+
+        if (null == token) {
+            return -1;
+        }
+
+        return token.getCharPositionInLine() + 1 + token.getText().length();
+    }
+}
+
+// starting point for parsing a groovy file
+compilationUnit
+    :   nls
+        (packageDeclaration (sep | EOF))? (statement (sep | EOF))* EOF
+    ;
+
+packageDeclaration
+    :   annotationsOpt PACKAGE qualifiedName
+    ;
+
+importDeclaration
+    :   annotationsOpt IMPORT STATIC? qualifiedName (DOT MUL | AS alias=identifier)?
+    ;
+
+
+typeDeclaration
+    :   classOrInterfaceModifiersOpt classDeclaration
+    ;
+
+modifier
+    :   classOrInterfaceModifier
+    |   m=(   NATIVE
+          |   SYNCHRONIZED
+          |   TRANSIENT
+          |   VOLATILE
+          |   DEF
+          )
+    ;
+
+modifiersOpt
+    :   modifiers?
+    ;
+
+modifiers
+    :   (modifier nls)+
+    ;
+
+classOrInterfaceModifiersOpt
+    :   classOrInterfaceModifiers?
+    ;
+
+classOrInterfaceModifiers
+    :   (classOrInterfaceModifier nls)+
+    ;
+
+classOrInterfaceModifier
+    :   annotation       // class or interface
+    |   m=(   PUBLIC     // class or interface
+          |   PROTECTED  // class or interface
+          |   PRIVATE    // class or interface
+          |   STATIC     // class or interface
+          |   ABSTRACT   // class or interface
+          |   FINAL      // class only -- does not apply to interfaces
+          |   STRICTFP   // class or interface
+          |   DEFAULT    // interface only -- does not apply to classes
+          )
+    ;
+
+variableModifier
+    :   annotation
+    |   m=( FINAL
+          | DEF
+          // Groovy supports declaring local variables as instance/class fields,
+          // e.g. import groovy.transform.*; @Field static List awe = [1, 2, 3]
+          // e.g. import groovy.transform.*; def a = { @Field public List awe = [1, 2, 3] }
+          // Notice: Groovy 2.4.7 just allows to declare local variables with the following modifiers when using annotations(e.g. @Field)
+          // TODO check whether the following modifiers accompany annotations or not. Because the legacy codes(e.g. benchmark/bench/heapsort.groovy) allow to declare the special instance/class fields without annotations, we leave it as it is for the time being
+          | PUBLIC
+          | PROTECTED
+          | PRIVATE
+          | STATIC
+          | ABSTRACT
+          | STRICTFP
+          )
+    ;
+
+variableModifiersOpt
+    :   variableModifiers?
+    ;
+
+variableModifiers
+    :   (variableModifier nls)+
+    ;
+
+typeParameters
+    :   LT nls typeParameter (COMMA nls typeParameter)* nls GT
+    ;
+
+typeParameter
+    :   className (EXTENDS nls typeBound)?
+    ;
+
+typeBound
+    :   type (BITAND nls type)*
+    ;
+
+typeList
+    :   type (COMMA nls type)*
+    ;
+
+
+/**
+ *  t   0: class; 1: interface; 2: enum; 3: annotation; 4: trait
+ */
+classDeclaration
+locals[ int t ]
+    :   (   CLASS { $t = 0; }
+        |   INTERFACE { $t = 1; }
+        |   ENUM { $t = 2; }
+        |   AT INTERFACE { $t = 3; }
+        |   TRAIT { $t = 4; }
+        )
+        identifier nls
+
+        (
+            { 3 != $t }?
+            typeParameters? nls
+            (
+                { 2 != $t }?
+                (EXTENDS nls
+                    (
+                        // Only interface can extend more than one super class
+                        {1 == $t}? scs=typeList
+                    |
+                        sc=type
+                    )
+                nls)?
+            |
+                /* enum should not have type parameters and extends */
+            )
+
+            (
+                {1 != $t}?
+                (IMPLEMENTS nls is=typeList nls)?
+            |
+                /* interface should not implement other interfaces */
+            )
+        |
+            /* annotation should not have implements and extends*/
+        )
+
+        classBody[$t]
+    ;
+
+// t    see the comment of classDeclaration
+classBody[int t]
+    :   LBRACE nls
+        (
+            /* Only enum can have enum constants */
+            { 2 == $t }?
+            enumConstants? nls
+        |
+
+        )
+        classBodyDeclaration[$t]? (sep classBodyDeclaration[$t])* sep? RBRACE
+    ;
+
+enumConstants
+    :   enumConstant (nls COMMA nls enumConstant)* (nls COMMA)?
+    ;
+
+enumConstant
+    :   annotationsOpt identifier arguments? anonymousInnerClassDeclaration[1]?
+    ;
+
+classBodyDeclaration[int t]
+    :   SEMI
+    |   (STATIC nls)? block
+    |   memberDeclaration[$t]
+    ;
+
+memberDeclaration[int t]
+    :   methodDeclaration[0, $t]
+    |   fieldDeclaration
+    |   modifiersOpt classDeclaration
+    ;
+
+/**
+ *  t   0: *class member* all kinds of method declaration AND constructor declaration,
+ *      1: normal method declaration, 2: abstract method declaration
+ *      3: normal method declaration OR abstract method declaration
+ *  ct  9: script, other see the comment of classDeclaration
+ */
+methodDeclaration[int t, int ct]
+    :   { 3 == $ct }?
+        returnType[$ct] methodName LPAREN rparen (DEFAULT nls elementValue)?
+    |
+        (   { 0 == $t }?
+            modifiersOpt typeParameters?
+        |   modifiersOpt  typeParameters? returnType[$ct]
+        |   modifiers  typeParameters? returnType[$ct]?
+        )
+        methodName formalParameters (nls THROWS nls qualifiedClassNameList)?
+        (
+            { 0 == $t || 3 == $t || 1 == $t}?
+            nls methodBody
+        |
+            { 0 == $t || 3 == $t || 2 == $t }?
+            /* no method body */
+        )
+    ;
+
+methodName
+    :   identifier
+    |   stringLiteral
+    ;
+
+returnType[int ct]
+    :
+        standardType
+    |
+        // annotation method can not have void return type
+        { 3 != $ct }? VOID
+    ;
+
+fieldDeclaration
+    :   variableDeclaration[1]
+    ;
+
+variableDeclarators
+    :   variableDeclarator (COMMA nls variableDeclarator)*
+    ;
+
+variableDeclarator
+    :   variableDeclaratorId (nls ASSIGN nls variableInitializer)?
+    ;
+
+variableDeclaratorId
+    :   identifier
+    ;
+
+variableInitializer
+    :   statementExpression
+    |   standardLambda
+    ;
+
+variableInitializers
+    :   variableInitializer nls (COMMA nls variableInitializer nls)* nls COMMA?
+    ;
+
+standardType
+options { baseContext = type; }
+    :   primitiveType (LBRACK RBRACK)*
+    |   standardClassOrInterfaceType (LBRACK RBRACK)*
+    ;
+
+type
+    :   (   primitiveType
+        |
+            // !!! ERROR ALTERNATIVE !!!
+            VOID { require(false, "void is not allowed here", -4); }
+        ) (LBRACK RBRACK)*
+    |   generalClassOrInterfaceType (LBRACK RBRACK)*
+    ;
+
+classOrInterfaceType
+    :   (   qualifiedClassName
+        |   qualifiedStandardClassName
+        ) typeArguments?
+    ;
+
+generalClassOrInterfaceType
+options { baseContext = classOrInterfaceType; }
+    :   qualifiedClassName typeArguments?
+    ;
+
+standardClassOrInterfaceType
+options { baseContext = classOrInterfaceType; }
+    :   qualifiedStandardClassName typeArguments?
+    ;
+
+primitiveType
+    :   BuiltInPrimitiveType
+    ;
+
+typeArguments
+    :   LT nls typeArgument (COMMA nls typeArgument)* nls GT
+    ;
+
+typeArgument
+    :   type
+    |   QUESTION ((EXTENDS | SUPER) nls type)?
+    ;
+
+qualifiedClassNameList
+    :   qualifiedClassName (COMMA nls qualifiedClassName)*
+    ;
+
+formalParameters
+    :   LPAREN formalParameterList? rparen
+    ;
+
+formalParameterList
+    :   formalParameter (COMMA nls formalParameter)* (COMMA nls lastFormalParameter)?
+    |   lastFormalParameter
+    ;
+
+formalParameter
+    :   variableModifiersOpt type?          variableDeclaratorId (nls ASSIGN nls expression)?
+    ;
+
+lastFormalParameter
+    :   variableModifiersOpt type? ELLIPSIS variableDeclaratorId (nls ASSIGN nls expression)?
+    ;
+
+methodBody
+    :   block
+    ;
+
+qualifiedName
+    :   qualifiedNameElement (DOT qualifiedNameElement)*
+    ;
+
+/**
+ *  Java doesn't have the keywords 'as', 'in', 'def', 'trait' so we make some allowances
+ *  for them in package names for better integration with existing Java packages
+ */
+qualifiedNameElement
+    :   identifier
+    |   DEF
+    |   IN
+    |   AS
+    |   TRAIT
+    ;
+
+qualifiedClassName
+    :   (qualifiedNameElement DOT)* identifier
+    ;
+
+qualifiedStandardClassName
+    :   (qualifiedNameElement DOT)* (className DOT)* className
+    ;
+
+literal
+    :   IntegerLiteral                                                                      #integerLiteralAlt
+    |   FloatingPointLiteral                                                                #floatingPointLiteralAlt
+    |   stringLiteral                                                                       #stringLiteralAlt
+    |   BooleanLiteral                                                                      #booleanLiteralAlt
+    |   NullLiteral                                                                         #nullLiteralAlt
+    ;
+
+// GSTRING
+
+gstring
+    :   GStringBegin gstringValue (GStringPart  gstringValue)* GStringEnd
+    ;
+
+gstringValue
+    :   gstringPath
+    |   LBRACE statementExpression? RBRACE
+    |   closure
+    ;
+
+gstringPath
+    :   identifier GStringPathPart*
+    ;
+
+
+// LAMBDA EXPRESSION
+lambda
+options { baseContext = standardLambda; }
+	:	lambdaParameters nls ARROW nls lambdaBody
+	;
+
+standardLambda
+	:	standardLambdaParameters nls ARROW nls lambdaBody
+	;
+
+lambdaParameters
+options { baseContext = standardLambdaParameters; }
+    :   formalParameters
+
+    // { a -> a * 2 } can be parsed as a lambda expression in a block, but we expect a closure.
+    // So it is better to put parameters in the parentheses and the following single parameter without parentheses is limited
+//    |   variableDeclaratorId
+    ;
+
+standardLambdaParameters
+    :   formalParameters
+    |   variableDeclaratorId
+    ;
+
+lambdaBody
+	:	block
+	|	statementExpression
+	;
+
+
+// CLOSURE
+closure
+locals[ String footprint = "" ]
+    :   LBRACE nls (formalParameterList? nls ARROW nls)? blockStatementsOpt RBRACE
+    ;
+
+blockStatementsOpt
+    :   blockStatements?
+    ;
+
+blockStatements
+    :   blockStatement (sep blockStatement)* sep?
+    ;
+
+// ANNOTATIONS
+
+annotationsOpt
+    :   (annotation nls)*
+    ;
+
+annotation
+    :   AT annotationName ( LPAREN elementValues? rparen )?
+    ;
+
+elementValues
+    :   elementValuePairs
+    |   elementValue
+    ;
+
+annotationName : qualifiedClassName ;
+
+elementValuePairs
+    :   elementValuePair (COMMA elementValuePair)*
+    ;
+
+elementValuePair
+    :   elementValuePairName nls ASSIGN nls elementValue
+    ;
+
+elementValuePairName
+    :   identifier
+    |   keywords
+    ;
+
+// TODO verify the potential performance issue because rule expression contains sub-rule assignments(https://github.com/antlr/grammars-v4/issues/215)
+elementValue
+    :   elementValueArrayInitializer
+    |   annotation
+    |   expression
+    ;
+
+elementValueArrayInitializer
+    :   LBRACK (elementValue (COMMA elementValue)*)? (COMMA)? RBRACK
+    ;
+
+// STATEMENTS / BLOCKS
+
+block
+    :   LBRACE nls blockStatementsOpt RBRACE
+    ;
+
+blockStatement
+    :   localVariableDeclaration
+    |   statement
+    ;
+
+localVariableDeclaration
+    :   { !SemanticPredicates.isInvalidLocalVariableDeclaration(_input) }?
+        variableDeclaration[0]
+    ;
+
+/**
+ *  t   0: local variable declaration; 1: field declaration
+ */
+variableDeclaration[int t]
+    :   (   { 0 == $t }? variableModifiers
+        |   { 1 == $t }? modifiers
+        )
+        type? variableDeclarators
+    |
+        (   { 0 == $t }? variableModifiersOpt
+        |   { 1 == $t }? modifiersOpt
+        )
+        type variableDeclarators
+    |
+        (   { 0 == $t }? variableModifiers
+        |   { 1 == $t }? modifiers
+        )
+        typeNamePairs nls ASSIGN nls variableInitializer
+    ;
+
+typeNamePairs
+    :   LPAREN typeNamePair (COMMA typeNamePair)* rparen
+    ;
+
+typeNamePair
+    :   type? variableDeclaratorId
+    ;
+
+variableNames
+    :   LPAREN variableDeclaratorId (COMMA variableDeclaratorId)+ rparen
+    ;
+
+switchStatement
+locals[ String footprint = "" ]
+    :   SWITCH parExpression nls LBRACE nls switchBlockStatementGroup* nls RBRACE
+    ;
+
+loopStatement
+locals[ String footprint = "" ]
+    :   FOR LPAREN forControl rparen nls statement                                                          #forStmtAlt
+    |   WHILE parExpression nls statement                                                                   #whileStmtAlt
+    |   DO nls statement nls WHILE parExpression                                                            #doWhileStmtAlt
+    ;
+
+continueStatement
+locals[ boolean isInsideLoop ]
+@init {
+    try {
+        $isInsideLoop = null != $loopStatement::footprint;
+    } catch(NullPointerException e) {
+        $isInsideLoop = false;
+    }
+}
+    :   CONTINUE
+        { require($isInsideLoop, "the continue statement is only allowed inside loops", -8); }
+        identifier?
+    ;
+
+breakStatement
+locals[ boolean isInsideLoop, boolean isInsideSwitch ]
+@init {
+    try {
+        $isInsideLoop = null != $loopStatement::footprint;
+    } catch(NullPointerException e) {
+        $isInsideLoop = false;
+    }
+
+    try {
+        $isInsideSwitch = null != $switchStatement::footprint;
+    } catch(NullPointerException e) {
+        $isInsideSwitch = false;
+    }
+}
+    :   BREAK
+        { require($isInsideLoop || $isInsideSwitch, "the break statement is only allowed inside loops or switches", -5); }
+        identifier?
+    ;
+
+tryCatchStatement
+locals[boolean resourcesExists = false]
+    :   TRY (resources { $resourcesExists = true; })? nls
+        block
+        (
+            (nls catchClause)+
+            (nls finallyBlock)?
+        |
+            nls finallyBlock
+        |
+            // try-with-resources can have no catche and finally clauses
+            { $resourcesExists }?<fail={"catch or finally clauses are required for try-catch statement"}>
+        )
+    ;
+
+assertStatement
+locals[ String footprint = "" ]
+    :   ASSERT ce=expression ((COLON | COMMA) nls me=expression)?
+    ;
+
+statement
+    :   block                                                                                               #blockStmtAlt
+    |   IF parExpression nls tb=statement ((nls | sep) ELSE nls fb=statement)?                              #ifElseStmtAlt
+    |   loopStatement                                                                                       #loopStmtAlt
+
+    |   tryCatchStatement                                                                                   #tryCatchStmtAlt
+
+    |   switchStatement                                                                                     #switchStmtAlt
+    |   SYNCHRONIZED parExpression nls block                                                                #synchronizedStmtAlt
+    |   RETURN expression?                                                                                  #returnStmtAlt
+    |   THROW expression                                                                                    #throwStmtAlt
+
+    |   breakStatement                                                                                      #breakStmtAlt
+    |   continueStatement                                                                                   #continueStmtAlt
+
+    |   identifier COLON nls statement                                                                      #labeledStmtAlt
+
+    // Import statement.  Can be used in any scope.  Has "import x as y" also.
+    |   importDeclaration                                                                                   #importStmtAlt
+
+    |   assertStatement                                                                                     #assertStmtAlt
+
+    |   typeDeclaration                                                                                     #typeDeclarationStmtAlt
+    |   localVariableDeclaration                                                                            #localVariableDeclarationStmtAlt
+
+    // validate the method in the AstBuilder#visitMethodDeclaration, e.g. method without method body is not allowed
+    |   { !SemanticPredicates.isInvalidMethodDeclaration(_input) }?
+        methodDeclaration[3, 9]                                                                             #methodDeclarationStmtAlt
+
+    |   statementExpression                                                                                 #expressionStmtAlt
+
+    |   SEMI                                                                                                #emptyStmtAlt
+    ;
+
+catchClause
+    :   CATCH LPAREN variableModifiersOpt catchType? identifier rparen nls block
+    ;
+
+catchType
+    :   qualifiedClassName (BITOR qualifiedClassName)*
+    ;
+
+finallyBlock
+    :   FINALLY nls block
+    ;
+
+
+resources
+    :   LPAREN nls resourceList sep? rparen
+    ;
+
+resourceList
+    :   resource (sep resource)*
+    ;
+
+resource
+    :   localVariableDeclaration
+    |   expression
+    ;
+
+
+/** Matches cases then statements, both of which are mandatory.
+ *  To handle empty cases at the end, we add switchLabel* to statement.
+ */
+switchBlockStatementGroup
+    :   (switchLabel nls)+ blockStatements
+    ;
+
+switchLabel
+    :   CASE expression COLON
+    |   DEFAULT COLON
+    ;
+
+forControl
+    :   enhancedForControl
+    |   classicalForControl
+    ;
+
+enhancedForControl
+    :   variableModifiersOpt type? variableDeclaratorId (COLON | IN) expression
+    ;
+
+classicalForControl
+    :   forInit? SEMI expression? SEMI forUpdate?
+    ;
+
+forInit
+    :   localVariableDeclaration
+    |   expressionList[false]
+    ;
+
+forUpdate
+    :   expressionList[false]
+    ;
+
+
+// EXPRESSIONS
+
+castParExpression
+    :   LPAREN type rparen
+    ;
+
+parExpression
+    :   LPAREN (statementExpression | standardLambda) rparen
+    ;
+
+expressionList[boolean canSpread]
+    :   expressionListElement[$canSpread] (COMMA expressionListElement[$canSpread])*
+    ;
+
+expressionListElement[boolean canSpread]
+    :   (   MUL { require($canSpread, "spread operator is not allowed here", -1); }
+        |
+        ) expression
+    ;
+
+/**
+ *  In order to resolve the syntactic ambiguities, e.g. (String)'abc' can be parsed as a cast expression or a parentheses-less method call(method name: (String), arguments: 'abc')
+ *      try to match expression first.
+ *  If it is not a normal expression, then try to match the command expression
+ */
+statementExpression
+    :   expression                          #normalExprAlt
+    |   commandExpression                   #commandExprAlt
+    ;
+
+postfixExpression
+locals[ boolean isInsideAssert ]
+@init {
+    try {
+        $isInsideAssert = null != $assertStatement::footprint;
+    } catch(NullPointerException e) {
+        $isInsideAssert = false;
+    }
+}
+    :   pathExpression op=(INC | DEC)?
+    ;
+
+expression
+    // qualified names, array expressions, method invocation, post inc/dec, type casting (level 1)
+    // The cast expression must be put before pathExpression to resovle the ambiguities between type casting and call on parentheses expression, e.g. (int)(1 / 2)
+    :   castParExpression expression                                                        #castExprAlt
+    |   postfixExpression                                                                   #postfixExprAlt
+
+    // ~(BNOT)/!(LNOT) (level 1)
+    |   (BITNOT | NOT) nls expression                                                       #unaryNotExprAlt
+
+    // math power operator (**) (level 2)
+    |   left=expression op=POWER nls right=expression                                       #powerExprAlt
+
+    // ++(prefix)/--(prefix)/+(unary)/-(unary) (level 3)
+    |   op=(INC | DEC | ADD | SUB) expression                                               #unaryAddExprAlt
+
+    // multiplication/division/modulo (level 4)
+    |   left=expression nls op=(MUL | DIV | MOD) nls right=expression                       #multiplicativeExprAlt
+
+    // binary addition/subtraction (level 5)
+    |   left=expression op=(ADD | SUB) nls right=expression                                 #additiveExprAlt
+
+    // bit shift expressions (level 6)
+    |   left=expression nls
+            (           (   dlOp=LT LT
+                        |   tgOp=GT GT GT
+                        |   dgOp=GT GT
+                        )
+            |   rangeOp=(    RANGE_INCLUSIVE
+                        |    RANGE_EXCLUSIVE
+                        )
+            ) nls
+        right=expression                                                                    #shiftExprAlt
+
+    // boolean relational expressions (level 7)
+    |   left=expression nls op=(AS | INSTANCEOF | NOT_INSTANCEOF) nls type                  #relationalExprAlt
+    |   left=expression nls op=(LE | GE | GT | LT | IN | NOT_IN)  nls right=expression      #relationalExprAlt
+
+    // equality/inequality (==/!=) (level 8)
+    |   left=expression nls
+            op=(    IDENTICAL
+               |    NOT_IDENTICAL
+               |    EQUAL
+               |    NOTEQUAL
+               |    SPACESHIP
+               ) nls
+        right=expression                                                                    #equalityExprAlt
+
+    // regex find and match (=~ and ==~) (level 8.5)
+    // jez: moved =~ closer to precedence of == etc, as...
+    // 'if (foo =~ "a.c")' is very close in intent to 'if (foo == "abc")'
+    |   left=expression nls op=(REGEX_FIND | REGEX_MATCH) nls right=expression              #regexExprAlt
+
+    // bitwise or non-short-circuiting and (&)  (level 9)
+    |   left=expression nls op=BITAND nls right=expression                                  #andExprAlt
+
+    // exclusive or (^)  (level 10)
+    |   left=expression nls op=XOR nls right=expression                                     #exclusiveOrExprAlt
+
+    // bitwise or non-short-circuiting or (|)  (level 11)
+    |   left=expression nls op=BITOR nls right=expression                                   #inclusiveOrExprAlt
+
+    // logical and (&&)  (level 12)
+    |   left=expression nls op=AND nls right=expression                                     #logicalAndExprAlt
+
+    // logical or (||)  (level 13)
+    |   left=expression nls op=OR nls right=expression                                      #logicalOrExprAlt
+
+    // conditional test (level 14)
+    |   <assoc=right> con=expression nls
+        (   QUESTION nls tb=expression nls COLON nls
+        |   ELVIS nls
+        )
+        fb=expression                                                                       #conditionalExprAlt
+
+    // assignment expression (level 15)
+    // "(a) = [1]" is a special case of multipleAssignmentExprAlt, it will be handle by assignmentExprAlt
+    |   <assoc=right> left=variableNames nls op=ASSIGN nls right=statementExpression        #multipleAssignmentExprAlt
+    |   <assoc=right> left=expression nls
+                        op=(   ASSIGN
+                           |   ADD_ASSIGN
+                           |   SUB_ASSIGN
+                           |   MUL_ASSIGN
+                           |   DIV_ASSIGN
+                           |   AND_ASSIGN
+                           |   OR_ASSIGN
+                           |   XOR_ASSIGN
+                           |   RSHIFT_ASSIGN
+                           |   URSHIFT_ASSIGN
+                           |   LSHIFT_ASSIGN
+                           |   MOD_ASSIGN
+                           |   POWER_ASSIGN
+                           |   ELVIS_ASSIGN
+                           ) nls
+                     (statementExpression | standardLambda)                                 #assignmentExprAlt
+    ;
+
+commandExpression
+    :   pathExpression
+        (
+            { SemanticPredicates.isFollowingMethodName($pathExpression.t) }?
+            argumentList
+        |
+            /* if pathExpression is a method call, no need to have any more arguments */
+        )
+
+        commandArgument*
+    ;
+
+commandArgument
+    :   primary
+        // what follows is either a normal argument, parens,
+        // an appended block, an index operation, or nothing
+        // parens (a b already processed):
+        //      a b c() d e -> a(b).c().d(e)
+        //      a b c()() d e -> a(b).c().call().d(e)
+        // index (a b already processed):
+        //      a b c[x] d e -> a(b).c[x].d(e)
+        //      a b c[x][y] d e -> a(b).c[x][y].d(e)
+        // block (a b already processed):
+        //      a b c {x} d e -> a(b).c({x}).d(e)
+        //
+        // parens/block completes method call
+        // index makes method call to property get with index
+        //
+        (   pathElement+
+        |   argumentList
+        )?
+    ;
+
+/**
+ *  A "path expression" is a name or other primary, possibly qualified by various
+ *  forms of dot, and/or followed by various kinds of brackets.
+ *  It can be used for value or assigned to, or else further qualified, indexed, or called.
+ *  It is called a "path" because it looks like a linear path through a data structure.
+ *  Examples:  x.y, x?.y, x*.y, x.@y; x[], x[y], x[y,z]; x(), x(y), x(y,z); x{s}; a.b[n].c(x).d{s}
+ *  (Compare to a C lvalue, or LeftHandSide in the JLS section 15.26.)
+ *  General expressions are built up from path expressions, using operators like '+' and '='.
+ *
+ *  t   0: primary, 1: namePart, 2: arguments, 3: closure, 4: indexPropertyArgs, 5: namedPropertyArgs
+ */
+pathExpression returns [int t]
+    :   primary (pathElement { $t = $pathElement.t; })*
+    ;
+
+pathElement returns [int t]
+locals[ boolean isInsideClosure ]
+@init {
+    try {
+        $isInsideClosure = null != $closure::footprint;
+    } catch(NullPointerException e) {
+        $isInsideClosure = false;
+    }
+}
+    :   nls
+
+        // AT: foo.@bar selects the field (or attribute), not property
+        ( SPREAD_DOT nls (AT | nonWildcardTypeArguments)?       // Spread operator:  x*.y  ===  x?.collect{it.y}
+        | SAFE_DOT nls (AT | nonWildcardTypeArguments)?         // Optional-null operator:  x?.y  === (x==null)?null:x.y
+        | METHOD_POINTER nls                                    // Method pointer operator: foo.&y == foo.metaClass.getMethodPointer(foo, "y")
+        | METHOD_REFERENCE nls                                  // Method reference: System.out::println
+        | DOT nls (AT | nonWildcardTypeArguments)?              // The all-powerful dot.
+        )
+        namePart
+        { $t = 1; }
+
+    |   arguments
+        { $t = 2; }
+
+    // Can always append a block, as foo{bar}
+    |   nls closure
+        { $t = 3; }
+
+    // Element selection is always an option, too.
+    // In Groovy, the stuff between brackets is a general argument list,
+    // since the bracket operator is transformed into a method call.
+    |   indexPropertyArgs
+        { $t = 4; }
+
+    |   namedPropertyArgs
+        { $t = 5; }
+    ;
+
+/**
+ *  This is the grammar for what can follow a dot:  x.a, x.@a, x.&a, x.'a', etc.
+ */
+namePart
+    :
+        (   identifier
+
+        // foo.'bar' is in all ways same as foo.bar, except that bar can have an arbitrary spelling
+        |   stringLiteral
+
+        |   dynamicMemberName
+
+        /* just a PROPOSAL, which has not been implemented yet!
+        // PROPOSAL, DECIDE:  Is this inline form of the 'with' statement useful?
+        // Definition:  a.{foo} === {with(a) {foo}}
+        // May cover some path expression use-cases previously handled by dynamic scoping (closure delegates).
+        |   block
+        */
+
+        // let's allow common keywords as property names
+        |   keywords
+        )
+    ;
+
+/**
+ *  If a dot is followed by a parenthesized or quoted expression, the member is computed dynamically,
+ *  and the member selection is done only at runtime.  This forces a statically unchecked member access.
+ */
+dynamicMemberName
+    :   parExpression
+    |   gstring
+    ;
+
+/** An expression may be followed by [...].
+ *  Unlike Java, these brackets may contain a general argument list,
+ *  which is passed to the array element operator, which can make of it what it wants.
+ *  The brackets may also be empty, as in T[].  This is how Groovy names array types.
+ */
+indexPropertyArgs
+    :   QUESTION? LBRACK expressionList[true]? RBRACK
+    ;
+
+namedPropertyArgs
+    :   LBRACK mapEntryList RBRACK
+    ;
+
+primary
+    :   identifier                                                                          #identifierPrmrAlt
+    |   literal                                                                             #literalPrmrAlt
+    |   gstring                                                                             #gstringPrmrAlt
+    |   NEW nls creator                                                                     #newPrmrAlt
+    |   THIS                                                                                #thisPrmrAlt
+    |   SUPER                                                                               #superPrmrAlt
+    |   parExpression                                                                       #parenPrmrAlt
+    |   closure                                                                             #closurePrmrAlt
+    |   lambda                                                                              #lambdaPrmrAlt
+    |   list                                                                                #listPrmrAlt
+    |   map                                                                                 #mapPrmrAlt
+    |   builtInType                                                                         #typePrmrAlt
+    ;
+
+list
+locals[boolean empty = true]
+    :   LBRACK
+        (
+            expressionList[true]
+            { $empty = false; }
+        )?
+        (
+            COMMA
+            { require(!$empty, "Empty list constructor should not contain any comma(,)", -1); }
+        )?
+        RBRACK
+    ;
+
+map
+    :   LBRACK
+        (   mapEntryList COMMA?
+        |   COLON
+        )
+        RBRACK
+    ;
+
+mapEntryList
+    :   mapEntry (COMMA mapEntry)*
+    ;
+
+mapEntry
+    :   mapEntryLabel COLON nls expression
+    |   MUL COLON nls expression
+    ;
+
+mapEntryLabel
+    :   keywords
+    |   primary
+    ;
+
+creator
+    :   createdName
+        (   nls arguments anonymousInnerClassDeclaration[0]?
+        |   (LBRACK expression RBRACK)+ (b+=LBRACK RBRACK)*
+        |   (b+=LBRACK RBRACK)+ nls arrayInitializer
+        )
+    ;
+
+arrayInitializer
+    :   LBRACE nls variableInitializers? nls RBRACE
+    ;
+
+/**
+ *  t   0: anonymous inner class; 1: anonymous enum
+ */
+anonymousInnerClassDeclaration[int t]
+    :   classBody[0]
+    ;
+
+createdName
+    :   primitiveType
+    |   qualifiedClassName typeArgumentsOrDiamond?
+    ;
+
+nonWildcardTypeArguments
+    :   LT nls typeList nls GT
+    ;
+
+typeArgumentsOrDiamond
+    :   LT GT
+    |   typeArguments
+    ;
+
+arguments
+    :   LPAREN
+        (   enhancedArgumentList?
+        |   enhancedArgumentList COMMA
+        )
+        rparen
+    ;
+
+argumentList
+options { baseContext = enhancedArgumentList; }
+    :   argumentListElement
+        (   COMMA nls
+            argumentListElement
+        )*
+    ;
+
+enhancedArgumentList
+    :   enhancedArgumentListElement
+        (   COMMA nls
+            enhancedArgumentListElement
+        )*
+    ;
+
+argumentListElement
+options { baseContext = enhancedArgumentListElement; }
+    :   expressionListElement[true]
+    |   mapEntry
+    ;
+
+enhancedArgumentListElement
+    :   expressionListElement[true]
+    |   standardLambda
+    |   mapEntry
+    ;
+
+stringLiteral
+    :   StringLiteral
+    ;
+
+className
+    :   CapitalizedIdentifier
+    ;
+
+identifier
+    :   Identifier
+    |   CapitalizedIdentifier
+
+    |
+        // if 'static' followed by DOT, we can treat them as identifiers, e.g. static.unused = { -> }
+        { DOT == _input.LT(2).getType() }?
+        STATIC
+    ;
+
+builtInType
+    :   BuiltInPrimitiveType
+    |   VOID
+    ;
+
+keywords
+    :   ABSTRACT
+    |   AS
+    |   ASSERT
+    |   BREAK
+    |   CASE
+    |   CATCH
+    |   CLASS
+    |   CONST
+    |   CONTINUE
+    |   DEF
+    |   DEFAULT
+    |   DO
+    |   ELSE
+    |   ENUM
+    |   EXTENDS
+    |   FINAL
+    |   FINALLY
+    |   FOR
+    |   GOTO
+    |   IF
+    |   IMPLEMENTS
+    |   IMPORT
+    |   IN
+    |   INSTANCEOF
+    |   INTERFACE
+    |   NATIVE
+    |   NEW
+    |   PACKAGE
+    |   RETURN
+    |   STATIC
+    |   STRICTFP
+    |   SUPER
+    |   SWITCH
+    |   SYNCHRONIZED
+    |   THIS
+    |   THROW
+    |   THROWS
+    |   TRANSIENT
+    |   TRAIT
+    |   TRY
+    |   VOLATILE
+    |   WHILE
+
+    |   NullLiteral
+    |   BooleanLiteral
+
+    |   BuiltInPrimitiveType
+    |   VOID
+
+    |   PUBLIC
+    |   PROTECTED
+    |   PRIVATE
+    ;
+
+rparen
+    :   RPAREN
+    |
+        // !!!Error Alternatives, impact the performance of parsing!!!
+        { require(false, "Missing ')'"); }
+    ;
+
+nls
+    :   NL*
+    ;
+
+sep :   SEMI NL*
+    |   NL+ (SEMI NL*)*
+    ;
+
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/groovy/org/apache/groovy/parser/antlr4/util/GroovyTestRig.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/groovy/org/apache/groovy/parser/antlr4/util/GroovyTestRig.groovy b/subprojects/parser-antlr4/src/main/groovy/org/apache/groovy/parser/antlr4/util/GroovyTestRig.groovy
new file mode 100644
index 0000000..798ed5f
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/groovy/org/apache/groovy/parser/antlr4/util/GroovyTestRig.groovy
@@ -0,0 +1,74 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4.util
+
+import groovy.util.logging.Log
+import org.antlr.v4.gui.TestRig
+import org.antlr.v4.runtime.ANTLRInputStream
+import org.antlr.v4.runtime.CommonTokenStream
+import org.apache.groovy.parser.antlr4.GroovyLangLexer
+import org.apache.groovy.parser.antlr4.GroovyLangParser
+
+/**
+ * A basic debug tool for investigating the parse trees and tokens of Groovy source code
+ *
+ * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
+ * Created on    2016/08/14
+ */
+@Log
+public class GroovyTestRig extends TestRig {
+    public GroovyTestRig(String[] args) throws Exception {
+        super(['Groovy', args.contains('-lexer') ? 'tokens' : 'compilationUnit', *args] as String[]);
+    }
+
+    public void inspectParseTree() {
+        def inputFile = new File(this.inputFiles[0]);
+
+        if (!(inputFile.exists() && inputFile.isFile())) {
+            log.info "Input file[${inputFile.absolutePath}] does not exist."
+            return;
+        }
+
+        byte[] content = inputFile.bytes;
+        String text = new String(content, this.encoding ?: 'UTF-8');
+
+        GroovyLangLexer lexer = new GroovyLangLexer(new ANTLRInputStream(text));
+        CommonTokenStream tokens = new CommonTokenStream(lexer);
+        GroovyLangParser parser = new GroovyLangParser(tokens);
+
+        this.process(lexer, GroovyLangParser.class, parser, new ByteArrayInputStream(content), new StringReader(text));
+    }
+
+    public static void main(String[] args) {
+        if (args.length == 0) {
+            log.info "Usage: [-tokens] [-lexer] [-tree] [-gui] [-ps file.ps] [-encoding encodingname] [-trace] [-diagnostics] [-SLL] input-filename";
+            return;
+        }
+
+        if (args.every { it.startsWith('-') }) {
+            log.info "input-filename is required!"
+            return;
+        }
+
+        GroovyTestRig groovyTestRig = new GroovyTestRig(args);
+
+        groovyTestRig.inspectParseTree();
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/AbstractParser.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/AbstractParser.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/AbstractParser.java
new file mode 100644
index 0000000..f216797
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/AbstractParser.java
@@ -0,0 +1,83 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser;
+
+import groovy.lang.GroovyClassLoader;
+import org.codehaus.groovy.ast.ModuleNode;
+import org.codehaus.groovy.control.CompilerConfiguration;
+import org.codehaus.groovy.control.ErrorCollector;
+import org.codehaus.groovy.control.SourceUnit;
+
+import java.io.File;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * The base parser for creating a module node.
+ * The concrete compiler configuration can be specified by the sub-classes of the base parser(e.g. Antlr2Parser, Antlr4Parser)
+ *
+ * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
+ * Created on    2016/08/14
+ */
+public abstract class AbstractParser {
+    private static final Logger LOGGER = Logger.getLogger(AbstractParser.class.getName());
+
+    public ModuleNode parse(File file) {
+        if (null == file || !file.exists()) {
+            throw new IllegalArgumentException(file + " does not exist.");
+        }
+
+        CompilerConfiguration configuration = this.getCompilerConfiguration();
+        SourceUnit sourceUnit = new SourceUnit(file, configuration, new GroovyClassLoader(), new ErrorCollector(configuration));
+
+        return this.parse(sourceUnit);
+    }
+
+    public ModuleNode parse(String name, String text) {
+        if (null == name) {
+            throw new IllegalArgumentException("name should not be null");
+        }
+
+        if (null == text) {
+            throw new IllegalArgumentException("text should not be null");
+        }
+
+        CompilerConfiguration configuration = this.getCompilerConfiguration();
+        SourceUnit sourceUnit = new SourceUnit(name, text, configuration, new GroovyClassLoader(), new ErrorCollector(configuration));
+
+        return this.parse(sourceUnit);
+    }
+
+    public ModuleNode parse(SourceUnit sourceUnit) {
+        try {
+            sourceUnit.parse();
+            sourceUnit.completePhase();
+            sourceUnit.nextPhase();
+            sourceUnit.convert();
+
+            return sourceUnit.getAST();
+        } catch (Exception e) {
+            LOGGER.log(Level.SEVERE, "Failed to parse " + sourceUnit.getName(), e);
+
+            return null;
+        }
+    }
+
+    protected abstract CompilerConfiguration getCompilerConfiguration();
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/Antlr2Parser.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/Antlr2Parser.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/Antlr2Parser.java
new file mode 100644
index 0000000..6567896
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/Antlr2Parser.java
@@ -0,0 +1,34 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser;
+
+import org.codehaus.groovy.control.CompilerConfiguration;
+
+/**
+ * The Antlr2 parser for creating a module node.
+ *
+ * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
+ * Created on    2016/08/14
+ */
+public class Antlr2Parser extends AbstractParser {
+    @Override
+    protected CompilerConfiguration getCompilerConfiguration() {
+        return CompilerConfiguration.DEFAULT;
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/Antlr4Parser.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/Antlr4Parser.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/Antlr4Parser.java
new file mode 100644
index 0000000..ebe569c
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/Antlr4Parser.java
@@ -0,0 +1,39 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser;
+
+import org.apache.groovy.parser.antlr4.Antlr4PluginFactory;
+import org.codehaus.groovy.control.CompilerConfiguration;
+
+/**
+ * The Antlr4 parser for creating a module node.
+ *
+ * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
+ * Created on    2016/08/14
+ */
+public class Antlr4Parser extends AbstractParser {
+
+    @Override
+    protected CompilerConfiguration getCompilerConfiguration() {
+        CompilerConfiguration configuration = new CompilerConfiguration(CompilerConfiguration.DEFAULT);
+        configuration.setPluginFactory(new Antlr4PluginFactory());
+
+        return configuration;
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractLexer.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractLexer.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractLexer.java
new file mode 100644
index 0000000..b3781b4
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractLexer.java
@@ -0,0 +1,32 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4;
+
+import org.antlr.v4.runtime.CharStream;
+import org.antlr.v4.runtime.Lexer;
+
+/**
+ * Because antlr4 does not support generating lexer with specified interface,
+ * we have to create a super class for it and implement the interface.
+ */
+public abstract class AbstractLexer extends Lexer implements SyntaxErrorReportable {
+    public AbstractLexer(CharStream input) {
+        super(input);
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractParser.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractParser.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractParser.java
new file mode 100644
index 0000000..95f493d
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractParser.java
@@ -0,0 +1,32 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4;
+
+import org.antlr.v4.runtime.Parser;
+import org.antlr.v4.runtime.TokenStream;
+
+/**
+ * Because antlr4 does not support generating parser with specified interface,
+ * we have to create a super class for it and implement the interface.
+ */
+public abstract class AbstractParser extends Parser implements SyntaxErrorReportable {
+    public AbstractParser(TokenStream input) {
+        super(input);
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4ParserPlugin.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4ParserPlugin.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4ParserPlugin.java
new file mode 100644
index 0000000..4d91d29
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4ParserPlugin.java
@@ -0,0 +1,45 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4;
+
+import org.codehaus.groovy.ast.ModuleNode;
+import org.codehaus.groovy.control.CompilationFailedException;
+import org.codehaus.groovy.control.ParserPlugin;
+import org.codehaus.groovy.control.SourceUnit;
+import org.codehaus.groovy.syntax.ParserException;
+import org.codehaus.groovy.syntax.Reduction;
+
+/**
+ * A parser plugin for the new parser
+ *
+ * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
+ * Created on    2016/08/14
+ */
+public class Antlr4ParserPlugin implements ParserPlugin {
+    @Override
+    public Reduction parseCST(SourceUnit sourceUnit, java.io.Reader reader) throws CompilationFailedException {
+        return null;
+    }
+
+    @Override
+    public ModuleNode buildAST(SourceUnit sourceUnit, java.lang.ClassLoader classLoader, Reduction cst) throws ParserException {
+        AstBuilder builder = new AstBuilder(sourceUnit, classLoader);
+        return builder.buildAST();
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4PluginFactory.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4PluginFactory.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4PluginFactory.java
new file mode 100644
index 0000000..10309d0
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/Antlr4PluginFactory.java
@@ -0,0 +1,35 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4;
+
+import org.codehaus.groovy.control.ParserPlugin;
+import org.codehaus.groovy.control.ParserPluginFactory;
+
+/**
+ * A parser plugin factory for the new parser
+ *
+ * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
+ * Created on    2016/08/14
+ */
+public class Antlr4PluginFactory extends ParserPluginFactory {
+    @Override
+    public ParserPlugin createParserPlugin() {
+        return new Antlr4ParserPlugin();
+    }
+}


[50/50] [abbrv] groovy git commit: GString literals can exist within source files at restricted places (originally related to parser restrictions because they start with the same character as comments). They can't start directly after a comment but leavi

Posted by pa...@apache.org.
GString literals can exist within source files at restricted places (originally related to parser restrictions because they start with the same character as comments). They can't start directly after a comment but leaving a blank line is sufficient.


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/35f0fa07
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/35f0fa07
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/35f0fa07

Branch: refs/heads/parrot
Commit: 35f0fa07e3b9eeabeab9e07b5f205979530b3b54
Parents: 6284259
Author: paulk <pa...@asert.com.au>
Authored: Wed May 10 12:33:26 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:26:03 2017 +1000

----------------------------------------------------------------------
 subprojects/parser-antlr4/src/test/resources/core/GString_02.groovy | 1 +
 subprojects/parser-antlr4/src/test/resources/core/GString_06.groovy | 1 +
 subprojects/parser-antlr4/src/test/resources/core/Literal_03.groovy | 1 +
 3 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/35f0fa07/subprojects/parser-antlr4/src/test/resources/core/GString_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/GString_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/GString_02.groovy
index 2e69232..a995cb1 100644
--- a/subprojects/parser-antlr4/src/test/resources/core/GString_02.groovy
+++ b/subprojects/parser-antlr4/src/test/resources/core/GString_02.groovy
@@ -16,6 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
+
 /abc${'123'}def $a.b.c,d${->12}/
 $/${-12}abc${'123'}def $a.b.c,d${->12}/$
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/35f0fa07/subprojects/parser-antlr4/src/test/resources/core/GString_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/GString_06.groovy b/subprojects/parser-antlr4/src/test/resources/core/GString_06.groovy
index 18d5770..fa222dc 100644
--- a/subprojects/parser-antlr4/src/test/resources/core/GString_06.groovy
+++ b/subprojects/parser-antlr4/src/test/resources/core/GString_06.groovy
@@ -16,4 +16,5 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
+
 /At $date/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/35f0fa07/subprojects/parser-antlr4/src/test/resources/core/Literal_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Literal_03.groovy b/subprojects/parser-antlr4/src/test/resources/core/Literal_03.groovy
index 865596b..5c81362 100644
--- a/subprojects/parser-antlr4/src/test/resources/core/Literal_03.groovy
+++ b/subprojects/parser-antlr4/src/test/resources/core/Literal_03.groovy
@@ -16,6 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
+
 /\123 \/ abc \u1234 \r\n\$/
 
 $/\123 \/ abc \u1234 \r\n/$


[44/50] [abbrv] groovy git commit: rename antlr4 parser to remove groovy- prefix since that is by convention for modules

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangLexer.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangLexer.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangLexer.java
deleted file mode 100644
index d3b7538..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangLexer.java
+++ /dev/null
@@ -1,63 +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.
- */
-package org.apache.groovy.parser.antlr4;
-
-import org.antlr.v4.runtime.CharStream;
-import org.antlr.v4.runtime.Lexer;
-import org.antlr.v4.runtime.LexerNoViableAltException;
-import org.antlr.v4.runtime.atn.ATN;
-import org.antlr.v4.runtime.atn.LexerATNSimulator;
-import org.apache.groovy.parser.antlr4.internal.AtnManager;
-
-/**
- * The lexer for Groovy programming language, which is based on the lexer generated by Antlr4
- *
- * @author <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- * Created on 2016/08/14
- */
-public class GroovyLangLexer extends GroovyLexer {
-    public GroovyLangLexer(CharStream input) {
-        super(input);
-
-        this.setInterpreter(new PositionAdjustingLexerATNSimulator(this, new AtnManager(this).getATN()));
-    }
-
-    @Override
-    public void recover(LexerNoViableAltException e) {
-        throw e; // if some lexical error occurred, stop parsing!
-    }
-
-    @Override
-    protected void rollbackOneChar() {
-        ((PositionAdjustingLexerATNSimulator) getInterpreter()).resetAcceptPosition(getInputStream(), _tokenStartCharIndex - 1, _tokenStartLine, _tokenStartCharPositionInLine - 1);
-    }
-
-    private static class PositionAdjustingLexerATNSimulator extends LexerATNSimulator {
-        public PositionAdjustingLexerATNSimulator(Lexer recog, ATN atn) {
-            super(recog, atn);
-        }
-
-        protected void resetAcceptPosition(CharStream input, int index, int line, int charPositionInLine) {
-            input.seek(index);
-            this.line = line;
-            this.charPositionInLine = charPositionInLine;
-            this.consume(input);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangParser.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangParser.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangParser.java
deleted file mode 100644
index fa33c6e..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovyLangParser.java
+++ /dev/null
@@ -1,38 +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.
- */
-
-package org.apache.groovy.parser.antlr4;
-
-import org.antlr.v4.runtime.TokenStream;
-import org.antlr.v4.runtime.atn.ParserATNSimulator;
-import org.apache.groovy.parser.antlr4.internal.AtnManager;
-
-/**
- * The parser for Groovy programming language, which is based on the parser generated by Antlr4
- *
- * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- * Created on    2016/08/14
- */
-public class GroovyLangParser extends GroovyParser {
-    public GroovyLangParser(TokenStream input) {
-        super(input);
-
-        this.setInterpreter(new ParserATNSimulator(this, new AtnManager(this).getATN()));
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovySyntaxError.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovySyntaxError.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovySyntaxError.java
deleted file mode 100644
index 7ca8bba..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovySyntaxError.java
+++ /dev/null
@@ -1,53 +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.
- */
-package org.apache.groovy.parser.antlr4;
-
-/**
- * Represents a syntax error of groovy program
- */
-public class GroovySyntaxError extends AssertionError {
-    public static final int LEXER = 0;
-    public static final int PARSER = 1;
-    private int source;
-    private int line;
-    private int column;
-
-    public GroovySyntaxError(String message, int source, int line, int column) {
-        super(message, null);
-
-        if (source != LEXER && source != PARSER) {
-            throw new IllegalArgumentException("Invalid syntax error source: " + source);
-        }
-
-        this.source = source;
-        this.line = line;
-        this.column = column;
-    }
-
-    public int getSource() {
-        return source;
-    }
-    public int getLine() {
-        return line;
-    }
-
-    public int getColumn() {
-        return column;
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovydocManager.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovydocManager.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovydocManager.java
deleted file mode 100644
index 449b2e7..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovydocManager.java
+++ /dev/null
@@ -1,183 +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.
- */
-package org.apache.groovy.parser.antlr4;
-
-import groovy.lang.Groovydoc;
-import org.antlr.v4.runtime.ParserRuleContext;
-import org.antlr.v4.runtime.tree.ParseTree;
-import org.antlr.v4.runtime.tree.TerminalNode;
-import org.codehaus.groovy.GroovyBugError;
-import org.codehaus.groovy.ast.ASTNode;
-import org.codehaus.groovy.ast.AnnotatedNode;
-import org.codehaus.groovy.ast.AnnotationNode;
-import org.codehaus.groovy.ast.ClassHelper;
-import org.codehaus.groovy.ast.expr.ConstantExpression;
-
-import java.util.List;
-
-import static org.codehaus.groovy.runtime.DefaultGroovyMethods.asBoolean;
-
-/**
- * A utilities for managing groovydoc, e.g.
- * 1) extracting groovydoc from groovy AST;
- * 2) TODO extracting tags from groovydoc;
- * 3) attach groovydoc to AST node as metadata
- */
-public class GroovydocManager {
-    public static final String DOC_COMMENT = "_DOC_COMMENT"; // keys for meta data
-    private static final String DOC_COMMENT_PREFIX = "/**";
-    private static final String EXTRACT_DOC_COMMENT = "groovy.extract.doc.comment";
-    private static final String TRUE_STR = "true";
-    private static final boolean EXTRACTING_DOC_COMMENT_ENABLED;
-    private static final String VALUE = "value";
-    private static final String RUNTIME_GROOVYDOC_PATTERN = "(?s)/[*][*]\\s+(\\s+[*]\\s*)*@Groovydoc\\b.+?[*]/";
-    private AstBuilder astBuilder;
-
-    static {
-        boolean edce;
-        try {
-            edce = TRUE_STR.equals(System.getProperty(EXTRACT_DOC_COMMENT));
-        } catch (Exception e) {
-            edce = false;
-        }
-
-        EXTRACTING_DOC_COMMENT_ENABLED = edce;
-    }
-
-    public GroovydocManager(AstBuilder astBuilder) {
-        this.astBuilder = astBuilder;
-    }
-
-    /**
-     * Attach doc comment to member node as meta data
-     *
-     */
-    public void handle(ASTNode node, GroovyParser.GroovyParserRuleContext ctx) {
-        if (!asBoolean(node) || !asBoolean(ctx)) {
-            return;
-        }
-
-        String docCommentNodeText = this.findDocCommentByNode(ctx);
-        if (null == docCommentNodeText) {
-            return;
-        }
-
-        attachDocCommentAsMetaData(node, docCommentNodeText);
-        attachGroovydocAnnotation(node, docCommentNodeText);
-    }
-
-    /*
-     * Attach doc comment to member node as meta data
-     */
-    private void attachDocCommentAsMetaData(ASTNode node, String docCommentNodeText) {
-        if (!EXTRACTING_DOC_COMMENT_ENABLED) {
-            return;
-        }
-
-        node.putNodeMetaData(DOC_COMMENT, docCommentNodeText);
-    }
-
-    /*
-     * Attach Groovydoc annotation to the target element
-     */
-    private void attachGroovydocAnnotation(ASTNode node, String docCommentNodeText) {
-        if (!(node instanceof AnnotatedNode)) {
-            return;
-        }
-
-        if (!docCommentNodeText.matches(RUNTIME_GROOVYDOC_PATTERN)) {
-            return;
-        }
-
-        AnnotatedNode annotatedNode = (AnnotatedNode) node;
-        AnnotationNode annotationNode = new AnnotationNode(ClassHelper.make(Groovydoc.class));
-        annotationNode.addMember(VALUE, new ConstantExpression(docCommentNodeText));
-        annotatedNode.addAnnotation(annotationNode);
-    }
-
-    private String findDocCommentByNode(ParserRuleContext node) {
-        if (!asBoolean(node)) {
-            return null;
-        }
-
-        if (node instanceof GroovyParser.ClassBodyContext) {
-            return null;
-        }
-
-        ParserRuleContext parentContext = node.getParent();
-
-        if (!asBoolean(parentContext)) {
-            return null;
-        }
-
-        String docCommentNodeText = null;
-        boolean sameTypeNodeBefore = false;
-        for (ParseTree child : parentContext.children) {
-
-            if (node == child) {
-                // if no doc comment node found and no siblings of same type before the node,
-                // try to find doc comment node of its parent
-                if (!asBoolean((Object) docCommentNodeText) && !sameTypeNodeBefore) {
-                    return findDocCommentByNode(parentContext);
-                }
-
-                return docCommentNodeText;
-            }
-
-            if (node.getClass() == child.getClass()) { // e.g. ClassBodyDeclarationContext == ClassBodyDeclarationContext
-                docCommentNodeText = null;
-                sameTypeNodeBefore = true;
-                continue;
-            }
-
-            if (!(child instanceof GroovyParser.NlsContext || child instanceof GroovyParser.SepContext)) {
-                continue;
-            }
-
-            // doc comments are treated as NL
-            List<? extends TerminalNode> nlList =
-                    child instanceof GroovyParser.NlsContext
-                            ? ((GroovyParser.NlsContext) child).NL()
-                            : ((GroovyParser.SepContext) child).NL();
-
-            int nlListSize = nlList.size();
-            if (0 == nlListSize) {
-                continue;
-            }
-
-            for (int i = nlListSize - 1; i >= 0; i--) {
-                String text = nlList.get(i).getText();
-
-                if (text.matches("\\s+")) {
-                    continue;
-                }
-
-                if (text.startsWith(DOC_COMMENT_PREFIX)) {
-                    docCommentNodeText = text;
-                } else {
-                    docCommentNodeText = null;
-                }
-
-                break;
-            }
-        }
-
-        throw new GroovyBugError("node can not be found: " + node.getText()); // The exception should never be thrown!
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierManager.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierManager.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierManager.java
deleted file mode 100644
index a45e36c..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierManager.java
+++ /dev/null
@@ -1,198 +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.
- */
-package org.apache.groovy.parser.antlr4;
-
-import org.codehaus.groovy.ast.AnnotatedNode;
-import org.codehaus.groovy.ast.AnnotationNode;
-import org.codehaus.groovy.ast.ConstructorNode;
-import org.codehaus.groovy.ast.MethodNode;
-import org.codehaus.groovy.ast.Parameter;
-import org.codehaus.groovy.ast.expr.VariableExpression;
-import org.objectweb.asm.Opcodes;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.stream.Collectors;
-
-import static org.apache.groovy.parser.antlr4.GroovyParser.*;
-import static org.codehaus.groovy.runtime.DefaultGroovyMethods.asBoolean;
-
-/**
- * Process modifiers for AST nodes
- * <p>
- * Created by Daniel.Sun on 2016/08/27.
- */
-class ModifierManager {
-    private static final Map<Class, List<Integer>> INVALID_MODIFIERS_MAP = Collections.unmodifiableMap(new HashMap<Class, List<Integer>>() {
-        {
-            put(ConstructorNode.class, Arrays.asList(STATIC, FINAL, ABSTRACT, NATIVE));
-            put(MethodNode.class, Arrays.asList(VOLATILE/*, TRANSIENT*/));
-        }
-    });
-    private AstBuilder astBuilder;
-    private List<ModifierNode> modifierNodeList;
-
-    public ModifierManager(AstBuilder astBuilder, List<ModifierNode> modifierNodeList) {
-        this.astBuilder = astBuilder;
-        this.validate(modifierNodeList);
-        this.modifierNodeList = Collections.unmodifiableList(asBoolean((Object) modifierNodeList) ? modifierNodeList : Collections.emptyList());
-    }
-
-    private void validate(List<ModifierNode> modifierNodeList) {
-        Map<ModifierNode, Integer> modifierNodeCounter = new LinkedHashMap<>(modifierNodeList.size());
-        int visibilityModifierCnt = 0;
-
-        for (ModifierNode modifierNode : modifierNodeList) {
-            Integer cnt = modifierNodeCounter.get(modifierNode);
-
-            if (null == cnt) {
-                modifierNodeCounter.put(modifierNode, 1);
-            } else if (1 == cnt && !modifierNode.isRepeatable()) {
-                throw astBuilder.createParsingFailedException("Cannot repeat modifier[" + modifierNode.getText() + "]", modifierNode);
-            }
-
-            if (modifierNode.isVisibilityModifier()) {
-                visibilityModifierCnt++;
-
-                if (visibilityModifierCnt > 1) {
-                    throw astBuilder.createParsingFailedException("Cannot specify modifier[" + modifierNode.getText() + "] when access scope has already been defined", modifierNode);
-                }
-            }
-        }
-    }
-
-    public void validate(MethodNode methodNode) {
-        validate(INVALID_MODIFIERS_MAP.get(MethodNode.class), methodNode);
-    }
-
-    public void validate(ConstructorNode constructorNode) {
-        validate(INVALID_MODIFIERS_MAP.get(ConstructorNode.class), constructorNode);
-    }
-
-    private void validate(List<Integer> invalidModifierList, MethodNode methodNode) {
-        modifierNodeList.forEach(e -> {
-            if (invalidModifierList.contains(e.getType())) {
-                throw astBuilder.createParsingFailedException(methodNode.getClass().getSimpleName().replace("Node", "") + " has an incorrect modifier '" + e + "'.", methodNode);
-            }
-        });
-    }
-
-    // t    1: class modifiers value; 2: class member modifiers value
-    private int calcModifiersOpValue(int t) {
-        int result = 0;
-
-        for (ModifierNode modifierNode : modifierNodeList) {
-            result |= modifierNode.getOpcode();
-        }
-
-        if (!this.containsVisibilityModifier()) {
-            if (1 == t) {
-                result |= Opcodes.ACC_SYNTHETIC | Opcodes.ACC_PUBLIC;
-            } else if (2 == t) {
-                result |= Opcodes.ACC_PUBLIC;
-            }
-        }
-
-        return result;
-    }
-
-    public int getClassModifiersOpValue() {
-        return this.calcModifiersOpValue(1);
-    }
-
-    public int getClassMemberModifiersOpValue() {
-        return this.calcModifiersOpValue(2);
-    }
-
-    public List<AnnotationNode> getAnnotations() {
-        return modifierNodeList.stream()
-                .filter(ModifierNode::isAnnotation)
-                .map(ModifierNode::getAnnotationNode)
-                .collect(Collectors.toList());
-    }
-
-    public boolean contains(int modifierType) {
-        return modifierNodeList.stream().anyMatch(e -> modifierType == e.getType());
-    }
-
-    public Optional<ModifierNode> get(int modifierType) {
-        return modifierNodeList.stream().filter(e -> modifierType == e.getType()).findFirst();
-    }
-
-    public boolean containsAnnotations() {
-        return modifierNodeList.stream().anyMatch(ModifierNode::isAnnotation);
-    }
-
-    public boolean containsVisibilityModifier() {
-        return modifierNodeList.stream().anyMatch(ModifierNode::isVisibilityModifier);
-    }
-
-    public boolean containsNonVisibilityModifier() {
-        return modifierNodeList.stream().anyMatch(ModifierNode::isNonVisibilityModifier);
-    }
-
-    public Parameter processParameter(Parameter parameter) {
-        modifierNodeList.forEach(e -> {
-            parameter.setModifiers(parameter.getModifiers() | e.getOpcode());
-
-            if (e.isAnnotation()) {
-                parameter.addAnnotation(e.getAnnotationNode());
-            }
-        });
-
-        return parameter;
-    }
-
-    public int clearVisibilityModifiers(int modifiers) {
-        return modifiers & ~Opcodes.ACC_PUBLIC & ~Opcodes.ACC_PROTECTED & ~Opcodes.ACC_PRIVATE;
-    }
-
-    public MethodNode processMethodNode(MethodNode mn) {
-        modifierNodeList.forEach(e -> {
-            mn.setModifiers((e.isVisibilityModifier() ? clearVisibilityModifiers(mn.getModifiers()) : mn.getModifiers()) | e.getOpcode());
-
-            if (e.isAnnotation()) {
-                mn.addAnnotation(e.getAnnotationNode());
-            }
-        });
-
-        return mn;
-    }
-
-    public VariableExpression processVariableExpression(VariableExpression ve) {
-        modifierNodeList.forEach(e -> {
-            ve.setModifiers(ve.getModifiers() | e.getOpcode());
-
-            // local variable does not attach annotations
-        });
-
-        return ve;
-    }
-
-    public <T extends AnnotatedNode> T attachAnnotations(T node) {
-        this.getAnnotations().forEach(node::addAnnotation);
-
-        return node;
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierNode.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierNode.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierNode.java
deleted file mode 100644
index 5d1007b..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierNode.java
+++ /dev/null
@@ -1,164 +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.
- */
-package org.apache.groovy.parser.antlr4;
-
-import org.codehaus.groovy.ast.ASTNode;
-import org.codehaus.groovy.ast.AnnotationNode;
-import org.objectweb.asm.Opcodes;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-
-import static org.apache.groovy.parser.antlr4.GroovyParser.*;
-import static org.codehaus.groovy.runtime.DefaultGroovyMethods.asBoolean;
-
-/**
- * Represents a modifier, which is better to place in the package org.codehaus.groovy.ast
- * <p>
- * Created by Daniel.Sun on 2016/08/23.
- */
-public class ModifierNode extends ASTNode {
-    private Integer type;
-    private Integer opcode; // ASM opcode
-    private String text;
-    private AnnotationNode annotationNode;
-    private boolean repeatable;
-
-    public static final int ANNOTATION_TYPE = -999;
-    public static final Map<Integer, Integer> MODIFIER_OPCODE_MAP = Collections.unmodifiableMap(new HashMap<Integer, Integer>() {
-        {
-            put(ANNOTATION_TYPE, 0);
-            put(DEF, 0);
-
-            put(NATIVE, Opcodes.ACC_NATIVE);
-            put(SYNCHRONIZED, Opcodes.ACC_SYNCHRONIZED);
-            put(TRANSIENT, Opcodes.ACC_TRANSIENT);
-            put(VOLATILE, Opcodes.ACC_VOLATILE);
-
-            put(PUBLIC, Opcodes.ACC_PUBLIC);
-            put(PROTECTED, Opcodes.ACC_PROTECTED);
-            put(PRIVATE, Opcodes.ACC_PRIVATE);
-            put(STATIC, Opcodes.ACC_STATIC);
-            put(ABSTRACT, Opcodes.ACC_ABSTRACT);
-            put(FINAL, Opcodes.ACC_FINAL);
-            put(STRICTFP, Opcodes.ACC_STRICT);
-            put(DEFAULT, 0); // no flag for specifying a default method in the JVM spec, hence no ACC_DEFAULT flag in ASM
-        }
-    });
-
-    public ModifierNode(Integer type) {
-        this.type = type;
-        this.opcode = MODIFIER_OPCODE_MAP.get(type);
-        this.repeatable = ANNOTATION_TYPE == type; // Only annotations are repeatable
-
-        if (!asBoolean((Object) this.opcode)) {
-            throw new IllegalArgumentException("Unsupported modifier type: " + type);
-        }
-    }
-
-    /**
-     * @param type the modifier type, which is same as the token type
-     * @param text text of the ast node
-     */
-    public ModifierNode(Integer type, String text) {
-        this(type);
-        this.text = text;
-    }
-
-    /**
-     * @param annotationNode the annotation node
-     * @param text           text of the ast node
-     */
-    public ModifierNode(AnnotationNode annotationNode, String text) {
-        this(ModifierNode.ANNOTATION_TYPE, text);
-        this.annotationNode = annotationNode;
-
-        if (!asBoolean(annotationNode)) {
-            throw new IllegalArgumentException("annotationNode can not be null");
-        }
-    }
-
-    /**
-     * Check whether the modifier is not an imagined modifier(annotation, def)
-     */
-    public boolean isModifier() {
-        return !this.isAnnotation() && !this.isDef();
-    }
-
-    public boolean isVisibilityModifier() {
-        return Objects.equals(PUBLIC, this.type)
-                || Objects.equals(PROTECTED, this.type)
-                || Objects.equals(PRIVATE, this.type);
-    }
-
-    public boolean isNonVisibilityModifier() {
-        return this.isModifier() && !this.isVisibilityModifier();
-    }
-
-    public boolean isAnnotation() {
-        return Objects.equals(ANNOTATION_TYPE, this.type);
-    }
-
-    public boolean isDef() {
-        return Objects.equals(DEF, this.type);
-    }
-
-    public Integer getType() {
-        return type;
-    }
-
-    public Integer getOpcode() {
-        return opcode;
-    }
-
-    public boolean isRepeatable() {
-        return repeatable;
-    }
-
-    @Override
-    public String getText() {
-        return text;
-    }
-
-    public AnnotationNode getAnnotationNode() {
-        return annotationNode;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        ModifierNode that = (ModifierNode) o;
-        return Objects.equals(type, that.type) &&
-                Objects.equals(text, that.text) &&
-                Objects.equals(annotationNode, that.annotationNode);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(type, text, annotationNode);
-    }
-
-    @Override
-    public String toString() {
-        return this.text;
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/PositionInfo.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/PositionInfo.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/PositionInfo.java
deleted file mode 100644
index b59aabb..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/PositionInfo.java
+++ /dev/null
@@ -1,73 +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.
- */
-package org.apache.groovy.parser.antlr4;
-
-import java.util.Objects;
-
-/**
- * Created by Daniel on 2017/4/22.
- */
-public class PositionInfo {
-    private int line;
-    private int column;
-
-    public PositionInfo(int line, int column) {
-        this.line = line;
-        this.column = column;
-    }
-
-    public int getLine() {
-        return line;
-    }
-
-    public void setLine(int line) {
-        this.line = line;
-    }
-
-    public int getColumn() {
-        return column;
-    }
-
-    public void setColumn(int column) {
-        this.column = column;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        PositionInfo that = (PositionInfo) o;
-        return line == that.line &&
-                column == that.column;
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(line, column);
-    }
-
-    @Override
-    public String toString() {
-        if (-1 == line || -1 == column) {
-            return "";
-        }
-
-        return " @ line " + line + ", column " + column;
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SemanticPredicates.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SemanticPredicates.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SemanticPredicates.java
deleted file mode 100644
index eb3dbd9..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SemanticPredicates.java
+++ /dev/null
@@ -1,152 +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.
- */
-package org.apache.groovy.parser.antlr4;
-
-import org.antlr.v4.runtime.CharStream;
-import org.antlr.v4.runtime.Token;
-import org.antlr.v4.runtime.TokenStream;
-
-import java.util.Collections;
-import java.util.Set;
-
-import static org.apache.groovy.parser.antlr4.GroovyParser.*;
-
-/**
- * Some semantic predicates for altering the behaviour of the lexer and parser
- *
- * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- * Created on    2016/08/20
- */
-public class SemanticPredicates {
-    public static boolean isFollowedByWhiteSpaces(CharStream cs) {
-        for (int index = 1, c = cs.LA(index); !('\r' == c || '\n' == c || CharStream.EOF == c); index++, c = cs.LA(index)) {
-            if (String.valueOf((char) c).matches("\\S+?")) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    public static boolean isFollowedBy(CharStream cs, char... chars) {
-        int c1 = cs.LA(1);
-
-        for (char c : chars) {
-            if (c1 == c) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    public static boolean isFollowedByJavaLetterInGString(CharStream cs) {
-        int c1 = cs.LA(1);
-
-        if ('$' == c1) { // single $ is not a valid identifier
-            return false;
-        }
-
-        String str1 = String.valueOf((char) c1);
-
-        if (str1.matches("[a-zA-Z_{]")) {
-            return true;
-        }
-
-        if (str1.matches("[^\u0000-\u007F\uD800-\uDBFF]")
-                && Character.isJavaIdentifierPart(c1)) {
-            return true;
-        }
-
-        int c2 = cs.LA(2);
-        String str2 = String.valueOf((char) c2);
-
-        if (str1.matches("[\uD800-\uDBFF]")
-                && str2.matches("[\uDC00-\uDFFF]")
-                && Character.isJavaIdentifierPart(Character.toCodePoint((char) c1, (char) c2))) {
-
-            return true;
-        }
-
-        return false;
-    }
-
-    /**
-     * Check whether following a method name of command expression.
-     * Method name should not end with "2: arguments" and "3: closure"
-     *
-     * @param t the type of pathExpression
-     * @return
-     */
-    public static boolean isFollowingMethodName(int t) {
-        return !(2 == t || 3 == t);
-    }
-
-    /**
-     * Distinguish between method declaration and method call/constructor declaration
-     */
-    public static boolean isInvalidMethodDeclaration(TokenStream ts) {
-        int tokenType = ts.LT(1).getType();
-
-        return (Identifier == tokenType || CapitalizedIdentifier == tokenType || StringLiteral == tokenType)
-                && LPAREN == (ts.LT(2).getType());
-    }
-
-    private static final Set<Integer> MODIFIER_SET =
-            Collections.unmodifiableSet(ModifierNode.MODIFIER_OPCODE_MAP.keySet());
-    /**
-     * Distinguish between local variable declaration and method call, e.g. `a b`
-     */
-    public static boolean isInvalidLocalVariableDeclaration(TokenStream ts) {
-        int index = 2;
-        Token token;
-        int tokenType;
-        int tokenType2 = ts.LT(index).getType();
-        int tokenType3;
-
-        if (DOT == tokenType2) {
-            int tokeTypeN = tokenType2;
-
-            do {
-                index = index + 2;
-                tokeTypeN = ts.LT(index).getType();
-            } while (DOT == tokeTypeN);
-
-            if (LT == tokeTypeN || LBRACK == tokeTypeN) {
-                return false;
-            }
-
-            index = index - 1;
-            tokenType2 = ts.LT(index + 1).getType();
-        } else {
-            index = 1;
-        }
-
-        token = ts.LT(index);
-        tokenType = token.getType();
-        tokenType3 = ts.LT(index + 2).getType();
-
-        return //VOID == tokenType ||
-                !(BuiltInPrimitiveType == tokenType || MODIFIER_SET.contains(tokenType))
-                    && Character.isLowerCase(token.getText().codePointAt(0))
-                    && !(ASSIGN == tokenType3 || (LT == tokenType2 || LBRACK == tokenType2));
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SyntaxErrorReportable.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SyntaxErrorReportable.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SyntaxErrorReportable.java
deleted file mode 100644
index 021e2f5..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SyntaxErrorReportable.java
+++ /dev/null
@@ -1,58 +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.
- */
-package org.apache.groovy.parser.antlr4;
-
-/**
- * A SyntaxErrorReportable is a recognizer that can report syntax error
- */
-public interface SyntaxErrorReportable {
-    default void require(boolean condition, String msg, int offset, boolean toAttachPositionInfo) {
-        if (condition) {
-            return;
-        }
-
-        this.throwSyntaxError(msg, offset, toAttachPositionInfo);
-    }
-    default void require(boolean condition, String msg, boolean toAttachPositionInfo) {
-        require(condition, msg, 0, toAttachPositionInfo);
-    }
-    default void require(boolean condition, String msg, int offset) {
-        require(condition, msg, offset,false);
-    }
-    default void require(boolean condition, String msg) {
-        require(condition, msg, false);
-    }
-
-    default void throwSyntaxError(String msg, int offset, boolean toAttachPositionInfo) {
-        PositionInfo positionInfo = this.genPositionInfo(offset);
-        throw new GroovySyntaxError(msg + (toAttachPositionInfo ? positionInfo.toString() : ""),
-                this.getSyntaxErrorSource(),
-                positionInfo.getLine(),
-                positionInfo.getColumn()
-        );
-    }
-
-    int getSyntaxErrorSource();
-    default PositionInfo genPositionInfo(int offset) {
-        return new PositionInfo(getErrorLine(), getErrorColumn() + offset);
-    }
-
-    int getErrorLine();
-    int getErrorColumn();
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/TryWithResourcesASTTransformation.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/TryWithResourcesASTTransformation.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/TryWithResourcesASTTransformation.java
deleted file mode 100644
index cbe3697..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/TryWithResourcesASTTransformation.java
+++ /dev/null
@@ -1,370 +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.
- */
-package org.apache.groovy.parser.antlr4;
-
-import org.codehaus.groovy.ast.ClassHelper;
-import org.codehaus.groovy.ast.Parameter;
-import org.codehaus.groovy.ast.expr.ArgumentListExpression;
-import org.codehaus.groovy.ast.expr.BinaryExpression;
-import org.codehaus.groovy.ast.expr.BooleanExpression;
-import org.codehaus.groovy.ast.expr.ConstantExpression;
-import org.codehaus.groovy.ast.expr.DeclarationExpression;
-import org.codehaus.groovy.ast.expr.MethodCallExpression;
-import org.codehaus.groovy.ast.expr.VariableExpression;
-import org.codehaus.groovy.ast.stmt.BlockStatement;
-import org.codehaus.groovy.ast.stmt.CatchStatement;
-import org.codehaus.groovy.ast.stmt.EmptyStatement;
-import org.codehaus.groovy.ast.stmt.ExpressionStatement;
-import org.codehaus.groovy.ast.stmt.IfStatement;
-import org.codehaus.groovy.ast.stmt.Statement;
-import org.codehaus.groovy.ast.stmt.ThrowStatement;
-import org.codehaus.groovy.ast.stmt.TryCatchStatement;
-import org.codehaus.groovy.syntax.Types;
-import org.objectweb.asm.Opcodes;
-
-import java.util.Collections;
-import java.util.List;
-
-import static org.codehaus.groovy.runtime.DefaultGroovyMethods.asBoolean;
-
-/**
- * Transform try-with-resources to try-catch-finally
- * Reference JLS "14.20.3. try-with-resources"(https://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html)
- *
- * @author <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- *         Created on 2016/11/04
- */
-public class TryWithResourcesASTTransformation {
-    private AstBuilder astBuilder;
-
-    public TryWithResourcesASTTransformation(AstBuilder astBuilder) {
-        this.astBuilder = astBuilder;
-    }
-
-    /**
-     * Reference JLS "14.20.3. try-with-resources"(https://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html)
-     *
-     * @param tryCatchStatement the try-with-resources statement to transform
-     * @return try-catch-finally statement, which contains no resources clause
-     */
-    public Statement transform(TryCatchStatement tryCatchStatement) {
-        if (!asBoolean(tryCatchStatement.getResourceStatements())) {
-            return tryCatchStatement;
-        }
-
-        if (this.isBasicTryWithResourcesStatement(tryCatchStatement)) {
-            return this.transformBasicTryWithResourcesStatement(tryCatchStatement);
-        } else {
-            return this.transformExtendedTryWithResourcesStatement(tryCatchStatement);
-        }
-    }
-
-    private boolean isBasicTryWithResourcesStatement(TryCatchStatement tryCatchStatement) {
-        if (EmptyStatement.INSTANCE.equals(tryCatchStatement.getFinallyStatement())
-                && !asBoolean(tryCatchStatement.getCatchStatements())) {
-            return true;
-        }
-
-        return false;
-    }
-
-    private ExpressionStatement makeVariableDeclarationFinal(ExpressionStatement variableDeclaration) {
-        if (!asBoolean(variableDeclaration)) {
-            return variableDeclaration;
-        }
-
-        if (!(variableDeclaration.getExpression() instanceof DeclarationExpression)) {
-            throw new IllegalArgumentException("variableDeclaration is not a declaration statement");
-        }
-
-        DeclarationExpression declarationExpression = (DeclarationExpression) variableDeclaration.getExpression();
-        if (!(declarationExpression.getLeftExpression() instanceof VariableExpression)) {
-            throw astBuilder.createParsingFailedException("The expression statement is not a variable delcaration statement", variableDeclaration);
-        }
-
-        VariableExpression variableExpression = (VariableExpression) declarationExpression.getLeftExpression();
-        variableExpression.setModifiers(variableExpression.getModifiers() | Opcodes.ACC_FINAL);
-
-        return variableDeclaration;
-    }
-
-    private int primaryExcCnt = 0;
-    private String genPrimaryExcName() {
-        return "__$$primaryExc" + primaryExcCnt++;
-    }
-
-    /*
-     *   try ResourceSpecification
-     *       Block
-     *   Catchesopt
-     *   Finallyopt
-     *
-     *   **The above AST should be transformed to the following AST**
-     *
-     *   try {
-     *       try ResourceSpecification
-     *           Block
-     *   }
-     *   Catchesopt
-     *   Finallyopt
-     */
-    private Statement transformExtendedTryWithResourcesStatement(TryCatchStatement tryCatchStatement) {
-        /*
-         *  try ResourceSpecification
-         *      Block
-         */
-        TryCatchStatement newTryWithResourcesStatement =
-                new TryCatchStatement(
-                        tryCatchStatement.getTryStatement(),
-                        EmptyStatement.INSTANCE);
-        tryCatchStatement.getResourceStatements().forEach(newTryWithResourcesStatement::addResource);
-
-
-        /*
-         *   try {
-         *       << the following try-with-resources has been transformed >>
-         *       try ResourceSpecification
-         *           Block
-         *   }
-         *   Catchesopt
-         *   Finallyopt
-         */
-        TryCatchStatement newTryCatchStatement =
-                new TryCatchStatement(
-                        astBuilder.createBlockStatement(this.transform(newTryWithResourcesStatement)),
-                        tryCatchStatement.getFinallyStatement());
-
-        tryCatchStatement.getCatchStatements().forEach(newTryCatchStatement::addCatch);
-
-        return newTryCatchStatement;
-    }
-
-    /*
-     *   try (VariableModifiersopt R Identifier = Expression ...)
-     *      Block
-     *
-     *  **The above AST should be transformed to the following AST**
-     *
-     *   {
-     *       final VariableModifiers_minus_final R Identifier = Expression;
-     *       Throwable #primaryExc = null;
-     *
-     *       try ResourceSpecification_tail
-     *           Block
-     *       catch (Throwable #t) {
-     *           #primaryExc = #t;
-     *           throw #t;
-     *       } finally {
-     *           if (Identifier != null) {
-     *               if (#primaryExc != null) {
-     *                   try {
-     *                       Identifier.close();
-     *                   } catch (Throwable #suppressedExc) {
-     *                       #primaryExc.addSuppressed(#suppressedExc);
-     *                   }
-     *               } else {
-     *                   Identifier.close();
-     *               }
-     *           }
-     *       }
-     *   }
-     *
-     */
-    private Statement transformBasicTryWithResourcesStatement(TryCatchStatement tryCatchStatement) {
-        // { ... }
-        BlockStatement blockStatement = new BlockStatement();
-
-        // final VariableModifiers_minus_final R Identifier = Expression;
-        ExpressionStatement firstResourceStatement =
-                this.makeVariableDeclarationFinal(
-                        tryCatchStatement.getResourceStatement(0));
-        astBuilder.appendStatementsToBlockStatement(blockStatement, firstResourceStatement);
-
-        // Throwable #primaryExc = null;
-        String primaryExcName = this.genPrimaryExcName();
-        ExpressionStatement primaryExcDeclarationStatement =
-                new ExpressionStatement(
-                        new DeclarationExpression(
-                                new VariableExpression(primaryExcName, ClassHelper.make(Throwable.class)),
-                                org.codehaus.groovy.syntax.Token.newSymbol(Types.ASSIGN, -1, -1),
-                                new ConstantExpression(null)
-                        )
-                );
-        astBuilder.appendStatementsToBlockStatement(blockStatement, primaryExcDeclarationStatement);
-
-
-        // The generated try-catch-finally statement
-        String firstResourceIdentifierName =
-                ((DeclarationExpression) tryCatchStatement.getResourceStatement(0).getExpression()).getLeftExpression().getText();
-
-        TryCatchStatement newTryCatchStatement =
-                new TryCatchStatement(
-                        tryCatchStatement.getTryStatement(),
-                        this.createFinallyBlockForNewTryCatchStatement(primaryExcName, firstResourceIdentifierName));
-
-        List<ExpressionStatement> resourceStatements = tryCatchStatement.getResourceStatements();
-        // 2nd, 3rd, ..., n'th resources declared in resources
-        List<ExpressionStatement> tailResourceStatements = resourceStatements.subList(1, resourceStatements.size());
-        tailResourceStatements.stream().forEach(newTryCatchStatement::addResource);
-
-        newTryCatchStatement.addCatch(this.createCatchBlockForOuterNewTryCatchStatement(primaryExcName));
-        astBuilder.appendStatementsToBlockStatement(blockStatement, this.transform(newTryCatchStatement));
-
-        return blockStatement;
-    }
-
-    /*
-     *   catch (Throwable #t) {
-     *       #primaryExc = #t;
-     *       throw #t;
-     *   }
-     *
-     */
-    private CatchStatement createCatchBlockForOuterNewTryCatchStatement(String primaryExcName) {
-        // { ... }
-        BlockStatement blockStatement = new BlockStatement();
-        String tExcName = this.genTExcName();
-
-        // #primaryExc = #t;
-        ExpressionStatement primaryExcAssignStatement =
-                new ExpressionStatement(
-                        new BinaryExpression(
-                                new VariableExpression(primaryExcName),
-                                org.codehaus.groovy.syntax.Token.newSymbol(Types.ASSIGN, -1, -1),
-                                new VariableExpression(tExcName)));
-        astBuilder.appendStatementsToBlockStatement(blockStatement, primaryExcAssignStatement);
-
-        // throw #t;
-        ThrowStatement throwTExcStatement = new ThrowStatement(new VariableExpression(tExcName));
-        astBuilder.appendStatementsToBlockStatement(blockStatement, throwTExcStatement);
-
-        // Throwable #t
-        Parameter tExcParameter = new Parameter(ClassHelper.make(Throwable.class), tExcName);
-
-        return new CatchStatement(tExcParameter, blockStatement);
-    }
-
-    private int tExcCnt = 0;
-    private String genTExcName() {
-        return "__$$t" + tExcCnt++;
-    }
-
-    /*
-     *   finally {
-     *       if (Identifier != null) {
-     *           if (#primaryExc != null) {
-     *              try {
-     *                  Identifier.close();
-     *              } catch (Throwable #suppressedExc) {
-     *                  #primaryExc.addSuppressed(#suppressedExc);
-     *              }
-     *           } else {
-     *               Identifier.close();
-     *           }
-     *       }
-     *   }
-     *
-     * We can simplify the above code to a Groovy version as follows:
-     *
-     *   finally {
-     *      if (#primaryExc != null)
-     *         try {
-     *             Identifier?.close();
-     *         } catch (Throwable #suppressedExc) {
-     *             #primaryExc.addSuppressed(#suppressedExc);
-     *         }
-     *      else
-     *          Identifier?.close();
-     *
-     *   }
-     *
-     */
-    private BlockStatement createFinallyBlockForNewTryCatchStatement(String primaryExcName, String firstResourceIdentifierName) {
-        BlockStatement finallyBlock = new BlockStatement();
-
-        // primaryExc != null
-        BooleanExpression conditionExpression =
-                new BooleanExpression(
-                        new BinaryExpression(
-                                new VariableExpression(primaryExcName),
-                                org.codehaus.groovy.syntax.Token.newSymbol(Types.COMPARE_NOT_EQUAL, -1, -1),
-                                new ConstantExpression(null)));
-
-        // try-catch statement
-        TryCatchStatement newTryCatchStatement =
-                new TryCatchStatement(
-                        astBuilder.createBlockStatement(this.createCloseResourceStatement(firstResourceIdentifierName)), // { Identifier?.close(); }
-                        EmptyStatement.INSTANCE);
-
-
-        String suppressedExcName = this.genSuppressedExcName();
-        newTryCatchStatement.addCatch(
-                // catch (Throwable #suppressedExc) { .. }
-                new CatchStatement(
-                        new Parameter(ClassHelper.make(Throwable.class), suppressedExcName),
-                        astBuilder.createBlockStatement(this.createAddSuppressedStatement(primaryExcName, suppressedExcName)) // #primaryExc.addSuppressed(#suppressedExc);
-                )
-        );
-
-        // if (#primaryExc != null) { ... }
-        IfStatement ifStatement =
-                new IfStatement(
-                        conditionExpression,
-                        newTryCatchStatement,
-                        this.createCloseResourceStatement(firstResourceIdentifierName) // Identifier?.close();
-                );
-        astBuilder.appendStatementsToBlockStatement(finallyBlock, ifStatement);
-
-        return astBuilder.createBlockStatement(finallyBlock);
-    }
-
-    private int suppressedExcCnt = 0;
-    private String genSuppressedExcName() {
-        return "__$$suppressedExc" + suppressedExcCnt++;
-    }
-
-    /*
-     *  Identifier?.close();
-     */
-    private ExpressionStatement createCloseResourceStatement(String firstResourceIdentifierName) {
-        MethodCallExpression closeMethodCallExpression =
-                new MethodCallExpression(new VariableExpression(firstResourceIdentifierName), "close", new ArgumentListExpression());
-
-        closeMethodCallExpression.setImplicitThis(false);
-        closeMethodCallExpression.setSafe(true);
-
-        return new ExpressionStatement(closeMethodCallExpression);
-    }
-
-    /*
-     *  #primaryExc.addSuppressed(#suppressedExc);
-     */
-    private ExpressionStatement createAddSuppressedStatement(String primaryExcName, String suppressedExcName) {
-        MethodCallExpression addSuppressedMethodCallExpression =
-                new MethodCallExpression(
-                        new VariableExpression(primaryExcName),
-                        "addSuppressed",
-                        new ArgumentListExpression(Collections.singletonList(new VariableExpression(suppressedExcName))));
-        addSuppressedMethodCallExpression.setImplicitThis(false);
-        addSuppressedMethodCallExpression.setSafe(true);
-
-        return new ExpressionStatement(addSuppressedMethodCallExpression);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/internal/AtnManager.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/internal/AtnManager.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/internal/AtnManager.java
deleted file mode 100644
index 02cc152..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/internal/AtnManager.java
+++ /dev/null
@@ -1,107 +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.
- */
-package org.apache.groovy.parser.antlr4.internal;
-
-import org.antlr.v4.runtime.atn.ATN;
-import org.apache.groovy.parser.antlr4.GroovyLangLexer;
-import org.apache.groovy.parser.antlr4.GroovyLangParser;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-
-/**
- * Manage ATN for lexer and parser to avoid memory leak
- *
- * @author <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- * Created on 2016/08/14
- */
-public class AtnManager {
-    public static final ReentrantReadWriteLock RRWL = new ReentrantReadWriteLock(true);
-    private static final String CACHE_THRESHOLD_NAME = "groovy.antlr4.cache.threshold";
-    private static final int CACHE_THRESHOLD;
-    private final Class ownerClass;
-    private final ATN atn;
-    private static final Map<Class, AtnWrapper> ATN_MAP =
-            Collections.unmodifiableMap(new HashMap<Class, AtnWrapper>() {
-                {
-                    put(GroovyLangLexer.class, new AtnWrapper(GroovyLangLexer._ATN));
-                    put(GroovyLangParser.class, new AtnWrapper(GroovyLangParser._ATN));
-                }
-            });
-
-    static {
-        int t = 50;
-
-        try {
-            t = Integer.parseInt(System.getProperty(CACHE_THRESHOLD_NAME));
-
-            // cache threshold should be at least 50 for better performance
-            t = t < 50 ? 50 : t;
-        } catch (Exception e) {
-            // ignored
-        }
-
-        CACHE_THRESHOLD = t;
-    }
-
-    public AtnManager(GroovyLangLexer lexer) {
-        this.ownerClass = lexer.getClass();
-        this.atn = GroovyLangLexer._ATN; //getAtnWrapper(this.ownerClass).checkAndClear();
-    }
-
-    public AtnManager(GroovyLangParser parser) {
-        this.ownerClass = parser.getClass();
-        this.atn = getAtnWrapper(this.ownerClass).checkAndClear();
-    }
-
-    public ATN getATN() {
-        return this.atn;
-    }
-
-    private AtnWrapper getAtnWrapper(Class ownerClass) {
-        return ATN_MAP.get(ownerClass);
-    }
-
-    private static class AtnWrapper {
-        private final ATN atn;
-        private final AtomicLong counter = new AtomicLong(0);
-
-        public AtnWrapper(ATN atn) {
-            this.atn = atn;
-        }
-
-        public ATN checkAndClear() {
-            if (0 != counter.incrementAndGet() % CACHE_THRESHOLD) {
-                return atn;
-            }
-
-            RRWL.writeLock().lock();
-            try {
-                atn.clearDFA();
-            } finally {
-                RRWL.writeLock().unlock();
-            }
-
-            return atn;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/internal/DescriptiveErrorStrategy.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/internal/DescriptiveErrorStrategy.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/internal/DescriptiveErrorStrategy.java
deleted file mode 100644
index 12081ed..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/internal/DescriptiveErrorStrategy.java
+++ /dev/null
@@ -1,110 +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.
- */
-package org.apache.groovy.parser.antlr4.internal;
-
-import org.antlr.v4.runtime.BailErrorStrategy;
-import org.antlr.v4.runtime.FailedPredicateException;
-import org.antlr.v4.runtime.InputMismatchException;
-import org.antlr.v4.runtime.NoViableAltException;
-import org.antlr.v4.runtime.Parser;
-import org.antlr.v4.runtime.ParserRuleContext;
-import org.antlr.v4.runtime.RecognitionException;
-import org.antlr.v4.runtime.Token;
-import org.antlr.v4.runtime.TokenStream;
-import org.antlr.v4.runtime.atn.PredictionMode;
-import org.antlr.v4.runtime.misc.NotNull;
-import org.antlr.v4.runtime.misc.ParseCancellationException;
-
-/**
- * Provide friendly error messages when parsing errors occurred.
- *
- * @author <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- *         Created on 2016/10/19
- */
-public class DescriptiveErrorStrategy extends BailErrorStrategy {
-    @Override
-    public void recover(Parser recognizer, RecognitionException e) {
-        for (ParserRuleContext context = recognizer.getContext(); context != null; context = context.getParent()) {
-            context.exception = e;
-        }
-
-        if (PredictionMode.LL.equals(recognizer.getInterpreter().getPredictionMode())) {
-            if (e instanceof NoViableAltException) {
-                this.reportNoViableAlternative(recognizer, (NoViableAltException) e);
-            } else if (e instanceof InputMismatchException) {
-                this.reportInputMismatch(recognizer, (InputMismatchException) e);
-            } else if (e instanceof FailedPredicateException) {
-                this.reportFailedPredicate(recognizer, (FailedPredicateException) e);
-            }
-        }
-
-        throw new ParseCancellationException(e);
-    }
-
-    @Override
-    public Token recoverInline(Parser recognizer)
-            throws RecognitionException {
-
-        this.recover(recognizer, new InputMismatchException(recognizer)); // stop parsing
-        return null;
-    }
-
-    protected String createNoViableAlternativeErrorMessage(Parser recognizer, NoViableAltException e) {
-        TokenStream tokens = recognizer.getInputStream();
-        String input;
-        if (tokens != null) {
-            if (e.getStartToken().getType() == Token.EOF) input = "<EOF>";
-            else input = tokens.getText(e.getStartToken(), e.getOffendingToken());
-        } else {
-            input = "<unknown input>";
-        }
-
-        return "Unexpected input: " + escapeWSAndQuote(input);
-    }
-
-    @Override
-    protected void reportNoViableAlternative(@NotNull Parser recognizer,
-                                             @NotNull NoViableAltException e) {
-
-        notifyErrorListeners(recognizer, this.createNoViableAlternativeErrorMessage(recognizer, e), e);
-    }
-
-    protected String createInputMismatchErrorMessage(@NotNull Parser recognizer,
-                                                     @NotNull InputMismatchException e) {
-        return "Unexpected input: " + getTokenErrorDisplay(e.getOffendingToken(recognizer)) +
-                "; Expecting " + e.getExpectedTokens().toString(recognizer.getVocabulary());
-    }
-
-    protected void reportInputMismatch(@NotNull Parser recognizer,
-                                       @NotNull InputMismatchException e) {
-
-        notifyErrorListeners(recognizer, this.createInputMismatchErrorMessage(recognizer, e), e);
-    }
-
-
-    protected String createFailedPredicateErrorMessage(@NotNull Parser recognizer,
-                                                       @NotNull FailedPredicateException e) {
-        return e.getMessage();
-    }
-
-    protected void reportFailedPredicate(@NotNull Parser recognizer,
-                                         @NotNull FailedPredicateException e) {
-        notifyErrorListeners(recognizer, this.createFailedPredicateErrorMessage(recognizer, e), e);
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java
deleted file mode 100644
index 739a737..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java
+++ /dev/null
@@ -1,149 +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.
- */
-package org.apache.groovy.parser.antlr4.util;
-
-import groovy.lang.Closure;
-import org.codehaus.groovy.runtime.StringGroovyMethods;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-/**
- * Utilities for handling strings
- *
- * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- * Created on    2016/08/20
- */
-public class StringUtils {
-    public static String replaceHexEscapes(String text) {
-        Pattern p = Pattern.compile("(\\\\*)\\\\u+([0-9abcdefABCDEF]{4})");
-	    return StringGroovyMethods.replaceAll((CharSequence) text, p, new Closure<Void>(null, null) {
-		    Object doCall(String _0, String _1, String _2) {
-				if (isLengthOdd(_1)) {
-					return _0;
-				}
-
-			    return _1 + new String(Character.toChars(Integer.parseInt(_2, 16)));
-		    }
-	    });
-    }
-
-	public static String replaceOctalEscapes(String text) {
-	    Pattern p = Pattern.compile("(\\\\*)\\\\([0-3]?[0-7]?[0-7])");
-	    return StringGroovyMethods.replaceAll((CharSequence) text, p, new Closure<Void>(null, null) {
-		    Object doCall(String _0, String _1, String _2) {
-				if (isLengthOdd(_1)) {
-					return _0;
-				}
-
-			    return _1 + new String(Character.toChars(Integer.parseInt(_2, 8)));
-		    }
-	    });
-    }
-
-    private static Map<Character, Character> STANDARD_ESCAPES = new HashMap<Character, Character>() {
-		{
-			this.put('b', '\b');
-			this.put('t', '\t');
-			this.put('n', '\n');
-			this.put('f', '\f');
-			this.put('r', '\r');
-		}
-	};
-
-	public static String replaceStandardEscapes(String text) {
-	    Pattern p = Pattern.compile("(\\\\*)\\\\([btnfr\"'])");
-
-	    String result = StringGroovyMethods.replaceAll((CharSequence) text, p, new Closure<Void>(null, null) {
-							Object doCall(String _0, String _1, String _2) {
-								if (isLengthOdd(_1)) {
-									return _0;
-								}
-
-								Character character = STANDARD_ESCAPES.get(_2.charAt(0));
-								return _1 + (character != null ? character : _2);
-							}
-						});
-
-		return result.replace("\\\\", "\\");
-    }
-
-	public static final int NONE_SLASHY = 0;
-	public static final int SLASHY = 1;
-	public static final int DOLLAR_SLASHY = 2;
-
-	public static String replaceEscapes(String text, int slashyType) {
-		if (slashyType == SLASHY || slashyType == DOLLAR_SLASHY) {
-			text = StringUtils.replaceHexEscapes(text);
-			text = StringUtils.replaceLineEscape(text);
-
-			if (slashyType == SLASHY) {
-				text = text.replace("\\/", "/");
-			}
-
-			if (slashyType == DOLLAR_SLASHY) {
-				text = text.replace("$$", "$");
-				text = text.replace("$/", "/");
-			}
-
-		} else if (slashyType == NONE_SLASHY) {
-			text = StringUtils.replaceEscapes(text);
-		} else {
-			throw new IllegalArgumentException("Invalid slashyType: " + slashyType);
-		}
-
-		return text;
-	}
-
-	private static String replaceEscapes(String text) {
-		text = text.replace("\\$", "$");
-
-		text = StringUtils.replaceLineEscape(text);
-
-        return StringUtils.replaceStandardEscapes(replaceHexEscapes(replaceOctalEscapes(text)));
-    }
-
-	private static String replaceLineEscape(String text) {
-		Pattern p = Pattern.compile("(\\\\*)\\\\\r?\n");
-		text = StringGroovyMethods.replaceAll((CharSequence) text, p, new Closure<Void>(null, null) {
-			Object doCall(String _0, String _1) {
-				if (isLengthOdd(_1)) {
-					return _0;
-				}
-
-				return _1;
-			}
-		});
-
-		return text;
-	}
-
-	private static boolean isLengthOdd(String str) {
-		return null != str && str.length() % 2 == 1;
-	}
-
-	public static String removeCR(String text) {
-        return text.replace("\r\n", "\n");
-    }
-
-	public static long countChar(String text, char c) {
-		return text.chars().filter(e -> c == e).count();
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy b/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
deleted file mode 100644
index 480d2ab..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
+++ /dev/null
@@ -1,368 +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.
- */
-package org.apache.groovy.parser.antlr4
-
-import org.codehaus.groovy.ast.ClassNode
-import org.codehaus.groovy.ast.FieldNode
-import org.codehaus.groovy.ast.MethodNode
-import org.codehaus.groovy.ast.Parameter
-import org.codehaus.groovy.ast.PropertyNode
-import org.codehaus.groovy.ast.stmt.AssertStatement
-import org.codehaus.groovy.ast.stmt.ExpressionStatement
-import org.codehaus.groovy.syntax.Token
-
-import static org.apache.groovy.parser.antlr4.TestUtils.doTest
-import static org.apache.groovy.parser.antlr4.TestUtils.doRunAndTest
-
-/**
- * Some basic test cases for the new parser
- *
- * @author  <a href="mailto:realbluesun@hotmail.com">Daniel.Sun</a>
- * Created on    2016/08/14
- */
-class GroovyParserTest extends GroovyTestCase {
-
-    void setUp() {}
-
-    void tearDown() {}
-
-    void "test groovy core - Comments"() {
-        doTest('core/Comments_01.groovy', [ExpressionStatement]);
-        doTestAttachedComments();
-    }
-
-    private static doTestAttachedComments() {
-        def (newAST, oldAST) = doTest('core/Comments_02.groovy');
-        List<ClassNode> classes = new ArrayList<>(newAST.classes).sort { c1, c2 -> c1.name <=> c2.name };
-        List<MethodNode> methods = new ArrayList<>(newAST.methods).sort { m1, m2 -> m1.name <=> m2.name };
-
-        assert classes[0].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '')            == '/** * test class Comments */'
-        assert classes[0].fields[0].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '')  == '/**     * test Comments.SOME_VAR     */'
-        assert classes[0].fields[1].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '')  == '/**     * test Comments.SOME_VAR2     */'
-        assert classes[0].fields[2].nodeMetaData[GroovydocManager.DOC_COMMENT] == null
-        assert classes[0].fields[3].nodeMetaData[GroovydocManager.DOC_COMMENT] == null
-        assert classes[0].declaredConstructors[0].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '') == '/**     * test Comments.constructor1     */'
-        assert classes[0].methods[0].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '') == '/**     * test Comments.m1     */'
-        assert classes[0].methods[1].nodeMetaData[GroovydocManager.DOC_COMMENT] == null
-        assert classes[0].methods[2].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '') == '/**     * test Comments.m3     */'
-
-        assert classes[1].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '')            == '/**     * test class InnerClazz     */'
-        assert classes[1].fields[0].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '')  == '/**         * test InnerClazz.SOME_VAR3         */'
-        assert classes[1].fields[1].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '')  == '/**         * test InnerClazz.SOME_VAR4         */'
-        assert classes[1].methods[0].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '') == '/**         * test Comments.m4         */'
-        assert classes[1].methods[1].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '') == '/**         * test Comments.m5         */'
-
-        assert classes[2].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '')            == '/**     * test class InnerEnum     */'
-        assert classes[2].fields[0].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '')  == '/**         * InnerEnum.NEW         */'
-        assert classes[2].fields[1].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '')  == '/**         * InnerEnum.OLD         */'
-
-        assert classes[3].nodeMetaData[GroovydocManager.DOC_COMMENT] == null
-
-        assert classes[4].fields[0].nodeMetaData[GroovydocManager.DOC_COMMENT] == null
-
-        assert classes[5].nodeMetaData[GroovydocManager.DOC_COMMENT] == null
-
-        assert methods[0].nodeMetaData[GroovydocManager.DOC_COMMENT].replaceAll(/\r?\n/, '') == '/** * test someScriptMethod1 */'
-        assert methods[1].nodeMetaData[GroovydocManager.DOC_COMMENT] == null
-    }
-
-    void "test groovy core - PackageDeclaration"() {
-        doTest('core/PackageDeclaration_01.groovy');
-        doTest('core/PackageDeclaration_02.groovy');
-        doTest('core/PackageDeclaration_03.groovy');
-        doTest('core/PackageDeclaration_04.groovy');
-        doTest('core/PackageDeclaration_05.groovy');
-        doTest('core/PackageDeclaration_06.groovy');
-    }
-
-    void "test groovy core - ImportDeclaration"() {
-        doTest('core/ImportDeclaration_01.groovy');
-        doTest('core/ImportDeclaration_02.groovy');
-        doTest('core/ImportDeclaration_03.groovy');
-        doTest('core/ImportDeclaration_04.groovy');
-        doTest('core/ImportDeclaration_05.groovy');
-        doTest('core/ImportDeclaration_06.groovy');
-        doTest('core/ImportDeclaration_07.groovy');
-        doTest('core/ImportDeclaration_08.groovy');
-    }
-
-    void "test groovy core - Annotation"() {
-        doTest('core/Annotation_01.groovy');
-        doTest('core/Annotation_02.groovy');
-        doTest('core/Annotation_03.groovy');
-        doTest('core/Annotation_04.groovy');
-        doTest('core/Annotation_05.groovy');
-        doTest('core/Annotation_06.groovy');
-        doTest('core/Annotation_07.groovy');
-        doTest('core/Annotation_08.groovy');
-        doTest('core/Annotation_09.groovy');
-        doRunAndTest('core/Annotation_10x.groovy');
-    }
-
-    void "test groovy core - Literal"() {
-        doTest('core/Literal_01.groovy');
-        doTest('core/Literal_02.groovy', [ExpressionStatement]);
-        doTest('core/Literal_03.groovy');
-    }
-
-    void "test groovy core - GString"() {
-        doTest('core/GString_01.groovy');
-        doTest('core/GString_02.groovy');
-        doTest('core/GString_03.groovy');
-        doTest('core/GString_04.groovy');
-        doTest('core/GString_05.groovy');
-        doTest('core/GString_06.groovy');
-    }
-
-    void "test groovy core - Closure"() {
-        doTest('core/Closure_01.groovy');
-        doTest('core/Closure_02.groovy');
-        doTest('core/Closure_03.groovy');
-        doTest('core/Closure_04.groovy');
-        doTest('core/Closure_05.groovy', [Parameter]);
-        doTest('core/Closure_06.groovy', [Parameter]);
-        doTest('core/Closure_07.groovy', [Parameter]);
-        doTest('core/Closure_08.groovy', [Parameter]);
-        doTest('core/Closure_09.groovy', [Parameter]);
-        doTest('core/Closure_10.groovy', [Parameter]);
-    }
-
-    void "test groovy core - Lambda"() {
-        doRunAndTest('core/Lambda_01x.groovy');
-    }
-
-    void "test groovy core - MethodReference"() {
-        doRunAndTest('core/MethodReference_01x.groovy');
-    }
-
-    void "test groovy core - MethodPointer"() {
-        doRunAndTest('core/MethodPointer_01x.groovy');
-    }
-
-    void "test groovy core - ElvisAssignment"() {
-        doRunAndTest('core/ElvisAssignment_01x.groovy');
-    }
-
-    void "test groovy core - List"() {
-        doTest('core/List_01.groovy');
-    }
-
-    void "test groovy core - Map"() {
-        doTest('core/Map_01.groovy');
-    }
-
-    void "test groovy core - Expression"() {
-        doTest('core/Expression_01.groovy');
-        doTest('core/Expression_02.groovy');
-        doTest('core/Expression_03.groovy');
-        doTest('core/Expression_04.groovy');
-        doTest('core/Expression_05.groovy');
-        doTest('core/Expression_06.groovy');
-        doTest('core/Expression_07.groovy');
-        doTest('core/Expression_08.groovy');
-        doTest('core/Expression_09.groovy');
-        doTest('core/Expression_10.groovy');
-        doTest('core/Expression_11.groovy');
-        doTest('core/Expression_12.groovy');
-        doTest('core/Expression_13.groovy');
-        doTest('core/Expression_14.groovy');
-        doTest('core/Expression_15.groovy');
-        doTest('core/Expression_16.groovy', [Parameter, ExpressionStatement]);
-        doTest('core/Expression_17.groovy');
-        doTest('core/Expression_18.groovy');
-        doTest('core/Expression_19.groovy');
-        doTest('core/Expression_20.groovy');
-        doRunAndTest('core/Expression_21x.groovy');
-        doTest('core/Expression_22x.groovy');
-        doRunAndTest('core/Expression_22x.groovy');
-        doRunAndTest('core/Expression_23x.groovy');
-    }
-
-    void "test groovy core - IdenticalOp"() {
-        doRunAndTest('core/IdenticalOp_01x.groovy');
-    }
-
-    void "test groovy core - Assert"() {
-        doTest('core/Assert_01.groovy');
-        doRunAndTest('core/Assert_02x.groovy');
-        doRunAndTest('core/Assert_03x.groovy');
-    }
-
-    void "test groovy core - IfElse"() {
-        doTest('core/IfElse_01.groovy', [AssertStatement]);
-    }
-
-    void "test groovy core - For"() {
-        doTest('core/For_01.groovy', [AssertStatement]);
-        doTest('core/For_02.groovy');
-        doTest('core/For_03.groovy');
-        doRunAndTest('core/For_04x.groovy');
-        doRunAndTest('core/For_05x.groovy');
-    }
-
-    void "test groovy core - While"() {
-        doTest('core/While_01.groovy');
-        doRunAndTest('core/While_02x.groovy');
-    }
-
-    void "test groovy core - CodeBlock"() {
-        doRunAndTest('core/CodeBlock_01x.groovy');
-    }
-
-    void "test groovy core - DoWhile"() {
-        doRunAndTest('core/DoWhile_01x.groovy');
-        doRunAndTest('core/DoWhile_02x.groovy');
-        doRunAndTest('core/DoWhile_03x.groovy');
-        doRunAndTest('core/DoWhile_04x.groovy');
-    }
-
-
-    void "test groovy core - TryCatch"() {
-        doTest('core/TryCatch_01.groovy');
-    }
-
-    void "test groovy core - TryWithResources"() {
-        doRunAndTest('core/TryWithResources_01x.groovy');
-    }
-
-    void "test groovy core - SafeIndex"() {
-        doRunAndTest('core/SafeIndex_01x.groovy');
-        doRunAndTest('core/SafeIndex_02x.groovy');
-        doRunAndTest('core/SafeIndex_03x.groovy');
-    }
-
-    void "test groovy core - NegativeRelationalOperators"() {
-        doRunAndTest('core/NegativeRelationalOperators_01x.groovy');
-        doRunAndTest('core/NegativeRelationalOperators_02x.groovy');
-    }
-
-    void "test groovy core - DefaultMethod"() {
-        doRunAndTest('core/DefaultMethod_01x.groovy');
-        doRunAndTest('core/DefaultMethod_02x.groovy');
-    }
-
-
-    void "test groovy core - Switch"() {
-        doTest('core/Switch_01.groovy');
-    }
-
-    void "test groovy core - Synchronized"() {
-        doTest('core/Synchronized_01.groovy');
-    }
-
-    void "test groovy core - Return"() {
-        doTest('core/Return_01.groovy');
-    }
-
-    void "test groovy core - Throw"() {
-        doTest('core/Throw_01.groovy');
-    }
-
-    void "test groovy core - Label"() {
-        doTest('core/Label_01.groovy');
-    }
-
-    void "test groovy core - LocalVariableDeclaration"() {
-        doTest('core/LocalVariableDeclaration_01.groovy', [Token]); // [class org.codehaus.groovy.syntax.Token][startLine]:: 9 != 8
-    }
-
-    void "test groovy core - MethodDeclaration"() {
-        doTest('core/MethodDeclaration_01.groovy');
-        doTest('core/MethodDeclaration_02.groovy');
-    }
-
-    void "test groovy core - ClassDeclaration"() {
-        doTest('core/ClassDeclaration_01.groovy');
-        doTest('core/ClassDeclaration_02.groovy');
-        doTest('core/ClassDeclaration_03.groovy');
-        doTest('core/ClassDeclaration_04.groovy', [PropertyNode, FieldNode]);
-        doTest('core/ClassDeclaration_05.groovy', [ExpressionStatement]);
-        doTest('core/ClassDeclaration_06.groovy');
-        doTest('core/ClassDeclaration_07.groovy');
-    }
-
-    void "test groovy core - InterfaceDeclaration"() {
-        doTest('core/InterfaceDeclaration_01.groovy');
-        doTest('core/InterfaceDeclaration_02.groovy');
-        doTest('core/InterfaceDeclaration_03.groovy');
-    }
-
-    void "test groovy core - EnumDeclaration"() {
-        doTest('core/EnumDeclaration_01.groovy');
-        doTest('core/EnumDeclaration_02.groovy', [ExpressionStatement]);
-        doTest('core/EnumDeclaration_03.groovy');
-        doTest('core/EnumDeclaration_04.groovy');
-        doTest('core/EnumDeclaration_05.groovy');
-    }
-
-    void "test groovy core - TraitDeclaration"() {
-        doTest('core/TraitDeclaration_01.groovy');
-        doTest('core/TraitDeclaration_02.groovy');
-        doTest('core/TraitDeclaration_03.groovy');
-        doTest('core/TraitDeclaration_04.groovy', [PropertyNode, FieldNode]);
-        doTest('core/TraitDeclaration_05.groovy');
-    }
-
-    void "test groovy core - AnnotationDeclaration"() {
-        doTest('core/AnnotationDeclaration_01.groovy');
-    }
-
-    void "test groovy core - Command"() {
-        doTest('core/Command_01.groovy');
-        doTest('core/Command_02.groovy');
-        doTest('core/Command_03.groovy', [ExpressionStatement, Parameter]);
-        doTest('core/Command_04.groovy', [ExpressionStatement]);
-        doTest('core/Command_05.groovy');
-        doRunAndTest('core/Command_06x.groovy')
-    }
-
-    void "test groovy core - Unicode"() {
-        doTest('core/Unicode_01.groovy');
-    }
-
-    void "test groovy core - BreakingChanges"() {
-        doRunAndTest('core/BreakingChange_01x.groovy');
-        doRunAndTest('core/BreakingChange_02x.groovy');
-        doRunAndTest('core/BreakingChange_03x.groovy');
-        doRunAndTest('core/BreakingChange_04x.groovy');
-    }
-
-    void "test groovy core - Array"() {
-        doRunAndTest('core/Array_01x.groovy');
-    }
-
-    void "test groovy core - Groovydoc"() {
-        doRunAndTest('core/Groovydoc_01x.groovy');
-    }
-
-    void "test groovy core - Script"() {
-        doRunAndTest('core/Script_01x.groovy');
-    }
-
-    void "test groovy core - BUG"() {
-        doRunAndTest('bugs/BUG-GROOVY-4757.groovy');
-        doRunAndTest('bugs/GROOVY-3898.groovy');
-        doRunAndTest('bugs/BUG-GROOVY-5652.groovy');
-        doRunAndTest('bugs/BUG-GROOVY-4762.groovy');
-        doRunAndTest('bugs/BUG-GROOVY-4438.groovy');
-        doRunAndTest('bugs/BUG-GROOVY-6038.groovy');
-        doRunAndTest('bugs/BUG-GROOVY-2324.groovy');
-        doTest('bugs/BUG-GROOVY-8161.groovy');
-    }
-}


[05/50] [abbrv] groovy git commit: remove skipping of tests for builds.apache.org as we no longer use it (closes #527)

Posted by pa...@apache.org.
remove skipping of tests for builds.apache.org as we no longer use it (closes #527)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/adad2a0f
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/adad2a0f
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/adad2a0f

Branch: refs/heads/parrot
Commit: adad2a0fa73ab494fe7bcc93e521609278b9bf69
Parents: 84df2e1
Author: PascalSchumacher <pa...@gmx.net>
Authored: Sun Apr 23 11:04:00 2017 +0200
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:04:15 2017 +1000

----------------------------------------------------------------------
 src/test/groovy/grape/GrapeIvyTest.groovy       | 35 +--------
 src/test/groovy/lang/ClassReloadingTest.groovy  | 17 -----
 .../groovy/groovy/swing/SwingBuilderTest.groovy | 79 --------------------
 3 files changed, 1 insertion(+), 130 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/adad2a0f/src/test/groovy/grape/GrapeIvyTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/grape/GrapeIvyTest.groovy b/src/test/groovy/grape/GrapeIvyTest.groovy
index bd33870..1bc845f 100644
--- a/src/test/groovy/grape/GrapeIvyTest.groovy
+++ b/src/test/groovy/grape/GrapeIvyTest.groovy
@@ -20,17 +20,11 @@ package groovy.grape
 
 import org.codehaus.groovy.control.CompilationFailedException
 import gls.CompilableTestSupport
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-
-import static org.junit.Assume.assumeFalse
 
 /**
  * @author Danno Ferrin
  * @author Paul King
  */
-@RunWith(JUnit4)
 class GrapeIvyTest extends CompilableTestSupport {
 
     GrapeIvyTest() {
@@ -45,7 +39,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         }
     }
 
-    @Test
     void testSingleArtifact() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -56,7 +49,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import com.jidesoft.swing.JideSplitButton; JideSplitButton.class").name == 'com.jidesoft.swing.JideSplitButton';
     }
 
-    @Test
     void testModuleWithDependencies() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -67,7 +59,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import org.apache.poi.POIDocument; POIDocument.class").name == 'org.apache.poi.POIDocument'
     }
 
-    @Test
     void testMultipleDependencies() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -86,7 +77,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import org.apache.poi.POIDocument; POIDocument.class").name == 'org.apache.poi.POIDocument'
     }
 
-    @Test
     void testListDependencies() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -108,7 +98,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         ]
     }
 
-    @Test
     void testGrabRefless() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -119,7 +108,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import com.jidesoft.swing.JideSplitButton; JideSplitButton.class").name == 'com.jidesoft.swing.JideSplitButton';
     }
 
-    @Test
     void testGrabScriptClass() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -130,7 +118,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import com.jidesoft.swing.JideSplitButton; JideSplitButton.class").name == 'com.jidesoft.swing.JideSplitButton';
     }
 
-    @Test
     void testGrabScriptLoader() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -142,7 +129,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import com.jidesoft.swing.JideSplitButton; JideSplitButton.class").name == 'com.jidesoft.swing.JideSplitButton';
     }
 
-    @Test
     void testGrabReflessMultiple() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -160,7 +146,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import org.apache.poi.POIDocument; POIDocument.class").name == 'org.apache.poi.POIDocument'
     }
 
-    @Test
     void testGrabScriptClassMultiple() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -178,7 +163,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import org.apache.poi.POIDocument; POIDocument.class").name == 'org.apache.poi.POIDocument'
     }
 
-    @Test
     void testGrabScriptLoaderMultiple() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -197,7 +181,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import org.apache.poi.POIDocument; POIDocument.class").name == 'org.apache.poi.POIDocument'
     }
 
-    @Test
     void testSerialGrabs() {
         GroovyClassLoader loader = new GroovyClassLoader()
         Grape.grab(groupId:'log4j', artifactId:'log4j', version:'1.1.3', classLoader:loader)
@@ -215,7 +198,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert !jars.contains ("log4j-1.2.13.jar")
     }
 
-    @Test
     void testConf() {
         GroovyClassLoader loader = new GroovyClassLoader()
 
@@ -265,7 +247,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         loader.getURLs().collect { URL it -> it.getPath().split('/')[-1] } as Set
     }
 
-    @Test
     void testClassifier() {
         GroovyClassLoader loader = new GroovyClassLoader()
         GroovyShell shell = new GroovyShell(loader)
@@ -276,10 +257,7 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert shell.evaluate("import net.sf.json.JSON; JSON").name == 'net.sf.json.JSON'
     }
 
-    @Test
     void testClassifierWithConf() {
-        assumeNotOnBuildsApacheOrgAndNotOnWindows()
-
         def coreJars = [
                 "json-lib-2.2.3-jdk15.jar",
                 "commons-lang-2.4.jar",
@@ -320,13 +298,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert jarNames(loader) == coreJars + optionalJars
     }
 
-    private assumeNotOnBuildsApacheOrgAndNotOnWindows() {
-        boolean buildsApacheOrg = new File('.').absolutePath =~ /jenkins|hudson/
-        boolean windows = System.properties['os.name'].toLowerCase().contains('windows')
-        assumeFalse('Test always fails on builds.apache.org on Windows, so we skip it there.', buildsApacheOrg && windows)
-    }
-
-    @Test
     void testTransitiveShorthandControl() {
         // BeanUtils is a transitive dependency for Digester
         assertScript '''
@@ -338,7 +309,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         '''
     }
 
-    @Test
     void testTransitiveShorthandExpectFailure() {
         assertScript '''
             @Grab('commons-digester:commons-digester:2.1;transitive=false')
@@ -352,7 +322,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         '''
     }
 
-    @Test
     void testAutoDownloadGrapeConfig() {
 
         assertScript '''
@@ -388,7 +357,6 @@ class GrapeIvyTest extends CompilableTestSupport {
     /**
      * GROOVY-470: multiple jars should be loaded for an artifacts with and without a classifier
      */
-    @Test
     void testClassifierAndNonClassifierOnSameArtifact() {
         GroovyClassLoader loader = new GroovyClassLoader()
         Grape.grab(groupId:'org.neo4j', artifactId:'neo4j-kernel', version:'2.0.0-RC1', classLoader:loader)
@@ -408,7 +376,6 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert jars.contains ("neo4j-kernel-2.0.0-RC1-tests.jar")
     }
 
-    @Test
     void testSystemProperties_groovy7548() {
         System.setProperty('groovy7548prop', 'x')
         assert System.getProperty('groovy7548prop') == 'x'
@@ -421,7 +388,7 @@ class GrapeIvyTest extends CompilableTestSupport {
         assert System.getProperty('groovy7548prop') == 'y'
     }
 
-    @Test // GROOVY-7649
+    // GROOVY-7649
     void testResolveSucceedsAfterFailure() {
         GroovyClassLoader loader = new GroovyClassLoader()
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/adad2a0f/src/test/groovy/lang/ClassReloadingTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/lang/ClassReloadingTest.groovy b/src/test/groovy/lang/ClassReloadingTest.groovy
index 197d637..e6b4ccd 100644
--- a/src/test/groovy/lang/ClassReloadingTest.groovy
+++ b/src/test/groovy/lang/ClassReloadingTest.groovy
@@ -18,21 +18,11 @@
  */
 package groovy.lang
 
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-
-import static org.junit.Assume.assumeFalse
-
 import org.codehaus.groovy.control.CompilerConfiguration
 
-@RunWith(JUnit4)
 class ClassReloadingTest extends GroovyTestCase {
 
-    @Test
     void testReloading() {
-        assumeNotOnBuildsApacheOrg()
-
         def file = File.createTempFile("TestReload", ".groovy", new File("target"))
         file.deleteOnExit()
         def className = file.name - ".groovy"
@@ -73,12 +63,6 @@ class ClassReloadingTest extends GroovyTestCase {
         }
     }
 
-    private assumeNotOnBuildsApacheOrg() {
-        boolean buildsApacheOrg = new File('.').absolutePath =~ /jenkins|hudson/
-        assumeFalse('Test always fails on builds.apache.org, so we skip it there.', buildsApacheOrg)
-    }
-
-    @Test
     void testReloadingInStringStringVersion() {
         def fileName = "Dummy3981.groovy"
 
@@ -105,7 +89,6 @@ class ClassReloadingTest extends GroovyTestCase {
         assert "goodbye" == message
     }
 
-    @Test
     void testReloadingIfInitialFileMissesTimestamp() {
         def parent = File.createTempDir("reload","test")
         def file = File.createTempFile("TestReload", ".groovy", parent)

http://git-wip-us.apache.org/repos/asf/groovy/blob/adad2a0f/subprojects/groovy-swing/src/test/groovy/groovy/swing/SwingBuilderTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-swing/src/test/groovy/groovy/swing/SwingBuilderTest.groovy b/subprojects/groovy-swing/src/test/groovy/groovy/swing/SwingBuilderTest.groovy
index 7a609d6..9e6e1b1 100644
--- a/subprojects/groovy-swing/src/test/groovy/groovy/swing/SwingBuilderTest.groovy
+++ b/subprojects/groovy-swing/src/test/groovy/groovy/swing/SwingBuilderTest.groovy
@@ -18,10 +18,6 @@
  */
 package groovy.swing
 
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-
 import javax.swing.JPopupMenu.Separator as JPopupMenu_Separator
 import javax.swing.JToolBar.Separator as JToolBar_Separator
 
@@ -36,21 +32,8 @@ import javax.swing.text.NumberFormatter
 import java.awt.*
 import javax.swing.*
 
-import static org.junit.Assume.assumeFalse
-
-@RunWith(JUnit4)
 class SwingBuilderTest extends GroovySwingTestCase {
 
-    private static final boolean buildsApacheOrg = new File('.').absolutePath =~ /jenkins|hudson/
-    private static final boolean windows = System.properties['os.name'].toLowerCase().contains('windows')
-
-    private assumeNotOnBuildsApacheOrgAndNotOnWindows() {
-        assumeFalse('''Filechooser seems bugy on Windows e.g.: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6973685
-on builds.apache.org these test fail with: java.lang.NullPointerException: at sun.awt.shell.Win32ShellFolder2.access$200(Win32ShellFolder2.java:72)
-Therefore we ship them on there.''', buildsApacheOrg && windows)
-    }
-
-    @Test
     void testWidgetId() {
         testInEDT {
 
@@ -75,10 +58,7 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testNamedWidgetCreation() {
-        assumeNotOnBuildsApacheOrgAndNotOnWindows()
-
         testInEDT {
             def topLevelWidgets = [
                     frame: [JFrame, true],
@@ -100,7 +80,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testLayoutCreation() {
         testInEDT {
 
@@ -122,7 +101,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testGridBagFactory() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -145,7 +123,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testBorderLayout() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -164,7 +141,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testLayoutConstraintsProperty() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -176,7 +152,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testWidgetCreation() {
         testInEDT {
 
@@ -228,7 +203,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testButtonGroup() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -262,7 +236,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testButtonGroupOnlyForButtons() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -274,7 +247,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testWidget() {
         testInEDT {
 
@@ -287,7 +259,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testSplitPane() {
         testInEDT {
 
@@ -310,7 +281,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testNestedWindows() {
         testInEDT {
 
@@ -341,7 +311,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testFrames() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -354,7 +323,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testDialogs() {
         testInEDT {
 
@@ -376,7 +344,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testWindows() {
         testInEDT {
 
@@ -387,7 +354,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testNodeCreation() {
         testInEDT {
 
@@ -408,7 +374,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testSetMnemonic() {
         testInEDT {
 
@@ -434,7 +399,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testBuilderProperties() {
         testInEDT {
 
@@ -443,7 +407,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testFormattedTextField() {
         testInEDT {
 
@@ -461,7 +424,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testScrollPane() {
         testInEDT {
 
@@ -475,7 +437,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testComboBox() {
         testInEDT {
 
@@ -490,7 +451,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testList() {
         testInEDT {
 
@@ -516,7 +476,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testMisplacedActionsAreIgnored() {
         testInEDT {
 
@@ -535,7 +494,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testBoxLayout() {
         testInEDT {
 
@@ -555,7 +513,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testKeystrokesWithinActions() {
         testInEDT {
 
@@ -584,7 +541,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testActionClosures() {
         testInEDT {
 
@@ -625,7 +581,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testSetAccelerator() {
         testInEDT {
 
@@ -648,7 +603,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         return action
     }
 
-    @Test
     void testSetAcceleratorShortcuts() {
         testInEDT {
 
@@ -665,7 +619,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testBorderLayoutConstraints() {
         testInEDT {
 
@@ -697,7 +650,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testSetConstraints() {
         testInEDT {
 
@@ -708,7 +660,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testSetToolTipText() {
         testInEDT {
 
@@ -720,7 +671,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testAttributeOrdering() {
         testInEDT {
 
@@ -745,7 +695,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testWidgetPassthroughConstraints() {
         testInEDT {
 
@@ -759,7 +708,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testGROOVY1837ReuseAction() {
         testInEDT {
 
@@ -775,7 +723,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testSeparators() {
         testInEDT {
 
@@ -795,7 +742,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testCollectionNodes() {
         testInEDT {
 
@@ -807,7 +753,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testFactoryCornerCases() {
         testInEDT {
 
@@ -824,7 +769,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testFactoryLogging() {
         testInEDT {
 
@@ -837,10 +781,7 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testEnhancedValueArguments() {
-        assumeNotOnBuildsApacheOrgAndNotOnWindows()
-
         testInEDT {
 
             def swing = new SwingBuilder()
@@ -1042,7 +983,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         instancePass = true
     }
 
-    @Test
     void testEDT() {
         if (HeadlessTestSupport.headless) return
         def swing = new SwingBuilder()
@@ -1060,7 +1000,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         assert instancePass
     }
 
-    @Test
     void testDoLater() {
         if (HeadlessTestSupport.headless) return
         def swing = new SwingBuilder()
@@ -1102,7 +1041,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         assert instancePass
     }
 
-    @Test
     void testDoOutside() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1146,7 +1084,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testJumbledThreading() {
         if (HeadlessTestSupport.headless) return;
 
@@ -1228,7 +1165,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         assert swing != oldSwing
     }
 
-    @Test
     void testParallelBuild() {
         if (HeadlessTestSupport.headless) return;
 
@@ -1253,7 +1189,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         assert l.parent == null
     }
 
-    @Test
     void testDispose() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1276,7 +1211,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testPackAndShow() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1310,10 +1244,7 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testContainment() {
-        assumeNotOnBuildsApacheOrgAndNotOnWindows()
-
         testInEDT {
             def swing = new SwingBuilder()
 
@@ -1414,7 +1345,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testMenus() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1460,7 +1390,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testLookAndFeel() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1513,7 +1442,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testMultiLookAndFeel() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1540,7 +1468,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testBorders() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1634,7 +1561,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testBorderAttachment() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1661,7 +1587,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testRenderer() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1696,7 +1621,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testNoParent() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1712,7 +1636,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testClientProperties() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1728,7 +1651,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testKeyStrokeAction() {
         testInEDT {
             def swing = new SwingBuilder()
@@ -1781,7 +1703,6 @@ Therefore we ship them on there.''', buildsApacheOrg && windows)
         }
     }
 
-    @Test
     void testAutomaticNameBasedOnIdAttribute() {
         testInEDT {
             def swing = new SwingBuilder()


[24/50] [abbrv] groovy git commit: Minor refactoring

Posted by pa...@apache.org.
Minor refactoring


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/c26bf466
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/c26bf466
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/c26bf466

Branch: refs/heads/parrot
Commit: c26bf4666e30631dd118dbd145deda0f591274fd
Parents: bce50a3
Author: sunlan <su...@apache.org>
Authored: Mon May 8 00:34:08 2017 +0800
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:11:03 2017 +1000

----------------------------------------------------------------------
 .../groovy/classgen/asm/WriterController.java   | 11 ++++------
 .../groovy/control/CompilerConfiguration.java   | 21 +++++++++++++++-----
 2 files changed, 20 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/c26bf466/src/main/org/codehaus/groovy/classgen/asm/WriterController.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/classgen/asm/WriterController.java b/src/main/org/codehaus/groovy/classgen/asm/WriterController.java
index 4eec57e..a7fdc2a 100644
--- a/src/main/org/codehaus/groovy/classgen/asm/WriterController.java
+++ b/src/main/org/codehaus/groovy/classgen/asm/WriterController.java
@@ -18,11 +18,6 @@
  */
 package org.codehaus.groovy.classgen.asm;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
 import org.codehaus.groovy.GroovyBugError;
 import org.codehaus.groovy.ast.ClassHelper;
 import org.codehaus.groovy.ast.ClassNode;
@@ -41,7 +36,9 @@ import org.objectweb.asm.ClassVisitor;
 import org.objectweb.asm.MethodVisitor;
 import org.objectweb.asm.Opcodes;
 
-import static org.codehaus.groovy.control.CompilerConfiguration.JDK_TO_BYTECODE_VERSION_MAP;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
 
 public class WriterController {
 
@@ -140,7 +137,7 @@ public class WriterController {
 
             return Opcodes.V1_8;
         } else {
-            Integer bytecodeVersion = JDK_TO_BYTECODE_VERSION_MAP.get(targetBytecode);
+            Integer bytecodeVersion = CompilerConfiguration.JDK_TO_BYTECODE_VERSION_MAP.get(targetBytecode);
 
             if (null != bytecodeVersion) {
                 return bytecodeVersion;

http://git-wip-us.apache.org/repos/asf/groovy/blob/c26bf466/src/main/org/codehaus/groovy/control/CompilerConfiguration.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/control/CompilerConfiguration.java b/src/main/org/codehaus/groovy/control/CompilerConfiguration.java
index 4278b55..a53f273 100644
--- a/src/main/org/codehaus/groovy/control/CompilerConfiguration.java
+++ b/src/main/org/codehaus/groovy/control/CompilerConfiguration.java
@@ -25,7 +25,18 @@ import org.objectweb.asm.Opcodes;
 
 import java.io.File;
 import java.io.PrintWriter;
-import java.util.*;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.StringTokenizer;
 
 /**
  * Compilation control flags and coordination stuff.
@@ -58,13 +69,10 @@ public class CompilerConfiguration {
     /** This (<code>"1.4"</code>) is the value for targetBytecode to compile for a JDK 1.4 JVM. **/
     public static final String PRE_JDK5 = JDK4;
 
-    /** An array of the valid targetBytecode values **/
-    public static final String[] ALLOWED_JDKS = { JDK4, JDK5, JDK6, JDK7, JDK8 };
-
     /**
      * JDK version to bytecode version mapping
      */
-    public static final Map<String, Integer> JDK_TO_BYTECODE_VERSION_MAP = Collections.unmodifiableMap(new HashMap<String, Integer>() {{
+    public static final Map<String, Integer> JDK_TO_BYTECODE_VERSION_MAP = Collections.unmodifiableMap(new LinkedHashMap<String, Integer>() {{
         put(JDK4, Opcodes.V1_4);
         put(JDK5, Opcodes.V1_5);
         put(JDK6, Opcodes.V1_6);
@@ -72,6 +80,9 @@ public class CompilerConfiguration {
         put(JDK8, Opcodes.V1_8);
     }});
 
+    /** An array of the valid targetBytecode values **/
+    public static final String[] ALLOWED_JDKS = JDK_TO_BYTECODE_VERSION_MAP.keySet().toArray(new String[0]);
+
     // Just call getVMVersion() once.
     public static final String currentJVMVersion = getVMVersion();
 


[39/50] [abbrv] groovy git commit: rename antlr4 parser to remove groovy- prefix since that is by convention for modules

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/TryWithResources_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/TryWithResources_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/TryWithResources_01x.groovy
deleted file mode 100644
index 94a183e..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/TryWithResources_01x.groovy
+++ /dev/null
@@ -1,284 +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.
- */
-import groovy.transform.CompileStatic
-
-import java.io.*
-
-
-class Resource implements Closeable {
-    int resourceId;
-    static closedResourceIds = [];
-    static exMsg = "failed to close";
-
-    public Resource(int resourceId) {
-        this.resourceId = resourceId;
-    }
-
-    public void close() {
-        if (3 == resourceId) throw new IOException(exMsg);
-
-        closedResourceIds << resourceId
-    }
-}
-
-// test case 1
-def a = 1;
-try (Resource r1 = new Resource(1)) {
-    a = 2;
-}
-assert Resource.closedResourceIds == [1]
-assert 2 == a
-
-// test case 2
-Resource.closedResourceIds = []
-final exMsg = "resource not found";
-try {
-    // try { ... } should throw the IOException, while the resource should be closed
-    try (Resource r1 = new Resource(2)) {
-        throw new FileNotFoundException(exMsg)
-    }
-} catch(FileNotFoundException e) {
-    assert exMsg == e.getMessage()
-}
-assert Resource.closedResourceIds == [2]
-
-// test case 3
-Resource.closedResourceIds = []
-a = 1;
-try {
-    try (Resource r1 = new Resource(3)) {
-        a = 2;
-    }
-} catch (IOException e) {
-    assert Resource.exMsg == e.getMessage()
-}
-assert 2 == a;
-assert Resource.closedResourceIds == []
-
-// test case 4
-Resource.closedResourceIds = []
-try {
-    // try { ... } should throw the IOException, while the resource should be closed
-    try (Resource r1 = new Resource(3)) {
-        throw new FileNotFoundException(exMsg)
-    }
-} catch(FileNotFoundException e) {
-    assert exMsg == e.getMessage()
-
-    def suppressedExceptions = e.getSuppressed();
-    assert suppressedExceptions.length == 1
-    assert suppressedExceptions[0] instanceof IOException
-    assert suppressedExceptions[0].getMessage() == Resource.exMsg
-}
-assert Resource.closedResourceIds == []
-
-
-// test case 5
-Resource.closedResourceIds = []
-a = 1;
-try (Resource r1 = new Resource(5);
-Resource r2 = new Resource(6);) {
-    a = 2;
-}
-assert Resource.closedResourceIds == [6, 5]
-assert 2 == a
-
-// test case 6
-Resource.closedResourceIds = []
-a = 1;
-try (Resource r1 = new Resource(5);
-Resource r2 = new Resource(6);
-Resource r3 = new Resource(7);) {
-    a = 2;
-}
-assert Resource.closedResourceIds == [7, 6, 5]
-assert 2 == a
-
-
-// test case 7
-Resource.closedResourceIds = []
-try (Resource r1 = new Resource(7)) {
-    throw new FileNotFoundException(exMsg)
-} catch(FileNotFoundException e) {
-    assert exMsg == e.getMessage()
-}
-assert Resource.closedResourceIds == [7]
-
-// test case 8
-Resource.closedResourceIds = []
-try (Resource r1 = new Resource(7);
-Resource r2 = new Resource(8)) {
-    throw new FileNotFoundException(exMsg)
-} catch(FileNotFoundException e) {
-    assert exMsg == e.getMessage()
-}
-assert Resource.closedResourceIds == [8, 7]
-
-
-// test case 9
-Resource.closedResourceIds = []
-a = 1;
-try (Resource r1 = new Resource(3)) {
-    a = 2;
-} catch (IOException e) {
-    assert Resource.exMsg == e.getMessage()
-}
-assert 2 == a;
-assert Resource.closedResourceIds == []
-
-
-// test case 10
-Resource.closedResourceIds = []
-a = 1;
-try (Resource r1 = new Resource(3);
-Resource r2 = new Resource(4)) {
-    a = 2;
-} catch (IOException e) {
-    assert Resource.exMsg == e.getMessage()
-}
-assert 2 == a;
-assert Resource.closedResourceIds == [4]
-
-// test case 11
-Resource.closedResourceIds = []
-a = 1;
-try (Resource r0 = new Resource(2);
-Resource r1 = new Resource(3);
-Resource r2 = new Resource(4)) {
-    a = 2;
-} catch (IOException e) {
-    assert Resource.exMsg == e.getMessage()
-}
-assert 2 == a;
-assert Resource.closedResourceIds == [4, 2]
-
-
-// test case 12
-Resource.closedResourceIds = []
-try (Resource r1 = new Resource(3);
-Resource r2 = new Resource(4)) {
-    throw new FileNotFoundException(exMsg)
-} catch(FileNotFoundException e) {
-    assert exMsg == e.getMessage()
-
-    def suppressedExceptions = e.getSuppressed();
-    assert suppressedExceptions.length == 1
-    assert suppressedExceptions[0] instanceof IOException
-    assert suppressedExceptions[0].getMessage() == Resource.exMsg
-}
-assert Resource.closedResourceIds == [4]
-
-// test case 13
-Resource.closedResourceIds = []
-try (Resource r0 = new Resource(2);
-Resource r1 = new Resource(3);
-Resource r2 = new Resource(4)) {
-    throw new FileNotFoundException(exMsg)
-} catch(FileNotFoundException e) {
-    assert exMsg == e.getMessage()
-
-    def suppressedExceptions = e.getSuppressed();
-    assert suppressedExceptions.length == 1
-    assert suppressedExceptions[0] instanceof IOException
-    assert suppressedExceptions[0].getMessage() == Resource.exMsg
-}
-assert Resource.closedResourceIds == [4, 2]
-
-// test case 14
-Resource.closedResourceIds = []
-a = 1;
-try (Resource r1 = new Resource(1)) {
-    a += 2;
-    try (Resource r2 = new Resource(2);Resource r4 = new Resource(4)) {
-        a += 3;
-        try (Resource r5 = new Resource(5);Resource r6 = new Resource(6);Resource r7 = new Resource(7)) {
-            a += 4;
-            try {
-                try (Resource r3 = new Resource(3)) {
-                    a += 5;
-                }
-            } catch (IOException e) {
-                assert Resource.exMsg == e.getMessage()
-            }
-        }
-    } catch(Exception e) {
-        // ignored
-    } finally {
-        a += 10
-    }
-}
-assert Resource.closedResourceIds == [7, 6, 5, 4, 2, 1]
-assert 25 == a
-
-// test case 15
-@CompileStatic
-void tryWithResources() {
-    Resource.closedResourceIds = []
-    int cs = 1;
-    try (Resource r1 = new Resource(1)) {
-        cs += 2;
-        try (Resource r2 = new Resource(2);Resource r4 = new Resource(4)) {
-            cs += 3;
-            try (Resource r5 = new Resource(5);Resource r6 = new Resource(6);Resource r7 = new Resource(7)) {
-                cs += 4;
-                try {
-                    try (Resource r3 = new Resource(3)) {
-                        cs += 5;
-                    }
-                } catch (IOException e) {
-                    assert Resource.exMsg == e.getMessage()
-                }
-            }
-        } catch(Exception e) {
-            // ignored
-        } finally {
-            cs += 10
-        }
-    }
-    assert Resource.closedResourceIds == [7, 6, 5, 4, 2, 1]
-    assert 25 == cs
-}
-
-tryWithResources()
-
-
-// test case 16
-Resource.closedResourceIds = []
-a = 1;
-try (
-        Resource r1 = new Resource(
-        1
-)
-        Resource r2 = new Resource(2)
-) {
-    a = 2;
-}
-assert Resource.closedResourceIds == [2, 1]
-assert 2 == a
-
-// test case 17
-Resource.closedResourceIds = []
-a = 1;
-try (r1 = new Resource(1)
-     r2 = new Resource(2)) {
-    a = 2;
-}
-assert Resource.closedResourceIds == [2, 1]
-assert 2 == a
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/Unicode_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Unicode_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Unicode_01.groovy
deleted file mode 100644
index a065baa..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Unicode_01.groovy
+++ /dev/null
@@ -1,42 +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.
- */
-def \u0061 = '\uuuuu0061'
-def \u0061\u0062
-def \u0061\u0062\u0063
-def \u0061\u0062\u00639
-def \u0061cC\u0062Bb\u00639aA
-def a\u00615\u00626\u0063Z
-def A\u00617\u00628\u0063z
-
-def \u0061\u0062() {}
-
-class \u0061 {
-    def \u0061\u0062
-
-    def \u0061cC\u0062Bb\u00639aA() {}
-}
-interface \u0061 {}
-enum \u0061 {
-    \u0061cC\u0062Bb\u00639aA, \u0061cC\u0062Bb\u00639aA2
-}
-trait \u0061 {}
-@interface \u0061 {}
-
-
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/While_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/While_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/While_01.groovy
deleted file mode 100644
index cbf0249..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/While_01.groovy
+++ /dev/null
@@ -1,76 +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.
- */
-while(true) assert true
-
-while(
-        true
-) assert true
-
-while(true)
-    assert true
-
-while(true) {
-    break;
-}
-
-out:
-while(true) {
-    break out;
-}
-
-out1:
-while(true) {
-    break out1;
-    out2: while (true) {
-        break out2;
-    }
-}
-
-
-while(true) {
-    continue
-}
-
-out:
-while(true) {
-    continue out;
-}
-
-out1:
-while(true) {
-    continue out1;
-    out2: while (true) {
-        continue out2;
-    }
-}
-
-out1:
-while(true) {
-    continue out1;
-    out2: while (true) {
-        break out2;
-    }
-}
-
-
-while (false)
-    int number = 1
-
-while(true);
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/core/While_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/While_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/While_02x.groovy
deleted file mode 100644
index e099280..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/While_02x.groovy
+++ /dev/null
@@ -1,23 +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.
- */
-int i = 0
-while (i < 5) {
-    i++
-}
-assert 5 == i;

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_01x.groovy
deleted file mode 100644
index 8dae1bd..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_01x.groovy
+++ /dev/null
@@ -1,21 +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.
- */
-class A {
-    def x()
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_02x.groovy
deleted file mode 100644
index 80a041c..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_02x.groovy
+++ /dev/null
@@ -1,22 +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.
- */
-enum E {
-    A, B
-    def y()
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_03x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_03x.groovy
deleted file mode 100644
index 92ace61..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_03x.groovy
+++ /dev/null
@@ -1,21 +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.
- */
-trait B {
-    def z()
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_04x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_04x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_04x.groovy
deleted file mode 100644
index 409fa18..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_04x.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-def w()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_05x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_05x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_05x.groovy
deleted file mode 100644
index aec108e..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_05x.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-abstract v()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_06x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_06x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_06x.groovy
deleted file mode 100644
index 7672201..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/AbstractMethod_06x.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-abstract u() {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Break_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Break_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Break_01x.groovy
deleted file mode 100644
index 14c8d30..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Break_01x.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-break
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Break_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Break_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Break_02x.groovy
deleted file mode 100644
index f08680b..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Break_02x.groovy
+++ /dev/null
@@ -1,21 +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.
- */
-if (true) {
-    break;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy
deleted file mode 100644
index b60a794..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy
+++ /dev/null
@@ -1,25 +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.
- */
-package fail
-
-class A {
-    String foo() {}
-    def foo() {}
-}
-new A()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy
deleted file mode 100644
index 607c5b5..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-[].for(1;2;3){println "in loop"}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy
deleted file mode 100644
index 29a16ec..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-def x = (1;2;3)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy
deleted file mode 100644
index dab42a1..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-[].bar(1;2;3)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy
deleted file mode 100644
index 5783cbd..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy
+++ /dev/null
@@ -1,28 +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.
- */
-class Crasher {
-    public void m() {
-        def fields = [1,2,3]
-        def expectedFieldNames = ["patentnumber", "status"].
-                for (int i=0; i<fields.size(); i++) {
-                    Object f = fields[i]
-                    System.out.println(f);
-                }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy
deleted file mode 100644
index 1318c4a..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-class Foo { static final Foo() {}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Continue_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Continue_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Continue_01x.groovy
deleted file mode 100644
index 4a23bf8..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Continue_01x.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-continue;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Continue_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Continue_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Continue_02x.groovy
deleted file mode 100644
index 744b34a..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Continue_02x.groovy
+++ /dev/null
@@ -1,21 +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.
- */
-if (true) {
-    continue;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/DoWhile_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/DoWhile_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/DoWhile_01x.groovy
deleted file mode 100644
index b770cfb..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/DoWhile_01x.groovy
+++ /dev/null
@@ -1,22 +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.
- */
-do
-println 123
-println 123
-while(false)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_01.groovy
deleted file mode 100644
index 4313d66..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_01.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-int()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_02.groovy
deleted file mode 100644
index d469216..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_02.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-1 = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_03.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_03.groovy
deleted file mode 100644
index 904f84e..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_03.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-m() = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_04.groovy
deleted file mode 100644
index 0d4e9af..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_04.groovy
+++ /dev/null
@@ -1,19 +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 = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_05.groovy
deleted file mode 100644
index 58cf67c..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_05.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-super = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_06.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_06.groovy
deleted file mode 100644
index 220518d..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_06.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-[1, 2] = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_07.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_07.groovy
deleted file mode 100644
index 6f6f9b0..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_07.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-[a: 1, b: 2] = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_08.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_08.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_08.groovy
deleted file mode 100644
index fb47d45..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_08.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-"$x" = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_09.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_09.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_09.groovy
deleted file mode 100644
index 4c1958c..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Expression_09.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-'x' = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/For_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/For_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/For_01.groovy
deleted file mode 100644
index 694dfed..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/For_01.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-for (*a; a.size() < 10;) {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/For_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/For_02.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/For_02.groovy
deleted file mode 100644
index 359b9ca..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/For_02.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-for (; a.size() < 10; *a) {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy
deleted file mode 100644
index 312818e..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy
+++ /dev/null
@@ -1,21 +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.
- */
-interface Foo {
-    def doit( String param = "Groovy", int o )
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/List_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/List_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/List_01.groovy
deleted file mode 100644
index b625423..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/List_01.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-[,]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/LocalVariableDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/LocalVariableDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/LocalVariableDeclaration_01.groovy
deleted file mode 100644
index 590cb87..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/LocalVariableDeclaration_01.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-@Test2 (int c, int d) = [1, 2]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy
deleted file mode 100644
index a8f27ad..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy
+++ /dev/null
@@ -1,23 +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.
- */
-{ ->
-    def say(String msg) {
-        println(msg)
-    }
-}()

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_01x.groovy
deleted file mode 100644
index d7d4ce7..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_01x.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-def def m() {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_02x.groovy
deleted file mode 100644
index fcb609a..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_02x.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-public public class A {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_03x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_03x.groovy
deleted file mode 100644
index de1f024..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_03x.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-final final int a = 1;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_04x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_04x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_04x.groovy
deleted file mode 100644
index 4b495ad..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_04x.groovy
+++ /dev/null
@@ -1,21 +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.
- */
-class A {
-    private public a
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_05x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_05x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_05x.groovy
deleted file mode 100644
index d19ca6c..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_05x.groovy
+++ /dev/null
@@ -1,21 +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.
- */
-class A {
-    protected public a
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_07.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_07.groovy
deleted file mode 100644
index 2134472..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Modifier_07.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-volatile x() {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_01x.groovy
deleted file mode 100644
index dc1585a..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_01x.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-(1 + 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_02x.groovy
deleted file mode 100644
index e2ce8a4..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_02x.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-(1 + 2))
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_03x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_03x.groovy
deleted file mode 100644
index af33a2e..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/ParExpression_03x.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-(1 + 2]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Parentheses_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Parentheses_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Parentheses_01.groovy
deleted file mode 100644
index 976b0d2..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Parentheses_01.groovy
+++ /dev/null
@@ -1,20 +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.
- */
-def a( {
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Super_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Super_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Super_01x.groovy
deleted file mode 100644
index 8abe436..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Super_01x.groovy
+++ /dev/null
@@ -1,24 +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.
- */
-class A {
-    A(int a) {
-        println a
-        super(123)
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Switch_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Switch_01.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Switch_01.groovy
deleted file mode 100644
index c548d86..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Switch_01.groovy
+++ /dev/null
@@ -1,27 +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.
- */
-switch (a) {
-    case 1:
-        break;
-    default:
-        break;
-    default:
-        break;
-}
-

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/This_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/This_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/This_01x.groovy
deleted file mode 100644
index d3fdc44..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/This_01x.groovy
+++ /dev/null
@@ -1,26 +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.
- */
-class A {
-    A(int a) {
-        println a
-        this()
-    }
-
-    A() {}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/UnexpectedCharacter_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/UnexpectedCharacter_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/UnexpectedCharacter_01x.groovy
deleted file mode 100644
index 5beccbe..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/UnexpectedCharacter_01x.groovy
+++ /dev/null
@@ -1,19 +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.
- */
-
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_01x.groovy
deleted file mode 100644
index fdeb7c4..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_01x.groovy
+++ /dev/null
@@ -1,21 +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.
- */
-class MyClass {
-    void field
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_02x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_02x.groovy
deleted file mode 100644
index 748003e..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/fail/Void_02x.groovy
+++ /dev/null
@@ -1,23 +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.
- */
-class MyClass {
-    def foo() {
-        void bar = null
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/README.adoc
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/README.adoc b/subprojects/parser-antlr4/README.adoc
new file mode 100644
index 0000000..4170426
--- /dev/null
+++ b/subprojects/parser-antlr4/README.adoc
@@ -0,0 +1,59 @@
+//////////////////////////////////////////
+
+  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 loop, standard loop(e.g. `for(int i = 0, j = 10; i < j; i++, j--) {..}`)
+* lambda expression
+* method reference and constructor reference
+* try-with-resources(i.e. ARM)
+* code block(i.e. `{..}`)
+* array initializer of Java style(e.g. `new int[] {1, 2, 3}`)
+* default method of interface
+* new operators: identity operators(`===`, `!==`), elvis assignment(`?=`), `!in`, `!instanceof`
+* safe index(e.g. `nullableVar?[1, 2]`)
+* runtime groovydoc(i.e. groovydoc with `@Groovydoc`), groovydoc attached to AST node as metadata
+
+=== How to enable the new parser
+
+* In the gradle build the property useAntlr4 has to be set to enable the build of the parser and the execution of all tests with it. Command line example:
+```
+./gradlew -PuseAntlr4=true bootstrapJar
+```
+* To enable the new parser automatically at runtime the system property groovy.antlr4 has to be set. Command line example:
+```
+export JAVA_OPTS="-Dgroovy.antlr4=true"
+groovy foo.groovy
+```
+* This system property also controls groovyc and has to be used in case it is used outside of this build, for example with:
+```
+groovyOptions.forkOptions.jvmArgs += ["-Dgroovy.antlr4=true"]
+```
+
+=== JVM system properties to control parsing
+
+* `groovy.antlr4.cache.threshold`: how frequently to clear DFA cache(default: 50). **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.extract.doc.comment`: whether to collect groovydoc while parsing groovy source code(default: false)
+
+*P.S. Parrot is based on the highly optimized version of antlr4(com.tunnelvisionlabs:antlr4), which is licensed under BSD.*
+ 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/build.gradle
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/build.gradle b/subprojects/parser-antlr4/build.gradle
new file mode 100644
index 0000000..8e9f0a4
--- /dev/null
+++ b/subprojects/parser-antlr4/build.gradle
@@ -0,0 +1,70 @@
+/*
+ *  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.
+ */
+if (!rootProject.hasProperty('useAntlr4')) return
+
+apply plugin: 'me.champeau.gradle.antlr4'
+
+def srcBase = "subprojects/parser-antlr4/src"
+def srcMain = "$srcBase/main"
+def srcTest = "$srcBase/test"
+def antlr4Source = "$srcMain/antlr4"
+def antlr4OutputRootDir = "$buildDir/generated-sources"
+def antlr4Output = "$antlr4OutputRootDir/org/apache/groovy/parser/antlr4"
+
+// set package for antlr generated classes
+antlr4 {
+    source = file(antlr4Source)
+    extraArgs = ["-no-listener", "-package", "org.apache.groovy.parser.antlr4"]
+    output = file(antlr4Output)
+}
+
+// make the Java compile task depend on the antlr4 task
+compileJava.dependsOn antlr4
+
+// add antlr4 to classpath
+configurations {
+   compile.extendsFrom antlr4
+}
+
+dependencies {
+    antlr4 "com.tunnelvisionlabs:antlr4:$antlr4Version"
+    testCompile project(':groovy-test')
+}
+
+
+task cleanGeneratedSources(type: Delete) {
+    delete antlr4OutputRootDir
+    file(antlr4OutputRootDir).mkdirs()
+}
+
+antlr4.dependsOn cleanGeneratedSources
+
+// add the generated source files to the list of java sources
+sourceSets.main.java.srcDirs += file("$antlr4OutputRootDir");
+sourceSets.main.java.srcDirs += file("$srcMain/java");
+sourceSets.main.groovy.srcDirs += file("$srcMain/groovy");
+sourceSets.main.resources.srcDirs += file("$antlr4Source");
+sourceSets.main.resources.srcDirs += file("$srcMain/resources");
+sourceSets.test.java.srcDirs += file("$srcTest/java");
+sourceSets.test.groovy.srcDirs += file("$srcTest/groovy");
+sourceSets.test.resources.srcDirs += file("$srcTest/resources");
+
+test {
+    jvmArgs "-Dgroovy.extract.doc.comment=true", "-Dgroovy.antlr4.cache.threshold=100"
+}


[06/50] [abbrv] groovy git commit: fix spec test (closes #531)

Posted by pa...@apache.org.
fix spec test (closes #531)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/2093378c
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/2093378c
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/2093378c

Branch: refs/heads/parrot
Commit: 2093378cdbfc34308386b345b9773818e17b00b6
Parents: a51162f
Author: John Wagenleitner <jw...@apache.org>
Authored: Sun Apr 30 13:14:24 2017 -0700
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:04:48 2017 +1000

----------------------------------------------------------------------
 src/spec/test/SyntaxTest.groovy | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/2093378c/src/spec/test/SyntaxTest.groovy
----------------------------------------------------------------------
diff --git a/src/spec/test/SyntaxTest.groovy b/src/spec/test/SyntaxTest.groovy
index 40bfc15..96c3c47 100644
--- a/src/spec/test/SyntaxTest.groovy
+++ b/src/spec/test/SyntaxTest.groovy
@@ -501,8 +501,9 @@ class SyntaxTest extends CompilableTestSupport {
             $$ escaped dollar sign
             \ backslash
             / forward slash
-            $$/ escaped dollar forward slash
-            $/$ escaped closing dollar slashy
+            $/ escaped forward slash
+            $$$/ escaped opening dollar slashy
+            $/$$ escaped closing dollar slashy
         /$
 
         assert [
@@ -512,7 +513,8 @@ class SyntaxTest extends CompilableTestSupport {
             '$ escaped dollar sign',
             '\\ backslash',
             '/ forward slash',
-            '$/ escaped dollar forward slash',
+            '/ escaped forward slash',
+            '$/ escaped opening dollar slashy',
             '/$ escaped closing dollar slashy'
         ].every { dollarSlashy.contains(it) }
         // end::dollar_slashy_1[]


[18/50] [abbrv] groovy git commit: vm8 tests not separated for 3.0+

Posted by pa...@apache.org.
vm8 tests not separated for 3.0+


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/046c6aa1
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/046c6aa1
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/046c6aa1

Branch: refs/heads/parrot
Commit: 046c6aa1ff69c2f9bc309537c5311b9aa8c9e3a5
Parents: dd4fed3
Author: paulk <pa...@asert.com.au>
Authored: Sun May 7 11:22:25 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:09:11 2017 +1000

----------------------------------------------------------------------
 build.gradle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/046c6aa1/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 0325f13..2254e1e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -65,7 +65,7 @@ buildScan {
 }
 
 ext.modules = {
-    subprojects.findAll{ !['performance', 'groovy-tests-vm8'].contains(it.name) }
+    subprojects.findAll{ !['performance'].contains(it.name) }
 }
 
 apply from: 'gradle/filter.gradle'


[13/50] [abbrv] groovy git commit: fix typo - side effect: closes #485

Posted by pa...@apache.org.
fix typo - side effect: closes #485


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/ac6bf0a9
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/ac6bf0a9
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/ac6bf0a9

Branch: refs/heads/parrot
Commit: ac6bf0a9abb40bcd42bb465673042bfbb16f51f5
Parents: 921f96d
Author: paulk <pa...@asert.com.au>
Authored: Fri May 5 20:33:19 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:06:12 2017 +1000

----------------------------------------------------------------------
 config/checkstyle/checkstyle.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/ac6bf0a9/config/checkstyle/checkstyle.xml
----------------------------------------------------------------------
diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml
index 81e9bf6..34aebe1 100644
--- a/config/checkstyle/checkstyle.xml
+++ b/config/checkstyle/checkstyle.xml
@@ -152,7 +152,7 @@
             <property name="illegalClassNames" value="java.util.GregorianCalendar, java.util.Hashtable, java.util.HashSet, java.util.HashMap, java.util.ArrayList, java.util.LinkedHashMap, java.util.LinkedHashSet, java.util.TreeSet, java.util.TreeMap, java.util.Vector"/>
         </module>
         <module name="UpperEll"/>
-        <!-- off for now - to allow parenteses which add clarity -->
+        <!-- off for now - to allow parentheses which add clarity -->
         <!--<module name="UnnecessaryParentheses"/>-->
         <module name="JUnitTestCase"/>
         <module name="FinalClass"/>


[12/50] [abbrv] groovy git commit: Fix some tests which have not been covered by Parrot before

Posted by pa...@apache.org.
Fix some tests which have not been covered by Parrot before


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/53b4f900
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/53b4f900
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/53b4f900

Branch: refs/heads/parrot
Commit: 53b4f90073e44b339c618cf3c40375e4508ed100
Parents: ac6bf0a
Author: sunlan <su...@apache.org>
Authored: Fri May 5 20:26:01 2017 +0800
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:06:12 2017 +1000

----------------------------------------------------------------------
 src/test/groovy/bugs/Groovy4252Bug.groovy       |  12 +-
 src/test/groovy/bugs/Groovy8046Bug.groovy       |   9 +-
 .../codehaus/groovy/antlr/GStringEndTest.groovy |  12 +-
 .../apache/groovy/parser/antlr4/GroovyLexer.g4  |  25 +-
 .../apache/groovy/parser/antlr4/GroovyParser.g4 |  45 ++-
 .../parser/antlr4/util/GroovyTestRig.groovy     |   4 +-
 .../apache/groovy/parser/antlr4/AstBuilder.java | 375 +++++--------------
 .../groovy/parser/antlr4/GroovySyntaxError.java |  13 +-
 .../groovy/parser/antlr4/ModifierManager.java   | 198 ++++++++++
 .../groovy/parser/antlr4/ModifierNode.java      | 164 ++++++++
 .../groovy/parser/antlr4/PositionInfo.java      |  73 ++++
 .../parser/antlr4/SemanticPredicates.java       |   6 +-
 .../parser/antlr4/SyntaxErrorReportable.java    |  30 +-
 .../parser/antlr4/GroovyParserTest.groovy       | 308 +++++++--------
 .../groovy/parser/antlr4/SyntaxErrorTest.groovy |  35 +-
 .../resources/core/EnumDeclaration_04.groovy    |   4 +
 .../resources/core/EnumDeclaration_05.groovy    |   4 +
 .../src/test/resources/core/GString_04.groovy   |   1 +
 .../src/test/resources/core/GString_05.groovy   |   1 +
 .../src/test/resources/core/GString_06.groovy   |   1 +
 .../src/test/resources/core/Script_01x.groovy   |   5 +
 .../resources/fail/ClassDeclaration_01x.groovy  |   7 +
 .../fail/ClosureListExpression_01.groovy        |   1 +
 .../fail/ClosureListExpression_02.groovy        |   1 +
 .../fail/ClosureListExpression_03.groovy        |   1 +
 .../fail/ClosureListExpression_04.groovy        |  10 +
 .../fail/ConstructorDeclaration_01.groovy       |   1 +
 .../fail/InterfaceDeclaration_01.groovy         |   3 +
 .../resources/fail/MethodDeclaration_01.groovy  |   5 +
 .../src/test/resources/fail/Modifier_07.groovy  |   1 +
 .../src/test/resources/fail/Void_01x.groovy     |   3 +
 .../src/test/resources/fail/Void_02x.groovy     |   5 +
 32 files changed, 873 insertions(+), 490 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/src/test/groovy/bugs/Groovy4252Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy4252Bug.groovy b/src/test/groovy/bugs/Groovy4252Bug.groovy
index 20b2693..1641286 100644
--- a/src/test/groovy/bugs/Groovy4252Bug.groovy
+++ b/src/test/groovy/bugs/Groovy4252Bug.groovy
@@ -29,7 +29,8 @@ class Groovy4252Bug extends GroovyShellTestCase {
             fail("The compilation should have failed as expression list of form (a;b;c) is not supported in this context")
         } catch (MultipleCompilationErrorsException e) {
             def syntaxError = e.errorCollector.getSyntaxError(0)
-            assert syntaxError.message.contains("Expression list of the form (a; b; c) is not supported in this context")
+            assert syntaxError.message.contains("Expression list of the form (a; b; c) is not supported in this context") ||
+                    syntaxError.message.contains("Missing ')'")
         }
     }
 
@@ -41,7 +42,8 @@ class Groovy4252Bug extends GroovyShellTestCase {
             fail("The compilation should have failed as expression list of form (a;b;c) is not supported in this context")
         } catch (MultipleCompilationErrorsException e) {
             def syntaxError = e.errorCollector.getSyntaxError(0)
-            assert syntaxError.message.contains("Expression list of the form (a; b; c) is not supported in this context")
+            assert syntaxError.message.contains("Expression list of the form (a; b; c) is not supported in this context") ||
+                    syntaxError.message.contains("Missing ')'")
         }
     }
 
@@ -53,7 +55,8 @@ class Groovy4252Bug extends GroovyShellTestCase {
             fail("The compilation should have failed as expression list of form (a;b;c) is not supported in this context")
         } catch (MultipleCompilationErrorsException e) {
             def syntaxError = e.errorCollector.getSyntaxError(0)
-            assert syntaxError.message.contains("Expression list of the form (a; b; c) is not supported in this context")
+            assert syntaxError.message.contains("Expression list of the form (a; b; c) is not supported in this context") ||
+                    syntaxError.message.contains("Missing ')'")
         }
     }
 
@@ -74,7 +77,8 @@ class Groovy4252Bug extends GroovyShellTestCase {
             fail("The compilation should have failed as expression list of form (a;b;c) is not supported in this context")
         } catch (MultipleCompilationErrorsException e) {
             def syntaxError = e.errorCollector.getSyntaxError(0)
-            assert syntaxError.message.contains("Expression list of the form (a; b; c) is not supported in this context")
+            assert syntaxError.message.contains("Expression list of the form (a; b; c) is not supported in this context") ||
+                    syntaxError.message.contains("Missing ')'")
         }
     }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/src/test/groovy/bugs/Groovy8046Bug.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/bugs/Groovy8046Bug.groovy b/src/test/groovy/bugs/Groovy8046Bug.groovy
index c8bf633..3b81814 100644
--- a/src/test/groovy/bugs/Groovy8046Bug.groovy
+++ b/src/test/groovy/bugs/Groovy8046Bug.groovy
@@ -27,7 +27,8 @@ class Groovy8046Bug extends CompilableTestSupport {
                 void field
             }
         """
-        assert message.contains("The field 'field' has invalid type void")
+        assert message.contains("The field 'field' has invalid type void") ||
+                message.contains("void is not allowed here")
     }
 
     void testParameterShouldNotHavePrimitiveVoidType() {
@@ -36,7 +37,8 @@ class Groovy8046Bug extends CompilableTestSupport {
                 int foo(void param) {}
             }
         """
-        assert message.contains("The parameter 'param' in method 'int foo(void)' has invalid type void")
+        assert message.contains("The parameter 'param' in method 'int foo(void)' has invalid type void") ||
+                message.contains("void is not allowed here")
     }
 
     void testLocalVariableShouldNotHavePrimitiveVoidType() {
@@ -47,6 +49,7 @@ class Groovy8046Bug extends CompilableTestSupport {
                 }
             }
         """
-        assert message.contains("The variable 'bar' has invalid type void")
+        assert message.contains("The variable 'bar' has invalid type void") ||
+                message.contains("void is not allowed here")
     }
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/src/test/org/codehaus/groovy/antlr/GStringEndTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/antlr/GStringEndTest.groovy b/src/test/org/codehaus/groovy/antlr/GStringEndTest.groovy
index b8f380f..fc7f98e 100644
--- a/src/test/org/codehaus/groovy/antlr/GStringEndTest.groovy
+++ b/src/test/org/codehaus/groovy/antlr/GStringEndTest.groovy
@@ -1,3 +1,7 @@
+package org.codehaus.groovy.antlr
+
+import org.codehaus.groovy.antlr.parser.GroovyLexer
+
 /*
  *  Licensed to the Apache Software Foundation (ASF) under one
  *  or more contributor license agreements.  See the NOTICE file
@@ -16,10 +20,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-import org.codehaus.groovy.control.*
-import org.codehaus.groovy.antlr.parser.GroovyLexer
-
-import antlr.TokenStreamRecognitionException;
+import org.codehaus.groovy.control.MultipleCompilationErrorsException;
 
 class GStringEndTest extends GroovyTestCase {
     void testInvalidEndContainsLineNumber(){
@@ -29,7 +30,8 @@ class GStringEndTest extends GroovyTestCase {
             '''
         } catch (MultipleCompilationErrorsException mcee) {
             def text = mcee.toString();
-            assert text.contains("line 2, column 41")
+            assert text.contains("line 2, column 41") ||  // the old parser
+                        text.contains("line 2, column 40") // parrot: column 40 is more accurate than the original 41
         }
     }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyLexer.g4
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyLexer.g4 b/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyLexer.g4
index ec7a08d..cdcfeea 100644
--- a/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyLexer.g4
+++ b/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyLexer.g4
@@ -153,8 +153,7 @@ options {
 
         require(null != paren, "Too many '" + text + "'");
         require(text.equals(PAREN_MAP.get(paren.getText())),
-                "'" + text + "' " + genPositionInfo() + " can not match '" + paren.getText() + "' " + formatPositionInfo(paren.getLine(), paren.getColumn()),
-                false);
+                "'" + paren.getText() + "'" + new PositionInfo(paren.getLine(), paren.getColumn()) + " can not match '" + text + "'");
 
         parenStack.pop();
     }
@@ -190,8 +189,13 @@ options {
     }
 
     @Override
-    public String genPositionInfo() {
-        return formatPositionInfo(getLine(), getCharPositionInLine() + 1);
+    public int getErrorLine() {
+        return getLine();
+    }
+
+    @Override
+    public int getErrorColumn() {
+        return getCharPositionInLine() + 1;
     }
 }
 
@@ -282,7 +286,14 @@ GStringPathPart
     :   '.' IdentifierInGString
     ;
 RollBackOne
-    :   . -> popMode, channel(HIDDEN)
+    :   . {
+            // a trick to handle GStrings followed by EOF properly
+            if (EOF == _input.LA(1) && ('"' == _input.LA(-1) || '/' == _input.LA(-1))) {
+                setType(GStringEnd);
+            } else {
+                setChannel(HIDDEN);
+            }
+          } -> popMode
     ;
 
 
@@ -771,14 +782,14 @@ ELVIS_ASSIGN    : '?=';
 CapitalizedIdentifier
     :   [A-Z] JavaLetterOrDigit*
 
-    // Groovy's identifier can be unicode escape
+    // FIXME REMOVE THE FOLLOWING ALTERNATIVE. Groovy's identifier can be unicode escape(e.g. def \u4e00\u9fa5 = '123'), which will impact the performance and is pointless to support IMO
     |   [A-Z] (JavaLetterOrDigit | UnicodeEscape)*
     ;
 
 Identifier
     :   JavaLetter JavaLetterOrDigit*
 
-    // Groovy's identifier can be unicode escape
+    // FIXME REMOVE THE FOLLOWING ALTERNATIVE. Groovy's identifier can be unicode escape(e.g. def \u4e00\u9fa5 = '123'), which will impact the performance and is pointless to support IMO
     |   (JavaLetter | UnicodeEscape) (JavaLetterOrDigit | UnicodeEscape)*
     ;
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4 b/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
index 75129c9..6775320 100644
--- a/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
+++ b/subprojects/groovy-parser-antlr4/src/main/antlr4/org/apache/groovy/parser/antlr4/GroovyParser.g4
@@ -111,14 +111,25 @@ options {
     }
 
     @Override
-    public String genPositionInfo() {
+    public int getErrorLine() {
         Token token = _input.LT(-1);
 
         if (null == token) {
-            return "";
+            return -1;
         }
 
-        return formatPositionInfo(token.getLine(), token.getCharPositionInLine() + 1 + token.getText().length());
+        return token.getLine();
+    }
+
+    @Override
+    public int getErrorColumn() {
+        Token token = _input.LT(-1);
+
+        if (null == token) {
+            return -1;
+        }
+
+        return token.getCharPositionInLine() + 1 + token.getText().length();
     }
 }
 
@@ -369,7 +380,11 @@ options { baseContext = type; }
     ;
 
 type
-    :   primitiveType (LBRACK RBRACK)*
+    :   (   primitiveType
+        |
+            // !!! ERROR ALTERNATIVE !!!
+            VOID { require(false, "void is not allowed here", -4); }
+        ) (LBRACK RBRACK)*
     |   generalClassOrInterfaceType (LBRACK RBRACK)*
     ;
 
@@ -631,7 +646,7 @@ locals[ boolean isInsideLoop ]
     }
 }
     :   CONTINUE
-        { $isInsideLoop }?<fail={"the continue statement is only allowed inside loops"}>
+        { require($isInsideLoop, "the continue statement is only allowed inside loops", -8); }
         identifier?
     ;
 
@@ -651,7 +666,7 @@ locals[ boolean isInsideLoop, boolean isInsideSwitch ]
     }
 }
     :   BREAK
-        { $isInsideLoop || $isInsideSwitch }?<fail={"the break statement is only allowed inside loops or switches"}>
+        { require($isInsideLoop || $isInsideSwitch, "the break statement is only allowed inside loops or switches", -5); }
         identifier?
     ;
 
@@ -750,7 +765,15 @@ switchLabel
 
 forControl
     :   enhancedForControl
-    |   forInit? SEMI expression? SEMI forUpdate?
+    |   classicalForControl
+    ;
+
+enhancedForControl
+    :   variableModifiersOpt type? variableDeclaratorId (COLON | IN) expression
+    ;
+
+classicalForControl
+    :   forInit? SEMI expression? SEMI forUpdate?
     ;
 
 forInit
@@ -762,10 +785,6 @@ forUpdate
     :   expressionList[false]
     ;
 
-enhancedForControl
-    :   variableModifiersOpt type? variableDeclaratorId (COLON | IN) expression
-    ;
-
 
 // EXPRESSIONS
 
@@ -782,7 +801,7 @@ expressionList[boolean canSpread]
     ;
 
 expressionListElement[boolean canSpread]
-    :   (   MUL { $canSpread }?<fail={"spread is not allowed here"}>
+    :   (   MUL { require($canSpread, "spread operator is not allowed here", -1); }
         |
         ) expression
     ;
@@ -1061,7 +1080,7 @@ locals[boolean empty = true]
         )?
         (
             COMMA
-            { !$empty }?<fail={"Empty list constructor should not contain any comma(,)"}>
+            { require(!$empty, "Empty list constructor should not contain any comma(,)", -1); }
         )?
         RBRACK
     ;

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/main/groovy/org/apache/groovy/parser/antlr4/util/GroovyTestRig.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/groovy/org/apache/groovy/parser/antlr4/util/GroovyTestRig.groovy b/subprojects/groovy-parser-antlr4/src/main/groovy/org/apache/groovy/parser/antlr4/util/GroovyTestRig.groovy
index 243f460..798ed5f 100644
--- a/subprojects/groovy-parser-antlr4/src/main/groovy/org/apache/groovy/parser/antlr4/util/GroovyTestRig.groovy
+++ b/subprojects/groovy-parser-antlr4/src/main/groovy/org/apache/groovy/parser/antlr4/util/GroovyTestRig.groovy
@@ -34,7 +34,7 @@ import org.apache.groovy.parser.antlr4.GroovyLangParser
 @Log
 public class GroovyTestRig extends TestRig {
     public GroovyTestRig(String[] args) throws Exception {
-        super(['Groovy', 'compilationUnit', *args] as String[]);
+        super(['Groovy', args.contains('-lexer') ? 'tokens' : 'compilationUnit', *args] as String[]);
     }
 
     public void inspectParseTree() {
@@ -57,7 +57,7 @@ public class GroovyTestRig extends TestRig {
 
     public static void main(String[] args) {
         if (args.length == 0) {
-            log.info "Usage: [-tokens] [-tree] [-gui] [-ps file.ps] [-encoding encodingname] [-trace] [-diagnostics] [-SLL] input-filename";
+            log.info "Usage: [-tokens] [-lexer] [-tree] [-gui] [-ps file.ps] [-encoding encodingname] [-trace] [-diagnostics] [-SLL] input-filename";
             return;
         }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
index a02286f..087c291 100644
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
+++ b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
@@ -35,10 +35,10 @@ import org.apache.groovy.parser.antlr4.util.StringUtils;
 import org.codehaus.groovy.GroovyBugError;
 import org.codehaus.groovy.antlr.EnumHelper;
 import org.codehaus.groovy.ast.ASTNode;
-import org.codehaus.groovy.ast.AnnotatedNode;
 import org.codehaus.groovy.ast.AnnotationNode;
 import org.codehaus.groovy.ast.ClassHelper;
 import org.codehaus.groovy.ast.ClassNode;
+import org.codehaus.groovy.ast.ConstructorNode;
 import org.codehaus.groovy.ast.EnumConstantClassNode;
 import org.codehaus.groovy.ast.FieldNode;
 import org.codehaus.groovy.ast.GenericsType;
@@ -391,14 +391,8 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
             return this.visitEnhancedForControl(ctx.enhancedForControl());
         }
 
-        if (asBoolean(ctx.SEMI())) { // e.g. for(int i = 0; i < 10; i++) {}
-            ClosureListExpression closureListExpression = new ClosureListExpression();
-
-            closureListExpression.addExpression(this.visitForInit(ctx.forInit()));
-            closureListExpression.addExpression(asBoolean(ctx.expression()) ? (Expression) this.visit(ctx.expression()) : EmptyExpression.INSTANCE);
-            closureListExpression.addExpression(this.visitForUpdate(ctx.forUpdate()));
-
-            return new Pair<>(ForStatement.FOR_LOOP_DUMMY, closureListExpression);
+        if (asBoolean(ctx.classicalForControl())) { // e.g. for(int i = 0; i < 10; i++) {}
+            return this.visitClassicalForControl(ctx.classicalForControl());
         }
 
         throw createParsingFailedException("Unsupported for control: " + ctx.getText(), ctx);
@@ -459,6 +453,16 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
         return new Pair<>(parameter, (Expression) this.visit(ctx.expression()));
     }
 
+    @Override
+    public Pair<Parameter, Expression> visitClassicalForControl(ClassicalForControlContext ctx) {
+        ClosureListExpression closureListExpression = new ClosureListExpression();
+
+        closureListExpression.addExpression(this.visitForInit(ctx.forInit()));
+        closureListExpression.addExpression(asBoolean(ctx.expression()) ? (Expression) this.visit(ctx.expression()) : EmptyExpression.INSTANCE);
+        closureListExpression.addExpression(this.visitForUpdate(ctx.forUpdate()));
+
+        return new Pair<>(ForStatement.FOR_LOOP_DUMMY, closureListExpression);
+    }
 
     @Override
     public WhileStatement visitWhileStmtAlt(WhileStmtAltContext ctx) {
@@ -850,7 +854,7 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
         List<ModifierNode> modifierNodeList = ctx.getNodeMetaData(TYPE_DECLARATION_MODIFIERS);
         Objects.requireNonNull(modifierNodeList, "modifierNodeList should not be null");
 
-        ModifierManager modifierManager = new ModifierManager(modifierNodeList);
+        ModifierManager modifierManager = new ModifierManager(this, modifierNodeList);
         int modifiers = modifierManager.getClassModifiersOpValue();
 
         boolean syntheticPublic = ((modifiers & Opcodes.ACC_SYNTHETIC) != 0);
@@ -1065,11 +1069,24 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
             }
 
             if (!asBoolean(anonymousInnerClassNode)) {
+                if (expression instanceof ListExpression) {
+                    ListExpression listExpression = new ListExpression();
+                    listExpression.addExpression(expression);
+
+                    return this.configureAST(listExpression, ctx);
+                }
+
                 return expression;
             }
 
             ListExpression listExpression = new ListExpression();
-            listExpression.addExpression(expression);
+
+            if (expression instanceof ListExpression) {
+                ((ListExpression) expression).getExpressions().forEach(listExpression::addExpression);
+            } else {
+                listExpression.addExpression(expression);
+            }
+
             listExpression.addExpression(
                     this.configureAST(
                             new ClassExpression(anonymousInnerClassNode),
@@ -1214,7 +1231,19 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
             modifierNodeList = this.visitModifiersOpt(ctx.modifiersOpt());
         }
 
-        return new ModifierManager(modifierNodeList);
+        return new ModifierManager(this, modifierNodeList);
+    }
+
+    private void validateParametersOfMethodDeclaration(Parameter[] parameters, ClassNode classNode) {
+        if (!classNode.isInterface()) {
+            return;
+        }
+
+        Arrays.stream(parameters).forEach(e -> {
+            if (e.hasInitialExpression()) {
+                throw createParsingFailedException("Cannot specify default value for method parameter '" + e.getName() + " = " + e.getInitialExpression().getText() + "' inside an interface", e);
+            }
+        });
     }
 
     @Override
@@ -1233,6 +1262,8 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
         // if classNode is not null, the method declaration is for class declaration
         ClassNode classNode = ctx.getNodeMetaData(CLASS_DECLARATION_CLASS_NODE);
         if (asBoolean(classNode)) {
+            validateParametersOfMethodDeclaration(parameters, classNode);
+
             methodNode = createConstructorOrMethodNodeForClass(ctx, modifierManager, methodName, returnType, parameters, exceptions, code, classNode);
         } else { // script method declaration
             methodNode = createScriptMethodNode(modifierManager, methodName, returnType, parameters, exceptions, code);
@@ -1254,14 +1285,14 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
 
         this.configureAST(methodNode, ctx);
 
-        validateMethodDeclaration(ctx, methodNode);
+        validateMethodDeclaration(ctx, methodNode, modifierManager);
 
         groovydocManager.handle(methodNode, ctx);
 
         return methodNode;
     }
 
-    private void validateMethodDeclaration(MethodDeclarationContext ctx, MethodNode methodNode) {
+    private void validateMethodDeclaration(MethodDeclarationContext ctx, MethodNode methodNode, ModifierManager modifierManager) {
         boolean isAbstractMethod = methodNode.isAbstract();
         boolean hasMethodBody = asBoolean(methodNode.getCode());
 
@@ -1274,6 +1305,12 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
                 throw createParsingFailedException("You defined a method[" + methodNode.getName() + "] without body. Try adding a method body, or declare it abstract", methodNode);
             }
         }
+
+        modifierManager.validate(methodNode);
+
+        if (methodNode instanceof ConstructorNode) {
+            modifierManager.validate((ConstructorNode) methodNode);
+        }
     }
 
     private MethodNode createScriptMethodNode(ModifierManager modifierManager, String methodName, ClassNode returnType, Parameter[] parameters, ClassNode[] exceptions, Statement code) {
@@ -1320,25 +1357,36 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
         }
 
         modifiers |= !modifierManager.contains(STATIC) && (classNode.isInterface() || (isTrue(classNode, IS_INTERFACE_WITH_DEFAULT_METHODS) && !modifierManager.contains(DEFAULT))) ? Opcodes.ACC_ABSTRACT : 0;
+
+        checkWhetherMethodNodeWithSameSignatureExists(classNode, methodName, parameters, ctx);
+
         methodNode = classNode.addMethod(methodName, modifiers, returnType, parameters, exceptions, code);
 
         methodNode.setAnnotationDefault(asBoolean(ctx.elementValue()));
         return methodNode;
     }
 
-    private MethodNode createConstructorNodeForClass(String methodName, Parameter[] parameters, ClassNode[] exceptions, Statement code, ClassNode classNode, int modifiers) {
-        MethodNode methodNode;ConstructorCallExpression thisOrSuperConstructorCallExpression = this.checkThisAndSuperConstructorCall(code);
+    private void checkWhetherMethodNodeWithSameSignatureExists(ClassNode classNode, String methodName, Parameter[] parameters, MethodDeclarationContext ctx) {
+        MethodNode sameSigMethodNode = classNode.getDeclaredMethod(methodName, parameters);
+
+        if (null == sameSigMethodNode) {
+            return;
+        }
+
+        throw createParsingFailedException("The method " +  sameSigMethodNode.getText() + " duplicates another method of the same signature", ctx);
+    }
+
+    private ConstructorNode createConstructorNodeForClass(String methodName, Parameter[] parameters, ClassNode[] exceptions, Statement code, ClassNode classNode, int modifiers) {
+        ConstructorCallExpression thisOrSuperConstructorCallExpression = this.checkThisAndSuperConstructorCall(code);
         if (asBoolean(thisOrSuperConstructorCallExpression)) {
             throw createParsingFailedException(thisOrSuperConstructorCallExpression.getText() + " should be the first statement in the constructor[" + methodName + "]", thisOrSuperConstructorCallExpression);
         }
 
-        methodNode =
-                classNode.addConstructor(
-                        modifiers,
-                        parameters,
-                        exceptions,
-                        code);
-        return methodNode;
+        return classNode.addConstructor(
+                modifiers,
+                parameters,
+                exceptions,
+                code);
     }
 
     @Override
@@ -1398,7 +1446,7 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
             modifierNodeList = this.visitModifiersOpt(ctx.modifiersOpt());
         }
 
-        return new ModifierManager(modifierNodeList);
+        return new ModifierManager(this, modifierNodeList);
     }
 
     private DeclarationListStatement createMultiAssignmentDeclarationListStatement(VariableDeclarationContext ctx, ModifierManager modifierManager) {
@@ -3434,7 +3482,13 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
         }
 
         if (asBoolean(ctx.statement())) {
-            return (Statement) this.visit(ctx.statement()); //this.configureAST((Statement) this.visit(ctx.statement()), ctx);
+            Object astNode = this.visit(ctx.statement()); //this.configureAST((Statement) this.visit(ctx.statement()), ctx);
+
+            if (astNode instanceof MethodNode) {
+                throw createParsingFailedException("Method definition not expected here", ctx);
+            } else {
+                return (Statement) astNode;
+            }
         }
 
         throw createParsingFailedException("Unsupported block statement: " + ctx.getText(), ctx);
@@ -3673,7 +3727,7 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
         }
 
         Parameter parameter =
-                new ModifierManager(this.visitVariableModifiersOpt(variableModifiersOptContext))
+                new ModifierManager(this, this.visitVariableModifiersOpt(variableModifiersOptContext))
                         .processParameter(
                                 this.configureAST(
                                         new Parameter(classNode, this.visitVariableDeclaratorId(variableDeclaratorIdContext).getName()),
@@ -4051,6 +4105,15 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
     private CompilationFailedException createParsingFailedException(Throwable t) {
         if (t instanceof SyntaxException) {
             this.collectSyntaxError((SyntaxException) t);
+        } else if (t instanceof GroovySyntaxError) {
+            GroovySyntaxError groovySyntaxError = (GroovySyntaxError) t;
+
+            this.collectSyntaxError(
+                    new SyntaxException(
+                            groovySyntaxError.getMessage(),
+                            groovySyntaxError,
+                            groovySyntaxError.getLine(),
+                            groovySyntaxError.getColumn()));
         } else if (t instanceof Exception) {
             this.collectException((Exception) t);
         }
@@ -4198,266 +4261,6 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
         }
     }
 
-    /**
-     * Process modifiers for AST nodes
-     * <p>
-     * Created by Daniel.Sun on 2016/08/27.
-     */
-    private class ModifierManager {
-        private List<ModifierNode> modifierNodeList;
-
-        public ModifierManager(List<ModifierNode> modifierNodeList) {
-            this.validate(modifierNodeList);
-            this.modifierNodeList = Collections.unmodifiableList(asBoolean((Object) modifierNodeList) ? modifierNodeList : Collections.emptyList());
-        }
-
-        private void validate(List<ModifierNode> modifierNodeList) {
-            Map<ModifierNode, Integer> modifierNodeCounter = new LinkedHashMap<>(modifierNodeList.size());
-            int visibilityModifierCnt = 0;
-
-            for (ModifierNode modifierNode : modifierNodeList) {
-                Integer cnt = modifierNodeCounter.get(modifierNode);
-
-                if (null == cnt) {
-                    modifierNodeCounter.put(modifierNode, 1);
-                } else if (1 == cnt && !modifierNode.isRepeatable()) {
-                    throw createParsingFailedException("Cannot repeat modifier[" + modifierNode.getText() + "]", modifierNode);
-                }
-
-                if (modifierNode.isVisibilityModifier()) {
-                    visibilityModifierCnt++;
-
-                    if (visibilityModifierCnt > 1) {
-                        throw createParsingFailedException("Cannot specify modifier[" + modifierNode.getText() + "] when access scope has already been defined", modifierNode);
-                    }
-                }
-            }
-        }
-
-        // t    1: class modifiers value; 2: class member modifiers value
-        private int calcModifiersOpValue(int t) {
-            int result = 0;
-
-            for (ModifierNode modifierNode : modifierNodeList) {
-                result |= modifierNode.getOpcode();
-            }
-
-            if (!this.containsVisibilityModifier()) {
-                if (1 == t) {
-                    result |= Opcodes.ACC_SYNTHETIC | Opcodes.ACC_PUBLIC;
-                } else if (2 == t) {
-                    result |= Opcodes.ACC_PUBLIC;
-                }
-            }
-
-            return result;
-        }
-
-        public int getClassModifiersOpValue() {
-            return this.calcModifiersOpValue(1);
-        }
-
-        public int getClassMemberModifiersOpValue() {
-            return this.calcModifiersOpValue(2);
-        }
-
-        public List<AnnotationNode> getAnnotations() {
-            return modifierNodeList.stream()
-                    .filter(ModifierNode::isAnnotation)
-                    .map(ModifierNode::getAnnotationNode)
-                    .collect(Collectors.toList());
-        }
-
-        public boolean contains(int modifierType) {
-            return modifierNodeList.stream().anyMatch(e -> modifierType == e.getType());
-        }
-
-        public boolean containsAnnotations() {
-            return modifierNodeList.stream().anyMatch(ModifierNode::isAnnotation);
-        }
-
-        public boolean containsVisibilityModifier() {
-            return modifierNodeList.stream().anyMatch(ModifierNode::isVisibilityModifier);
-        }
-
-        public boolean containsNonVisibilityModifier() {
-            return modifierNodeList.stream().anyMatch(ModifierNode::isNonVisibilityModifier);
-        }
-
-        public Parameter processParameter(Parameter parameter) {
-            modifierNodeList.forEach(e -> {
-                parameter.setModifiers(parameter.getModifiers() | e.getOpcode());
-
-                if (e.isAnnotation()) {
-                    parameter.addAnnotation(e.getAnnotationNode());
-                }
-            });
-
-            return parameter;
-        }
-
-        public MethodNode processMethodNode(MethodNode mn) {
-            modifierNodeList.forEach(e -> {
-                mn.setModifiers(mn.getModifiers() | e.getOpcode());
-
-                if (e.isAnnotation()) {
-                    mn.addAnnotation(e.getAnnotationNode());
-                }
-            });
-
-            return mn;
-        }
-
-        public VariableExpression processVariableExpression(VariableExpression ve) {
-            modifierNodeList.forEach(e -> {
-                ve.setModifiers(ve.getModifiers() | e.getOpcode());
-
-                // local variable does not attach annotations
-            });
-
-            return ve;
-        }
-
-        public <T extends AnnotatedNode> T attachAnnotations(T node) {
-            this.getAnnotations().forEach(node::addAnnotation);
-
-            return node;
-        }
-    }
-
-    /**
-     * Represents a modifier, which is better to place in the package org.codehaus.groovy.ast
-     * <p>
-     * Created by Daniel.Sun on 2016/08/23.
-     */
-    public static class ModifierNode extends ASTNode {
-        private Integer type;
-        private Integer opcode; // ASM opcode
-        private String text;
-        private AnnotationNode annotationNode;
-        private boolean repeatable;
-
-        public static final int ANNOTATION_TYPE = -999;
-        public static final Map<Integer, Integer> MODIFIER_OPCODE_MAP = Collections.unmodifiableMap(new HashMap<Integer, Integer>() {
-            {
-                put(ANNOTATION_TYPE, 0);
-                put(DEF, 0);
-
-                put(NATIVE, Opcodes.ACC_NATIVE);
-                put(SYNCHRONIZED, Opcodes.ACC_SYNCHRONIZED);
-                put(TRANSIENT, Opcodes.ACC_TRANSIENT);
-                put(VOLATILE, Opcodes.ACC_VOLATILE);
-
-                put(PUBLIC, Opcodes.ACC_PUBLIC);
-                put(PROTECTED, Opcodes.ACC_PROTECTED);
-                put(PRIVATE, Opcodes.ACC_PRIVATE);
-                put(STATIC, Opcodes.ACC_STATIC);
-                put(ABSTRACT, Opcodes.ACC_ABSTRACT);
-                put(FINAL, Opcodes.ACC_FINAL);
-                put(STRICTFP, Opcodes.ACC_STRICT);
-                put(DEFAULT, 0); // no flag for specifying a default method in the JVM spec, hence no ACC_DEFAULT flag in ASM
-            }
-        });
-
-        public ModifierNode(Integer type) {
-            this.type = type;
-            this.opcode = MODIFIER_OPCODE_MAP.get(type);
-            this.repeatable = ANNOTATION_TYPE == type; // Only annotations are repeatable
-
-            if (!asBoolean((Object) this.opcode)) {
-                throw new IllegalArgumentException("Unsupported modifier type: " + type);
-            }
-        }
-
-        /**
-         * @param type the modifier type, which is same as the token type
-         * @param text text of the ast node
-         */
-        public ModifierNode(Integer type, String text) {
-            this(type);
-            this.text = text;
-        }
-
-        /**
-         * @param annotationNode the annotation node
-         * @param text           text of the ast node
-         */
-        public ModifierNode(AnnotationNode annotationNode, String text) {
-            this(ModifierNode.ANNOTATION_TYPE, text);
-            this.annotationNode = annotationNode;
-
-            if (!asBoolean(annotationNode)) {
-                throw new IllegalArgumentException("annotationNode can not be null");
-            }
-        }
-
-        /**
-         * Check whether the modifier is not an imagined modifier(annotation, def)
-         */
-        public boolean isModifier() {
-            return !this.isAnnotation() && !this.isDef();
-        }
-
-        public boolean isVisibilityModifier() {
-            return Objects.equals(PUBLIC, this.type)
-                    || Objects.equals(PROTECTED, this.type)
-                    || Objects.equals(PRIVATE, this.type);
-        }
-
-        public boolean isNonVisibilityModifier() {
-            return this.isModifier() && !this.isVisibilityModifier();
-        }
-
-        public boolean isAnnotation() {
-            return Objects.equals(ANNOTATION_TYPE, this.type);
-        }
-
-        public boolean isDef() {
-            return Objects.equals(DEF, this.type);
-        }
-
-        public Integer getType() {
-            return type;
-        }
-
-        public Integer getOpcode() {
-            return opcode;
-        }
-
-        public boolean isRepeatable() {
-            return repeatable;
-        }
-
-        @Override
-        public String getText() {
-            return text;
-        }
-
-        public AnnotationNode getAnnotationNode() {
-            return annotationNode;
-        }
-
-        @Override
-        public boolean equals(Object o) {
-            if (this == o) return true;
-            if (o == null || getClass() != o.getClass()) return false;
-            ModifierNode that = (ModifierNode) o;
-            return Objects.equals(type, that.type) &&
-                    Objects.equals(text, that.text) &&
-                    Objects.equals(annotationNode, that.annotationNode);
-        }
-
-        @Override
-        public int hashCode() {
-            return Objects.hash(type, text, annotationNode);
-        }
-
-        @Override
-        public String toString() {
-            return this.text;
-        }
-    }
-
     private final ModuleNode moduleNode;
     private final SourceUnit sourceUnit;
     private final ClassLoader classLoader; // Our ClassLoader, which provides information on external types

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovySyntaxError.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovySyntaxError.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovySyntaxError.java
index 12bb63d..7ca8bba 100644
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovySyntaxError.java
+++ b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/GroovySyntaxError.java
@@ -25,8 +25,10 @@ public class GroovySyntaxError extends AssertionError {
     public static final int LEXER = 0;
     public static final int PARSER = 1;
     private int source;
+    private int line;
+    private int column;
 
-    public GroovySyntaxError(String message, int source) {
+    public GroovySyntaxError(String message, int source, int line, int column) {
         super(message, null);
 
         if (source != LEXER && source != PARSER) {
@@ -34,9 +36,18 @@ public class GroovySyntaxError extends AssertionError {
         }
 
         this.source = source;
+        this.line = line;
+        this.column = column;
     }
 
     public int getSource() {
         return source;
     }
+    public int getLine() {
+        return line;
+    }
+
+    public int getColumn() {
+        return column;
+    }
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierManager.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierManager.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierManager.java
new file mode 100644
index 0000000..a45e36c
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierManager.java
@@ -0,0 +1,198 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4;
+
+import org.codehaus.groovy.ast.AnnotatedNode;
+import org.codehaus.groovy.ast.AnnotationNode;
+import org.codehaus.groovy.ast.ConstructorNode;
+import org.codehaus.groovy.ast.MethodNode;
+import org.codehaus.groovy.ast.Parameter;
+import org.codehaus.groovy.ast.expr.VariableExpression;
+import org.objectweb.asm.Opcodes;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import static org.apache.groovy.parser.antlr4.GroovyParser.*;
+import static org.codehaus.groovy.runtime.DefaultGroovyMethods.asBoolean;
+
+/**
+ * Process modifiers for AST nodes
+ * <p>
+ * Created by Daniel.Sun on 2016/08/27.
+ */
+class ModifierManager {
+    private static final Map<Class, List<Integer>> INVALID_MODIFIERS_MAP = Collections.unmodifiableMap(new HashMap<Class, List<Integer>>() {
+        {
+            put(ConstructorNode.class, Arrays.asList(STATIC, FINAL, ABSTRACT, NATIVE));
+            put(MethodNode.class, Arrays.asList(VOLATILE/*, TRANSIENT*/));
+        }
+    });
+    private AstBuilder astBuilder;
+    private List<ModifierNode> modifierNodeList;
+
+    public ModifierManager(AstBuilder astBuilder, List<ModifierNode> modifierNodeList) {
+        this.astBuilder = astBuilder;
+        this.validate(modifierNodeList);
+        this.modifierNodeList = Collections.unmodifiableList(asBoolean((Object) modifierNodeList) ? modifierNodeList : Collections.emptyList());
+    }
+
+    private void validate(List<ModifierNode> modifierNodeList) {
+        Map<ModifierNode, Integer> modifierNodeCounter = new LinkedHashMap<>(modifierNodeList.size());
+        int visibilityModifierCnt = 0;
+
+        for (ModifierNode modifierNode : modifierNodeList) {
+            Integer cnt = modifierNodeCounter.get(modifierNode);
+
+            if (null == cnt) {
+                modifierNodeCounter.put(modifierNode, 1);
+            } else if (1 == cnt && !modifierNode.isRepeatable()) {
+                throw astBuilder.createParsingFailedException("Cannot repeat modifier[" + modifierNode.getText() + "]", modifierNode);
+            }
+
+            if (modifierNode.isVisibilityModifier()) {
+                visibilityModifierCnt++;
+
+                if (visibilityModifierCnt > 1) {
+                    throw astBuilder.createParsingFailedException("Cannot specify modifier[" + modifierNode.getText() + "] when access scope has already been defined", modifierNode);
+                }
+            }
+        }
+    }
+
+    public void validate(MethodNode methodNode) {
+        validate(INVALID_MODIFIERS_MAP.get(MethodNode.class), methodNode);
+    }
+
+    public void validate(ConstructorNode constructorNode) {
+        validate(INVALID_MODIFIERS_MAP.get(ConstructorNode.class), constructorNode);
+    }
+
+    private void validate(List<Integer> invalidModifierList, MethodNode methodNode) {
+        modifierNodeList.forEach(e -> {
+            if (invalidModifierList.contains(e.getType())) {
+                throw astBuilder.createParsingFailedException(methodNode.getClass().getSimpleName().replace("Node", "") + " has an incorrect modifier '" + e + "'.", methodNode);
+            }
+        });
+    }
+
+    // t    1: class modifiers value; 2: class member modifiers value
+    private int calcModifiersOpValue(int t) {
+        int result = 0;
+
+        for (ModifierNode modifierNode : modifierNodeList) {
+            result |= modifierNode.getOpcode();
+        }
+
+        if (!this.containsVisibilityModifier()) {
+            if (1 == t) {
+                result |= Opcodes.ACC_SYNTHETIC | Opcodes.ACC_PUBLIC;
+            } else if (2 == t) {
+                result |= Opcodes.ACC_PUBLIC;
+            }
+        }
+
+        return result;
+    }
+
+    public int getClassModifiersOpValue() {
+        return this.calcModifiersOpValue(1);
+    }
+
+    public int getClassMemberModifiersOpValue() {
+        return this.calcModifiersOpValue(2);
+    }
+
+    public List<AnnotationNode> getAnnotations() {
+        return modifierNodeList.stream()
+                .filter(ModifierNode::isAnnotation)
+                .map(ModifierNode::getAnnotationNode)
+                .collect(Collectors.toList());
+    }
+
+    public boolean contains(int modifierType) {
+        return modifierNodeList.stream().anyMatch(e -> modifierType == e.getType());
+    }
+
+    public Optional<ModifierNode> get(int modifierType) {
+        return modifierNodeList.stream().filter(e -> modifierType == e.getType()).findFirst();
+    }
+
+    public boolean containsAnnotations() {
+        return modifierNodeList.stream().anyMatch(ModifierNode::isAnnotation);
+    }
+
+    public boolean containsVisibilityModifier() {
+        return modifierNodeList.stream().anyMatch(ModifierNode::isVisibilityModifier);
+    }
+
+    public boolean containsNonVisibilityModifier() {
+        return modifierNodeList.stream().anyMatch(ModifierNode::isNonVisibilityModifier);
+    }
+
+    public Parameter processParameter(Parameter parameter) {
+        modifierNodeList.forEach(e -> {
+            parameter.setModifiers(parameter.getModifiers() | e.getOpcode());
+
+            if (e.isAnnotation()) {
+                parameter.addAnnotation(e.getAnnotationNode());
+            }
+        });
+
+        return parameter;
+    }
+
+    public int clearVisibilityModifiers(int modifiers) {
+        return modifiers & ~Opcodes.ACC_PUBLIC & ~Opcodes.ACC_PROTECTED & ~Opcodes.ACC_PRIVATE;
+    }
+
+    public MethodNode processMethodNode(MethodNode mn) {
+        modifierNodeList.forEach(e -> {
+            mn.setModifiers((e.isVisibilityModifier() ? clearVisibilityModifiers(mn.getModifiers()) : mn.getModifiers()) | e.getOpcode());
+
+            if (e.isAnnotation()) {
+                mn.addAnnotation(e.getAnnotationNode());
+            }
+        });
+
+        return mn;
+    }
+
+    public VariableExpression processVariableExpression(VariableExpression ve) {
+        modifierNodeList.forEach(e -> {
+            ve.setModifiers(ve.getModifiers() | e.getOpcode());
+
+            // local variable does not attach annotations
+        });
+
+        return ve;
+    }
+
+    public <T extends AnnotatedNode> T attachAnnotations(T node) {
+        this.getAnnotations().forEach(node::addAnnotation);
+
+        return node;
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierNode.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierNode.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierNode.java
new file mode 100644
index 0000000..5d1007b
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/ModifierNode.java
@@ -0,0 +1,164 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4;
+
+import org.codehaus.groovy.ast.ASTNode;
+import org.codehaus.groovy.ast.AnnotationNode;
+import org.objectweb.asm.Opcodes;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+import static org.apache.groovy.parser.antlr4.GroovyParser.*;
+import static org.codehaus.groovy.runtime.DefaultGroovyMethods.asBoolean;
+
+/**
+ * Represents a modifier, which is better to place in the package org.codehaus.groovy.ast
+ * <p>
+ * Created by Daniel.Sun on 2016/08/23.
+ */
+public class ModifierNode extends ASTNode {
+    private Integer type;
+    private Integer opcode; // ASM opcode
+    private String text;
+    private AnnotationNode annotationNode;
+    private boolean repeatable;
+
+    public static final int ANNOTATION_TYPE = -999;
+    public static final Map<Integer, Integer> MODIFIER_OPCODE_MAP = Collections.unmodifiableMap(new HashMap<Integer, Integer>() {
+        {
+            put(ANNOTATION_TYPE, 0);
+            put(DEF, 0);
+
+            put(NATIVE, Opcodes.ACC_NATIVE);
+            put(SYNCHRONIZED, Opcodes.ACC_SYNCHRONIZED);
+            put(TRANSIENT, Opcodes.ACC_TRANSIENT);
+            put(VOLATILE, Opcodes.ACC_VOLATILE);
+
+            put(PUBLIC, Opcodes.ACC_PUBLIC);
+            put(PROTECTED, Opcodes.ACC_PROTECTED);
+            put(PRIVATE, Opcodes.ACC_PRIVATE);
+            put(STATIC, Opcodes.ACC_STATIC);
+            put(ABSTRACT, Opcodes.ACC_ABSTRACT);
+            put(FINAL, Opcodes.ACC_FINAL);
+            put(STRICTFP, Opcodes.ACC_STRICT);
+            put(DEFAULT, 0); // no flag for specifying a default method in the JVM spec, hence no ACC_DEFAULT flag in ASM
+        }
+    });
+
+    public ModifierNode(Integer type) {
+        this.type = type;
+        this.opcode = MODIFIER_OPCODE_MAP.get(type);
+        this.repeatable = ANNOTATION_TYPE == type; // Only annotations are repeatable
+
+        if (!asBoolean((Object) this.opcode)) {
+            throw new IllegalArgumentException("Unsupported modifier type: " + type);
+        }
+    }
+
+    /**
+     * @param type the modifier type, which is same as the token type
+     * @param text text of the ast node
+     */
+    public ModifierNode(Integer type, String text) {
+        this(type);
+        this.text = text;
+    }
+
+    /**
+     * @param annotationNode the annotation node
+     * @param text           text of the ast node
+     */
+    public ModifierNode(AnnotationNode annotationNode, String text) {
+        this(ModifierNode.ANNOTATION_TYPE, text);
+        this.annotationNode = annotationNode;
+
+        if (!asBoolean(annotationNode)) {
+            throw new IllegalArgumentException("annotationNode can not be null");
+        }
+    }
+
+    /**
+     * Check whether the modifier is not an imagined modifier(annotation, def)
+     */
+    public boolean isModifier() {
+        return !this.isAnnotation() && !this.isDef();
+    }
+
+    public boolean isVisibilityModifier() {
+        return Objects.equals(PUBLIC, this.type)
+                || Objects.equals(PROTECTED, this.type)
+                || Objects.equals(PRIVATE, this.type);
+    }
+
+    public boolean isNonVisibilityModifier() {
+        return this.isModifier() && !this.isVisibilityModifier();
+    }
+
+    public boolean isAnnotation() {
+        return Objects.equals(ANNOTATION_TYPE, this.type);
+    }
+
+    public boolean isDef() {
+        return Objects.equals(DEF, this.type);
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public Integer getOpcode() {
+        return opcode;
+    }
+
+    public boolean isRepeatable() {
+        return repeatable;
+    }
+
+    @Override
+    public String getText() {
+        return text;
+    }
+
+    public AnnotationNode getAnnotationNode() {
+        return annotationNode;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        ModifierNode that = (ModifierNode) o;
+        return Objects.equals(type, that.type) &&
+                Objects.equals(text, that.text) &&
+                Objects.equals(annotationNode, that.annotationNode);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(type, text, annotationNode);
+    }
+
+    @Override
+    public String toString() {
+        return this.text;
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/PositionInfo.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/PositionInfo.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/PositionInfo.java
new file mode 100644
index 0000000..b59aabb
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/PositionInfo.java
@@ -0,0 +1,73 @@
+/*
+ *  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.
+ */
+package org.apache.groovy.parser.antlr4;
+
+import java.util.Objects;
+
+/**
+ * Created by Daniel on 2017/4/22.
+ */
+public class PositionInfo {
+    private int line;
+    private int column;
+
+    public PositionInfo(int line, int column) {
+        this.line = line;
+        this.column = column;
+    }
+
+    public int getLine() {
+        return line;
+    }
+
+    public void setLine(int line) {
+        this.line = line;
+    }
+
+    public int getColumn() {
+        return column;
+    }
+
+    public void setColumn(int column) {
+        this.column = column;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        PositionInfo that = (PositionInfo) o;
+        return line == that.line &&
+                column == that.column;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(line, column);
+    }
+
+    @Override
+    public String toString() {
+        if (-1 == line || -1 == column) {
+            return "";
+        }
+
+        return " @ line " + line + ", column " + column;
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SemanticPredicates.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SemanticPredicates.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SemanticPredicates.java
index 811276f..eb3dbd9 100644
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SemanticPredicates.java
+++ b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SemanticPredicates.java
@@ -109,7 +109,7 @@ public class SemanticPredicates {
     }
 
     private static final Set<Integer> MODIFIER_SET =
-            Collections.unmodifiableSet(AstBuilder.ModifierNode.MODIFIER_OPCODE_MAP.keySet());
+            Collections.unmodifiableSet(ModifierNode.MODIFIER_OPCODE_MAP.keySet());
     /**
      * Distinguish between local variable declaration and method call, e.g. `a b`
      */
@@ -142,8 +142,8 @@ public class SemanticPredicates {
         tokenType = token.getType();
         tokenType3 = ts.LT(index + 2).getType();
 
-        return VOID == tokenType
-                ||  !(BuiltInPrimitiveType == tokenType || MODIFIER_SET.contains(tokenType))
+        return //VOID == tokenType ||
+                !(BuiltInPrimitiveType == tokenType || MODIFIER_SET.contains(tokenType))
                     && Character.isLowerCase(token.getText().codePointAt(0))
                     && !(ASSIGN == tokenType3 || (LT == tokenType2 || LBRACK == tokenType2));
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SyntaxErrorReportable.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SyntaxErrorReportable.java b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SyntaxErrorReportable.java
index e79c73c..021e2f5 100644
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SyntaxErrorReportable.java
+++ b/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SyntaxErrorReportable.java
@@ -22,25 +22,37 @@ package org.apache.groovy.parser.antlr4;
  * A SyntaxErrorReportable is a recognizer that can report syntax error
  */
 public interface SyntaxErrorReportable {
-    default void require(boolean condition, String msg, boolean toAttachPositionInfo) {
+    default void require(boolean condition, String msg, int offset, boolean toAttachPositionInfo) {
         if (condition) {
             return;
         }
 
-        this.throwSyntaxError(msg, toAttachPositionInfo);
+        this.throwSyntaxError(msg, offset, toAttachPositionInfo);
+    }
+    default void require(boolean condition, String msg, boolean toAttachPositionInfo) {
+        require(condition, msg, 0, toAttachPositionInfo);
+    }
+    default void require(boolean condition, String msg, int offset) {
+        require(condition, msg, offset,false);
     }
     default void require(boolean condition, String msg) {
-        require(condition, msg, true);
+        require(condition, msg, false);
     }
 
-    default void throwSyntaxError(String msg, boolean toAttachPositionInfo) {
-        throw new GroovySyntaxError(msg + (toAttachPositionInfo ? this.genPositionInfo() : ""), this.getSyntaxErrorSource());
+    default void throwSyntaxError(String msg, int offset, boolean toAttachPositionInfo) {
+        PositionInfo positionInfo = this.genPositionInfo(offset);
+        throw new GroovySyntaxError(msg + (toAttachPositionInfo ? positionInfo.toString() : ""),
+                this.getSyntaxErrorSource(),
+                positionInfo.getLine(),
+                positionInfo.getColumn()
+        );
     }
 
-    default String formatPositionInfo(int line, int column) {
-        return " @ line " + line + ", column " + column;
+    int getSyntaxErrorSource();
+    default PositionInfo genPositionInfo(int offset) {
+        return new PositionInfo(getErrorLine(), getErrorColumn() + offset);
     }
 
-    int getSyntaxErrorSource();
-    String genPositionInfo();
+    int getErrorLine();
+    int getErrorColumn();
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy b/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
index 0750c37..6892237 100644
--- a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
@@ -18,18 +18,11 @@
  */
 package org.apache.groovy.parser.antlr4
 
-import org.codehaus.groovy.ast.ClassNode
-import org.codehaus.groovy.ast.FieldNode
-import org.codehaus.groovy.ast.MethodNode
-import org.codehaus.groovy.ast.Parameter
-import org.codehaus.groovy.ast.PropertyNode
+import org.codehaus.groovy.ast.*
 import org.codehaus.groovy.ast.stmt.AssertStatement
 import org.codehaus.groovy.ast.stmt.ExpressionStatement
 import org.codehaus.groovy.syntax.Token
 
-import static org.apache.groovy.parser.antlr4.TestUtils.doTest
-import static org.apache.groovy.parser.antlr4.TestUtils.doRunAndTest
-
 /**
  * Some basic test cases for the new parser
  *
@@ -43,12 +36,12 @@ class GroovyParserTest extends GroovyTestCase {
     void tearDown() {}
 
     void "test groovy core - Comments"() {
-        doTest('core/Comments_01.groovy', [ExpressionStatement]);
+        TestUtils.doTest('core/Comments_01.groovy', [ExpressionStatement]);
         doTestAttachedComments();
     }
 
     private static doTestAttachedComments() {
-        def (newAST, oldAST) = doTest('core/Comments_02.groovy');
+        def (newAST, oldAST) = TestUtils.doTest('core/Comments_02.groovy');
         List<ClassNode> classes = new ArrayList<>(newAST.classes).sort { c1, c2 -> c1.name <=> c2.name };
         List<MethodNode> methods = new ArrayList<>(newAST.methods).sort { m1, m2 -> m1.name <=> m2.name };
 
@@ -83,276 +76,285 @@ class GroovyParserTest extends GroovyTestCase {
     }
 
     void "test groovy core - PackageDeclaration"() {
-        doTest('core/PackageDeclaration_01.groovy');
-        doTest('core/PackageDeclaration_02.groovy');
-        doTest('core/PackageDeclaration_03.groovy');
-        doTest('core/PackageDeclaration_04.groovy');
-        doTest('core/PackageDeclaration_05.groovy');
-        doTest('core/PackageDeclaration_06.groovy');
+        TestUtils.doTest('core/PackageDeclaration_01.groovy');
+        TestUtils.doTest('core/PackageDeclaration_02.groovy');
+        TestUtils.doTest('core/PackageDeclaration_03.groovy');
+        TestUtils.doTest('core/PackageDeclaration_04.groovy');
+        TestUtils.doTest('core/PackageDeclaration_05.groovy');
+        TestUtils.doTest('core/PackageDeclaration_06.groovy');
     }
 
     void "test groovy core - ImportDeclaration"() {
-        doTest('core/ImportDeclaration_01.groovy');
-        doTest('core/ImportDeclaration_02.groovy');
-        doTest('core/ImportDeclaration_03.groovy');
-        doTest('core/ImportDeclaration_04.groovy');
-        doTest('core/ImportDeclaration_05.groovy');
-        doTest('core/ImportDeclaration_06.groovy');
-        doTest('core/ImportDeclaration_07.groovy');
-        doTest('core/ImportDeclaration_08.groovy');
+        TestUtils.doTest('core/ImportDeclaration_01.groovy');
+        TestUtils.doTest('core/ImportDeclaration_02.groovy');
+        TestUtils.doTest('core/ImportDeclaration_03.groovy');
+        TestUtils.doTest('core/ImportDeclaration_04.groovy');
+        TestUtils.doTest('core/ImportDeclaration_05.groovy');
+        TestUtils.doTest('core/ImportDeclaration_06.groovy');
+        TestUtils.doTest('core/ImportDeclaration_07.groovy');
+        TestUtils.doTest('core/ImportDeclaration_08.groovy');
     }
 
     void "test groovy core - Annotation"() {
-        doTest('core/Annotation_01.groovy');
-        doTest('core/Annotation_02.groovy');
-        doTest('core/Annotation_03.groovy');
-        doTest('core/Annotation_04.groovy');
-        doTest('core/Annotation_05.groovy');
-        doTest('core/Annotation_06.groovy');
-        doTest('core/Annotation_07.groovy');
-        doTest('core/Annotation_08.groovy');
-        doTest('core/Annotation_09.groovy');
-        doRunAndTest('core/Annotation_10x.groovy');
+        TestUtils.doTest('core/Annotation_01.groovy');
+        TestUtils.doTest('core/Annotation_02.groovy');
+        TestUtils.doTest('core/Annotation_03.groovy');
+        TestUtils.doTest('core/Annotation_04.groovy');
+        TestUtils.doTest('core/Annotation_05.groovy');
+        TestUtils.doTest('core/Annotation_06.groovy');
+        TestUtils.doTest('core/Annotation_07.groovy');
+        TestUtils.doTest('core/Annotation_08.groovy');
+        TestUtils.doTest('core/Annotation_09.groovy');
+        TestUtils.doRunAndTest('core/Annotation_10x.groovy');
     }
 
     void "test groovy core - Literal"() {
-        doTest('core/Literal_01.groovy');
-        doTest('core/Literal_02.groovy', [ExpressionStatement]);
-        doTest('core/Literal_03.groovy');
+        TestUtils.doTest('core/Literal_01.groovy');
+        TestUtils.doTest('core/Literal_02.groovy', [ExpressionStatement]);
+        TestUtils.doTest('core/Literal_03.groovy');
     }
 
     void "test groovy core - GString"() {
-        doTest('core/GString_01.groovy');
-        doTest('core/GString_02.groovy');
-        doTest('core/GString_03.groovy');
+        TestUtils.doTest('core/GString_01.groovy');
+        TestUtils.doTest('core/GString_02.groovy');
+        TestUtils.doTest('core/GString_03.groovy');
+        TestUtils.doTest('core/GString_04.groovy');
+        TestUtils.doTest('core/GString_05.groovy');
+        TestUtils.doTest('core/GString_06.groovy');
     }
 
     void "test groovy core - Closure"() {
-        doTest('core/Closure_01.groovy');
-        doTest('core/Closure_02.groovy');
-        doTest('core/Closure_03.groovy');
-        doTest('core/Closure_04.groovy');
-        doTest('core/Closure_05.groovy', [Parameter]);
-        doTest('core/Closure_06.groovy', [Parameter]);
-        doTest('core/Closure_07.groovy', [Parameter]);
-        doTest('core/Closure_08.groovy', [Parameter]);
-        doTest('core/Closure_09.groovy', [Parameter]);
-        doTest('core/Closure_10.groovy', [Parameter]);
+        TestUtils.doTest('core/Closure_01.groovy');
+        TestUtils.doTest('core/Closure_02.groovy');
+        TestUtils.doTest('core/Closure_03.groovy');
+        TestUtils.doTest('core/Closure_04.groovy');
+        TestUtils.doTest('core/Closure_05.groovy', [Parameter]);
+        TestUtils.doTest('core/Closure_06.groovy', [Parameter]);
+        TestUtils.doTest('core/Closure_07.groovy', [Parameter]);
+        TestUtils.doTest('core/Closure_08.groovy', [Parameter]);
+        TestUtils.doTest('core/Closure_09.groovy', [Parameter]);
+        TestUtils.doTest('core/Closure_10.groovy', [Parameter]);
     }
 
     void "test groovy core - Lambda"() {
-        doRunAndTest('core/Lambda_01x.groovy');
+        TestUtils.doRunAndTest('core/Lambda_01x.groovy');
     }
 
     void "test groovy core - MethodReference"() {
-        doRunAndTest('core/MethodReference_01x.groovy');
+        TestUtils.doRunAndTest('core/MethodReference_01x.groovy');
     }
 
     void "test groovy core - MethodPointer"() {
-        doRunAndTest('core/MethodPointer_01x.groovy');
+        TestUtils.doRunAndTest('core/MethodPointer_01x.groovy');
     }
 
     void "test groovy core - ElvisAssignment"() {
-        doRunAndTest('core/ElvisAssignment_01x.groovy');
+        TestUtils.doRunAndTest('core/ElvisAssignment_01x.groovy');
     }
 
     void "test groovy core - List"() {
-        doTest('core/List_01.groovy');
+        TestUtils.doTest('core/List_01.groovy');
     }
 
     void "test groovy core - Map"() {
-        doTest('core/Map_01.groovy');
+        TestUtils.doTest('core/Map_01.groovy');
     }
 
     void "test groovy core - Expression"() {
-        doTest('core/Expression_01.groovy');
-        doTest('core/Expression_02.groovy');
-        doTest('core/Expression_03.groovy');
-        doTest('core/Expression_04.groovy');
-        doTest('core/Expression_05.groovy');
-        doTest('core/Expression_06.groovy');
-        doTest('core/Expression_07.groovy');
-        doTest('core/Expression_08.groovy');
-        doTest('core/Expression_09.groovy');
-        doTest('core/Expression_10.groovy');
-        doTest('core/Expression_11.groovy');
-        doTest('core/Expression_12.groovy');
-        doTest('core/Expression_13.groovy');
-        doTest('core/Expression_14.groovy');
-        doTest('core/Expression_15.groovy');
-        doTest('core/Expression_16.groovy', [Parameter, ExpressionStatement]);
-        doTest('core/Expression_17.groovy');
-        doTest('core/Expression_18.groovy');
-        doTest('core/Expression_19.groovy');
-        doTest('core/Expression_20.groovy');
-        doRunAndTest('core/Expression_21x.groovy');
-        doTest('core/Expression_22x.groovy');
-        doRunAndTest('core/Expression_22x.groovy');
-        doRunAndTest('core/Expression_23x.groovy');
+        TestUtils.doTest('core/Expression_01.groovy');
+        TestUtils.doTest('core/Expression_02.groovy');
+        TestUtils.doTest('core/Expression_03.groovy');
+        TestUtils.doTest('core/Expression_04.groovy');
+        TestUtils.doTest('core/Expression_05.groovy');
+        TestUtils.doTest('core/Expression_06.groovy');
+        TestUtils.doTest('core/Expression_07.groovy');
+        TestUtils.doTest('core/Expression_08.groovy');
+        TestUtils.doTest('core/Expression_09.groovy');
+        TestUtils.doTest('core/Expression_10.groovy');
+        TestUtils.doTest('core/Expression_11.groovy');
+        TestUtils.doTest('core/Expression_12.groovy');
+        TestUtils.doTest('core/Expression_13.groovy');
+        TestUtils.doTest('core/Expression_14.groovy');
+        TestUtils.doTest('core/Expression_15.groovy');
+        TestUtils.doTest('core/Expression_16.groovy', [Parameter, ExpressionStatement]);
+        TestUtils.doTest('core/Expression_17.groovy');
+        TestUtils.doTest('core/Expression_18.groovy');
+        TestUtils.doTest('core/Expression_19.groovy');
+        TestUtils.doTest('core/Expression_20.groovy');
+        TestUtils.doRunAndTest('core/Expression_21x.groovy');
+        TestUtils.doTest('core/Expression_22x.groovy');
+        TestUtils.doRunAndTest('core/Expression_22x.groovy');
+        TestUtils.doRunAndTest('core/Expression_23x.groovy');
     }
 
     void "test groovy core - IdenticalOp"() {
-        doRunAndTest('core/IdenticalOp_01x.groovy');
+        TestUtils.doRunAndTest('core/IdenticalOp_01x.groovy');
     }
 
     void "test groovy core - Assert"() {
-        doTest('core/Assert_01.groovy');
-        doRunAndTest('core/Assert_02x.groovy');
-        doRunAndTest('core/Assert_03x.groovy');
+        TestUtils.doTest('core/Assert_01.groovy');
+        TestUtils.doRunAndTest('core/Assert_02x.groovy');
+        TestUtils.doRunAndTest('core/Assert_03x.groovy');
     }
 
     void "test groovy core - IfElse"() {
-        doTest('core/IfElse_01.groovy', [AssertStatement]);
+        TestUtils.doTest('core/IfElse_01.groovy', [AssertStatement]);
     }
 
     void "test groovy core - For"() {
-        doTest('core/For_01.groovy', [AssertStatement]);
-        doTest('core/For_02.groovy');
-        doTest('core/For_03.groovy');
-        doRunAndTest('core/For_04x.groovy');
-        doRunAndTest('core/For_05x.groovy');
+        TestUtils.doTest('core/For_01.groovy', [AssertStatement]);
+        TestUtils.doTest('core/For_02.groovy');
+        TestUtils.doTest('core/For_03.groovy');
+        TestUtils.doRunAndTest('core/For_04x.groovy');
+        TestUtils.doRunAndTest('core/For_05x.groovy');
     }
 
     void "test groovy core - While"() {
-        doTest('core/While_01.groovy');
-        doRunAndTest('core/While_02x.groovy');
+        TestUtils.doTest('core/While_01.groovy');
+        TestUtils.doRunAndTest('core/While_02x.groovy');
     }
 
     void "test groovy core - CodeBlock"() {
-        doRunAndTest('core/CodeBlock_01x.groovy');
+        TestUtils.doRunAndTest('core/CodeBlock_01x.groovy');
     }
 
     void "test groovy core - DoWhile"() {
-        doRunAndTest('core/DoWhile_01x.groovy');
-        doRunAndTest('core/DoWhile_02x.groovy');
-        doRunAndTest('core/DoWhile_03x.groovy');
-        doRunAndTest('core/DoWhile_04x.groovy');
+        TestUtils.doRunAndTest('core/DoWhile_01x.groovy');
+        TestUtils.doRunAndTest('core/DoWhile_02x.groovy');
+        TestUtils.doRunAndTest('core/DoWhile_03x.groovy');
+        TestUtils.doRunAndTest('core/DoWhile_04x.groovy');
     }
 
 
     void "test groovy core - TryCatch"() {
-        doTest('core/TryCatch_01.groovy');
+        TestUtils.doTest('core/TryCatch_01.groovy');
     }
 
     void "test groovy core - TryWithResources"() {
-        doRunAndTest('core/TryWithResources_01x.groovy');
+        TestUtils.doRunAndTest('core/TryWithResources_01x.groovy');
     }
 
     void "test groovy core - SafeIndex"() {
-        doRunAndTest('core/SafeIndex_01x.groovy');
-        doRunAndTest('core/SafeIndex_02x.groovy');
-        doRunAndTest('core/SafeIndex_03x.groovy');
+        TestUtils.doRunAndTest('core/SafeIndex_01x.groovy');
+        TestUtils.doRunAndTest('core/SafeIndex_02x.groovy');
+        TestUtils.doRunAndTest('core/SafeIndex_03x.groovy');
     }
 
     void "test groovy core - NegativeRelationalOperators"() {
-        doRunAndTest('core/NegativeRelationalOperators_01x.groovy');
-        doRunAndTest('core/NegativeRelationalOperators_02x.groovy');
+        TestUtils.doRunAndTest('core/NegativeRelationalOperators_01x.groovy');
+        TestUtils.doRunAndTest('core/NegativeRelationalOperators_02x.groovy');
     }
 
     void "test groovy core - DefaultMethod"() {
-        doRunAndTest('core/DefaultMethod_01x.groovy');
-        doRunAndTest('core/DefaultMethod_02x.groovy');
+        TestUtils.doRunAndTest('core/DefaultMethod_01x.groovy');
+        TestUtils.doRunAndTest('core/DefaultMethod_02x.groovy');
     }
 
 
     void "test groovy core - Switch"() {
-        doTest('core/Switch_01.groovy');
+        TestUtils.doTest('core/Switch_01.groovy');
     }
 
     void "test groovy core - Synchronized"() {
-        doTest('core/Synchronized_01.groovy');
+        TestUtils.doTest('core/Synchronized_01.groovy');
     }
 
     void "test groovy core - Return"() {
-        doTest('core/Return_01.groovy');
+        TestUtils.doTest('core/Return_01.groovy');
     }
 
     void "test groovy core - Throw"() {
-        doTest('core/Throw_01.groovy');
+        TestUtils.doTest('core/Throw_01.groovy');
     }
 
     void "test groovy core - Label"() {
-        doTest('core/Label_01.groovy');
+        TestUtils.doTest('core/Label_01.groovy');
     }
 
     void "test groovy core - LocalVariableDeclaration"() {
-        doTest('core/LocalVariableDeclaration_01.groovy', [Token]); // [class org.codehaus.groovy.syntax.Token][startLine]:: 9 != 8
+        TestUtils.doTest('core/LocalVariableDeclaration_01.groovy', [Token]); // [class org.codehaus.groovy.syntax.Token][startLine]:: 9 != 8
     }
 
     void "test groovy core - MethodDeclaration"() {
-        doTest('core/MethodDeclaration_01.groovy');
-        doTest('core/MethodDeclaration_02.groovy');
+        TestUtils.doTest('core/MethodDeclaration_01.groovy');
+        TestUtils.doTest('core/MethodDeclaration_02.groovy');
     }
 
     void "test groovy core - ClassDeclaration"() {
-        doTest('core/ClassDeclaration_01.groovy');
-        doTest('core/ClassDeclaration_02.groovy');
-        doTest('core/ClassDeclaration_03.groovy');
-        doTest('core/ClassDeclaration_04.groovy', [PropertyNode, FieldNode]);
-        doTest('core/ClassDeclaration_05.groovy', [ExpressionStatement]);
-        doTest('core/ClassDeclaration_06.groovy');
-        doTest('core/ClassDeclaration_07.groovy');
+        TestUtils.doTest('core/ClassDeclaration_01.groovy');
+        TestUtils.doTest('core/ClassDeclaration_02.groovy');
+        TestUtils.doTest('core/ClassDeclaration_03.groovy');
+        TestUtils.doTest('core/ClassDeclaration_04.groovy', [PropertyNode, FieldNode]);
+        TestUtils.doTest('core/ClassDeclaration_05.groovy', [ExpressionStatement]);
+        TestUtils.doTest('core/ClassDeclaration_06.groovy');
+        TestUtils.doTest('core/ClassDeclaration_07.groovy');
     }
 
     void "test groovy core - InterfaceDeclaration"() {
-        doTest('core/InterfaceDeclaration_01.groovy');
-        doTest('core/InterfaceDeclaration_02.groovy');
-        doTest('core/InterfaceDeclaration_03.groovy');
+        TestUtils.doTest('core/InterfaceDeclaration_01.groovy');
+        TestUtils.doTest('core/InterfaceDeclaration_02.groovy');
+        TestUtils.doTest('core/InterfaceDeclaration_03.groovy');
     }
 
     void "test groovy core - EnumDeclaration"() {
-        doTest('core/EnumDeclaration_01.groovy');
-        doTest('core/EnumDeclaration_02.groovy', [ExpressionStatement]);
-        doTest('core/EnumDeclaration_03.groovy');
+        TestUtils.doTest('core/EnumDeclaration_01.groovy');
+        TestUtils.doTest('core/EnumDeclaration_02.groovy', [ExpressionStatement]);
+        TestUtils.doTest('core/EnumDeclaration_03.groovy');
+        TestUtils.doTest('core/EnumDeclaration_04.groovy');
+        TestUtils.doTest('core/EnumDeclaration_05.groovy');
     }
 
     void "test groovy core - TraitDeclaration"() {
-        doTest('core/TraitDeclaration_01.groovy');
-        doTest('core/TraitDeclaration_02.groovy');
-        doTest('core/TraitDeclaration_03.groovy');
-        doTest('core/TraitDeclaration_04.groovy', [PropertyNode, FieldNode]);
-        doTest('core/TraitDeclaration_05.groovy');
+        TestUtils.doTest('core/TraitDeclaration_01.groovy');
+        TestUtils.doTest('core/TraitDeclaration_02.groovy');
+        TestUtils.doTest('core/TraitDeclaration_03.groovy');
+        TestUtils.doTest('core/TraitDeclaration_04.groovy', [PropertyNode, FieldNode]);
+        TestUtils.doTest('core/TraitDeclaration_05.groovy');
     }
 
     void "test groovy core - AnnotationDeclaration"() {
-        doTest('core/AnnotationDeclaration_01.groovy');
+        TestUtils.doTest('core/AnnotationDeclaration_01.groovy');
     }
 
     void "test groovy core - Command"() {
-        doTest('core/Command_01.groovy');
-        doTest('core/Command_02.groovy');
-        doTest('core/Command_03.groovy', [ExpressionStatement, Parameter]);
-        doTest('core/Command_04.groovy', [ExpressionStatement]);
-        doTest('core/Command_05.groovy');
-        doRunAndTest('core/Command_06x.groovy')
+        TestUtils.doTest('core/Command_01.groovy');
+        TestUtils.doTest('core/Command_02.groovy');
+        TestUtils.doTest('core/Command_03.groovy', [ExpressionStatement, Parameter]);
+        TestUtils.doTest('core/Command_04.groovy', [ExpressionStatement]);
+        TestUtils.doTest('core/Command_05.groovy');
+        TestUtils.doRunAndTest('core/Command_06x.groovy')
     }
 
     void "test groovy core - Unicode"() {
-        doTest('core/Unicode_01.groovy');
+        TestUtils.doTest('core/Unicode_01.groovy');
     }
 
     void "test groovy core - BreakingChanges"() {
-        doRunAndTest('core/BreakingChange_01x.groovy');
-        doRunAndTest('core/BreakingChange_02x.groovy');
-        doRunAndTest('core/BreakingChange_03x.groovy');
-        doRunAndTest('core/BreakingChange_04x.groovy');
+        TestUtils.doRunAndTest('core/BreakingChange_01x.groovy');
+        TestUtils.doRunAndTest('core/BreakingChange_02x.groovy');
+        TestUtils.doRunAndTest('core/BreakingChange_03x.groovy');
+        TestUtils.doRunAndTest('core/BreakingChange_04x.groovy');
     }
 
     void "test groovy core - Array"() {
-        doRunAndTest('core/Array_01x.groovy');
+        TestUtils.doRunAndTest('core/Array_01x.groovy');
     }
 
     void "test groovy core - Groovydoc"() {
-        doRunAndTest('core/Groovydoc_01x.groovy');
+        TestUtils.doRunAndTest('core/Groovydoc_01x.groovy');
+    }
+
+    void "test groovy core - Script"() {
+        TestUtils.doRunAndTest('core/Script_01x.groovy');
     }
 
     void "test groovy core - BUG"() {
-        doRunAndTest('bugs/BUG-GROOVY-4757.groovy');
-        doRunAndTest('bugs/GROOVY-3898.groovy');
-        doRunAndTest('bugs/BUG-GROOVY-5652.groovy');
-        doRunAndTest('bugs/BUG-GROOVY-4762.groovy');
-        doRunAndTest('bugs/BUG-GROOVY-4438.groovy');
-        doRunAndTest('bugs/BUG-GROOVY-6038.groovy');
-        doRunAndTest('bugs/BUG-GROOVY-2324.groovy');
+        TestUtils.doRunAndTest('bugs/BUG-GROOVY-4757.groovy');
+        TestUtils.doRunAndTest('bugs/GROOVY-3898.groovy');
+        TestUtils.doRunAndTest('bugs/BUG-GROOVY-5652.groovy');
+        TestUtils.doRunAndTest('bugs/BUG-GROOVY-4762.groovy');
+        TestUtils.doRunAndTest('bugs/BUG-GROOVY-4438.groovy');
+        TestUtils.doRunAndTest('bugs/BUG-GROOVY-6038.groovy');
+        TestUtils.doRunAndTest('bugs/BUG-GROOVY-2324.groovy');
     }
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy b/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy
index 3514c75..67a68f8 100644
--- a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy
+++ b/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/SyntaxErrorTest.groovy
@@ -20,9 +20,6 @@ package org.apache.groovy.parser.antlr4
 
 import org.apache.groovy.parser.antlr4.util.ASTComparatorCategory
 
-import static org.apache.groovy.parser.antlr4.TestUtils.COMMON_IGNORE_CLASS_LIST
-import static org.apache.groovy.parser.antlr4.TestUtils.shouldFail
-
 /**
  * Some syntax error test cases for the new parser
  *
@@ -141,11 +138,41 @@ class SyntaxErrorTest extends GroovyTestCase {
         TestUtils.doRunAndShouldFail('fail/Modifier_03x.groovy');
         TestUtils.doRunAndShouldFail('fail/Modifier_04x.groovy');
         TestUtils.doRunAndShouldFail('fail/Modifier_05x.groovy');
+        TestUtils.shouldFail('fail/Modifier_07.groovy');
+    }
+
+    void "test groovy core - ClassDeclaration"() {
+        TestUtils.doRunAndShouldFail('fail/ClassDeclaration_01x.groovy');
+    }
+
+    void "test groovy core - MethodDeclaration"() {
+        TestUtils.shouldFail('fail/MethodDeclaration_01.groovy');
+    }
+
+    void "test groovy core - ConstructorDeclaration"() {
+        TestUtils.shouldFail('fail/ConstructorDeclaration_01.groovy');
     }
 
+    void "test groovy core - ClosureListExpression"() {
+        TestUtils.shouldFail('fail/ClosureListExpression_01.groovy');
+        TestUtils.shouldFail('fail/ClosureListExpression_02.groovy');
+        TestUtils.shouldFail('fail/ClosureListExpression_03.groovy');
+        TestUtils.shouldFail('fail/ClosureListExpression_04.groovy');
+    }
+
+    void "test groovy core - InterfaceDeclaration"() {
+        TestUtils.shouldFail('fail/InterfaceDeclaration_01.groovy');
+    }
+
+    void "test groovy core - void"() {
+        TestUtils.doRunAndShouldFail('fail/Void_01x.groovy');
+        TestUtils.doRunAndShouldFail('fail/Void_02x.groovy');
+    }
+
+
     /**************************************/
     static unzipScriptAndShouldFail(String entryName, List ignoreClazzList, Map<String, String> replacementsMap=[:], boolean toCheckNewParserOnly = false) {
-        ignoreClazzList.addAll(COMMON_IGNORE_CLASS_LIST)
+        ignoreClazzList.addAll(TestUtils.COMMON_IGNORE_CLASS_LIST)
 
         TestUtils.unzipAndFail(SCRIPT_ZIP_PATH, entryName, TestUtils.addIgnore(ignoreClazzList, ASTComparatorCategory.LOCATION_IGNORE_LIST), replacementsMap, toCheckNewParserOnly)
     }

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_04.groovy
new file mode 100644
index 0000000..e25feb0
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_04.groovy
@@ -0,0 +1,4 @@
+enum ListEnum1 {
+    ONE([111, 222])
+    ListEnum1(Object listArg){}
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_05.groovy
new file mode 100644
index 0000000..f53e0d3
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/EnumDeclaration_05.groovy
@@ -0,0 +1,4 @@
+enum ListEnum1 {
+    ONE([111, 222]) {}
+    ListEnum1(Object listArg){}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_04.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_04.groovy
new file mode 100644
index 0000000..00a8c02
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_04.groovy
@@ -0,0 +1 @@
+"At $date"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_05.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_05.groovy
new file mode 100644
index 0000000..67e5f5e
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_05.groovy
@@ -0,0 +1 @@
+"""At $date"""
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_06.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_06.groovy
new file mode 100644
index 0000000..e1446b9
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/GString_06.groovy
@@ -0,0 +1 @@
+/At $date/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/53b4f900/subprojects/groovy-parser-antlr4/src/test/resources/core/Script_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/src/test/resources/core/Script_01x.groovy b/subprojects/groovy-parser-antlr4/src/test/resources/core/Script_01x.groovy
new file mode 100644
index 0000000..2bc3c15
--- /dev/null
+++ b/subprojects/groovy-parser-antlr4/src/test/resources/core/Script_01x.groovy
@@ -0,0 +1,5 @@
+protected String getGroovySql() {
+    return "abc"
+}
+
+assert "abc" == getGroovySql()


[31/50] [abbrv] groovy git commit: rename antlr4 parser to remove groovy- prefix since that is by convention for modules

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/TryWithResources_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/TryWithResources_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/TryWithResources_01x.groovy
new file mode 100644
index 0000000..94a183e
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/TryWithResources_01x.groovy
@@ -0,0 +1,284 @@
+/*
+ *  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.
+ */
+import groovy.transform.CompileStatic
+
+import java.io.*
+
+
+class Resource implements Closeable {
+    int resourceId;
+    static closedResourceIds = [];
+    static exMsg = "failed to close";
+
+    public Resource(int resourceId) {
+        this.resourceId = resourceId;
+    }
+
+    public void close() {
+        if (3 == resourceId) throw new IOException(exMsg);
+
+        closedResourceIds << resourceId
+    }
+}
+
+// test case 1
+def a = 1;
+try (Resource r1 = new Resource(1)) {
+    a = 2;
+}
+assert Resource.closedResourceIds == [1]
+assert 2 == a
+
+// test case 2
+Resource.closedResourceIds = []
+final exMsg = "resource not found";
+try {
+    // try { ... } should throw the IOException, while the resource should be closed
+    try (Resource r1 = new Resource(2)) {
+        throw new FileNotFoundException(exMsg)
+    }
+} catch(FileNotFoundException e) {
+    assert exMsg == e.getMessage()
+}
+assert Resource.closedResourceIds == [2]
+
+// test case 3
+Resource.closedResourceIds = []
+a = 1;
+try {
+    try (Resource r1 = new Resource(3)) {
+        a = 2;
+    }
+} catch (IOException e) {
+    assert Resource.exMsg == e.getMessage()
+}
+assert 2 == a;
+assert Resource.closedResourceIds == []
+
+// test case 4
+Resource.closedResourceIds = []
+try {
+    // try { ... } should throw the IOException, while the resource should be closed
+    try (Resource r1 = new Resource(3)) {
+        throw new FileNotFoundException(exMsg)
+    }
+} catch(FileNotFoundException e) {
+    assert exMsg == e.getMessage()
+
+    def suppressedExceptions = e.getSuppressed();
+    assert suppressedExceptions.length == 1
+    assert suppressedExceptions[0] instanceof IOException
+    assert suppressedExceptions[0].getMessage() == Resource.exMsg
+}
+assert Resource.closedResourceIds == []
+
+
+// test case 5
+Resource.closedResourceIds = []
+a = 1;
+try (Resource r1 = new Resource(5);
+Resource r2 = new Resource(6);) {
+    a = 2;
+}
+assert Resource.closedResourceIds == [6, 5]
+assert 2 == a
+
+// test case 6
+Resource.closedResourceIds = []
+a = 1;
+try (Resource r1 = new Resource(5);
+Resource r2 = new Resource(6);
+Resource r3 = new Resource(7);) {
+    a = 2;
+}
+assert Resource.closedResourceIds == [7, 6, 5]
+assert 2 == a
+
+
+// test case 7
+Resource.closedResourceIds = []
+try (Resource r1 = new Resource(7)) {
+    throw new FileNotFoundException(exMsg)
+} catch(FileNotFoundException e) {
+    assert exMsg == e.getMessage()
+}
+assert Resource.closedResourceIds == [7]
+
+// test case 8
+Resource.closedResourceIds = []
+try (Resource r1 = new Resource(7);
+Resource r2 = new Resource(8)) {
+    throw new FileNotFoundException(exMsg)
+} catch(FileNotFoundException e) {
+    assert exMsg == e.getMessage()
+}
+assert Resource.closedResourceIds == [8, 7]
+
+
+// test case 9
+Resource.closedResourceIds = []
+a = 1;
+try (Resource r1 = new Resource(3)) {
+    a = 2;
+} catch (IOException e) {
+    assert Resource.exMsg == e.getMessage()
+}
+assert 2 == a;
+assert Resource.closedResourceIds == []
+
+
+// test case 10
+Resource.closedResourceIds = []
+a = 1;
+try (Resource r1 = new Resource(3);
+Resource r2 = new Resource(4)) {
+    a = 2;
+} catch (IOException e) {
+    assert Resource.exMsg == e.getMessage()
+}
+assert 2 == a;
+assert Resource.closedResourceIds == [4]
+
+// test case 11
+Resource.closedResourceIds = []
+a = 1;
+try (Resource r0 = new Resource(2);
+Resource r1 = new Resource(3);
+Resource r2 = new Resource(4)) {
+    a = 2;
+} catch (IOException e) {
+    assert Resource.exMsg == e.getMessage()
+}
+assert 2 == a;
+assert Resource.closedResourceIds == [4, 2]
+
+
+// test case 12
+Resource.closedResourceIds = []
+try (Resource r1 = new Resource(3);
+Resource r2 = new Resource(4)) {
+    throw new FileNotFoundException(exMsg)
+} catch(FileNotFoundException e) {
+    assert exMsg == e.getMessage()
+
+    def suppressedExceptions = e.getSuppressed();
+    assert suppressedExceptions.length == 1
+    assert suppressedExceptions[0] instanceof IOException
+    assert suppressedExceptions[0].getMessage() == Resource.exMsg
+}
+assert Resource.closedResourceIds == [4]
+
+// test case 13
+Resource.closedResourceIds = []
+try (Resource r0 = new Resource(2);
+Resource r1 = new Resource(3);
+Resource r2 = new Resource(4)) {
+    throw new FileNotFoundException(exMsg)
+} catch(FileNotFoundException e) {
+    assert exMsg == e.getMessage()
+
+    def suppressedExceptions = e.getSuppressed();
+    assert suppressedExceptions.length == 1
+    assert suppressedExceptions[0] instanceof IOException
+    assert suppressedExceptions[0].getMessage() == Resource.exMsg
+}
+assert Resource.closedResourceIds == [4, 2]
+
+// test case 14
+Resource.closedResourceIds = []
+a = 1;
+try (Resource r1 = new Resource(1)) {
+    a += 2;
+    try (Resource r2 = new Resource(2);Resource r4 = new Resource(4)) {
+        a += 3;
+        try (Resource r5 = new Resource(5);Resource r6 = new Resource(6);Resource r7 = new Resource(7)) {
+            a += 4;
+            try {
+                try (Resource r3 = new Resource(3)) {
+                    a += 5;
+                }
+            } catch (IOException e) {
+                assert Resource.exMsg == e.getMessage()
+            }
+        }
+    } catch(Exception e) {
+        // ignored
+    } finally {
+        a += 10
+    }
+}
+assert Resource.closedResourceIds == [7, 6, 5, 4, 2, 1]
+assert 25 == a
+
+// test case 15
+@CompileStatic
+void tryWithResources() {
+    Resource.closedResourceIds = []
+    int cs = 1;
+    try (Resource r1 = new Resource(1)) {
+        cs += 2;
+        try (Resource r2 = new Resource(2);Resource r4 = new Resource(4)) {
+            cs += 3;
+            try (Resource r5 = new Resource(5);Resource r6 = new Resource(6);Resource r7 = new Resource(7)) {
+                cs += 4;
+                try {
+                    try (Resource r3 = new Resource(3)) {
+                        cs += 5;
+                    }
+                } catch (IOException e) {
+                    assert Resource.exMsg == e.getMessage()
+                }
+            }
+        } catch(Exception e) {
+            // ignored
+        } finally {
+            cs += 10
+        }
+    }
+    assert Resource.closedResourceIds == [7, 6, 5, 4, 2, 1]
+    assert 25 == cs
+}
+
+tryWithResources()
+
+
+// test case 16
+Resource.closedResourceIds = []
+a = 1;
+try (
+        Resource r1 = new Resource(
+        1
+)
+        Resource r2 = new Resource(2)
+) {
+    a = 2;
+}
+assert Resource.closedResourceIds == [2, 1]
+assert 2 == a
+
+// test case 17
+Resource.closedResourceIds = []
+a = 1;
+try (r1 = new Resource(1)
+     r2 = new Resource(2)) {
+    a = 2;
+}
+assert Resource.closedResourceIds == [2, 1]
+assert 2 == a
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Unicode_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Unicode_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Unicode_01.groovy
new file mode 100644
index 0000000..a065baa
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Unicode_01.groovy
@@ -0,0 +1,42 @@
+/*
+ *  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.
+ */
+def \u0061 = '\uuuuu0061'
+def \u0061\u0062
+def \u0061\u0062\u0063
+def \u0061\u0062\u00639
+def \u0061cC\u0062Bb\u00639aA
+def a\u00615\u00626\u0063Z
+def A\u00617\u00628\u0063z
+
+def \u0061\u0062() {}
+
+class \u0061 {
+    def \u0061\u0062
+
+    def \u0061cC\u0062Bb\u00639aA() {}
+}
+interface \u0061 {}
+enum \u0061 {
+    \u0061cC\u0062Bb\u00639aA, \u0061cC\u0062Bb\u00639aA2
+}
+trait \u0061 {}
+@interface \u0061 {}
+
+
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/While_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/While_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/While_01.groovy
new file mode 100644
index 0000000..cbf0249
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/While_01.groovy
@@ -0,0 +1,76 @@
+/*
+ *  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.
+ */
+while(true) assert true
+
+while(
+        true
+) assert true
+
+while(true)
+    assert true
+
+while(true) {
+    break;
+}
+
+out:
+while(true) {
+    break out;
+}
+
+out1:
+while(true) {
+    break out1;
+    out2: while (true) {
+        break out2;
+    }
+}
+
+
+while(true) {
+    continue
+}
+
+out:
+while(true) {
+    continue out;
+}
+
+out1:
+while(true) {
+    continue out1;
+    out2: while (true) {
+        continue out2;
+    }
+}
+
+out1:
+while(true) {
+    continue out1;
+    out2: while (true) {
+        break out2;
+    }
+}
+
+
+while (false)
+    int number = 1
+
+while(true);
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/While_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/While_02x.groovy b/subprojects/parser-antlr4/src/test/resources/core/While_02x.groovy
new file mode 100644
index 0000000..e099280
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/While_02x.groovy
@@ -0,0 +1,23 @@
+/*
+ *  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.
+ */
+int i = 0
+while (i < 5) {
+    i++
+}
+assert 5 == i;

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_01x.groovy
new file mode 100644
index 0000000..8dae1bd
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_01x.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+class A {
+    def x()
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_02x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_02x.groovy
new file mode 100644
index 0000000..80a041c
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_02x.groovy
@@ -0,0 +1,22 @@
+/*
+ *  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.
+ */
+enum E {
+    A, B
+    def y()
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_03x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_03x.groovy
new file mode 100644
index 0000000..92ace61
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_03x.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+trait B {
+    def z()
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_04x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_04x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_04x.groovy
new file mode 100644
index 0000000..409fa18
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_04x.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+def w()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_05x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_05x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_05x.groovy
new file mode 100644
index 0000000..aec108e
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_05x.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+abstract v()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_06x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_06x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_06x.groovy
new file mode 100644
index 0000000..7672201
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/AbstractMethod_06x.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+abstract u() {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Break_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Break_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Break_01x.groovy
new file mode 100644
index 0000000..14c8d30
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Break_01x.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+break
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Break_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Break_02x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Break_02x.groovy
new file mode 100644
index 0000000..f08680b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Break_02x.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+if (true) {
+    break;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy
new file mode 100644
index 0000000..b60a794
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/ClassDeclaration_01x.groovy
@@ -0,0 +1,25 @@
+/*
+ *  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.
+ */
+package fail
+
+class A {
+    String foo() {}
+    def foo() {}
+}
+new A()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy
new file mode 100644
index 0000000..607c5b5
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_01.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+[].for(1;2;3){println "in loop"}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy b/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy
new file mode 100644
index 0000000..29a16ec
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_02.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+def x = (1;2;3)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy b/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy
new file mode 100644
index 0000000..dab42a1
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_03.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+[].bar(1;2;3)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy b/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy
new file mode 100644
index 0000000..5783cbd
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/ClosureListExpression_04.groovy
@@ -0,0 +1,28 @@
+/*
+ *  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.
+ */
+class Crasher {
+    public void m() {
+        def fields = [1,2,3]
+        def expectedFieldNames = ["patentnumber", "status"].
+                for (int i=0; i<fields.size(); i++) {
+                    Object f = fields[i]
+                    System.out.println(f);
+                }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy
new file mode 100644
index 0000000..1318c4a
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/ConstructorDeclaration_01.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+class Foo { static final Foo() {}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Continue_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Continue_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Continue_01x.groovy
new file mode 100644
index 0000000..4a23bf8
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Continue_01x.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+continue;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Continue_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Continue_02x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Continue_02x.groovy
new file mode 100644
index 0000000..744b34a
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Continue_02x.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+if (true) {
+    continue;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/DoWhile_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/DoWhile_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/DoWhile_01x.groovy
new file mode 100644
index 0000000..b770cfb
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/DoWhile_01x.groovy
@@ -0,0 +1,22 @@
+/*
+ *  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.
+ */
+do
+println 123
+println 123
+while(false)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Expression_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Expression_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Expression_01.groovy
new file mode 100644
index 0000000..4313d66
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Expression_01.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+int()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Expression_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Expression_02.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Expression_02.groovy
new file mode 100644
index 0000000..d469216
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Expression_02.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+1 = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Expression_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Expression_03.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Expression_03.groovy
new file mode 100644
index 0000000..904f84e
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Expression_03.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+m() = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Expression_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Expression_04.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Expression_04.groovy
new file mode 100644
index 0000000..0d4e9af
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Expression_04.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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 = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Expression_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Expression_05.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Expression_05.groovy
new file mode 100644
index 0000000..58cf67c
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Expression_05.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+super = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Expression_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Expression_06.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Expression_06.groovy
new file mode 100644
index 0000000..220518d
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Expression_06.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+[1, 2] = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Expression_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Expression_07.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Expression_07.groovy
new file mode 100644
index 0000000..6f6f9b0
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Expression_07.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+[a: 1, b: 2] = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Expression_08.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Expression_08.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Expression_08.groovy
new file mode 100644
index 0000000..fb47d45
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Expression_08.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+"$x" = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Expression_09.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Expression_09.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Expression_09.groovy
new file mode 100644
index 0000000..4c1958c
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Expression_09.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+'x' = 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/For_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/For_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/For_01.groovy
new file mode 100644
index 0000000..694dfed
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/For_01.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+for (*a; a.size() < 10;) {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/For_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/For_02.groovy b/subprojects/parser-antlr4/src/test/resources/fail/For_02.groovy
new file mode 100644
index 0000000..359b9ca
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/For_02.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+for (; a.size() < 10; *a) {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy
new file mode 100644
index 0000000..312818e
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/InterfaceDeclaration_01.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+interface Foo {
+    def doit( String param = "Groovy", int o )
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/List_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/List_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/List_01.groovy
new file mode 100644
index 0000000..b625423
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/List_01.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+[,]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/LocalVariableDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/LocalVariableDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/LocalVariableDeclaration_01.groovy
new file mode 100644
index 0000000..590cb87
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/LocalVariableDeclaration_01.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+@Test2 (int c, int d) = [1, 2]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy
new file mode 100644
index 0000000..a8f27ad
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/MethodDeclaration_01.groovy
@@ -0,0 +1,23 @@
+/*
+ *  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.
+ */
+{ ->
+    def say(String msg) {
+        println(msg)
+    }
+}()

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Modifier_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Modifier_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_01x.groovy
new file mode 100644
index 0000000..d7d4ce7
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_01x.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+def def m() {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Modifier_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Modifier_02x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_02x.groovy
new file mode 100644
index 0000000..fcb609a
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_02x.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+public public class A {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Modifier_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Modifier_03x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_03x.groovy
new file mode 100644
index 0000000..de1f024
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_03x.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+final final int a = 1;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Modifier_04x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Modifier_04x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_04x.groovy
new file mode 100644
index 0000000..4b495ad
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_04x.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+class A {
+    private public a
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Modifier_05x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Modifier_05x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_05x.groovy
new file mode 100644
index 0000000..d19ca6c
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_05x.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+class A {
+    protected public a
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Modifier_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Modifier_07.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_07.groovy
new file mode 100644
index 0000000..2134472
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Modifier_07.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+volatile x() {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_01x.groovy
new file mode 100644
index 0000000..dc1585a
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_01x.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+(1 + 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_02x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_02x.groovy
new file mode 100644
index 0000000..e2ce8a4
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_02x.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+(1 + 2))
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_03x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_03x.groovy
new file mode 100644
index 0000000..af33a2e
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/ParExpression_03x.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+(1 + 2]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Parentheses_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Parentheses_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Parentheses_01.groovy
new file mode 100644
index 0000000..976b0d2
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Parentheses_01.groovy
@@ -0,0 +1,20 @@
+/*
+ *  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.
+ */
+def a( {
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Super_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Super_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Super_01x.groovy
new file mode 100644
index 0000000..8abe436
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Super_01x.groovy
@@ -0,0 +1,24 @@
+/*
+ *  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.
+ */
+class A {
+    A(int a) {
+        println a
+        super(123)
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Switch_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Switch_01.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Switch_01.groovy
new file mode 100644
index 0000000..c548d86
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Switch_01.groovy
@@ -0,0 +1,27 @@
+/*
+ *  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.
+ */
+switch (a) {
+    case 1:
+        break;
+    default:
+        break;
+    default:
+        break;
+}
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/This_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/This_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/This_01x.groovy
new file mode 100644
index 0000000..d3fdc44
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/This_01x.groovy
@@ -0,0 +1,26 @@
+/*
+ *  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.
+ */
+class A {
+    A(int a) {
+        println a
+        this()
+    }
+
+    A() {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/UnexpectedCharacter_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/UnexpectedCharacter_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/UnexpectedCharacter_01x.groovy
new file mode 100644
index 0000000..5beccbe
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/UnexpectedCharacter_01x.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Void_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Void_01x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Void_01x.groovy
new file mode 100644
index 0000000..fdeb7c4
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Void_01x.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+class MyClass {
+    void field
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/fail/Void_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/fail/Void_02x.groovy b/subprojects/parser-antlr4/src/test/resources/fail/Void_02x.groovy
new file mode 100644
index 0000000..748003e
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/fail/Void_02x.groovy
@@ -0,0 +1,23 @@
+/*
+ *  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.
+ */
+class MyClass {
+    def foo() {
+        void bar = null
+    }
+}


[09/50] [abbrv] groovy git commit: GROOVY-8174: Groovy.Sql+Oracle parameter substitution problem (closes #534)

Posted by pa...@apache.org.
GROOVY-8174: Groovy.Sql+Oracle parameter substitution problem (closes #534)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/921f96d0
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/921f96d0
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/921f96d0

Branch: refs/heads/parrot
Commit: 921f96d0477308350c81690213d3ab5ec35fbfe9
Parents: 2093378
Author: paulk <pa...@asert.com.au>
Authored: Thu May 4 10:53:41 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:05:34 2017 +1000

----------------------------------------------------------------------
 subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/921f96d0/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java b/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
index 26d52df..fd0ff13 100644
--- a/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
+++ b/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
@@ -4114,8 +4114,10 @@ public class Sql {
                 Map paramsMap = (Map) params.get(0);
                 if (paramsMap.isEmpty()) return;
             }
-            if (metaData.getParameterCount() != params.size()) {
+            if (metaData.getParameterCount() < params.size()) {
                 throw new IllegalArgumentException("Found " + metaData.getParameterCount() + " parameter placeholders but supplied with " + params.size() + " parameters");
+            } else if (metaData.getParameterCount() != params.size()) {
+                LOG.warning("Found " + metaData.getParameterCount() + " parameter placeholders but supplied with " + params.size() + " parameters");
             }
         }
         for (Object value : params) {


[04/50] [abbrv] groovy git commit: clean-up now that jdk7 is baseline (closes #526)

Posted by pa...@apache.org.
clean-up now that jdk7 is baseline (closes #526)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/84df2e11
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/84df2e11
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/84df2e11

Branch: refs/heads/parrot
Commit: 84df2e11fcbdcafe032910b3e1320f6be59377d1
Parents: 8a17a1e
Author: PascalSchumacher <pa...@gmx.net>
Authored: Fri Apr 21 20:27:22 2017 +0200
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:04:03 2017 +1000

----------------------------------------------------------------------
 .../groovy/control/CompilerConfiguration.java   | 10 +-----
 src/spec/doc/invokedynamic-support.adoc         |  7 ++---
 .../CircularLanguageReferenceTest.groovy        | 33 --------------------
 .../PropertyUsageFromJavaTest.groovy            | 33 --------------------
 .../src/main/java/groovy/json/internal/Sys.java |  8 +----
 5 files changed, 5 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/84df2e11/src/main/org/codehaus/groovy/control/CompilerConfiguration.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/control/CompilerConfiguration.java b/src/main/org/codehaus/groovy/control/CompilerConfiguration.java
index a3107ac..1ee26d3 100644
--- a/src/main/org/codehaus/groovy/control/CompilerConfiguration.java
+++ b/src/main/org/codehaus/groovy/control/CompilerConfiguration.java
@@ -37,8 +37,6 @@ import java.util.*;
 
 public class CompilerConfiguration {
 
-    private static final String JDK5_CLASSNAME_CHECK = "java.lang.annotation.Annotation";
-
     /** This (<code>"indy"</code>) is the Optimization Option value for enabling <code>invokedynamic</code> complilation. */
     public static final String INVOKEDYNAMIC = "indy";
 
@@ -800,13 +798,7 @@ public class CompilerConfiguration {
     }
     
     private static String getVMVersion() {
-        try {
-            Class.forName(JDK5_CLASSNAME_CHECK);
-            return POST_JDK5;
-        } catch(Exception ex) {
-            // IGNORE
-        }
-        return PRE_JDK5;
+        return POST_JDK5;
     }
     
     /**

http://git-wip-us.apache.org/repos/asf/groovy/blob/84df2e11/src/spec/doc/invokedynamic-support.adoc
----------------------------------------------------------------------
diff --git a/src/spec/doc/invokedynamic-support.adoc b/src/spec/doc/invokedynamic-support.adoc
index 7c3314a..944d938 100644
--- a/src/spec/doc/invokedynamic-support.adoc
+++ b/src/spec/doc/invokedynamic-support.adoc
@@ -28,7 +28,6 @@ Since Groovy 2.0, we added support for the JVM http://docs.oracle.com/javase/7/d
 
 This means that unlike APIs, AST transformations or syntactic sugar, this feature is **not visible** to the developer or the end user. It is a compilation and runtime feature only. This means that given two programs written in Groovy, you have the choice to compile it with or without invokedynamic support. Whatever you choose, it comes with pros and cons:
 
-- classes compiled with invokedynamic can only be used on JDK 1.7+ (without invokedynamic, Groovy classes are still compatible with JDK 1.5+)
 - call site caching, as implemented in "normal" Groovy is replaced with invokedynamic since Groovy 2.1
 - it is possible to mix classes compiled with and without invokedynamic in the same project, as long as you run JDK 1.7+
 - depending on the JVM (even different minor versions of the JVM), you can target close to Java performance for dynamic Groovy with invokedynamic support activated
@@ -39,8 +38,8 @@ This means that unlike APIs, AST transformations or syntactic sugar, this featur
 
 The Groovy distribution comes with **two** jars:
 
-- groovy-x.y.z.jar : compatible with JDK 1.5+, makes use of call site caching
-- groovy-x-y-z-indy.jar : compatible with JDK 1.7+ only, has invokedynamic support bundled, old call site caching still possible
+- groovy-x.y.z.jar : makes use of call site caching
+- groovy-x-y-z-indy.jar : has invokedynamic support bundled, old call site caching still possible
 
 The first jar is Groovy compiled without invokedynamic support, while the second one has invokedynamic support bundled. As Groovy core and the groovy modules are sometimes written in Groovy, we currently have no choice but issuing two distinct versions of Groovy. This means that if you pick the "normal" jar, the groovy classes of groovy itself are compiled with call site caching (1.5+), while if you use the "indy" jar, the groovy classes of groovy itself are compiled using invokedynamic. This means that the invokedynamic version of Groovy doesn't make use of the old call site caching mechanism.
 
@@ -96,4 +95,4 @@ Independently of the jar version that you use (and after having exchanged the ja
 |invokedynamic
 |===
 
-So even if you use the indy jar, if you don't use the invokedynamic flag at compile time, then the compiled classes will use the "old" format, meaning they will use the JDK1.5+ classes without invokedynamic.
\ No newline at end of file
+So even if you use the indy jar, if you don't use the invokedynamic flag at compile time, then the compiled classes will use the "old" format.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/84df2e11/src/test/org/codehaus/groovy/tools/stubgenerator/CircularLanguageReferenceTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/tools/stubgenerator/CircularLanguageReferenceTest.groovy b/src/test/org/codehaus/groovy/tools/stubgenerator/CircularLanguageReferenceTest.groovy
index 1035cbd..4450bed 100644
--- a/src/test/org/codehaus/groovy/tools/stubgenerator/CircularLanguageReferenceTest.groovy
+++ b/src/test/org/codehaus/groovy/tools/stubgenerator/CircularLanguageReferenceTest.groovy
@@ -18,12 +18,6 @@
  */
 package org.codehaus.groovy.tools.stubgenerator
 
-import org.junit.After
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-
 /**
  * Test circular reference between Java and Groovy, as well as inheritance:
  * a Shape Java interface is implemented by a Rectangle Groovy class,
@@ -33,30 +27,8 @@ import org.junit.runners.JUnit4
  *
  * @author Guillaume Laforge
  */
-import static org.junit.Assume.assumeFalse
-
-@RunWith(JUnit4)
 class CircularLanguageReferenceTest extends StubTestCase {
 
-    @Before
-    void setUp() {
-        assumeNotOnTravisCIAndNotJava6()
-        super.setUp()
-    }
-
-    private assumeNotOnTravisCIAndNotJava6() {
-        boolean travisCI = new File('.').absolutePath =~ /travis/
-        boolean java6 = System.getProperty('java.version').startsWith('1.6')
-
-        assumeFalse('''Test always fails with "java.lang.IllegalArgumentException: URI is not hierarchical"
-            on open jdk used by travis.''', travisCI && java6)
-    }
-
-    @Test
-    void test() {
-        super.testRun()
-    }
-
     void verifyStubs() {
         classes['stubgenerator.circularLanguageReference.Rectangle'].with {
             assert methods['area'     ].signature == "public double area()"
@@ -67,10 +39,5 @@ class CircularLanguageReferenceTest extends StubTestCase {
             assert imports == ['java.lang.*', 'java.io.*', 'java.net.*', 'java.util.*', 'groovy.lang.*', 'groovy.util.*']
         }
     }
-
-    @After
-    void tearDown() {
-        super.tearDown()
-    }
 }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/84df2e11/src/test/org/codehaus/groovy/tools/stubgenerator/PropertyUsageFromJavaTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/tools/stubgenerator/PropertyUsageFromJavaTest.groovy b/src/test/org/codehaus/groovy/tools/stubgenerator/PropertyUsageFromJavaTest.groovy
index e199972..eb34176 100644
--- a/src/test/org/codehaus/groovy/tools/stubgenerator/PropertyUsageFromJavaTest.groovy
+++ b/src/test/org/codehaus/groovy/tools/stubgenerator/PropertyUsageFromJavaTest.groovy
@@ -18,41 +18,13 @@
  */
 package org.codehaus.groovy.tools.stubgenerator
 
-import org.junit.After
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-
-import static org.junit.Assume.assumeFalse
-
 /**
  * Tests Groovy properties and how they can be used from Java.
  *
  * @author Guillaume Laforge
  */
-@RunWith(JUnit4)
 class PropertyUsageFromJavaTest extends StubTestCase {
 
-    @Before
-    void setUp() {
-        assumeNotOnTravisCIAndNotJava6()
-        super.setUp()
-    }
-
-    private assumeNotOnTravisCIAndNotJava6() {
-        boolean travisCI = new File('.').absolutePath =~ /travis/
-        boolean java6 = System.getProperty('java.version').startsWith('1.6')
-
-        assumeFalse('''Test always fails with "java.lang.IllegalArgumentException: URI is not hierarchical"
-            on open jdk used by travis.''', travisCI && java6)
-    }
-
-    @Test
-    void test() {
-        super.testRun()
-    }
-
     void verifyStubs() {
         classes['stubgenerator.propertyUsageFromJava.somepackage.GroovyPogo'].with {
             assert methods['getAge'].signature == "public int getAge()"
@@ -61,10 +33,5 @@ class PropertyUsageFromJavaTest extends StubTestCase {
             assert methods['setName'].signature == "public void setName(java.lang.String value)"
         }
     }
-
-    @After
-    void tearDown() {
-        super.tearDown()
-    }
 }
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/84df2e11/subprojects/groovy-json/src/main/java/groovy/json/internal/Sys.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-json/src/main/java/groovy/json/internal/Sys.java b/subprojects/groovy-json/src/main/java/groovy/json/internal/Sys.java
index 8c2953c..4d8c3ed 100644
--- a/subprojects/groovy-json/src/main/java/groovy/json/internal/Sys.java
+++ b/subprojects/groovy-json/src/main/java/groovy/json/internal/Sys.java
@@ -24,7 +24,6 @@ import java.util.regex.Pattern;
 
 class Sys {
 
-    private static final boolean is1_7OrLater;
     private static final boolean is1_8OrLater;
     private static final boolean is1_7;
     private static final boolean is1_8;
@@ -37,10 +36,6 @@ class Sys {
             try {
                 String ver = split[0];
 
-                if (ver.startsWith("1.6")) {
-                    v = new BigDecimal("1.6");
-                }
-
                 if (ver.startsWith("1.7")) {
                     v = new BigDecimal("1.7");
                 }
@@ -66,14 +61,13 @@ class Sys {
             }
         }
 
-        is1_7OrLater = v.compareTo(new BigDecimal("1.7")) >= 0;
         is1_8OrLater = v.compareTo(new BigDecimal("1.8")) >= 0;
         is1_7 = v.compareTo(new BigDecimal("1.7")) == 0;
         is1_8 = v.compareTo(new BigDecimal("1.8")) == 0;
     }
 
     public static boolean is1_7OrLater() {
-        return is1_7OrLater;
+        return true;
     }
 
     public static boolean is1_8OrLater() {


[32/50] [abbrv] groovy git commit: rename antlr4 parser to remove groovy- prefix since that is by convention for modules

Posted by pa...@apache.org.
http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_07.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_07.groovy b/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_07.groovy
new file mode 100644
index 0000000..36b6215
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_07.groovy
@@ -0,0 +1,24 @@
+/*
+ *  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.
+ */
+package core;
+import java.util.*
+import java.math.BigDecimal;
+import java.io.*
+import static java.lang.Math.*
+import static java.lang.Math.pow

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_08.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_08.groovy b/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_08.groovy
new file mode 100644
index 0000000..c6f8d2e
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/ImportDeclaration_08.groovy
@@ -0,0 +1,46 @@
+/*
+ *  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.
+ */
+#!/usr/bin/env groovy
+/*
+ *  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.
+ */
+package core;
+
+import java.util.*
+import java.math.BigDecimal;
+import java.io.*
+import java.sql.Blob as Bb
+import static java.lang.Math.*;
+import static java.lang.Math.pow as pw
+import def.in.as.trait.*;

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/InterfaceDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/InterfaceDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/InterfaceDeclaration_01.groovy
new file mode 100644
index 0000000..992926c
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/InterfaceDeclaration_01.groovy
@@ -0,0 +1,54 @@
+/*
+ *  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.
+ */
+package core
+
+interface A1 {}
+interface A2<T> {}
+interface A3<T extends A> {}
+interface A4<T extends A & B> {}
+interface A5<T extends A & B & C> {}
+interface A6<T extends A & B & C> extends A {}
+interface A62 extends A<T> {}
+interface A7<T extends A & B & C> extends A, B {}
+interface A8<T extends A & B & C> extends A, B, C {}
+@Test2 interface A9<T extends A & B & C> extends A, B, C {}
+@Test2 @Test3 public interface A10<T extends A & B & C> extends A, B, C {}
+
+@Test2
+@Test3
+@Test4
+public
+interface A11
+<
+        T extends
+A &
+B &
+C
+>
+extends
+A,
+B,
+C
+        {
+
+        }
+
+interface Iterator extends java.util.Iterator {}
+
+interface i {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/InterfaceDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/InterfaceDeclaration_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/InterfaceDeclaration_02.groovy
new file mode 100644
index 0000000..a6e49ba
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/InterfaceDeclaration_02.groovy
@@ -0,0 +1,60 @@
+/*
+ *  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.
+ */
+package core
+
+import java.sql.SQLException
+
+public interface AA1 {
+        int a;
+        long b;
+        double c;
+        char d;
+        short e;
+        byte f;
+        float g;
+        boolean h;
+        String i;
+
+        public static final NAME = "AA1"
+
+        @Test3
+        public static final NAME2 = "AA1"
+
+        void sayHello();
+        abstract void sayHello2();
+        public void sayHello3();
+        public abstract void sayHello4();
+        @Test2
+        public abstract void sayHello5();
+
+        @Test2
+        public abstract void sayHello6() throws IOException, SQLException;
+
+        @Test2
+        @Test3
+        public abstract <T> T sayHello7() throws IOException, SQLException;
+
+        @Test2
+        @Test3
+        public abstract <T extends A> T sayHello8() throws IOException, SQLException;
+
+        @Test2
+        @Test3
+        public abstract <T extends A & B> T sayHello9() throws IOException, SQLException;
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/InterfaceDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/InterfaceDeclaration_03.groovy b/subprojects/parser-antlr4/src/test/resources/core/InterfaceDeclaration_03.groovy
new file mode 100644
index 0000000..9c78681
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/InterfaceDeclaration_03.groovy
@@ -0,0 +1,25 @@
+/*
+ *  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.
+ */
+interface Koo {
+    class Inner {}
+}
+
+interface Koo2 {
+    public static final Inner INNER = new Inner() {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Label_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Label_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Label_01.groovy
new file mode 100644
index 0000000..9e9645b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Label_01.groovy
@@ -0,0 +1,33 @@
+/*
+ *  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.
+ */
+a: assert true;
+a: assert true
+a:
+assert true;
+a:
+assert true
+
+
+before:
+setup:
+int a = 1
+int b = 1
+expect:
+a == b
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Lambda_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Lambda_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/Lambda_01x.groovy
new file mode 100644
index 0000000..5c147ac
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Lambda_01x.groovy
@@ -0,0 +1,66 @@
+/*
+ *  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.
+ */
+assert 9 == [1, 2, 3].stream().map(e -> e + 1).reduce(0, (r, e) -> r + e)
+assert 9 == [1, 2, 3].stream().map(e -> {e + 1}).reduce(0, (r, e) -> r + e)
+assert 9 == [1, 2, 3].stream().map((e) -> e + 1).reduce(0, (r, e) -> r + e)
+assert 9 == [1, 2, 3].stream().map((e) -> e + 1).reduce(0, (r, e) -> {r + e})
+assert 32 == ((e) -> e + 1)(2) + ((e, f) -> e + f)(2, 3) + ((e, f, g) -> e * f * g)(2, 3, 4)
+
+assert 24 == ((e, f, g) -> {e * f * g})(2, 3, 4)
+assert 24 == ((int e, int f, int g) -> {
+    int tmpE = e;
+    int tmpF = f;
+    int tmpG = g;
+    return tmpE * tmpF * tmpG;
+})(2, 3, 4)
+assert 24 == ((int e, int f, int g=4) -> {
+    int tmpE = e;
+    int tmpF = f;
+    int tmpG = g;
+    return tmpE * tmpF * tmpG;
+})(2, 3)
+
+def list = [2, 3, 1]
+Collections.sort(list, (n1, n2) -> n1 <=> n2)
+assert [1, 2, 3] == list
+
+assert 1 == (e -> e)(1)
+assert 2 == (() -> 2)()
+
+def lambda = e -> e;
+assert 1 == lambda(1)
+
+lambda = e -> e + 1;
+assert 2 == lambda(1)
+
+int sum = 0;
+[1, 2, 3].forEach(e -> {
+    sum += e
+})
+assert 6 == sum;
+
+def c = { (e) -> e * 2 }
+assert 6 == c()(3)
+
+c = { (e) -> { e * 2 } }
+assert 6 == c()(3)
+
+assert ['1', '2', '3'] == [0, 1, 2].collect(e -> String.valueOf e + 1)
+assert [3, 4, 5] == ['0', '1', '2'].collect(e -> Integer.parseInt e plus 1 plus 2)
+assert [4] == ['0'].collect(e -> e.length() plus 1 plus 2)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/List_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/List_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/List_01.groovy
new file mode 100644
index 0000000..f7c122e
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/List_01.groovy
@@ -0,0 +1,33 @@
+/*
+ *  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.
+ */
+[]
+[
+        
+]
+[1, 2, 3]
+[1, 2, 3,]
+[[1, 2, 3], 2, 3]
+[
+        [1,
+         2,
+         3],
+        2,
+        3]
+
+[1, *[2, 3, 4], 5, 6, *[7, 8], *[9]]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Literal_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Literal_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Literal_01.groovy
new file mode 100644
index 0000000..c3a1f3a
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Literal_01.groovy
@@ -0,0 +1,97 @@
+/*
+ *  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.
+ */
+null
+true
+false
+
+
+1
+12
+123
+
+1.2
+1.2f
+1.2F
+1.2d
+1.2D
+1.2g
+1.2G
+
+0x1234567890abcdef
+0X1234567890ABCDEF
+0x1234567890abcdefi
+0x1234567890abcdefl
+0x1234567890abcdefg
+0x1234567890abcdefI
+0x1234567890abcdefL
+0x1234567890abcdefG
+0xabcdef
+0xABCDEF
+0xABCDEF
+0xabcdef
+0xABCDEF
+
+01234567
+01234567
+01234567
+01234567i
+01234567l
+01234567g
+01234567I
+01234567L
+01234567G
+
+1__2
+2_12_3
+2__12__3
+2__12__3.1__2
+2__12__3.1__2
+12e10
+12e-10
+12e10
+12e-10
+12.12e10
+12.12e-10
+12.12e10
+12.12e-10
+12.12e-10f
+12.12e-10d
+12.12e-10g
+12e-10F
+120e-10D
+11F
+12D
+1.1F
+1.2D
+12e-10G
+12.1__2e-10f
+12.1_2e-10d
+1__12_2.12e-10g
+0xab__cdef
+0xAB__CD_EF
+012__34567L
+
+0b010101
+0B10101011
+0B10101011i
+0B10101011I
+0B10101011l
+0B10101011L
+0B10101011g
+0B10101011G
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Literal_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Literal_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/Literal_02.groovy
new file mode 100644
index 0000000..de55750
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Literal_02.groovy
@@ -0,0 +1,66 @@
+/*
+ *  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.
+ */
+'123'
+'abc'
+'a1b2c3'
+'a\tb\tc'
+'a\nb\r\nc'
+'$a$b$c'
+'$1$2$3'
+'$1$2\$3'
+'\$1\$2\$3\
+  hello world\
+'
+"\$1\$2\$3\
+  hello world\
+"
+' nested "double quotes" '
+" nested 'quotes' "
+' \6 1 digit is escaped'
+' \665 2 digits are escaped, \'5\' is a character.'
+' \3666 3 digits are escaped'
+' \166 '
+" \166 "
+' \u1234 '
+
+'''abc'''
+'''123'''
+'''
+            ''hello world''
+            'hello'
+            ''world'
+            'hi''
+            \
+            \t\r\n
+            $\$
+            \u1234
+            \123
+'''
+
+"""
+            ''hello world''
+            'hello'
+            ''world'
+            'hi''
+            \
+            \t\r\n
+            \$
+            \u1234
+            \123
+"""

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Literal_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Literal_03.groovy b/subprojects/parser-antlr4/src/test/resources/core/Literal_03.groovy
new file mode 100644
index 0000000..865596b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Literal_03.groovy
@@ -0,0 +1,21 @@
+/*
+ *  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.
+ */
+/\123 \/ abc \u1234 \r\n\$/
+
+$/\123 \/ abc \u1234 \r\n/$

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/LocalVariableDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/LocalVariableDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/LocalVariableDeclaration_01.groovy
new file mode 100644
index 0000000..7db2948
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/LocalVariableDeclaration_01.groovy
@@ -0,0 +1,128 @@
+/*
+ *  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.
+ */
+import groovy.transform.Field
+
+int a;
+int b = 1;
+int c =
+        1;
+final d = 1;
+@Test2 e = 1;
+@Test2 final f = 1;
+final
+@Test2 g = 1;
+
+int h, i = 1;
+int j,
+        k =
+                1;
+int l =
+        2,
+    m =
+            1;
+int n =
+        1
+int o =
+        2,
+    p =
+            1
+
+List list = [1, 2 + 6, [1, 2 + 3]]
+List list2 =
+        [
+                1,
+         2 +
+                6,
+                [1,
+                 2 +
+                         3]
+        ]
+
+def (int x, int y) = [1, 2]
+
+@Test2
+def
+        (int q,
+                int r) =
+                        [1, 2]
+
+def (int s, int t) = otherTuple
+
+def (int w, z) = [1, 2]
+def (a2, int b2) = [1, 2]
+
+def (u, v) = [1, 2]
+
+def (int c2, String d2, java.lang.Double e2) = [1, '2', 3.3D]
+
+def cc = {
+        String bb = 'Test'
+        return bb;
+}
+
+int xx = b c d e
+
+@Field static List list = [1, 2, 3]
+
+if (false)
+        def a = 5
+
+if(false)
+        def a, b = 10
+
+if(false)
+        def a = 9, b = 10
+
+if (false)
+        def a = 5
+else
+        def b = 2
+
+if(false)
+        def a, b = 10
+else
+        def a, b = 8
+
+if(false)
+        def a = 9, b = 10
+else
+        def a = 6, b = 8
+
+while(false)
+        def a = 5
+
+while(false)
+        def a, b = 10
+
+while(false)
+        def a = 9, b = 10
+
+for(;;)
+        def a = 5
+
+for(;;)
+        def a, b = 10
+
+for(;;)
+        def a = 9, b = 10
+
+
+
+Class<String>[] c
+Class<?>[] c2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Map_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Map_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Map_01.groovy
new file mode 100644
index 0000000..bcc0f3e
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Map_01.groovy
@@ -0,0 +1,47 @@
+/*
+ *  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.
+ */
+[a: 1, b: 2, c: 3]
+[(a): 1, (b**2): x, c: 2 + 3]
+['a': '1', 'b': 2, 'c': '3']
+[1: 2, 2: 3, 3: 4]
+[1.1: 2, 2.2: 3, 3.3: 4]
+[
+        (a)
+        :
+                1
+        ,
+        (
+                b**2
+        )
+        :
+                x
+        ,
+        c
+        :
+                2 +
+                        3
+]
+
+[(a): '1', *: [(a + 1): 1, (b): 2], *: ['a': 1 + 2]]
+
+[:]
+[
+        :
+]
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/MethodDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/MethodDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/MethodDeclaration_01.groovy
new file mode 100644
index 0000000..e7220e0
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/MethodDeclaration_01.groovy
@@ -0,0 +1,50 @@
+/*
+ *  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.
+ */
+int plus(int a, int b) {
+        return a + b;
+}
+
+int plus2(int a,
+          int b)
+{
+        return a + b;
+}
+
+int plus3(int a,
+          int b)
+throws
+        Exception1,
+        Exception2
+{
+        return a + b;
+}
+
+def <T> T someMethod() {}
+def <T extends List> T someMethod2() {}
+def <T extends A & B> T someMethod3() {}
+
+static m(a) {}
+static m2(a, b) {}
+static m3(a, b, c) {}
+static Object m4(a, b, c) {}
+
+private String relativePath() { '' }
+def foo() {}
+
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/MethodDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/MethodDeclaration_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/MethodDeclaration_02.groovy
new file mode 100644
index 0000000..91879a9
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/MethodDeclaration_02.groovy
@@ -0,0 +1,59 @@
+/*
+ *  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.
+ */
+final int plus(int a, int b) {
+        return a + b;
+}
+
+final plus(int a, int b) {
+        return a + b;
+}
+
+@Test2 plus(int a, int b) {
+        return a + b;
+}
+
+@Test2
+int plus(int a, int b) {
+        return a + b;
+}
+
+@Test2
+final int plus(int a, int b) {
+        return a + b;
+}
+
+@Test2
+@Test3
+synchronized final int plus(int a, int b) {
+        return a + b;
+}
+
+
+public void someMethod (java.lang.Class<String> clazz) {}
+public void someMethod2 (java.lang.Class clazz) {}
+public boolean someMethod3 (java.util.List<String> list) {
+        list instanceof java.util.List
+}
+
+/* return element i,j of infinite matrix A */
+def A(i, j) {
+        return 1.0D / ((i+j) * (i + j + 1.0D) / 2.0D  + i + 1.0D)
+}
+
+String m(Integer a, ... params) {}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/MethodPointer_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/MethodPointer_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/MethodPointer_01x.groovy
new file mode 100644
index 0000000..eaddb93
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/MethodPointer_01x.groovy
@@ -0,0 +1,23 @@
+/*
+ *  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.
+ */
+def shell = new GroovyShell()
+assert shell.evaluate("x = String.&toUpperCase; x('abc')") == "ABC"
+assert shell.evaluate("x = 'abc'.&toUpperCase; x()") == "ABC"
+assert shell.evaluate("x = Integer.&parseInt; x('123')") == 123
+assert shell.evaluate("x = 3.&parseInt; x('123')") == 123
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/MethodReference_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/MethodReference_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/MethodReference_01x.groovy
new file mode 100644
index 0000000..a31b5b8
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/MethodReference_01x.groovy
@@ -0,0 +1,103 @@
+/*
+ *  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.
+ */
+import java.util.stream.Collectors
+
+// class::staticMethod
+assert ['1', '2', '3'] == [1, 2, 3].stream().map(Integer::toString).collect(Collectors.toList())
+
+// class::instanceMethod
+assert ['A', 'B', 'C'] == ['a', 'b', 'c'].stream().map(String::toUpperCase).collect(Collectors.toList())
+
+
+
+def robot = new Robot();
+
+// instance::instanceMethod
+assert ['Hi, Jochen', 'Hi, Paul', 'Hi, Daniel'] == [new Person('Jochen'), new Person('Paul'), new Person('Daniel')].stream().map(robot::greet).collect(Collectors.toList())
+
+// class::staticMethod
+assert ['Jochen', 'Paul', 'Daniel'] == [new Person('Jochen'), new Person('Paul'), new Person('Daniel')].stream().map(Person::getText).collect(Collectors.toList())
+assert ['Jochen', 'Paul', 'Daniel'] == [new Person('Jochen'), new Person('Paul'), new Person('Daniel')].stream().map(BasePerson::getText).collect(Collectors.toList())
+
+// instance::staticMethod
+assert ['J', 'P', 'D'] == [new Person('Jochen'), new Person('Paul'), new Person('Daniel')].stream().map(robot::firstCharOfName).collect(Collectors.toList())
+
+// class::instanceMethod
+assert ['Jochen', 'Paul', 'Daniel'] == [new Person('Jochen'), new Person('Paul'), new Person('Daniel')].stream().map(Person::getName).collect(Collectors.toList())
+
+
+// ----------------------------------
+class BasePerson {
+    public static String getText(Person p) {
+        return p.name;
+    }
+}
+
+class Person extends BasePerson {
+    private String name;
+
+    public Person(String name) {
+        this.name = name
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+}
+class Robot {
+    public String greet(Person p) {
+        return "Hi, ${p.name}"
+    }
+
+    public static char firstCharOfName(Person p) {
+        return p.getName().charAt(0);
+    }
+}
+
+def mr = String::toUpperCase
+assert 'ABC' == mr('abc')
+assert 'ABC' == String::toUpperCase('abc')
+
+assert new HashSet() == HashSet::new()
+assert new String() == String::new()
+assert 1 == Integer::new(1)
+assert new String[0] == String[]::new(0)
+assert new String[0] == String[]::new('0')
+assert new String[1][2] == String[][]::new(1, 2)
+assert new String[1][2][3] == String[][][]::new(1, 2, 3)
+
+assert [new String[1], new String[2], new String[3]] == [1, 2, 3].stream().map(String[]::new).collect(Collectors.toList())
+assert [1, 2, 3] as String[] == [1, 2, 3].stream().map(String::valueOf).toArray(String[]::new)
+
+
+def a = String[][]::new(1, 2)
+def b = new String[1][2]
+assert a.class == b.class && a == b
+
+a = String[][][]::new(1, 2)
+b = new String[1][2][]
+assert a.class == b.class && a == b
+
+a = String[][][][]::new(1, 2)
+b = new String[1][2][][]
+assert a.class == b.class && a == b
+
+
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/NegativeRelationalOperators_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/NegativeRelationalOperators_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/NegativeRelationalOperators_01x.groovy
new file mode 100644
index 0000000..7c91cd3
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/NegativeRelationalOperators_01x.groovy
@@ -0,0 +1,39 @@
+/*
+ *  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.
+ */
+assert 'a' instanceof String
+assert 'a' !instanceof Integer
+assert 1 !instanceof String
+assert null !instanceof String
+assert 1 in [1, 2]
+assert 3 !in [1, 2]
+assert 3 !in ['1', '2']
+assert '3' !in [1, 2]
+assert '3' !in ['1', '2']
+assert null !in ['1', '2']
+assert null !in [1, 2]
+
+boolean interesting = false
+assert !interesting
+
+boolean instanceofboolean = false
+assert !instanceofboolean
+
+assert 1 !in[2, 3]
+assert 1 !in([2, 3])
+assert 1 !in{return [2, 3]}()

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/NegativeRelationalOperators_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/NegativeRelationalOperators_02x.groovy b/subprojects/parser-antlr4/src/test/resources/core/NegativeRelationalOperators_02x.groovy
new file mode 100644
index 0000000..1400f9f
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/NegativeRelationalOperators_02x.groovy
@@ -0,0 +1,36 @@
+/*
+ *  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.
+ */
+import groovy.transform.CompileStatic
+
+@CompileStatic
+def cs() {
+    assert 'a' instanceof String
+    assert 'a' !instanceof Integer
+    assert 1 !instanceof String
+    assert null !instanceof String
+    assert 1 in [1, 2]
+    assert 3 !in [1, 2]
+    assert 3 !in ['1', '2']
+    assert '3' !in [1, 2]
+    assert '3' !in ['1', '2']
+    assert null !in ['1', '2']
+    assert null !in [1, 2]
+}
+
+cs();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_01.groovy
new file mode 100644
index 0000000..17619c2
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_01.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+package com.groovyhelp.core
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_02.groovy
new file mode 100644
index 0000000..ec6d67f
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_02.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+package com.groovyhelp.core

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_03.groovy b/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_03.groovy
new file mode 100644
index 0000000..6114f1c
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_03.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+package com.groovyhelp.core;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_04.groovy b/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_04.groovy
new file mode 100644
index 0000000..88b48aa
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_04.groovy
@@ -0,0 +1,38 @@
+/*
+ *  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.
+ */
+#!/usr/bin/env groovy
+/*
+ *  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.
+ */
+package com.groovyhelp.core;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_05.groovy b/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_05.groovy
new file mode 100644
index 0000000..c60b3c3
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_05.groovy
@@ -0,0 +1,41 @@
+/*
+ *  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.
+ */
+#!/usr/bin/env groovy
+/*
+ *  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.
+ */
+package com.groovyhelp.core;
+/**
+ * Created by Daniel.Sun on 2016/08/17.
+ */
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_06.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_06.groovy b/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_06.groovy
new file mode 100644
index 0000000..313cc8f
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/PackageDeclaration_06.groovy
@@ -0,0 +1,19 @@
+/*
+ *  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.
+ */
+package def.in.as.trait;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Return_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Return_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Return_01.groovy
new file mode 100644
index 0000000..2f0f983
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Return_01.groovy
@@ -0,0 +1,26 @@
+/*
+ *  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.
+ */
+return
+return;
+return 1;
+return 2
+return
+3;
+return
+4
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/SafeIndex_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/SafeIndex_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/SafeIndex_01x.groovy
new file mode 100644
index 0000000..1cbcf66
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/SafeIndex_01x.groovy
@@ -0,0 +1,28 @@
+/*
+ *  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.
+ */
+assert null == null?[1];
+assert null == null?[1]?[1, 2];
+assert null == null?[1]?[1, 2]?[1, 2, 3];
+
+def a = null;
+assert null == a?[1, 2];
+
+def f() {return null}
+assert null == f()?[1];
+

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/SafeIndex_02x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/SafeIndex_02x.groovy b/subprojects/parser-antlr4/src/test/resources/core/SafeIndex_02x.groovy
new file mode 100644
index 0000000..aa13c83
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/SafeIndex_02x.groovy
@@ -0,0 +1,65 @@
+/*
+ *  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.
+ */
+import groovy.transform.*
+
+class SomeContainer {
+    public Object getAt(int i) {
+        return "123";
+    }
+
+    public void putAt(int i, Object obj) {
+    }
+}
+
+def safe() {
+    List list = null;
+    assert null == list?[1];
+    list?[1] = 'a';
+    assert null == list?[1];
+
+    Map map = null;
+    assert null == map?[1];
+    map?[1] = 'a';
+    assert null == map?[1];
+
+    SomeContainer sc = null;
+    assert null == sc?[1];
+    sc?[1] = 'a';
+    assert null == sc?[1];
+}
+safe();
+
+@CompileStatic
+def csSafe() {
+    List list = null;
+    assert null == list?[1];
+    list?[1] = 'a';
+    assert null == list?[1];
+
+    Map map = null;
+    assert null == map?[1];
+    map?[1] = 'a';
+    assert null == map?[1];
+
+    SomeContainer sc = null;
+    assert null == sc?[1];
+    sc?[1] = 'a';
+    assert null == sc?[1];
+}
+csSafe();

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/SafeIndex_03x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/SafeIndex_03x.groovy b/subprojects/parser-antlr4/src/test/resources/core/SafeIndex_03x.groovy
new file mode 100644
index 0000000..d94d414
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/SafeIndex_03x.groovy
@@ -0,0 +1,298 @@
+/*
+ *  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.
+ */
+import groovy.transform.*
+
+@CompileStatic
+def csObjArray() {
+    String[] array = ['a', 'b'];
+    assert 'b' == array?[1];
+
+    array?[1] = 'c';
+    assert 'c' == array?[1];
+
+    array = null;
+    assert null == array?[1];
+
+    array?[1] = 'c';
+    assert null == array?[1];
+}
+csObjArray();
+
+def objArray() {
+    String[] array = ['a', 'b'];
+    assert 'b' == array?[1];
+
+    array?[1] = 'c';
+    assert 'c' == array?[1];
+
+    array = null;
+    assert null == array?[1];
+
+    array?[1] = 'c';
+    assert null == array?[1];
+}
+objArray();
+
+@CompileStatic
+def csBooleanArray() {
+    boolean[] array = [true, false];
+    assert false == array?[1];
+
+    array?[1] = true;
+    assert true == array?[1];
+
+    array = null;
+    assert null == array?[1];
+
+    array?[1] = true;
+    assert null == array?[1];
+}
+csBooleanArray();
+
+def booleanArray() {
+    boolean[] array = [true, false];
+    assert false == array?[1];
+
+    array?[1] = true;
+    assert true == array?[1];
+
+    array = null;
+    assert null == array?[1];
+
+    array?[1] = true;
+    assert null == array?[1];
+}
+booleanArray();
+
+@CompileStatic
+def csCharArray() {
+    char[] array = ['a' as char, 'b' as char];
+    assert ('b' as char) == array?[1];
+
+    array?[1] = 'c';
+    assert ('c' as char) == array?[1];
+
+    array = null;
+    assert null == array?[1];
+
+    array?[1] = 'c';
+    assert null == array?[1];
+}
+csCharArray();
+
+def charArray() {
+    char[] array = ['a' as char, 'b' as char];
+    assert ('b' as char) == array?[1];
+
+    array?[1] = 'c';
+    assert ('c' as char) == array?[1];
+
+    array = null;
+    assert null == array?[1];
+
+    array?[1] = 'c';
+    assert null == array?[1];
+}
+charArray();
+
+@CompileStatic
+def csByteArray() {
+    byte[] array = [1 as byte, 2 as byte];
+    assert (2 as byte) == array?[1];
+
+    array?[1] = 3 as byte;
+    assert (3 as byte) == array?[1];
+
+    array = null;
+    assert null == array?[1];
+
+    array?[1] = 3 as byte;
+    assert null == array?[1];
+}
+csByteArray();
+
+def byteArray() {
+    byte[] array = [1 as byte, 2 as byte];
+    assert (2 as byte) == array?[1];
+
+    array?[1] = 3 as byte;
+    assert (3 as byte) == array?[1];
+
+    array = null;
+    assert null == array?[1];
+
+    array?[1] = 3 as byte;
+    assert null == array?[1];
+}
+byteArray();
+
+@CompileStatic
+def csShortArray() {
+    short[] array = [1 as short, 2 as short];
+    assert (2 as short) == array?[1];
+
+    array?[1] = 3 as short;
+    assert (3 as short) == array?[1];
+
+    array = null;
+    assert null == array?[1];
+
+    array?[1] = 3 as short;
+    assert null == array?[1];
+}
+csShortArray();
+
+def shortArray() {
+    short[] array = [1 as short, 2 as short];
+    assert (2 as short) == array?[1];
+
+    array?[1] = 3 as short;
+    assert (3 as short) == array?[1];
+
+    array = null;
+    assert null == array?[1];
+
+    array?[1] = 3 as short;
+    assert null == array?[1];
+}
+shortArray();
+
+@CompileStatic
+def csIntArray() {
+    int[] array = [1, 2];
+    assert 2 == array?[1];
+
+    array?[1] = 3;
+    assert 3 == array?[1];
+
+    array = null;
+    assert null == array?[1];
+
+    array?[1] = 3;
+    assert null == array?[1];
+}
+csIntArray();
+
+def intArray() {
+    int[] array = [1, 2];
+    assert 2 == array?[1];
+
+    array?[1] = 3;
+    assert 3 == array?[1];
+
+    array = null;
+    assert null == array?[1];
+
+    array?[1] = 3;
+    assert null == array?[1];
+}
+intArray();
+
+@CompileStatic
+def csLongArray() {
+    long[] array = [1L, 2L];
+    assert 2L == array?[1];
+
+    array?[1] = 3L;
+    assert 3L == array?[1];
+
+    array = null;
+    assert null == array?[1];
+
+    array?[1] = 3L;
+    assert null == array?[1];
+}
+csLongArray();
+
+def longArray() {
+    long[] array = [1L, 2L];
+    assert 2L == array?[1];
+
+    array?[1] = 3L;
+    assert 3L == array?[1];
+
+    array = null;
+    assert null == array?[1];
+
+    array?[1] = 3L;
+    assert null == array?[1];
+}
+longArray();
+
+@CompileStatic
+def csFloatArray() {
+    float[] array = [1.1f, 2.2f];
+    assert 2.2f == array?[1];
+
+    array?[1] = 3.3f;
+    assert 3.3f == array?[1];
+
+    array = null;
+    assert null == array?[1];
+
+    array?[1] = 3.3f;
+    assert null == array?[1];
+}
+csFloatArray();
+
+def floatArray() {
+    float[] array = [1.1f, 2.2f];
+    assert 2.2f == array?[1];
+
+    array?[1] = 3.3f;
+    assert 3.3f == array?[1];
+
+    array = null;
+    assert null == array?[1];
+
+    array?[1] = 3.3f;
+    assert null == array?[1];
+}
+floatArray();
+
+@CompileStatic
+def csDoubleArray() {
+    double[] array = [1.1d, 2.2d];
+    assert 2.2d == array?[1];
+
+    array?[1] = 3.3d;
+    assert 3.3d == array?[1];
+
+    array = null;
+    assert null == array?[1];
+
+    array?[1] = 3.3d;
+    assert null == array?[1];
+}
+csDoubleArray();
+
+def doubleArray() {
+    double[] array = [1.1d, 2.2d];
+    assert 2.2d == array?[1];
+
+    array?[1] = 3.3d;
+    assert 3.3d == array?[1];
+
+    array = null;
+    assert null == array?[1];
+
+    array?[1] = 3.3d;
+    assert null == array?[1];
+}
+doubleArray();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Script_01x.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Script_01x.groovy b/subprojects/parser-antlr4/src/test/resources/core/Script_01x.groovy
new file mode 100644
index 0000000..0e47db0
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Script_01x.groovy
@@ -0,0 +1,23 @@
+/*
+ *  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.
+ */
+protected String getGroovySql() {
+    return "abc"
+}
+
+assert "abc" == getGroovySql()

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Switch_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Switch_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Switch_01.groovy
new file mode 100644
index 0000000..f26d15b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Switch_01.groovy
@@ -0,0 +1,78 @@
+/*
+ *  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.
+ */
+switch (a) {
+    case 1:
+        break;
+    case 2:
+        break;
+}
+
+switch (a) {
+    case 1:
+        break;
+    case 2:
+        break;
+    default:
+        break;
+}
+
+switch (a) {
+    case 1:
+    case 2:
+        break;
+    case 3:
+        break;
+    default:
+        break;
+}
+
+switch (a) {
+    case 1:
+    case 2 + 3:
+        break;
+    case 3:
+        break;
+    case 4 + 2:
+    case 5:
+    default:
+        break;
+}
+
+switch (a) {
+    case 1:
+    case 2 + 3: break;
+    case 3: break;
+    case 4 + 2:
+    case 5:
+    default: break;
+}
+
+switch (a) {case 1:
+    case 2 + 3: break;
+    case 3: break;
+    case 4 + 2:
+    case 5:
+    default: break;}
+
+switch (a) {
+    case 1:
+        int x = 1;
+    default:
+        int y = 2;
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Synchronized_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Synchronized_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Synchronized_01.groovy
new file mode 100644
index 0000000..bc1bc88
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Synchronized_01.groovy
@@ -0,0 +1,54 @@
+/*
+ *  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.
+ */
+synchronized ('a')
+{
+    assert true
+}
+
+synchronized ('a') {
+    assert true
+}
+
+synchronized ('a') {assert true
+}
+
+synchronized ('a') {assert true}
+
+synchronized ('a') {assert true;}
+
+synchronized ('a') {
+    assert true
+    assert true
+}
+
+synchronized ('a') {
+    assert true;
+    assert true
+}
+
+synchronized ('a') {
+    assert true; assert true
+}
+
+synchronized ('a') {assert true; assert true
+}
+
+synchronized ('a') {assert true; assert true}
+
+synchronized ('a') {assert true; assert true;}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/Throw_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/Throw_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/Throw_01.groovy
new file mode 100644
index 0000000..f78903c
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Throw_01.groovy
@@ -0,0 +1,20 @@
+/*
+ *  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.
+ */
+throw e;
+throw e
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_01.groovy
new file mode 100644
index 0000000..b5ed026
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_01.groovy
@@ -0,0 +1,60 @@
+/*
+ *  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.
+ */
+package core
+
+trait A {}
+trait B<T> {}
+trait C<T extends A> {}
+trait D<T extends A & B> {}
+trait E<T extends A & B & C> {}
+trait F<T extends A & B & C> extends A {}
+trait F2 extends A<T> {}
+trait G1<T extends A & B & C> extends A implements X {}
+trait G2<T extends A & B & C> extends A<T> implements X<T> {}
+trait G3                      extends A<T> implements X<T> {}
+trait G4                      extends A    implements X<T> {}
+trait G5                      extends A    implements X    {}
+trait G2<T extends A & B & C> extends A<T> implements X<T> {}
+trait H<T extends A & B & C> extends A implements X, Y {}
+trait I<T extends A & B & C> extends A implements X, Y, Z {}
+public trait J<T extends A & B & C> extends A implements X, Y, Z {}
+@Test2 public trait K<T extends A & B & C> extends A implements X, Y, Z {}
+@Test2 @Test3 public trait L<T extends A & B & C> extends A implements X, Y, Z {}
+
+@Test2
+@Test3
+public
+trait M
+<
+        T extends
+        A &
+        B &
+        C
+>
+extends
+A
+implements
+X,
+Y,
+Z
+        {
+
+        }
+
+trait t {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_02.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_02.groovy b/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_02.groovy
new file mode 100644
index 0000000..6820b1f
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_02.groovy
@@ -0,0 +1,58 @@
+/*
+ *  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.
+ */
+trait AA {
+    {
+        println 123
+    }
+}
+
+trait BB {
+    static {
+        println '123'
+    }
+}
+
+trait CC {
+    static
+    {
+        println '123'
+    }
+}
+
+trait DD {
+    static {
+        println '123'
+    }
+
+    {
+        println 'abc'
+    }
+
+    static {
+        println '234'
+    }
+
+    {
+        println 'bcd'
+    }
+}
+
+trait EE {{}}
+trait FF {static {}}
+trait GG {static {};{}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_03.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_03.groovy b/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_03.groovy
new file mode 100644
index 0000000..2a68103
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_03.groovy
@@ -0,0 +1,66 @@
+/*
+ *  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.
+ */
+import java.sql.SQLException
+
+trait AAA {
+    public AAA() {
+
+    }
+
+    public AAA(String name) {
+
+    }
+
+    @Test2
+    public AAA(String name, int age) throws Exception {
+
+    }
+
+    AAA(String name, int age, String title) throws Exception {
+
+    }
+
+    private AAA(String name, int age, String title, double income) throws Exception {
+
+    }
+
+    @Test2
+    public String sayHello(String name) {
+        return "Hello, $name";
+    }
+
+    @Test2
+    public <T> T sayHello2(T name) throws IOException, SQLException {
+        return "Hello, $name";
+    }
+
+    public static privateStaticMethod(){}
+
+    public void m(final int param) {}
+    public void m2(def param) {}
+    public void m3(final int param1, long param2, final String param3) {}
+
+    def "hello world"(p1, p2) {
+        println "$p1, $p2"
+    }
+
+    def run() {
+        this."hello world"('ab', 'bc')
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_04.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_04.groovy b/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_04.groovy
new file mode 100644
index 0000000..7cd679c
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_04.groovy
@@ -0,0 +1,46 @@
+/*
+ *  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.
+ */
+public trait Person {
+    public static final SOME_CONSTANT = 'SOME_CONSTANT';
+    private String name = 'Daniel';
+    private int age;
+    @Test2
+    private String country = 'China',
+            location = 'Shanghai';
+
+    private String field, field2 = 'field2';
+    String someProperty;
+    String someProperty2 = 'someProperty2';
+    String someProperty3 = 'someProperty3',
+            someProperty4 = 'someProperty4';
+    String someProperty5, someProperty6 = 'someProperty6';
+    final String someProperty7 = 'someProperty7';
+    static final String someProperty8 = 'someProperty8';
+
+    @Test3
+    static final String someProperty9 = 'someProperty9';
+
+    protected static def protectedStaticDefField;
+}
+
+trait xx {
+    class yy {
+        enum zz {}
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_05.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_05.groovy b/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_05.groovy
new file mode 100644
index 0000000..625074e
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/TraitDeclaration_05.groovy
@@ -0,0 +1,41 @@
+/*
+ *  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.
+ */
+trait SwimmingAbility {
+    def swim() {
+        prt("swimming..")
+    }
+
+    abstract String prt(String msg);
+}
+
+trait FlyingAbility {
+    def fly() {
+        println "flying.."
+    }
+}
+
+class Duck implements SwimmingAbility, FlyingAbility {
+    String prt(String msg) {
+        println msg + " happily";
+    }
+}
+
+def duck = new Duck()
+duck.swim()
+duck.fly()

http://git-wip-us.apache.org/repos/asf/groovy/blob/2c01e99f/subprojects/parser-antlr4/src/test/resources/core/TryCatch_01.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/core/TryCatch_01.groovy b/subprojects/parser-antlr4/src/test/resources/core/TryCatch_01.groovy
new file mode 100644
index 0000000..d09e1c3
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/TryCatch_01.groovy
@@ -0,0 +1,130 @@
+/*
+ *  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.
+ */
+import java.sql.SQLException
+
+try {
+    assert true;
+} finally {
+    return 0;
+}
+
+try {
+    assert true;
+} catch(Exception e) {
+    assert false;
+}
+
+try {
+    assert true;
+} catch(Exception
+            e) {
+    assert false;
+}
+
+try {
+    assert true;
+} catch(e) {
+    assert false;
+}
+
+try {
+    assert true;
+} catch(e) {
+    assert false;
+} catch(t) {
+    assert false;
+}
+
+try {
+    assert true;
+} catch(final e) {
+    assert false;
+}
+
+try {
+    assert true;
+} catch(final Exception e) {
+    assert false;
+}
+
+try {
+    assert true;
+} catch(IOException e) {
+    assert false;
+} catch(Exception e) {
+    assert false;
+}
+
+try {
+    assert true;
+} catch(IOException e) {
+    assert false;
+} catch(Exception e) {
+    assert false;
+} finally {
+    return 0;
+}
+
+try
+{
+    assert true;
+}
+catch(IOException e)
+{
+    assert false;
+}
+catch(Exception e)
+{
+    assert false;
+}
+finally
+{
+    return 0;
+}
+
+try {
+    assert true;
+} catch(Exception e) {
+    assert false;
+} finally {
+    return 0;
+}
+
+try {
+    assert true;
+} catch(NullPointerException | IOException e) {
+    assert false;
+} finally {
+    return 0;
+}
+
+try {
+    assert true;
+} catch(NullPointerException | IOException e) {
+    assert false;
+}
+
+try {
+    assert true;
+} catch(NullPointerException |
+        IOException |
+        SQLException
+                e) {
+    assert false;
+}


[23/50] [abbrv] groovy git commit: adjust findbugs fix

Posted by pa...@apache.org.
adjust findbugs fix


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/8ed3fba2
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/8ed3fba2
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/8ed3fba2

Branch: refs/heads/parrot
Commit: 8ed3fba22ef6cbcae65708ab65108f7f9d85fdf1
Parents: 2c63110
Author: paulk <pa...@asert.com.au>
Authored: Sun May 7 23:34:35 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:10:18 2017 +1000

----------------------------------------------------------------------
 gradle/quality.gradle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/8ed3fba2/gradle/quality.gradle
----------------------------------------------------------------------
diff --git a/gradle/quality.gradle b/gradle/quality.gradle
index e57b552..b0a4bcf 100644
--- a/gradle/quality.gradle
+++ b/gradle/quality.gradle
@@ -141,7 +141,7 @@ allprojects {
         // hack to exclude html files since include by itself doesn't work
         def temp = classes
         temp.include '**/*.class'
-        classes = files(temp.files)
+        classes = temp
     }
 }
 


[03/50] [abbrv] groovy git commit: GROOVY-7579: Improve docs for invokeMethod (closes #528)

Posted by pa...@apache.org.
GROOVY-7579: Improve docs for invokeMethod (closes #528)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/8a17a1e2
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/8a17a1e2
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/8a17a1e2

Branch: refs/heads/parrot
Commit: 8a17a1e27e0b4106d65ca0c5f0d511c51d0a58f7
Parents: aff9fff
Author: John Wagenleitner <jw...@apache.org>
Authored: Sun Apr 23 16:06:13 2017 -0700
Committer: paulk <pa...@asert.com.au>
Committed: Thu May 11 08:03:50 2017 +1000

----------------------------------------------------------------------
 src/spec/doc/core-metaprogramming.adoc | 43 +++++++++++++++++------------
 1 file changed, 25 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/8a17a1e2/src/spec/doc/core-metaprogramming.adoc
----------------------------------------------------------------------
diff --git a/src/spec/doc/core-metaprogramming.adoc b/src/spec/doc/core-metaprogramming.adoc
index 52344fd..4609d7f 100644
--- a/src/spec/doc/core-metaprogramming.adoc
+++ b/src/spec/doc/core-metaprogramming.adoc
@@ -21,19 +21,19 @@
 
 = Metaprogramming
 
-The Groovy language supports two flavors of metaprogramming: runtime metaprogramming and compile-time metaprogramming.
-The first one allows altering the class model and the behavior of a program at runtime, while the second only occurs
-at compile-time. Both have pros and cons, that we will detail in this section.
+The Groovy language supports two flavors of metaprogramming: runtime and compile-time.
+The first allows altering the class model and the behavior of a program at runtime while the second only occurs
+at compile-time. Both have pros and cons that we will detail in this section.
 
 == Runtime metaprogramming
-With runtime metaprogramming we can postpone to runtime the decision to intercept, inject and even synthesize methods of classes and interfaces. For a deep understanding of Groovy MOP we need to understand Groovy objects and Groovy's method handling.
-In Groovy we work with three kinds of objects: POJO, POGO and Groovy Interceptors. Groovy allows metaprogramming for all types of objects but in different manner.
+With runtime metaprogramming we can postpone to runtime the decision to intercept, inject and even synthesize methods of classes and interfaces. For a deep understanding of Groovy's metaobject protocol (MOP) we need to understand Groovy objects and Groovy's method handling.
+In Groovy we work with three kinds of objects: POJO, POGO and Groovy Interceptors. Groovy allows metaprogramming for all types of objects but in a different manner.
 
-- POJO - A regular Java object, whose class can be written in Java or any other language for the JVM.
-- POGO - A Groovy object, whose class is written in Groovy. It extends `java.lang.Object` and implements the gapi:groovy.lang.GroovyObject[] interface by default.
-- Groovy Interceptor - A Groovy object that implements the gapi:groovy.lang.GroovyInterceptable[] interface and has method-interception capability, which we'll discuss in the <<core-metaprogramming.adoc#_groovyinterceptable,GroovyInterceptable>> section.
+- POJO - A regular Java object whose class can be written in Java or any other language for the JVM.
+- POGO - A Groovy object whose class is written in Groovy. It extends `java.lang.Object` and implements the gapi:groovy.lang.GroovyObject[] interface by default.
+- Groovy Interceptor - A Groovy object that implements the gapi:groovy.lang.GroovyInterceptable[] interface and has method-interception capability which is discussed in the <<core-metaprogramming.adoc#_groovyinterceptable,GroovyInterceptable>> section.
 
-For every method call Groovy checks whether the object is a POJO or a POGO. For POJOs, Groovy fetches it's `MetaClass` from the gapi:groovy.lang.MetaClassRegistry[] and delegates method invocation to it. For POGOs, Groovy takes more steps, as illustrated in the following figure:
+For every method call Groovy checks whether the object is a POJO or a POGO. For POJOs, Groovy fetches its `MetaClass` from the gapi:groovy.lang.MetaClassRegistry[] and delegates method invocation to it. For POGOs, Groovy takes more steps, as illustrated in the following figure:
 
 .Groovy interception mechanism
 image::assets/img/GroovyInterceptions.png[align="center"]
@@ -62,14 +62,21 @@ public interface GroovyObject {
 
 ==== invokeMethod
 
-According to the schema in <<core-metaprogramming.adoc#_runtime_metaprogramming,Runtime Metaprogramming>> this method is called when the method you called is not present on a Groovy object.
-Here is a simple example using a overridden `invokeMethod()` method:
+This method is primarily intended to be used in conjunction with the <<core-metaprogramming.adoc#_groovyinterceptable,GroovyInterceptable>>
+interface or an object's `MetaClass` where it will intercept all method calls.
+
+It is also invoked when the method called is not present on a Groovy object. Here is a simple example using an
+overridden `invokeMethod()` method:
 
 [source,groovy]
 ----
 include::{projectdir}/src/spec/test/metaprogramming/GroovyObjectTest.groovy[tags=groovy_invoke_method,indent=0]
 ----
 
+However, the use of `invokeMethod` to intercept missing methods is discouraged.  In cases where the intent is to only
+intercept method calls in the case of a failed method dispatch use <<core-metaprogramming.adoc#_methodmissing,methodMissing>>
+instead.
+
 ==== get/setProperty
 
 Every read access to a property can be intercepted by overriding the `getProperty()` method of the current object.
@@ -90,7 +97,7 @@ include::{projectdir}/src/spec/test/metaprogramming/GroovyObjectTest.groovy[tags
 
 ==== get/setMetaClass
 
-You can a access an object's `metaClass` or set your own `MetaClass` implementation for changing the default interception mechanism. For example you can write your own implementation of the `MetaClass` interface and assign to it to objects and accordingly change the interception mechanism:
+You can a access an object's `metaClass` or set your own `MetaClass` implementation for changing the default interception mechanism. For example, you can write your own implementation of the `MetaClass` interface and assign it to objects in order to change the interception mechanism:
 
 [source,groovy]
 ----
@@ -106,7 +113,7 @@ You can find an additional example in the <<core-metaprogramming.adoc#_groovyint
 
 === get/setAttribute
 
-This functionality is related to the `MetaClass` implementation. In the default implementation you can access fields without invoking their getters and setters. The examples below demonstrate this approach:
+This functionality is related to the `MetaClass` implementation. In the default implementation you can access fields without invoking their getters and setters. The examples below demonstrates this approach:
 
 [source, groovy]
 ----
@@ -121,7 +128,7 @@ include::{projectdir}/src/spec/test/metaprogramming/GroovyObjectTest.groovy[tags
 === methodMissing
 
 Groovy supports the concept of `methodMissing`. This method differs from `invokeMethod` in that it
-is only invoked in case of a failed method dispatch, when no method can be found for the given name and/or the
+is only invoked in the case of a failed method dispatch when no method can be found for the given name and/or the
 given arguments:
 
 [source,groovy]
@@ -131,7 +138,7 @@ include::{projectdir}/src/spec/test/metaprogramming/MethodPropertyMissingTest.gr
 
 Typically when using `methodMissing` it is possible to cache the result for the next time the same method is called.
 
-For example consider dynamic finders in GORM. These are implemented in terms of `methodMissing`. The code resembles
+For example, consider dynamic finders in GORM. These are implemented in terms of `methodMissing`. The code resembles
 something like this:
 
 [source,groovy]
@@ -194,7 +201,7 @@ package groovy.lang;
 public interface GroovyInterceptable extends GroovyObject {
 }
 ----
-When a Groovy object implements the `GroovyInterceptable` interface, it's `invokeMethod()` is called for any method calls. Below you can see a simple example of a object of this type:
+When a Groovy object implements the `GroovyInterceptable` interface, its `invokeMethod()` is called for any method calls. Below you can see a simple example of a object of this type:
 
 [source,groovy]
 ----
@@ -209,9 +216,9 @@ include::{projectdir}/src/spec/test/metaprogramming/InterceptableTest.groovy[tag
 ----
 
 [NOTE]
-We cannot use default groovy methods like `println` because these methods are injected into all groovy objects so they will be intercepted too.
+We cannot use default groovy methods like `println` because these methods are injected into all Groovy objects so they will be intercepted too.
 
-If we want to intercept all methods call but do not want to implement the `GroovyInterceptable` interface we can implement `invokeMethod()` on an object's `MetaClass`.
+If we want to intercept all method calls but do not want to implement the `GroovyInterceptable` interface we can implement `invokeMethod()` on an object's `MetaClass`.
 This approach works for both POGOs and POJOs, as shown by this example:
 
 [source,groovy]