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/08 07:32:35 UTC

[01/23] groovy git commit: Fix some tests which have not been covered by Parrot before

Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X 3b5d5266c -> eb2f9dde1


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/e23a4b2b
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/e23a4b2b
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/e23a4b2b

Branch: refs/heads/GROOVY_2_6_X
Commit: e23a4b2b4675b2595afdacfb142236178c0021e9
Parents: 3b5d526
Author: sunlan <su...@apache.org>
Authored: Fri May 5 20:26:01 2017 +0800
Committer: paulk <pa...@asert.com.au>
Committed: Mon May 8 17:26:10 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 | 106 +++++--
 .../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    |  34 ++
 .../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, 887 insertions(+), 211 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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 daeb7b3..2ea441d 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/e23a4b2b/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/e23a4b2b/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 ea5575d..2aa72fd 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;
@@ -466,6 +466,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) {
@@ -862,7 +872,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);
@@ -1078,11 +1088,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),
@@ -1233,7 +1256,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
@@ -1252,6 +1287,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);
@@ -1277,14 +1314,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());
 
@@ -1297,6 +1334,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) {
@@ -1343,25 +1386,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
@@ -1421,7 +1475,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) {
@@ -3502,7 +3556,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);
@@ -3759,7 +3819,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()),
@@ -4130,6 +4190,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);
         }
@@ -4284,6 +4353,7 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
         }
     }
 
+<<<<<<< HEAD
     /**
      * Process modifiers for AST nodes
      * <p>

http://git-wip-us.apache.org/repos/asf/groovy/blob/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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 ed0b531..f9d0caa 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
@@ -28,4 +28,38 @@ public interface SyntaxErrorReportable {
     String formatPositionInfo(int line, int column);
     int getSyntaxErrorSource();
     String genPositionInfo();
+
+    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/e23a4b2b/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 a125c42..9142530 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,61 +76,64 @@ 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"() {
@@ -156,211 +152,221 @@ class GroovyParserTest extends GroovyTestCase {
         }
     }
 
+    void "test groovy core - MethodReference"() {
+        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/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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()

http://git-wip-us.apache.org/repos/asf/groovy/blob/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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/e23a4b2b/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
+    }
+}


[19/23] 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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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


[22/23] 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/eb2f9dde/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 0eaa3a1..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)+ 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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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 aaec57b..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractLexer.java
+++ /dev/null
@@ -1,52 +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);
-    }
-
-    public void require(boolean condition, String msg, boolean toAttachPositionInfo) {
-        if (condition) {
-            return;
-        }
-
-        this.throwSyntaxError(msg, toAttachPositionInfo);
-    }
-    public void require(boolean condition, String msg) {
-        require(condition, msg, true);
-    }
-
-    public void throwSyntaxError(String msg, boolean toAttachPositionInfo) {
-        throw new GroovySyntaxError(msg + (toAttachPositionInfo ? this.genPositionInfo() : ""), this.getSyntaxErrorSource());
-    }
-
-    public String formatPositionInfo(int line, int column) {
-        return " @ line " + line + ", column " + column;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/eb2f9dde/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 1ba6ca3..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractParser.java
+++ /dev/null
@@ -1,51 +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);
-    }
-
-    public void require(boolean condition, String msg, boolean toAttachPositionInfo) {
-        if (condition) {
-            return;
-        }
-
-        this.throwSyntaxError(msg, toAttachPositionInfo);
-    }
-    public void require(boolean condition, String msg) {
-        require(condition, msg, true);
-    }
-
-    public void throwSyntaxError(String msg, boolean toAttachPositionInfo) {
-        throw new GroovySyntaxError(msg + (toAttachPositionInfo ? this.genPositionInfo() : ""), this.getSyntaxErrorSource());
-    }
-
-    public String formatPositionInfo(int line, int column) {
-        return " @ line " + line + ", column " + column;
-    }
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/eb2f9dde/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/eb2f9dde/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();
-    }
-}


[21/23] 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/eb2f9dde/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 8228ed2..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
+++ /dev/null
@@ -1,4691 +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 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());
-
-        for (StatementContext s : ctx.statement()) {
-            Object e = this.visit(s);
-            if (e instanceof DeclarationListStatement) { // local variable declaration
-                for (Statement ds : ((DeclarationListStatement) e).getDeclarationStatements()) {
-                    moduleNode.addStatement(ds);
-                }
-            } else if (e instanceof Statement) {
-                moduleNode.addStatement((Statement) e);
-            } else if (e instanceof MethodNode) { // script method
-                moduleNode.addMethod((MethodNode) e);
-            }
-        }
-        for (ClassNode cl : this.classNodeList) {
-            moduleNode.addClass(cl);
-        }
-        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();
-
-        for (AnnotationNode e : this.visitAnnotationsOpt(ctx.annotationsOpt())) {
-            packageNode.addAnnotation(e);
-        }
-
-        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<QualifiedNameElementContext> identifierList = new LinkedList<>(ctx.qualifiedName().qualifiedNameElement());
-                int identifierListSize = identifierList.size();
-                String name = identifierList.get(identifierListSize - 1).getText();
-                StringBuilder builder = new StringBuilder();
-                long limit = identifierListSize - 1;
-                for (GroovyParserRuleContext groovyParserRuleContext : identifierList) {
-                    if (limit-- == 0) break;
-                    String text = groovyParserRuleContext.getText();
-                    if (builder.length() > 0) {
-                        builder.append(DOT_STR);
-                    }
-                    builder.append(text);
-                }
-                ClassNode classNode =
-                        ClassHelper.make(
-                                builder.toString());
-                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.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, (Expression)closureListExpression);
-        }
-
-        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())) {
-            for (ExpressionStatement e : this.visitResources(ctx.resources())) {
-                tryCatchStatement.addResource(e);
-            }
-        }
-
-        for (CatchClauseContext cc : ctx.catchClause()) {
-            List<CatchStatement> list = this.visitCatchClause(cc);
-            for (CatchStatement cs : list) {
-                tryCatchStatement.addCatch(cs);
-            }
-        }
-        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) {
-        List<ExpressionStatement> list = new ArrayList<>();
-        for (ResourceContext resourceContext : ctx.resource()) {
-            ExpressionStatement expressionStatement = visitResource(resourceContext);
-            list.add(expressionStatement);
-        }
-        return list;
-    }
-
-    @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*
-
-        List<CatchStatement> list = new ArrayList<>();
-        for (ClassNode e : this.visitCatchType(ctx.catchType())) {
-            CatchStatement catchStatement = 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());
-            list.add(catchStatement);
-        }
-        return list;
-    }
-
-    @Override
-    public List<ClassNode> visitCatchType(CatchTypeContext ctx) {
-        if (!asBoolean(ctx)) {
-            return Collections.singletonList(ClassHelper.OBJECT_TYPE);
-        }
-
-        List<ClassNode> list = new ArrayList<>();
-        for (QualifiedClassNameContext qualifiedClassNameContext : ctx.qualifiedClassName()) {
-            ClassNode classNode = visitQualifiedClassName(qualifiedClassNameContext);
-            list.add(classNode);
-        }
-        return list;
-    }
-
-
-    @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 = new LinkedList<>();
-        for (SwitchBlockStatementGroupContext c : ctx.switchBlockStatementGroup()) {
-            statementList.addAll(this.visitSwitchBlockStatementGroup(c));
-        }
-
-        List<CaseStatement> caseStatementList = new LinkedList<>();
-        List<Statement> defaultStatementList = new LinkedList<>();
-
-        for (Statement e : statementList) {
-            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);
-
-        List<Statement> statementList = new ArrayList<>(4);
-        for (SwitchLabelContext e : ctx.switchLabel()) {
-            Pair<Token, Expression> pair = this.visitSwitchLabel(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(), (Expression) 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) {
-        for (ClassBodyDeclarationContext c : ctx.classBody().classBodyDeclaration()) {
-            MemberDeclarationContext memberDeclarationContext = c.memberDeclaration();
-            if(memberDeclarationContext != null) {
-                MethodDeclarationContext methodDeclarationContext = memberDeclarationContext.methodDeclaration();
-                if (methodDeclarationContext != null) {
-                    if (createModifierManager(methodDeclarationContext).contains(DEFAULT)) {
-                        return true;
-                    }
-                }
-            }
-        }
-        return false;
-    }
-
-    @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());
-        }
-
-        for (ClassBodyDeclarationContext e : ctx.classBodyDeclaration()) {
-            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");
-
-        List<FieldNode> list = new LinkedList<>();
-        for (EnumConstantContext e : ctx.enumConstant()) {
-            e.putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
-            list.add(visitEnumConstant(e));
-        }
-        return list;
-    }
-
-    @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));
-
-        for (AnnotationNode a : this.visitAnnotationsOpt(ctx.annotationsOpt())) {
-            enumConstant.addAnnotation(a);
-        }
-
-        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();
-                List<Expression> list = new ArrayList<>();
-                for (MapEntryExpression e : mapEntryExpressionList) {
-                    Expression e1 = (Expression) e;
-                    list.add(e1);
-                }
-                ListExpression listExpression =
-                        new ListExpression(
-                                list);
-
-                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;
-        }
-
-        List<GenericsType> list = new ArrayList<>();
-        for (TypeParameterContext typeParameterContext : ctx.typeParameter()) {
-            GenericsType genericsType = visitTypeParameter(typeParameterContext);
-            list.add(genericsType);
-        }
-        return list.toArray(new GenericsType[0]);
-    }
-
-    @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;
-        }
-
-        List<ClassNode> list = new ArrayList<>();
-        for (TypeContext typeContext : ctx.type()) {
-            ClassNode classNode = visitType(typeContext);
-            list.add(classNode);
-        }
-        return list.toArray(new ClassNode[0]);
-    }
-
-    @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<InnerClassNode>());
-        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);
-        }
-        for (InnerClassNode e : anonymousInnerClassList) {
-            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)) {
-            for (Parameter e : methodNode.getParameters()) {
-                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);
-        }
-
-        List<Expression> list = new ArrayList<>();
-        for (Expression e : this.visitTypeNamePairs(ctx.typeNamePairs())) {
-            modifierManager.processVariableExpression((VariableExpression) e);
-            list.add(e);
-        }
-        return this.configureAST(
-                new DeclarationListStatement(
-                        this.configureAST(
-                                modifierManager.attachAnnotations(
-                                        new DeclarationExpression(
-                                                new ArgumentListExpression(
-                                                        list
-                                                ),
-                                                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);
-        }
-
-        for (DeclarationExpression e : declarationExpressionList) {
-            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) {
-        for (DeclarationExpression e : declarationExpressionList) {
-            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) {
-        List<Expression> list = new ArrayList<>();
-        for (TypeNamePairContext typeNamePairContext : ctx.typeNamePair()) {
-            VariableExpression variableExpression = visitTypeNamePair(typeNamePairContext);
-            list.add(variableExpression);
-        }
-        return list;
-    }
-
-    @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");
-
-        List<DeclarationExpression> list = new LinkedList<>();
-        for (VariableDeclaratorContext e : ctx.variableDeclarator()) {
-            e.putNodeMetaData(VARIABLE_DECLARATION_VARIABLE_TYPE, variableType);
-            list.add(this.visitVariableDeclarator(e));
-            }
-            return list;
-    }
-
-    @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();
-        }
-
-        List<Expression> list = new ArrayList<>();
-        for (VariableInitializerContext variableInitializerContext : ctx.variableInitializer()) {
-            Expression expression = visitVariableInitializer(variableInitializerContext);
-            list.add(expression);
-        }
-        return list;
-    }
-
-    @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);
-        }
-
-        Expression r = methodCallExpression;
-        for (CommandArgumentContext commandArgumentContext : ctx.commandArgument()) {
-            commandArgumentContext.putNodeMetaData(CMD_EXPRESSION_BASE_EXPR, r);
-            r = this.visitCommandArgument(commandArgumentContext);
-        }
-
-        return this.configureAST(r, 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 {
-                List<Expression> list = new LinkedList<>();
-                for (MapEntryExpression e : mapEntryExpressionList) {
-                    list.add(e.getKeyExpression() instanceof SpreadMapExpression ?
-                            e.getKeyExpression() : e);
-                }
-                ListExpression listExpression = this.configureAST(new ListExpression(list), 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


<TRUNCATED>

[03/23] 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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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


[15/23] 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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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..c955408
--- /dev/null
+++ b/subprojects/parser-antlr4/build.gradle
@@ -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.
+ */
+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");
+
+
+allprojects {
+   tasks.withType(GroovyCompile) {
+        groovyOptions.forkOptions.jvmArgs += ["-Dgroovy.antlr4=true"]
+    }
+}
+
+test {
+    jvmArgs "-Dgroovy.extract.doc.comment=true", "-Dgroovy.antlr4.cache.threshold=100"
+}
\ No newline at end of file


[18/23] 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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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 adbab99..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/resources/core/Array_01x.groovy
+++ /dev/null
@@ -1,90 +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'
-}
-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'
-}
-testArrayInitializerCS();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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


[08/23] 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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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;
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/eb2f9dde/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
+


[09/23] 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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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

http://git-wip-us.apache.org/repos/asf/groovy/blob/eb2f9dde/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


[02/23] 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/8405be03
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/8405be03
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/8405be03

Branch: refs/heads/GROOVY_2_6_X
Commit: 8405be0381001ceb7b1592d06920be7dd8dcc230
Parents: e23a4b2
Author: sunlan <su...@apache.org>
Authored: Sat May 6 01:00:36 2017 +0800
Committer: paulk <pa...@asert.com.au>
Committed: Mon May 8 17:30:33 2017 +1000

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


http://git-wip-us.apache.org/repos/asf/groovy/blob/8405be03/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 2aa72fd..8228ed2 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
@@ -1314,14 +1314,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());
 
@@ -1333,6 +1333,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);
@@ -3542,13 +3547,9 @@ public class AstBuilder extends GroovyParserBaseVisitor<Object> implements Groov
             Statement statement = visitBlockStatement(blockStatementContext);
             list.add(statement);
         }
-        return this.configureAST(
-                this.createBlockStatement(
-                        list),
-                ctx);
+        return this.configureAST(this.createBlockStatement(list), ctx);
     }
 
-
     @Override
     public Statement visitBlockStatement(BlockStatementContext ctx) {
         if (asBoolean(ctx.localVariableDeclaration())) {

http://git-wip-us.apache.org/repos/asf/groovy/blob/8405be03/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 9142530..77eba20 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,64 +83,64 @@ 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"() {
@@ -152,221 +159,218 @@ class GroovyParserTest extends GroovyTestCase {
         }
     }
 
-    void "test groovy core - MethodReference"() {
-        TestUtils.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/8405be03/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


[14/23] 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/eb2f9dde/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/eb2f9dde/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..0eaa3a1
--- /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)+ 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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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..aaec57b
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractLexer.java
@@ -0,0 +1,52 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT 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);
+    }
+
+    public void require(boolean condition, String msg, boolean toAttachPositionInfo) {
+        if (condition) {
+            return;
+        }
+
+        this.throwSyntaxError(msg, toAttachPositionInfo);
+    }
+    public void require(boolean condition, String msg) {
+        require(condition, msg, true);
+    }
+
+    public void throwSyntaxError(String msg, boolean toAttachPositionInfo) {
+        throw new GroovySyntaxError(msg + (toAttachPositionInfo ? this.genPositionInfo() : ""), this.getSyntaxErrorSource());
+    }
+
+    public String formatPositionInfo(int line, int column) {
+        return " @ line " + line + ", column " + column;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/eb2f9dde/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..1ba6ca3
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AbstractParser.java
@@ -0,0 +1,51 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT 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);
+    }
+
+    public void require(boolean condition, String msg, boolean toAttachPositionInfo) {
+        if (condition) {
+            return;
+        }
+
+        this.throwSyntaxError(msg, toAttachPositionInfo);
+    }
+    public void require(boolean condition, String msg) {
+        require(condition, msg, true);
+    }
+
+    public void throwSyntaxError(String msg, boolean toAttachPositionInfo) {
+        throw new GroovySyntaxError(msg + (toAttachPositionInfo ? this.genPositionInfo() : ""), this.getSyntaxErrorSource());
+    }
+
+    public String formatPositionInfo(int line, int column) {
+        return " @ line " + line + ", column " + column;
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/eb2f9dde/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/eb2f9dde/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();
+    }
+}


[11/23] 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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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


[04/23] 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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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 {


[10/23] 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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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..adbab99
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/resources/core/Array_01x.groovy
@@ -0,0 +1,90 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT 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'
+}
+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'
+}
+testArrayInitializerCS();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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();

http://git-wip-us.apache.org/repos/asf/groovy/blob/eb2f9dde/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


[16/23] 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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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;
-}


[13/23] 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/eb2f9dde/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..8228ed2
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
@@ -0,0 +1,4691 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT 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 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());
+
+        for (StatementContext s : ctx.statement()) {
+            Object e = this.visit(s);
+            if (e instanceof DeclarationListStatement) { // local variable declaration
+                for (Statement ds : ((DeclarationListStatement) e).getDeclarationStatements()) {
+                    moduleNode.addStatement(ds);
+                }
+            } else if (e instanceof Statement) {
+                moduleNode.addStatement((Statement) e);
+            } else if (e instanceof MethodNode) { // script method
+                moduleNode.addMethod((MethodNode) e);
+            }
+        }
+        for (ClassNode cl : this.classNodeList) {
+            moduleNode.addClass(cl);
+        }
+        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();
+
+        for (AnnotationNode e : this.visitAnnotationsOpt(ctx.annotationsOpt())) {
+            packageNode.addAnnotation(e);
+        }
+
+        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<QualifiedNameElementContext> identifierList = new LinkedList<>(ctx.qualifiedName().qualifiedNameElement());
+                int identifierListSize = identifierList.size();
+                String name = identifierList.get(identifierListSize - 1).getText();
+                StringBuilder builder = new StringBuilder();
+                long limit = identifierListSize - 1;
+                for (GroovyParserRuleContext groovyParserRuleContext : identifierList) {
+                    if (limit-- == 0) break;
+                    String text = groovyParserRuleContext.getText();
+                    if (builder.length() > 0) {
+                        builder.append(DOT_STR);
+                    }
+                    builder.append(text);
+                }
+                ClassNode classNode =
+                        ClassHelper.make(
+                                builder.toString());
+                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.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, (Expression)closureListExpression);
+        }
+
+        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())) {
+            for (ExpressionStatement e : this.visitResources(ctx.resources())) {
+                tryCatchStatement.addResource(e);
+            }
+        }
+
+        for (CatchClauseContext cc : ctx.catchClause()) {
+            List<CatchStatement> list = this.visitCatchClause(cc);
+            for (CatchStatement cs : list) {
+                tryCatchStatement.addCatch(cs);
+            }
+        }
+        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) {
+        List<ExpressionStatement> list = new ArrayList<>();
+        for (ResourceContext resourceContext : ctx.resource()) {
+            ExpressionStatement expressionStatement = visitResource(resourceContext);
+            list.add(expressionStatement);
+        }
+        return list;
+    }
+
+    @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*
+
+        List<CatchStatement> list = new ArrayList<>();
+        for (ClassNode e : this.visitCatchType(ctx.catchType())) {
+            CatchStatement catchStatement = 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());
+            list.add(catchStatement);
+        }
+        return list;
+    }
+
+    @Override
+    public List<ClassNode> visitCatchType(CatchTypeContext ctx) {
+        if (!asBoolean(ctx)) {
+            return Collections.singletonList(ClassHelper.OBJECT_TYPE);
+        }
+
+        List<ClassNode> list = new ArrayList<>();
+        for (QualifiedClassNameContext qualifiedClassNameContext : ctx.qualifiedClassName()) {
+            ClassNode classNode = visitQualifiedClassName(qualifiedClassNameContext);
+            list.add(classNode);
+        }
+        return list;
+    }
+
+
+    @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 = new LinkedList<>();
+        for (SwitchBlockStatementGroupContext c : ctx.switchBlockStatementGroup()) {
+            statementList.addAll(this.visitSwitchBlockStatementGroup(c));
+        }
+
+        List<CaseStatement> caseStatementList = new LinkedList<>();
+        List<Statement> defaultStatementList = new LinkedList<>();
+
+        for (Statement e : statementList) {
+            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);
+
+        List<Statement> statementList = new ArrayList<>(4);
+        for (SwitchLabelContext e : ctx.switchLabel()) {
+            Pair<Token, Expression> pair = this.visitSwitchLabel(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(), (Expression) 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) {
+        for (ClassBodyDeclarationContext c : ctx.classBody().classBodyDeclaration()) {
+            MemberDeclarationContext memberDeclarationContext = c.memberDeclaration();
+            if(memberDeclarationContext != null) {
+                MethodDeclarationContext methodDeclarationContext = memberDeclarationContext.methodDeclaration();
+                if (methodDeclarationContext != null) {
+                    if (createModifierManager(methodDeclarationContext).contains(DEFAULT)) {
+                        return true;
+                    }
+                }
+            }
+        }
+        return false;
+    }
+
+    @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());
+        }
+
+        for (ClassBodyDeclarationContext e : ctx.classBodyDeclaration()) {
+            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");
+
+        List<FieldNode> list = new LinkedList<>();
+        for (EnumConstantContext e : ctx.enumConstant()) {
+            e.putNodeMetaData(CLASS_DECLARATION_CLASS_NODE, classNode);
+            list.add(visitEnumConstant(e));
+        }
+        return list;
+    }
+
+    @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));
+
+        for (AnnotationNode a : this.visitAnnotationsOpt(ctx.annotationsOpt())) {
+            enumConstant.addAnnotation(a);
+        }
+
+        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();
+                List<Expression> list = new ArrayList<>();
+                for (MapEntryExpression e : mapEntryExpressionList) {
+                    Expression e1 = (Expression) e;
+                    list.add(e1);
+                }
+                ListExpression listExpression =
+                        new ListExpression(
+                                list);
+
+                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;
+        }
+
+        List<GenericsType> list = new ArrayList<>();
+        for (TypeParameterContext typeParameterContext : ctx.typeParameter()) {
+            GenericsType genericsType = visitTypeParameter(typeParameterContext);
+            list.add(genericsType);
+        }
+        return list.toArray(new GenericsType[0]);
+    }
+
+    @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;
+        }
+
+        List<ClassNode> list = new ArrayList<>();
+        for (TypeContext typeContext : ctx.type()) {
+            ClassNode classNode = visitType(typeContext);
+            list.add(classNode);
+        }
+        return list.toArray(new ClassNode[0]);
+    }
+
+    @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<InnerClassNode>());
+        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);
+        }
+        for (InnerClassNode e : anonymousInnerClassList) {
+            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)) {
+            for (Parameter e : methodNode.getParameters()) {
+                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);
+        }
+
+        List<Expression> list = new ArrayList<>();
+        for (Expression e : this.visitTypeNamePairs(ctx.typeNamePairs())) {
+            modifierManager.processVariableExpression((VariableExpression) e);
+            list.add(e);
+        }
+        return this.configureAST(
+                new DeclarationListStatement(
+                        this.configureAST(
+                                modifierManager.attachAnnotations(
+                                        new DeclarationExpression(
+                                                new ArgumentListExpression(
+                                                        list
+                                                ),
+                                                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);
+        }
+
+        for (DeclarationExpression e : declarationExpressionList) {
+            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) {
+        for (DeclarationExpression e : declarationExpressionList) {
+            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) {
+        List<Expression> list = new ArrayList<>();
+        for (TypeNamePairContext typeNamePairContext : ctx.typeNamePair()) {
+            VariableExpression variableExpression = visitTypeNamePair(typeNamePairContext);
+            list.add(variableExpression);
+        }
+        return list;
+    }
+
+    @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");
+
+        List<DeclarationExpression> list = new LinkedList<>();
+        for (VariableDeclaratorContext e : ctx.variableDeclarator()) {
+            e.putNodeMetaData(VARIABLE_DECLARATION_VARIABLE_TYPE, variableType);
+            list.add(this.visitVariableDeclarator(e));
+            }
+            return list;
+    }
+
+    @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();
+        }
+
+        List<Expression> list = new ArrayList<>();
+        for (VariableInitializerContext variableInitializerContext : ctx.variableInitializer()) {
+            Expression expression = visitVariableInitializer(variableInitializerContext);
+            list.add(expression);
+        }
+        return list;
+    }
+
+    @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);
+        }
+
+        Expression r = methodCallExpression;
+        for (CommandArgumentContext commandArgumentContext : ctx.commandArgument()) {
+            commandArgumentContext.putNodeMetaData(CMD_EXPRESSION_BASE_EXPR, r);
+            r = this.visitCommandArgument(commandArgumentContext);
+        }
+
+        return this.configureAST(r, 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 {
+                List<Expression> list = new LinkedList<>();
+                for (MapEntryExpression e : mapEntryExpressionList) {
+                    list.add(e.getKeyExpression() instanceof SpreadMapExpression ?
+                            e.getKeyExpression() : e);
+                }
+                ListExpression listExpression = this.configureAST(new ListExpression(list), 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

<TRUNCATED>

[06/23] 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/c60c5edc
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/c60c5edc
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/c60c5edc

Branch: refs/heads/GROOVY_2_6_X
Commit: c60c5edc024fe5a9a723ded9bbbe1ecde13a6e2a
Parents: 8405be0
Author: paulk <pa...@asert.com.au>
Authored: Mon May 8 10:22:08 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Mon May 8 17:31:25 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   | 18 ++++++
 .../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, 3912 insertions(+), 105 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/settings.gradle
----------------------------------------------------------------------
diff --git a/settings.gradle b/settings.gradle
index 64575ff..1269c0e 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -34,6 +34,7 @@ def subprojects = ['groovy-ant',
         'tests-vm8',
         'groovy-testng',
         'groovy-xml',
+        'groovy-parser-antlr4',
         'groovy-macro'
 ]
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/c60c5edc/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/c60c5edc/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/c60c5edc/subprojects/groovy-parser-antlr4/build.gradle
----------------------------------------------------------------------
diff --git a/subprojects/groovy-parser-antlr4/build.gradle b/subprojects/groovy-parser-antlr4/build.gradle
index a2afecc..08d19df 100644
--- a/subprojects/groovy-parser-antlr4/build.gradle
+++ b/subprojects/groovy-parser-antlr4/build.gradle
@@ -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 (!rootProject.hasProperty('useAntlr4')) return
 
 apply plugin: 'me.champeau.gradle.antlr4'

http://git-wip-us.apache.org/repos/asf/groovy/blob/c60c5edc/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/c60c5edc/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 2ea441d..0eaa3a1 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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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 9982d63..52b7f36 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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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 033cb34..adbab99 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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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


[23/23] 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/eb2f9dde
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/eb2f9dde
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/eb2f9dde

Branch: refs/heads/GROOVY_2_6_X
Commit: eb2f9dde1a0cebe8320b5ba3f8897dae6b555a7f
Parents: c60c5ed
Author: paulk <pa...@asert.com.au>
Authored: Mon May 8 10:26:36 2017 +1000
Committer: paulk <pa...@asert.com.au>
Committed: Mon May 8 17:31:52 2017 +1000

----------------------------------------------------------------------
 build.gradle                                    |    2 +-
 settings.gradle                                 |    1 -
 subprojects/groovy-parser-antlr4/README.adoc    |   59 -
 subprojects/groovy-parser-antlr4/build.gradle   |   77 -
 .../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     |   52 -
 .../groovy/parser/antlr4/AbstractParser.java    |   51 -
 .../parser/antlr4/Antlr4ParserPlugin.java       |   45 -
 .../parser/antlr4/Antlr4PluginFactory.java      |   35 -
 .../apache/groovy/parser/antlr4/AstBuilder.java | 4691 ------------------
 .../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    |   65 -
 .../TryWithResourcesASTTransformation.java      |  376 --
 .../parser/antlr4/internal/AtnManager.java      |  107 -
 .../internal/DescriptiveErrorStrategy.java      |  110 -
 .../groovy/parser/antlr4/util/StringUtils.java  |  154 -
 .../parser/antlr4/GroovyParserTest.groovy       |  376 --
 .../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    |   90 -
 .../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          |   77 +
 .../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     |   52 +
 .../groovy/parser/antlr4/AbstractParser.java    |   51 +
 .../parser/antlr4/Antlr4ParserPlugin.java       |   45 +
 .../parser/antlr4/Antlr4PluginFactory.java      |   35 +
 .../apache/groovy/parser/antlr4/AstBuilder.java | 4691 ++++++++++++++++++
 .../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    |   65 +
 .../TryWithResourcesASTTransformation.java      |  376 ++
 .../parser/antlr4/internal/AtnManager.java      |  107 +
 .../internal/DescriptiveErrorStrategy.java      |  110 +
 .../groovy/parser/antlr4/util/StringUtils.java  |  154 +
 .../parser/antlr4/GroovyParserTest.groovy       |  376 ++
 .../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    |   90 +
 .../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, 19840 insertions(+), 19841 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/eb2f9dde/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 63776eb..fe053a7 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/eb2f9dde/settings.gradle
----------------------------------------------------------------------
diff --git a/settings.gradle b/settings.gradle
index 1269c0e..64575ff 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -34,7 +34,6 @@ def subprojects = ['groovy-ant',
         'tests-vm8',
         'groovy-testng',
         'groovy-xml',
-        'groovy-parser-antlr4',
         'groovy-macro'
 ]
 

http://git-wip-us.apache.org/repos/asf/groovy/blob/eb2f9dde/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/eb2f9dde/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 08d19df..0000000
--- a/subprojects/groovy-parser-antlr4/build.gradle
+++ /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.
- */
-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");
-
-
-allprojects {
-   tasks.withType(GroovyCompile) {
-        groovyOptions.forkOptions.jvmArgs += ["-Dgroovy.antlr4=true"]
-    }
-}
-
-test {
-    jvmArgs "-Dgroovy.extract.doc.comment=true", "-Dgroovy.antlr4.cache.threshold=100"
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/eb2f9dde/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
-    :   .
-    ;


[05/23] 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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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/c60c5edc/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


[17/23] 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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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


[07/23] 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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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
+    }
+}


[20/23] 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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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 f9d0caa..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SyntaxErrorReportable.java
+++ /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.
- */
-package org.apache.groovy.parser.antlr4;
-
-/**
- * A SyntaxErrorReportable is a recognizer that can report syntax error
- */
-public interface SyntaxErrorReportable {
-    void require(boolean condition, String msg, boolean toAttachPositionInfo);
-    void require(boolean condition, String msg);
-    void throwSyntaxError(String msg, boolean toAttachPositionInfo);
-    String formatPositionInfo(int line, int column);
-    int getSyntaxErrorSource();
-    String genPositionInfo();
-
-    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/eb2f9dde/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 52b7f36..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/TryWithResourcesASTTransformation.java
+++ /dev/null
@@ -1,376 +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.Expression;
-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);
-
-        for(ExpressionStatement e : tryCatchStatement.getResourceStatements()) {
-            newTryWithResourcesStatement.addResource(e);
-        }
-
-        /*
-         *   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());
-
-        for (CatchStatement s : tryCatchStatement.getCatchStatements()) {
-            newTryCatchStatement.addCatch(s);
-        }
-        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());
-        for(ExpressionStatement s: tailResourceStatements) {
-            newTryCatchStatement.addResource(s);
-        }
-
-        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((Expression) new VariableExpression(suppressedExcName))));
-        addSuppressedMethodCallExpression.setImplicitThis(false);
-        addSuppressedMethodCallExpression.setSafe(true);
-
-        return new ExpressionStatement(addSuppressedMethodCallExpression);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/groovy/blob/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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 980facb..0000000
--- a/subprojects/groovy-parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java
+++ /dev/null
@@ -1,154 +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) {
-		int length = text.length();
-		int count = 0;
-		for(int i = 0; i<length; ++i) {
-			if (text.charAt(i) == c) count++;
-		}
-		return count; // return text.chars().filter(e -> c == e).count();
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/eb2f9dde/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 77eba20..0000000
--- a/subprojects/groovy-parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
+++ /dev/null
@@ -1,376 +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"() {
-        if (Runtime.class.getPackage().getImplementationVersion().startsWith("1.7.")) {
-            doRunAndTest('core/Lambda_01x_1_7.groovy');
-        } else {
-            doRunAndTest('core/Lambda_01x.groovy');
-        }
-    }
-
-    void "test groovy core - MethodReference"() {
-        if (Runtime.class.getPackage().getImplementationVersion().startsWith("1.7.")) {
-            doRunAndTest('core/MethodReference_01x_1_7.groovy');
-        } else {
-            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');
-    }
-}


[12/23] 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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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..f9d0caa
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/SyntaxErrorReportable.java
@@ -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.
+ */
+package org.apache.groovy.parser.antlr4;
+
+/**
+ * A SyntaxErrorReportable is a recognizer that can report syntax error
+ */
+public interface SyntaxErrorReportable {
+    void require(boolean condition, String msg, boolean toAttachPositionInfo);
+    void require(boolean condition, String msg);
+    void throwSyntaxError(String msg, boolean toAttachPositionInfo);
+    String formatPositionInfo(int line, int column);
+    int getSyntaxErrorSource();
+    String genPositionInfo();
+
+    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/eb2f9dde/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..52b7f36
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/TryWithResourcesASTTransformation.java
@@ -0,0 +1,376 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT 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.Expression;
+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);
+
+        for(ExpressionStatement e : tryCatchStatement.getResourceStatements()) {
+            newTryWithResourcesStatement.addResource(e);
+        }
+
+        /*
+         *   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());
+
+        for (CatchStatement s : tryCatchStatement.getCatchStatements()) {
+            newTryCatchStatement.addCatch(s);
+        }
+        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());
+        for(ExpressionStatement s: tailResourceStatements) {
+            newTryCatchStatement.addResource(s);
+        }
+
+        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((Expression) new VariableExpression(suppressedExcName))));
+        addSuppressedMethodCallExpression.setImplicitThis(false);
+        addSuppressedMethodCallExpression.setSafe(true);
+
+        return new ExpressionStatement(addSuppressedMethodCallExpression);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/eb2f9dde/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/eb2f9dde/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/eb2f9dde/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..980facb
--- /dev/null
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java
@@ -0,0 +1,154 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT 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) {
+		int length = text.length();
+		int count = 0;
+		for(int i = 0; i<length; ++i) {
+			if (text.charAt(i) == c) count++;
+		}
+		return count; // return text.chars().filter(e -> c == e).count();
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/eb2f9dde/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..77eba20
--- /dev/null
+++ b/subprojects/parser-antlr4/src/test/groovy/org/apache/groovy/parser/antlr4/GroovyParserTest.groovy
@@ -0,0 +1,376 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT 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"() {
+        if (Runtime.class.getPackage().getImplementationVersion().startsWith("1.7.")) {
+            doRunAndTest('core/Lambda_01x_1_7.groovy');
+        } else {
+            doRunAndTest('core/Lambda_01x.groovy');
+        }
+    }
+
+    void "test groovy core - MethodReference"() {
+        if (Runtime.class.getPackage().getImplementationVersion().startsWith("1.7.")) {
+            doRunAndTest('core/MethodReference_01x_1_7.groovy');
+        } else {
+            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');
+    }
+}