Search in sources :

Example 1 with DEFAULT

use of org.apache.groovy.parser.antlr4.GroovyLexer.DEFAULT in project groovy by apache.

the class AstBuilder method visitSwitchBlockStatementExpressionGroup.

@Override
@SuppressWarnings("unchecked")
public Tuple3<List<Statement>, Boolean, Boolean> visitSwitchBlockStatementExpressionGroup(SwitchBlockStatementExpressionGroupContext ctx) {
    int labelCnt = ctx.switchExpressionLabel().size();
    List<Token> firstLabelHolder = new ArrayList<>(1);
    final int[] arrowCntHolder = new int[1];
    boolean[] isArrowHolder = new boolean[1];
    boolean[] hasResultStmtHolder = new boolean[1];
    List<Statement> result = (List<Statement>) ctx.switchExpressionLabel().stream().map(e -> (Object) this.visitSwitchExpressionLabel(e)).reduce(new ArrayList<Statement>(4), (r, e) -> {
        List<Statement> statementList = (List<Statement>) r;
        Tuple3<Token, List<Expression>, Integer> tuple = (Tuple3<Token, List<Expression>, Integer>) e;
        boolean isArrow = ARROW == tuple.getV3();
        isArrowHolder[0] = isArrow;
        if (isArrow) {
            if (++arrowCntHolder[0] > 1 && !firstLabelHolder.isEmpty()) {
                throw createParsingFailedException("`case ... ->` does not support falling through cases", firstLabelHolder.get(0));
            }
        }
        boolean isLast = labelCnt - 1 == statementList.size();
        BlockStatement codeBlock = this.visitBlockStatements(ctx.blockStatements());
        List<Statement> statements = codeBlock.getStatements();
        int statementsCnt = statements.size();
        if (0 == statementsCnt) {
            throw createParsingFailedException("`yield` is expected", ctx.blockStatements());
        }
        if (isArrow && statementsCnt > 1) {
            throw createParsingFailedException("Expect only 1 statement, but " + statementsCnt + " statements found", ctx.blockStatements());
        }
        if (!isArrow) {
            boolean[] hasYieldHolder = new boolean[1];
            boolean[] hasThrowHolder = new boolean[1];
            codeBlock.visit(new CodeVisitorSupport() {

                @Override
                public void visitReturnStatement(ReturnStatement statement) {
                    if (isTrue(statement, IS_YIELD_STATEMENT)) {
                        hasYieldHolder[0] = true;
                        return;
                    }
                    super.visitReturnStatement(statement);
                }

                @Override
                public void visitThrowStatement(ThrowStatement statement) {
                    hasThrowHolder[0] = true;
                }
            });
            if (hasYieldHolder[0] || hasThrowHolder[0]) {
                hasResultStmtHolder[0] = true;
            }
        }
        Statement exprOrBlockStatement = statements.get(0);
        if (exprOrBlockStatement instanceof BlockStatement) {
            BlockStatement blockStatement = (BlockStatement) exprOrBlockStatement;
            List<Statement> branchStatementList = blockStatement.getStatements();
            if (1 == branchStatementList.size()) {
                exprOrBlockStatement = branchStatementList.get(0);
            }
        }
        if (!(exprOrBlockStatement instanceof ReturnStatement || exprOrBlockStatement instanceof ThrowStatement)) {
            if (isArrow) {
                MethodCallExpression callClosure = callX(configureAST(closureX(null, exprOrBlockStatement), exprOrBlockStatement), "call");
                callClosure.setImplicitThis(false);
                Expression resultExpr = exprOrBlockStatement instanceof ExpressionStatement ? ((ExpressionStatement) exprOrBlockStatement).getExpression() : callClosure;
                codeBlock = configureAST(createBlockStatement(configureAST(returnS(resultExpr), exprOrBlockStatement)), exprOrBlockStatement);
            }
        }
        switch(tuple.getV1().getType()) {
            case CASE:
                {
                    if (!asBoolean(statementList)) {
                        firstLabelHolder.add(tuple.getV1());
                    }
                    for (int i = 0, n = tuple.getV2().size(); i < n; i++) {
                        Expression expr = tuple.getV2().get(i);
                        statementList.add(configureAST(new CaseStatement(expr, // check whether processing the last label. if yes, block statement should be attached.
                        (isLast && i == n - 1) ? codeBlock : EmptyStatement.INSTANCE), firstLabelHolder.get(0)));
                    }
                    break;
                }
            case DEFAULT:
                {
                    codeBlock.putNodeMetaData(IS_SWITCH_DEFAULT, true);
                    statementList.add(// this.configureAST(codeBlock, tuple.getKey())
                    codeBlock);
                    break;
                }
        }
        return statementList;
    });
    return tuple(result, isArrowHolder[0], hasResultStmtHolder[0]);
}
Also used : CastParExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.CastParExpressionContext) SUB(org.apache.groovy.parser.antlr4.GroovyParser.SUB) CastExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.CastExprAltContext) ConditionalExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ConditionalExprAltContext) DEFAULT(org.apache.groovy.parser.antlr4.GroovyParser.DEFAULT) IdentifierContext(org.apache.groovy.parser.antlr4.GroovyParser.IdentifierContext) SEALED(org.apache.groovy.parser.antlr4.GroovyParser.SEALED) QualifiedClassNameListContext(org.apache.groovy.parser.antlr4.GroovyParser.QualifiedClassNameListContext) ModifierContext(org.apache.groovy.parser.antlr4.GroovyParser.ModifierContext) ElementValuePairsContext(org.apache.groovy.parser.antlr4.GroovyParser.ElementValuePairsContext) BlockStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.BlockStatementContext) PathExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.PathExpressionContext) NonSealed(groovy.transform.NonSealed) EnumConstantsContext(org.apache.groovy.parser.antlr4.GroovyParser.EnumConstantsContext) Map(java.util.Map) ListContext(org.apache.groovy.parser.antlr4.GroovyParser.ListContext) Sealed(groovy.transform.Sealed) PropertyNode(org.codehaus.groovy.ast.PropertyNode) Trait(groovy.transform.Trait) TypeNamePairContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeNamePairContext) UnaryMinusExpression(org.codehaus.groovy.ast.expr.UnaryMinusExpression) ClosureListExpression(org.codehaus.groovy.ast.expr.ClosureListExpression) Recognizer(org.antlr.v4.runtime.Recognizer) QualifiedNameElementContext(org.apache.groovy.parser.antlr4.GroovyParser.QualifiedNameElementContext) EnhancedStatementExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.EnhancedStatementExpressionContext) EmptyDimsContext(org.apache.groovy.parser.antlr4.GroovyParser.EmptyDimsContext) ArgumentListExpression(org.codehaus.groovy.ast.expr.ArgumentListExpression) ClosureOrLambdaExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.ClosureOrLambdaExpressionContext) CommandExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.CommandExpressionContext) CommandExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.CommandExprAltContext) GstringValueContext(org.apache.groovy.parser.antlr4.GroovyParser.GstringValueContext) ArrayInitializerContext(org.apache.groovy.parser.antlr4.GroovyParser.ArrayInitializerContext) MethodReferenceExpression(org.codehaus.groovy.ast.expr.MethodReferenceExpression) Stream(java.util.stream.Stream) TernaryExpression(org.codehaus.groovy.ast.expr.TernaryExpression) AssertStatement(org.codehaus.groovy.ast.stmt.AssertStatement) DefaultGroovyMethods.asBoolean(org.codehaus.groovy.runtime.DefaultGroovyMethods.asBoolean) IdentifierPrmrAltContext(org.apache.groovy.parser.antlr4.GroovyParser.IdentifierPrmrAltContext) AndExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.AndExprAltContext) DEC(org.apache.groovy.parser.antlr4.GroovyParser.DEC) PropertyExpression(org.codehaus.groovy.ast.expr.PropertyExpression) DEF(org.apache.groovy.parser.antlr4.GroovyParser.DEF) GeneralUtils.declS(org.codehaus.groovy.ast.tools.GeneralUtils.declS) VariableDeclaratorIdContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableDeclaratorIdContext) YieldStatementContext(org.apache.groovy.parser.antlr4.GroovyLangParser.YieldStatementContext) LinkedHashMap(java.util.LinkedHashMap) EnhancedForControlContext(org.apache.groovy.parser.antlr4.GroovyParser.EnhancedForControlContext) PrefixExpression(org.codehaus.groovy.ast.expr.PrefixExpression) SystemUtil(org.apache.groovy.util.SystemUtil) ExpressionStatement(org.codehaus.groovy.ast.stmt.ExpressionStatement) GeneralUtils.returnS(org.codehaus.groovy.ast.tools.GeneralUtils.returnS) GroovyParserRuleContext(org.apache.groovy.parser.antlr4.GroovyParser.GroovyParserRuleContext) PowerExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.PowerExprAltContext) StandardLambdaExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.StandardLambdaExpressionContext) PostfixExpression(org.codehaus.groovy.ast.expr.PostfixExpression) StringUtils(org.apache.groovy.parser.antlr4.util.StringUtils) ElementValuePairContext(org.apache.groovy.parser.antlr4.GroovyParser.ElementValuePairContext) Expression(org.codehaus.groovy.ast.expr.Expression) AnnotationNameContext(org.apache.groovy.parser.antlr4.GroovyParser.AnnotationNameContext) FINAL(org.apache.groovy.parser.antlr4.GroovyParser.FINAL) Opcodes(org.objectweb.asm.Opcodes) CompileStatic(groovy.transform.CompileStatic) UnaryPlusExpression(org.codehaus.groovy.ast.expr.UnaryPlusExpression) SourceUnit(org.codehaus.groovy.control.SourceUnit) ClassNode(org.codehaus.groovy.ast.ClassNode) SwitchExpressionLabelContext(org.apache.groovy.parser.antlr4.GroovyLangParser.SwitchExpressionLabelContext) ForStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ForStmtAltContext) BreakStatement(org.codehaus.groovy.ast.stmt.BreakStatement) GeneralUtils.listX(org.codehaus.groovy.ast.tools.GeneralUtils.listX) GeneralUtils.localVarX(org.codehaus.groovy.ast.tools.GeneralUtils.localVarX) GenericsType(org.codehaus.groovy.ast.GenericsType) IOException(java.io.IOException) PredictionMode(org.antlr.v4.runtime.atn.PredictionMode) ForControlContext(org.apache.groovy.parser.antlr4.GroovyParser.ForControlContext) ReturnStatement(org.codehaus.groovy.ast.stmt.ReturnStatement) AnnotationConstantExpression(org.codehaus.groovy.ast.expr.AnnotationConstantExpression) VariableModifiersContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableModifiersContext) CompilationUnitContext(org.apache.groovy.parser.antlr4.GroovyParser.CompilationUnitContext) RecognitionException(org.antlr.v4.runtime.RecognitionException) BitwiseNegationExpression(org.codehaus.groovy.ast.expr.BitwiseNegationExpression) TupleConstructor(groovy.transform.TupleConstructor) ANTLRErrorListener(org.antlr.v4.runtime.ANTLRErrorListener) IfElseStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.IfElseStatementContext) MapEntryLabelContext(org.apache.groovy.parser.antlr4.GroovyParser.MapEntryLabelContext) AS(org.apache.groovy.parser.antlr4.GroovyParser.AS) EqualityExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.EqualityExprAltContext) GeneralUtils.stmt(org.codehaus.groovy.ast.tools.GeneralUtils.stmt) Interval(org.antlr.v4.runtime.misc.Interval) IntegerLiteralAltContext(org.apache.groovy.parser.antlr4.GroovyParser.IntegerLiteralAltContext) MapExpression(org.codehaus.groovy.ast.expr.MapExpression) TypeArgumentsContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeArgumentsContext) CompilePhase(org.codehaus.groovy.control.CompilePhase) TokenStream(org.antlr.v4.runtime.TokenStream) AtnManager(org.apache.groovy.parser.antlr4.internal.atnmanager.AtnManager) ExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.ExpressionContext) ConstantExpression(org.codehaus.groovy.ast.expr.ConstantExpression) ClosureUtils(org.codehaus.groovy.ast.tools.ClosureUtils) ModuleNode(org.codehaus.groovy.ast.ModuleNode) LogicalAndExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.LogicalAndExprAltContext) FormalParameterContext(org.apache.groovy.parser.antlr4.GroovyParser.FormalParameterContext) EnumConstantClassNode(org.codehaus.groovy.ast.EnumConstantClassNode) BlockContext(org.apache.groovy.parser.antlr4.GroovyParser.BlockContext) Numbers(org.codehaus.groovy.syntax.Numbers) SwitchLabelContext(org.apache.groovy.parser.antlr4.GroovyParser.SwitchLabelContext) BreakStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.BreakStatementContext) BuiltInTypeContext(org.apache.groovy.parser.antlr4.GroovyParser.BuiltInTypeContext) MethodNameContext(org.apache.groovy.parser.antlr4.GroovyParser.MethodNameContext) CreatorContext(org.apache.groovy.parser.antlr4.GroovyParser.CreatorContext) ForStatement(org.codehaus.groovy.ast.stmt.ForStatement) INC(org.apache.groovy.parser.antlr4.GroovyParser.INC) LabeledStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.LabeledStmtAltContext) MethodDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.MethodDeclarationContext) ScriptStatementsContext(org.apache.groovy.parser.antlr4.GroovyParser.ScriptStatementsContext) NamedPropertyArgsContext(org.apache.groovy.parser.antlr4.GroovyParser.NamedPropertyArgsContext) ExclusiveOrExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ExclusiveOrExprAltContext) Types(org.codehaus.groovy.syntax.Types) GeneralUtils.closureX(org.codehaus.groovy.ast.tools.GeneralUtils.closureX) DefaultGroovyMethods(org.codehaus.groovy.runtime.DefaultGroovyMethods) ThisPrmrAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ThisPrmrAltContext) SwitchBlockStatementGroupContext(org.apache.groovy.parser.antlr4.GroovyParser.SwitchBlockStatementGroupContext) StringGroovyMethods(org.codehaus.groovy.runtime.StringGroovyMethods) Collectors(java.util.stream.Collectors) NotExpression(org.codehaus.groovy.ast.expr.NotExpression) PrimitiveTypeContext(org.apache.groovy.parser.antlr4.GroovyParser.PrimitiveTypeContext) InnerClassNode(org.codehaus.groovy.ast.InnerClassNode) Objects(java.util.Objects) ARROW(org.apache.groovy.parser.antlr4.GroovyLangParser.ARROW) IfStatement(org.codehaus.groovy.ast.stmt.IfStatement) MapContext(org.apache.groovy.parser.antlr4.GroovyParser.MapContext) NewPrmrAltContext(org.apache.groovy.parser.antlr4.GroovyParser.NewPrmrAltContext) EnhancedArgumentListInParContext(org.apache.groovy.parser.antlr4.GroovyParser.EnhancedArgumentListInParContext) ForUpdateContext(org.apache.groovy.parser.antlr4.GroovyParser.ForUpdateContext) RegexExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.RegexExprAltContext) INSTANCEOF(org.apache.groovy.parser.antlr4.GroovyParser.INSTANCEOF) AnnotationNode(org.codehaus.groovy.ast.AnnotationNode) VariableDeclaratorContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableDeclaratorContext) CompactConstructorDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.CompactConstructorDeclarationContext) TypeArgumentsOrDiamondContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeArgumentsOrDiamondContext) Verifier(org.codehaus.groovy.classgen.Verifier) ContinueStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.ContinueStatementContext) Maps(org.apache.groovy.util.Maps) Tuple2(groovy.lang.Tuple2) NOT_IN(org.apache.groovy.parser.antlr4.GroovyParser.NOT_IN) Tuple3(groovy.lang.Tuple3) ThrowStatement(org.codehaus.groovy.ast.stmt.ThrowStatement) VariableNamesContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableNamesContext) GeneralUtils.varX(org.codehaus.groovy.ast.tools.GeneralUtils.varX) EmptyExpression(org.codehaus.groovy.ast.expr.EmptyExpression) LinkedList(java.util.LinkedList) AnnotationContext(org.apache.groovy.parser.antlr4.GroovyParser.AnnotationContext) GstringContext(org.apache.groovy.parser.antlr4.GroovyParser.GstringContext) ConstructorCallExpression(org.codehaus.groovy.ast.expr.ConstructorCallExpression) DynamicMemberNameContext(org.apache.groovy.parser.antlr4.GroovyParser.DynamicMemberNameContext) MapEntryContext(org.apache.groovy.parser.antlr4.GroovyParser.MapEntryContext) StatementContext(org.apache.groovy.parser.antlr4.GroovyParser.StatementContext) DoWhileStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.DoWhileStmtAltContext) ClassHelper(org.codehaus.groovy.ast.ClassHelper) GeneralUtils.cloneParams(org.codehaus.groovy.ast.tools.GeneralUtils.cloneParams) ShiftExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ShiftExprAltContext) ClassBodyDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassBodyDeclarationContext) DescriptiveErrorStrategy(org.apache.groovy.parser.antlr4.internal.DescriptiveErrorStrategy) TypeUtil.isPrimitiveType(org.codehaus.groovy.classgen.asm.util.TypeUtil.isPrimitiveType) SynchronizedStatement(org.codehaus.groovy.ast.stmt.SynchronizedStatement) ClassExpression(org.codehaus.groovy.ast.expr.ClassExpression) ReturnTypeContext(org.apache.groovy.parser.antlr4.GroovyParser.ReturnTypeContext) ASTNode(org.codehaus.groovy.ast.ASTNode) TupleExpression(org.codehaus.groovy.ast.expr.TupleExpression) NonWildcardTypeArgumentsContext(org.apache.groovy.parser.antlr4.GroovyParser.NonWildcardTypeArgumentsContext) ThisFormalParameterContext(org.apache.groovy.parser.antlr4.GroovyParser.ThisFormalParameterContext) TryCatchStatement(org.codehaus.groovy.ast.stmt.TryCatchStatement) RANGE_EXCLUSIVE_RIGHT(org.apache.groovy.parser.antlr4.GroovyParser.RANGE_EXCLUSIVE_RIGHT) MethodPointerExpression(org.codehaus.groovy.ast.expr.MethodPointerExpression) BooleanLiteralAltContext(org.apache.groovy.parser.antlr4.GroovyParser.BooleanLiteralAltContext) ConstructorNode(org.codehaus.groovy.ast.ConstructorNode) MapEntryExpression(org.codehaus.groovy.ast.expr.MapEntryExpression) ClassOrInterfaceModifierContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassOrInterfaceModifierContext) SyntaxException(org.codehaus.groovy.syntax.SyntaxException) PRIVATE(org.apache.groovy.parser.antlr4.GroovyParser.PRIVATE) InclusiveOrExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.InclusiveOrExprAltContext) ElementValueArrayInitializerContext(org.apache.groovy.parser.antlr4.GroovyParser.ElementValueArrayInitializerContext) Arrays(java.util.Arrays) Token(org.antlr.v4.runtime.Token) CharStreams(org.antlr.v4.runtime.CharStreams) NamePartContext(org.apache.groovy.parser.antlr4.GroovyParser.NamePartContext) GE(org.apache.groovy.parser.antlr4.GroovyParser.GE) EnumConstantContext(org.apache.groovy.parser.antlr4.GroovyParser.EnumConstantContext) LocalVariableDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.LocalVariableDeclarationContext) ClassBodyContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassBodyContext) MethodBodyContext(org.apache.groovy.parser.antlr4.GroovyParser.MethodBodyContext) WhileStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.WhileStmtAltContext) CaseStatement(org.codehaus.groovy.ast.stmt.CaseStatement) CommandArgumentContext(org.apache.groovy.parser.antlr4.GroovyParser.CommandArgumentContext) CreatedNameContext(org.apache.groovy.parser.antlr4.GroovyParser.CreatedNameContext) NOT_INSTANCEOF(org.apache.groovy.parser.antlr4.GroovyParser.NOT_INSTANCEOF) IndexPropertyArgsContext(org.apache.groovy.parser.antlr4.GroovyParser.IndexPropertyArgsContext) TypeBoundContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeBoundContext) GT(org.apache.groovy.parser.antlr4.GroovyParser.GT) ParExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.ParExpressionContext) ClosureContext(org.apache.groovy.parser.antlr4.GroovyParser.ClosureContext) VariableExpression(org.codehaus.groovy.ast.expr.VariableExpression) PackageNode(org.codehaus.groovy.ast.PackageNode) ModifierNode(org.codehaus.groovy.ast.ModifierNode) AnnotatedNodeUtils(org.apache.groovy.ast.tools.AnnotatedNodeUtils) ConditionalStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.ConditionalStatementContext) EnhancedArgumentListElementContext(org.apache.groovy.parser.antlr4.GroovyParser.EnhancedArgumentListElementContext) AssertStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.AssertStatementContext) ClassHelper.isPrimitiveVoid(org.codehaus.groovy.ast.ClassHelper.isPrimitiveVoid) NON_SEALED(org.apache.groovy.parser.antlr4.GroovyParser.NON_SEALED) GeneralUtils.callX(org.codehaus.groovy.ast.tools.GeneralUtils.callX) TerminalNode(org.antlr.v4.runtime.tree.TerminalNode) PositionConfigureUtils.configureAST(org.apache.groovy.parser.antlr4.util.PositionConfigureUtils.configureAST) SwitchExpressionContext(org.apache.groovy.parser.antlr4.GroovyLangParser.SwitchExpressionContext) CompilationFailedException(org.codehaus.groovy.control.CompilationFailedException) AnnotationsOptContext(org.apache.groovy.parser.antlr4.GroovyParser.AnnotationsOptContext) CastExpression(org.codehaus.groovy.ast.expr.CastExpression) ParserRuleContext(org.antlr.v4.runtime.ParserRuleContext) RelationalExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.RelationalExprAltContext) BooleanExpression(org.codehaus.groovy.ast.expr.BooleanExpression) BlockStatementsOptContext(org.apache.groovy.parser.antlr4.GroovyParser.BlockStatementsOptContext) ImportDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.ImportDeclarationContext) ThrowStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ThrowStmtAltContext) FieldDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.FieldDeclarationContext) FinallyBlockContext(org.apache.groovy.parser.antlr4.GroovyParser.FinallyBlockContext) StandardLambdaParametersContext(org.apache.groovy.parser.antlr4.GroovyParser.StandardLambdaParametersContext) LambdaExpression(org.codehaus.groovy.ast.expr.LambdaExpression) LoopStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.LoopStmtAltContext) WhileStatement(org.codehaus.groovy.ast.stmt.WhileStatement) ArrayList(java.util.ArrayList) StringLiteralContext(org.apache.groovy.parser.antlr4.GroovyParser.StringLiteralContext) CharStream(org.antlr.v4.runtime.CharStream) EmptyDimsOptContext(org.apache.groovy.parser.antlr4.GroovyParser.EmptyDimsOptContext) MethodNode(org.codehaus.groovy.ast.MethodNode) NullLiteralAltContext(org.apache.groovy.parser.antlr4.GroovyParser.NullLiteralAltContext) CatchClauseContext(org.apache.groovy.parser.antlr4.GroovyParser.CatchClauseContext) ClassDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassDeclarationContext) ParseTree(org.antlr.v4.runtime.tree.ParseTree) VariableInitializerContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableInitializerContext) MultipleAssignmentExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.MultipleAssignmentExprAltContext) RANGE_EXCLUSIVE_FULL(org.apache.groovy.parser.antlr4.GroovyParser.RANGE_EXCLUSIVE_FULL) Parameter(org.codehaus.groovy.ast.Parameter) VariableInitializersContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableInitializersContext) FloatingPointLiteralAltContext(org.apache.groovy.parser.antlr4.GroovyParser.FloatingPointLiteralAltContext) SwitchExprAltContext(org.apache.groovy.parser.antlr4.GroovyLangParser.SwitchExprAltContext) VAR(org.apache.groovy.parser.antlr4.GroovyParser.VAR) ClassOrInterfaceModifiersContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassOrInterfaceModifiersContext) IN(org.apache.groovy.parser.antlr4.GroovyParser.IN) ExpressionListContext(org.apache.groovy.parser.antlr4.GroovyParser.ExpressionListContext) EmptyStatement(org.codehaus.groovy.ast.stmt.EmptyStatement) TypeDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeDeclarationContext) ElementValuesContext(org.apache.groovy.parser.antlr4.GroovyParser.ElementValuesContext) PackageDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.PackageDeclarationContext) GStringExpression(org.codehaus.groovy.ast.expr.GStringExpression) BufferedReader(java.io.BufferedReader) ArrayDeque(java.util.ArrayDeque) DefaultGroovyMethods.last(org.codehaus.groovy.runtime.DefaultGroovyMethods.last) ResourceContext(org.apache.groovy.parser.antlr4.GroovyParser.ResourceContext) ListExpression(org.codehaus.groovy.ast.expr.ListExpression) SAFE_INDEX(org.apache.groovy.parser.antlr4.GroovyParser.SAFE_INDEX) TryCatchStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.TryCatchStatementContext) SynchronizedStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.SynchronizedStmtAltContext) MapEntryListContext(org.apache.groovy.parser.antlr4.GroovyParser.MapEntryListContext) ElementValueContext(org.apache.groovy.parser.antlr4.GroovyParser.ElementValueContext) VariableDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableDeclarationContext) CommonTokenStream(org.antlr.v4.runtime.CommonTokenStream) ClassNameContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassNameContext) TypeListContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeListContext) CatchTypeContext(org.apache.groovy.parser.antlr4.GroovyParser.CatchTypeContext) RangeExpression(org.codehaus.groovy.ast.expr.RangeExpression) UnaryNotExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.UnaryNotExprAltContext) GeneralUtils.assignX(org.codehaus.groovy.ast.tools.GeneralUtils.assignX) ModifiersOptContext(org.apache.groovy.parser.antlr4.GroovyParser.ModifiersOptContext) NamedArgumentListExpression(org.codehaus.groovy.ast.expr.NamedArgumentListExpression) VariableModifierContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableModifierContext) SwitchBlockStatementExpressionGroupContext(org.apache.groovy.parser.antlr4.GroovyLangParser.SwitchBlockStatementExpressionGroupContext) PathElementContext(org.apache.groovy.parser.antlr4.GroovyParser.PathElementContext) UnaryAddExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.UnaryAddExprAltContext) TypeNamePairsContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeNamePairsContext) AnnotatedQualifiedClassNameContext(org.apache.groovy.parser.antlr4.GroovyParser.AnnotatedQualifiedClassNameContext) SpreadExpression(org.codehaus.groovy.ast.expr.SpreadExpression) AnonymousInnerClassDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.AnonymousInnerClassDeclarationContext) ForInitContext(org.apache.groovy.parser.antlr4.GroovyParser.ForInitContext) VariableModifiersOptContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableModifiersOptContext) ArrayExpression(org.codehaus.groovy.ast.expr.ArrayExpression) MultiplicativeExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.MultiplicativeExprAltContext) SyntaxErrorMessage(org.codehaus.groovy.control.messages.SyntaxErrorMessage) AssignmentExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.AssignmentExprAltContext) CatchStatement(org.codehaus.groovy.ast.stmt.CatchStatement) TypeArgumentContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeArgumentContext) VariableDeclaratorsContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableDeclaratorsContext) TypeParameterContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeParameterContext) GroovyBugError(org.codehaus.groovy.GroovyBugError) ReturnStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ReturnStmtAltContext) List(java.util.List) BinaryExpression(org.codehaus.groovy.ast.expr.BinaryExpression) TypeParametersContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeParametersContext) ArgumentsContext(org.apache.groovy.parser.antlr4.GroovyParser.ArgumentsContext) BlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement) LE(org.apache.groovy.parser.antlr4.GroovyParser.LE) BlockStatementsContext(org.apache.groovy.parser.antlr4.GroovyParser.BlockStatementsContext) Optional(java.util.Optional) GstringPathContext(org.apache.groovy.parser.antlr4.GroovyParser.GstringPathContext) QualifiedStandardClassNameContext(org.apache.groovy.parser.antlr4.GroovyParser.QualifiedStandardClassNameContext) KeywordsContext(org.apache.groovy.parser.antlr4.GroovyParser.KeywordsContext) AdditiveExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.AdditiveExprAltContext) NodeMetaDataHandler(org.codehaus.groovy.ast.NodeMetaDataHandler) ClassicalForControlContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassicalForControlContext) Statement(org.codehaus.groovy.ast.stmt.Statement) ParseCancellationException(org.antlr.v4.runtime.misc.ParseCancellationException) CodeVisitorSupport(org.codehaus.groovy.ast.CodeVisitorSupport) ElvisOperatorExpression(org.codehaus.groovy.ast.expr.ElvisOperatorExpression) STATIC(org.apache.groovy.parser.antlr4.GroovyParser.STATIC) LT(org.apache.groovy.parser.antlr4.GroovyParser.LT) Deque(java.util.Deque) ResourceListContext(org.apache.groovy.parser.antlr4.GroovyParser.ResourceListContext) SwitchStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.SwitchStatementContext) SuperPrmrAltContext(org.apache.groovy.parser.antlr4.GroovyParser.SuperPrmrAltContext) EnumHelper(org.codehaus.groovy.antlr.EnumHelper) FormalParametersContext(org.apache.groovy.parser.antlr4.GroovyParser.FormalParametersContext) MethodCallExpression(org.codehaus.groovy.ast.expr.MethodCallExpression) DoWhileStatement(org.codehaus.groovy.ast.stmt.DoWhileStatement) ExpressionListElementContext(org.apache.groovy.parser.antlr4.GroovyParser.ExpressionListElementContext) LambdaBodyContext(org.apache.groovy.parser.antlr4.GroovyParser.LambdaBodyContext) ContinueStatement(org.codehaus.groovy.ast.stmt.ContinueStatement) QualifiedNameContext(org.apache.groovy.parser.antlr4.GroovyParser.QualifiedNameContext) SpreadMapExpression(org.codehaus.groovy.ast.expr.SpreadMapExpression) ResourcesContext(org.apache.groovy.parser.antlr4.GroovyParser.ResourcesContext) YieldStmtAltContext(org.apache.groovy.parser.antlr4.GroovyLangParser.YieldStmtAltContext) ADD(org.apache.groovy.parser.antlr4.GroovyParser.ADD) PostfixExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.PostfixExpressionContext) Iterator(java.util.Iterator) CASE(org.apache.groovy.parser.antlr4.GroovyParser.CASE) ExpressionInParContext(org.apache.groovy.parser.antlr4.GroovyParser.ExpressionInParContext) DimContext(org.apache.groovy.parser.antlr4.GroovyParser.DimContext) DeclarationExpression(org.codehaus.groovy.ast.expr.DeclarationExpression) ClosureExpression(org.codehaus.groovy.ast.expr.ClosureExpression) TypeContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeContext) SwitchStatement(org.codehaus.groovy.ast.stmt.SwitchStatement) FormalParameterListContext(org.apache.groovy.parser.antlr4.GroovyParser.FormalParameterListContext) ImportNode(org.codehaus.groovy.ast.ImportNode) QualifiedClassNameContext(org.apache.groovy.parser.antlr4.GroovyParser.QualifiedClassNameContext) LogicalOrExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.LogicalOrExprAltContext) FieldNode(org.codehaus.groovy.ast.FieldNode) AttributeExpression(org.codehaus.groovy.ast.expr.AttributeExpression) RANGE_INCLUSIVE(org.apache.groovy.parser.antlr4.GroovyParser.RANGE_INCLUSIVE) ClassOrInterfaceTypeContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassOrInterfaceTypeContext) Tuple.tuple(groovy.lang.Tuple.tuple) RANGE_EXCLUSIVE_LEFT(org.apache.groovy.parser.antlr4.GroovyParser.RANGE_EXCLUSIVE_LEFT) ClassOrInterfaceModifiersOptContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassOrInterfaceModifiersOptContext) MemberDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.MemberDeclarationContext) Collections(java.util.Collections) ModifiersContext(org.apache.groovy.parser.antlr4.GroovyParser.ModifiersContext) AssertStatement(org.codehaus.groovy.ast.stmt.AssertStatement) ExpressionStatement(org.codehaus.groovy.ast.stmt.ExpressionStatement) BreakStatement(org.codehaus.groovy.ast.stmt.BreakStatement) ReturnStatement(org.codehaus.groovy.ast.stmt.ReturnStatement) ForStatement(org.codehaus.groovy.ast.stmt.ForStatement) IfStatement(org.codehaus.groovy.ast.stmt.IfStatement) ThrowStatement(org.codehaus.groovy.ast.stmt.ThrowStatement) SynchronizedStatement(org.codehaus.groovy.ast.stmt.SynchronizedStatement) TryCatchStatement(org.codehaus.groovy.ast.stmt.TryCatchStatement) CaseStatement(org.codehaus.groovy.ast.stmt.CaseStatement) WhileStatement(org.codehaus.groovy.ast.stmt.WhileStatement) EmptyStatement(org.codehaus.groovy.ast.stmt.EmptyStatement) CatchStatement(org.codehaus.groovy.ast.stmt.CatchStatement) BlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement) Statement(org.codehaus.groovy.ast.stmt.Statement) DoWhileStatement(org.codehaus.groovy.ast.stmt.DoWhileStatement) ContinueStatement(org.codehaus.groovy.ast.stmt.ContinueStatement) SwitchStatement(org.codehaus.groovy.ast.stmt.SwitchStatement) CaseStatement(org.codehaus.groovy.ast.stmt.CaseStatement) ArrayList(java.util.ArrayList) Token(org.antlr.v4.runtime.Token) BlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement) CodeVisitorSupport(org.codehaus.groovy.ast.CodeVisitorSupport) MethodCallExpression(org.codehaus.groovy.ast.expr.MethodCallExpression) UnaryMinusExpression(org.codehaus.groovy.ast.expr.UnaryMinusExpression) ClosureListExpression(org.codehaus.groovy.ast.expr.ClosureListExpression) ArgumentListExpression(org.codehaus.groovy.ast.expr.ArgumentListExpression) MethodReferenceExpression(org.codehaus.groovy.ast.expr.MethodReferenceExpression) TernaryExpression(org.codehaus.groovy.ast.expr.TernaryExpression) PropertyExpression(org.codehaus.groovy.ast.expr.PropertyExpression) PrefixExpression(org.codehaus.groovy.ast.expr.PrefixExpression) PostfixExpression(org.codehaus.groovy.ast.expr.PostfixExpression) Expression(org.codehaus.groovy.ast.expr.Expression) UnaryPlusExpression(org.codehaus.groovy.ast.expr.UnaryPlusExpression) AnnotationConstantExpression(org.codehaus.groovy.ast.expr.AnnotationConstantExpression) BitwiseNegationExpression(org.codehaus.groovy.ast.expr.BitwiseNegationExpression) MapExpression(org.codehaus.groovy.ast.expr.MapExpression) ConstantExpression(org.codehaus.groovy.ast.expr.ConstantExpression) NotExpression(org.codehaus.groovy.ast.expr.NotExpression) EmptyExpression(org.codehaus.groovy.ast.expr.EmptyExpression) ConstructorCallExpression(org.codehaus.groovy.ast.expr.ConstructorCallExpression) ClassExpression(org.codehaus.groovy.ast.expr.ClassExpression) TupleExpression(org.codehaus.groovy.ast.expr.TupleExpression) MethodPointerExpression(org.codehaus.groovy.ast.expr.MethodPointerExpression) MapEntryExpression(org.codehaus.groovy.ast.expr.MapEntryExpression) VariableExpression(org.codehaus.groovy.ast.expr.VariableExpression) CastExpression(org.codehaus.groovy.ast.expr.CastExpression) BooleanExpression(org.codehaus.groovy.ast.expr.BooleanExpression) LambdaExpression(org.codehaus.groovy.ast.expr.LambdaExpression) GStringExpression(org.codehaus.groovy.ast.expr.GStringExpression) ListExpression(org.codehaus.groovy.ast.expr.ListExpression) RangeExpression(org.codehaus.groovy.ast.expr.RangeExpression) NamedArgumentListExpression(org.codehaus.groovy.ast.expr.NamedArgumentListExpression) SpreadExpression(org.codehaus.groovy.ast.expr.SpreadExpression) ArrayExpression(org.codehaus.groovy.ast.expr.ArrayExpression) BinaryExpression(org.codehaus.groovy.ast.expr.BinaryExpression) ElvisOperatorExpression(org.codehaus.groovy.ast.expr.ElvisOperatorExpression) MethodCallExpression(org.codehaus.groovy.ast.expr.MethodCallExpression) SpreadMapExpression(org.codehaus.groovy.ast.expr.SpreadMapExpression) DeclarationExpression(org.codehaus.groovy.ast.expr.DeclarationExpression) ClosureExpression(org.codehaus.groovy.ast.expr.ClosureExpression) AttributeExpression(org.codehaus.groovy.ast.expr.AttributeExpression) Tuple3(groovy.lang.Tuple3) ExpressionStatement(org.codehaus.groovy.ast.stmt.ExpressionStatement) ReturnStatement(org.codehaus.groovy.ast.stmt.ReturnStatement) LinkedList(java.util.LinkedList) ArrayList(java.util.ArrayList) List(java.util.List) ThrowStatement(org.codehaus.groovy.ast.stmt.ThrowStatement)

Example 2 with DEFAULT

use of org.apache.groovy.parser.antlr4.GroovyLexer.DEFAULT in project groovy by apache.

the class AstBuilder method visitSwitchBlockStatementGroup.

@Override
@SuppressWarnings("unchecked")
public List<Statement> visitSwitchBlockStatementGroup(final SwitchBlockStatementGroupContext ctx) {
    int labelCnt = ctx.switchLabel().size();
    List<Token> firstLabelHolder = new ArrayList<>(1);
    return (List<Statement>) ctx.switchLabel().stream().map(e -> (Object) this.visitSwitchLabel(e)).reduce(new ArrayList<Statement>(4), (r, e) -> {
        List<Statement> statementList = (List<Statement>) r;
        Tuple2<Token, Expression> tuple = (Tuple2<Token, Expression>) e;
        boolean isLast = labelCnt - 1 == statementList.size();
        switch(tuple.getV1().getType()) {
            case CASE:
                {
                    if (!asBoolean(statementList)) {
                        firstLabelHolder.add(tuple.getV1());
                    }
                    statementList.add(configureAST(new CaseStatement(tuple.getV2(), // 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, tuple.getKey())
                    blockStatement);
                    break;
                }
        }
        return statementList;
    });
}
Also used : CastParExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.CastParExpressionContext) SUB(org.apache.groovy.parser.antlr4.GroovyParser.SUB) CastExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.CastExprAltContext) ConditionalExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ConditionalExprAltContext) DEFAULT(org.apache.groovy.parser.antlr4.GroovyParser.DEFAULT) IdentifierContext(org.apache.groovy.parser.antlr4.GroovyParser.IdentifierContext) SEALED(org.apache.groovy.parser.antlr4.GroovyParser.SEALED) QualifiedClassNameListContext(org.apache.groovy.parser.antlr4.GroovyParser.QualifiedClassNameListContext) ModifierContext(org.apache.groovy.parser.antlr4.GroovyParser.ModifierContext) ElementValuePairsContext(org.apache.groovy.parser.antlr4.GroovyParser.ElementValuePairsContext) BlockStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.BlockStatementContext) PathExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.PathExpressionContext) NonSealed(groovy.transform.NonSealed) EnumConstantsContext(org.apache.groovy.parser.antlr4.GroovyParser.EnumConstantsContext) Map(java.util.Map) ListContext(org.apache.groovy.parser.antlr4.GroovyParser.ListContext) Sealed(groovy.transform.Sealed) PropertyNode(org.codehaus.groovy.ast.PropertyNode) Trait(groovy.transform.Trait) TypeNamePairContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeNamePairContext) UnaryMinusExpression(org.codehaus.groovy.ast.expr.UnaryMinusExpression) ClosureListExpression(org.codehaus.groovy.ast.expr.ClosureListExpression) Recognizer(org.antlr.v4.runtime.Recognizer) QualifiedNameElementContext(org.apache.groovy.parser.antlr4.GroovyParser.QualifiedNameElementContext) EnhancedStatementExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.EnhancedStatementExpressionContext) EmptyDimsContext(org.apache.groovy.parser.antlr4.GroovyParser.EmptyDimsContext) ArgumentListExpression(org.codehaus.groovy.ast.expr.ArgumentListExpression) ClosureOrLambdaExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.ClosureOrLambdaExpressionContext) CommandExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.CommandExpressionContext) CommandExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.CommandExprAltContext) GstringValueContext(org.apache.groovy.parser.antlr4.GroovyParser.GstringValueContext) ArrayInitializerContext(org.apache.groovy.parser.antlr4.GroovyParser.ArrayInitializerContext) MethodReferenceExpression(org.codehaus.groovy.ast.expr.MethodReferenceExpression) Stream(java.util.stream.Stream) TernaryExpression(org.codehaus.groovy.ast.expr.TernaryExpression) AssertStatement(org.codehaus.groovy.ast.stmt.AssertStatement) DefaultGroovyMethods.asBoolean(org.codehaus.groovy.runtime.DefaultGroovyMethods.asBoolean) IdentifierPrmrAltContext(org.apache.groovy.parser.antlr4.GroovyParser.IdentifierPrmrAltContext) AndExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.AndExprAltContext) DEC(org.apache.groovy.parser.antlr4.GroovyParser.DEC) PropertyExpression(org.codehaus.groovy.ast.expr.PropertyExpression) DEF(org.apache.groovy.parser.antlr4.GroovyParser.DEF) GeneralUtils.declS(org.codehaus.groovy.ast.tools.GeneralUtils.declS) VariableDeclaratorIdContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableDeclaratorIdContext) YieldStatementContext(org.apache.groovy.parser.antlr4.GroovyLangParser.YieldStatementContext) LinkedHashMap(java.util.LinkedHashMap) EnhancedForControlContext(org.apache.groovy.parser.antlr4.GroovyParser.EnhancedForControlContext) PrefixExpression(org.codehaus.groovy.ast.expr.PrefixExpression) SystemUtil(org.apache.groovy.util.SystemUtil) ExpressionStatement(org.codehaus.groovy.ast.stmt.ExpressionStatement) GeneralUtils.returnS(org.codehaus.groovy.ast.tools.GeneralUtils.returnS) GroovyParserRuleContext(org.apache.groovy.parser.antlr4.GroovyParser.GroovyParserRuleContext) PowerExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.PowerExprAltContext) StandardLambdaExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.StandardLambdaExpressionContext) PostfixExpression(org.codehaus.groovy.ast.expr.PostfixExpression) StringUtils(org.apache.groovy.parser.antlr4.util.StringUtils) ElementValuePairContext(org.apache.groovy.parser.antlr4.GroovyParser.ElementValuePairContext) Expression(org.codehaus.groovy.ast.expr.Expression) AnnotationNameContext(org.apache.groovy.parser.antlr4.GroovyParser.AnnotationNameContext) FINAL(org.apache.groovy.parser.antlr4.GroovyParser.FINAL) Opcodes(org.objectweb.asm.Opcodes) CompileStatic(groovy.transform.CompileStatic) UnaryPlusExpression(org.codehaus.groovy.ast.expr.UnaryPlusExpression) SourceUnit(org.codehaus.groovy.control.SourceUnit) ClassNode(org.codehaus.groovy.ast.ClassNode) SwitchExpressionLabelContext(org.apache.groovy.parser.antlr4.GroovyLangParser.SwitchExpressionLabelContext) ForStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ForStmtAltContext) BreakStatement(org.codehaus.groovy.ast.stmt.BreakStatement) GeneralUtils.listX(org.codehaus.groovy.ast.tools.GeneralUtils.listX) GeneralUtils.localVarX(org.codehaus.groovy.ast.tools.GeneralUtils.localVarX) GenericsType(org.codehaus.groovy.ast.GenericsType) IOException(java.io.IOException) PredictionMode(org.antlr.v4.runtime.atn.PredictionMode) ForControlContext(org.apache.groovy.parser.antlr4.GroovyParser.ForControlContext) ReturnStatement(org.codehaus.groovy.ast.stmt.ReturnStatement) AnnotationConstantExpression(org.codehaus.groovy.ast.expr.AnnotationConstantExpression) VariableModifiersContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableModifiersContext) CompilationUnitContext(org.apache.groovy.parser.antlr4.GroovyParser.CompilationUnitContext) RecognitionException(org.antlr.v4.runtime.RecognitionException) BitwiseNegationExpression(org.codehaus.groovy.ast.expr.BitwiseNegationExpression) TupleConstructor(groovy.transform.TupleConstructor) ANTLRErrorListener(org.antlr.v4.runtime.ANTLRErrorListener) IfElseStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.IfElseStatementContext) MapEntryLabelContext(org.apache.groovy.parser.antlr4.GroovyParser.MapEntryLabelContext) AS(org.apache.groovy.parser.antlr4.GroovyParser.AS) EqualityExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.EqualityExprAltContext) GeneralUtils.stmt(org.codehaus.groovy.ast.tools.GeneralUtils.stmt) Interval(org.antlr.v4.runtime.misc.Interval) IntegerLiteralAltContext(org.apache.groovy.parser.antlr4.GroovyParser.IntegerLiteralAltContext) MapExpression(org.codehaus.groovy.ast.expr.MapExpression) TypeArgumentsContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeArgumentsContext) CompilePhase(org.codehaus.groovy.control.CompilePhase) TokenStream(org.antlr.v4.runtime.TokenStream) AtnManager(org.apache.groovy.parser.antlr4.internal.atnmanager.AtnManager) ExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.ExpressionContext) ConstantExpression(org.codehaus.groovy.ast.expr.ConstantExpression) ClosureUtils(org.codehaus.groovy.ast.tools.ClosureUtils) ModuleNode(org.codehaus.groovy.ast.ModuleNode) LogicalAndExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.LogicalAndExprAltContext) FormalParameterContext(org.apache.groovy.parser.antlr4.GroovyParser.FormalParameterContext) EnumConstantClassNode(org.codehaus.groovy.ast.EnumConstantClassNode) BlockContext(org.apache.groovy.parser.antlr4.GroovyParser.BlockContext) Numbers(org.codehaus.groovy.syntax.Numbers) SwitchLabelContext(org.apache.groovy.parser.antlr4.GroovyParser.SwitchLabelContext) BreakStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.BreakStatementContext) BuiltInTypeContext(org.apache.groovy.parser.antlr4.GroovyParser.BuiltInTypeContext) MethodNameContext(org.apache.groovy.parser.antlr4.GroovyParser.MethodNameContext) CreatorContext(org.apache.groovy.parser.antlr4.GroovyParser.CreatorContext) ForStatement(org.codehaus.groovy.ast.stmt.ForStatement) INC(org.apache.groovy.parser.antlr4.GroovyParser.INC) LabeledStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.LabeledStmtAltContext) MethodDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.MethodDeclarationContext) ScriptStatementsContext(org.apache.groovy.parser.antlr4.GroovyParser.ScriptStatementsContext) NamedPropertyArgsContext(org.apache.groovy.parser.antlr4.GroovyParser.NamedPropertyArgsContext) ExclusiveOrExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ExclusiveOrExprAltContext) Types(org.codehaus.groovy.syntax.Types) GeneralUtils.closureX(org.codehaus.groovy.ast.tools.GeneralUtils.closureX) DefaultGroovyMethods(org.codehaus.groovy.runtime.DefaultGroovyMethods) ThisPrmrAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ThisPrmrAltContext) SwitchBlockStatementGroupContext(org.apache.groovy.parser.antlr4.GroovyParser.SwitchBlockStatementGroupContext) StringGroovyMethods(org.codehaus.groovy.runtime.StringGroovyMethods) Collectors(java.util.stream.Collectors) NotExpression(org.codehaus.groovy.ast.expr.NotExpression) PrimitiveTypeContext(org.apache.groovy.parser.antlr4.GroovyParser.PrimitiveTypeContext) InnerClassNode(org.codehaus.groovy.ast.InnerClassNode) Objects(java.util.Objects) ARROW(org.apache.groovy.parser.antlr4.GroovyLangParser.ARROW) IfStatement(org.codehaus.groovy.ast.stmt.IfStatement) MapContext(org.apache.groovy.parser.antlr4.GroovyParser.MapContext) NewPrmrAltContext(org.apache.groovy.parser.antlr4.GroovyParser.NewPrmrAltContext) EnhancedArgumentListInParContext(org.apache.groovy.parser.antlr4.GroovyParser.EnhancedArgumentListInParContext) ForUpdateContext(org.apache.groovy.parser.antlr4.GroovyParser.ForUpdateContext) RegexExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.RegexExprAltContext) INSTANCEOF(org.apache.groovy.parser.antlr4.GroovyParser.INSTANCEOF) AnnotationNode(org.codehaus.groovy.ast.AnnotationNode) VariableDeclaratorContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableDeclaratorContext) CompactConstructorDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.CompactConstructorDeclarationContext) TypeArgumentsOrDiamondContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeArgumentsOrDiamondContext) Verifier(org.codehaus.groovy.classgen.Verifier) ContinueStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.ContinueStatementContext) Maps(org.apache.groovy.util.Maps) Tuple2(groovy.lang.Tuple2) NOT_IN(org.apache.groovy.parser.antlr4.GroovyParser.NOT_IN) Tuple3(groovy.lang.Tuple3) ThrowStatement(org.codehaus.groovy.ast.stmt.ThrowStatement) VariableNamesContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableNamesContext) GeneralUtils.varX(org.codehaus.groovy.ast.tools.GeneralUtils.varX) EmptyExpression(org.codehaus.groovy.ast.expr.EmptyExpression) LinkedList(java.util.LinkedList) AnnotationContext(org.apache.groovy.parser.antlr4.GroovyParser.AnnotationContext) GstringContext(org.apache.groovy.parser.antlr4.GroovyParser.GstringContext) ConstructorCallExpression(org.codehaus.groovy.ast.expr.ConstructorCallExpression) DynamicMemberNameContext(org.apache.groovy.parser.antlr4.GroovyParser.DynamicMemberNameContext) MapEntryContext(org.apache.groovy.parser.antlr4.GroovyParser.MapEntryContext) StatementContext(org.apache.groovy.parser.antlr4.GroovyParser.StatementContext) DoWhileStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.DoWhileStmtAltContext) ClassHelper(org.codehaus.groovy.ast.ClassHelper) GeneralUtils.cloneParams(org.codehaus.groovy.ast.tools.GeneralUtils.cloneParams) ShiftExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ShiftExprAltContext) ClassBodyDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassBodyDeclarationContext) DescriptiveErrorStrategy(org.apache.groovy.parser.antlr4.internal.DescriptiveErrorStrategy) TypeUtil.isPrimitiveType(org.codehaus.groovy.classgen.asm.util.TypeUtil.isPrimitiveType) SynchronizedStatement(org.codehaus.groovy.ast.stmt.SynchronizedStatement) ClassExpression(org.codehaus.groovy.ast.expr.ClassExpression) ReturnTypeContext(org.apache.groovy.parser.antlr4.GroovyParser.ReturnTypeContext) ASTNode(org.codehaus.groovy.ast.ASTNode) TupleExpression(org.codehaus.groovy.ast.expr.TupleExpression) NonWildcardTypeArgumentsContext(org.apache.groovy.parser.antlr4.GroovyParser.NonWildcardTypeArgumentsContext) ThisFormalParameterContext(org.apache.groovy.parser.antlr4.GroovyParser.ThisFormalParameterContext) TryCatchStatement(org.codehaus.groovy.ast.stmt.TryCatchStatement) RANGE_EXCLUSIVE_RIGHT(org.apache.groovy.parser.antlr4.GroovyParser.RANGE_EXCLUSIVE_RIGHT) MethodPointerExpression(org.codehaus.groovy.ast.expr.MethodPointerExpression) BooleanLiteralAltContext(org.apache.groovy.parser.antlr4.GroovyParser.BooleanLiteralAltContext) ConstructorNode(org.codehaus.groovy.ast.ConstructorNode) MapEntryExpression(org.codehaus.groovy.ast.expr.MapEntryExpression) ClassOrInterfaceModifierContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassOrInterfaceModifierContext) SyntaxException(org.codehaus.groovy.syntax.SyntaxException) PRIVATE(org.apache.groovy.parser.antlr4.GroovyParser.PRIVATE) InclusiveOrExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.InclusiveOrExprAltContext) ElementValueArrayInitializerContext(org.apache.groovy.parser.antlr4.GroovyParser.ElementValueArrayInitializerContext) Arrays(java.util.Arrays) Token(org.antlr.v4.runtime.Token) CharStreams(org.antlr.v4.runtime.CharStreams) NamePartContext(org.apache.groovy.parser.antlr4.GroovyParser.NamePartContext) GE(org.apache.groovy.parser.antlr4.GroovyParser.GE) EnumConstantContext(org.apache.groovy.parser.antlr4.GroovyParser.EnumConstantContext) LocalVariableDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.LocalVariableDeclarationContext) ClassBodyContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassBodyContext) MethodBodyContext(org.apache.groovy.parser.antlr4.GroovyParser.MethodBodyContext) WhileStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.WhileStmtAltContext) CaseStatement(org.codehaus.groovy.ast.stmt.CaseStatement) CommandArgumentContext(org.apache.groovy.parser.antlr4.GroovyParser.CommandArgumentContext) CreatedNameContext(org.apache.groovy.parser.antlr4.GroovyParser.CreatedNameContext) NOT_INSTANCEOF(org.apache.groovy.parser.antlr4.GroovyParser.NOT_INSTANCEOF) IndexPropertyArgsContext(org.apache.groovy.parser.antlr4.GroovyParser.IndexPropertyArgsContext) TypeBoundContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeBoundContext) GT(org.apache.groovy.parser.antlr4.GroovyParser.GT) ParExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.ParExpressionContext) ClosureContext(org.apache.groovy.parser.antlr4.GroovyParser.ClosureContext) VariableExpression(org.codehaus.groovy.ast.expr.VariableExpression) PackageNode(org.codehaus.groovy.ast.PackageNode) ModifierNode(org.codehaus.groovy.ast.ModifierNode) AnnotatedNodeUtils(org.apache.groovy.ast.tools.AnnotatedNodeUtils) ConditionalStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.ConditionalStatementContext) EnhancedArgumentListElementContext(org.apache.groovy.parser.antlr4.GroovyParser.EnhancedArgumentListElementContext) AssertStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.AssertStatementContext) ClassHelper.isPrimitiveVoid(org.codehaus.groovy.ast.ClassHelper.isPrimitiveVoid) NON_SEALED(org.apache.groovy.parser.antlr4.GroovyParser.NON_SEALED) GeneralUtils.callX(org.codehaus.groovy.ast.tools.GeneralUtils.callX) TerminalNode(org.antlr.v4.runtime.tree.TerminalNode) PositionConfigureUtils.configureAST(org.apache.groovy.parser.antlr4.util.PositionConfigureUtils.configureAST) SwitchExpressionContext(org.apache.groovy.parser.antlr4.GroovyLangParser.SwitchExpressionContext) CompilationFailedException(org.codehaus.groovy.control.CompilationFailedException) AnnotationsOptContext(org.apache.groovy.parser.antlr4.GroovyParser.AnnotationsOptContext) CastExpression(org.codehaus.groovy.ast.expr.CastExpression) ParserRuleContext(org.antlr.v4.runtime.ParserRuleContext) RelationalExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.RelationalExprAltContext) BooleanExpression(org.codehaus.groovy.ast.expr.BooleanExpression) BlockStatementsOptContext(org.apache.groovy.parser.antlr4.GroovyParser.BlockStatementsOptContext) ImportDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.ImportDeclarationContext) ThrowStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ThrowStmtAltContext) FieldDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.FieldDeclarationContext) FinallyBlockContext(org.apache.groovy.parser.antlr4.GroovyParser.FinallyBlockContext) StandardLambdaParametersContext(org.apache.groovy.parser.antlr4.GroovyParser.StandardLambdaParametersContext) LambdaExpression(org.codehaus.groovy.ast.expr.LambdaExpression) LoopStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.LoopStmtAltContext) WhileStatement(org.codehaus.groovy.ast.stmt.WhileStatement) ArrayList(java.util.ArrayList) StringLiteralContext(org.apache.groovy.parser.antlr4.GroovyParser.StringLiteralContext) CharStream(org.antlr.v4.runtime.CharStream) EmptyDimsOptContext(org.apache.groovy.parser.antlr4.GroovyParser.EmptyDimsOptContext) MethodNode(org.codehaus.groovy.ast.MethodNode) NullLiteralAltContext(org.apache.groovy.parser.antlr4.GroovyParser.NullLiteralAltContext) CatchClauseContext(org.apache.groovy.parser.antlr4.GroovyParser.CatchClauseContext) ClassDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassDeclarationContext) ParseTree(org.antlr.v4.runtime.tree.ParseTree) VariableInitializerContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableInitializerContext) MultipleAssignmentExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.MultipleAssignmentExprAltContext) RANGE_EXCLUSIVE_FULL(org.apache.groovy.parser.antlr4.GroovyParser.RANGE_EXCLUSIVE_FULL) Parameter(org.codehaus.groovy.ast.Parameter) VariableInitializersContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableInitializersContext) FloatingPointLiteralAltContext(org.apache.groovy.parser.antlr4.GroovyParser.FloatingPointLiteralAltContext) SwitchExprAltContext(org.apache.groovy.parser.antlr4.GroovyLangParser.SwitchExprAltContext) VAR(org.apache.groovy.parser.antlr4.GroovyParser.VAR) ClassOrInterfaceModifiersContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassOrInterfaceModifiersContext) IN(org.apache.groovy.parser.antlr4.GroovyParser.IN) ExpressionListContext(org.apache.groovy.parser.antlr4.GroovyParser.ExpressionListContext) EmptyStatement(org.codehaus.groovy.ast.stmt.EmptyStatement) TypeDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeDeclarationContext) ElementValuesContext(org.apache.groovy.parser.antlr4.GroovyParser.ElementValuesContext) PackageDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.PackageDeclarationContext) GStringExpression(org.codehaus.groovy.ast.expr.GStringExpression) BufferedReader(java.io.BufferedReader) ArrayDeque(java.util.ArrayDeque) DefaultGroovyMethods.last(org.codehaus.groovy.runtime.DefaultGroovyMethods.last) ResourceContext(org.apache.groovy.parser.antlr4.GroovyParser.ResourceContext) ListExpression(org.codehaus.groovy.ast.expr.ListExpression) SAFE_INDEX(org.apache.groovy.parser.antlr4.GroovyParser.SAFE_INDEX) TryCatchStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.TryCatchStatementContext) SynchronizedStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.SynchronizedStmtAltContext) MapEntryListContext(org.apache.groovy.parser.antlr4.GroovyParser.MapEntryListContext) ElementValueContext(org.apache.groovy.parser.antlr4.GroovyParser.ElementValueContext) VariableDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableDeclarationContext) CommonTokenStream(org.antlr.v4.runtime.CommonTokenStream) ClassNameContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassNameContext) TypeListContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeListContext) CatchTypeContext(org.apache.groovy.parser.antlr4.GroovyParser.CatchTypeContext) RangeExpression(org.codehaus.groovy.ast.expr.RangeExpression) UnaryNotExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.UnaryNotExprAltContext) GeneralUtils.assignX(org.codehaus.groovy.ast.tools.GeneralUtils.assignX) ModifiersOptContext(org.apache.groovy.parser.antlr4.GroovyParser.ModifiersOptContext) NamedArgumentListExpression(org.codehaus.groovy.ast.expr.NamedArgumentListExpression) VariableModifierContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableModifierContext) SwitchBlockStatementExpressionGroupContext(org.apache.groovy.parser.antlr4.GroovyLangParser.SwitchBlockStatementExpressionGroupContext) PathElementContext(org.apache.groovy.parser.antlr4.GroovyParser.PathElementContext) UnaryAddExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.UnaryAddExprAltContext) TypeNamePairsContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeNamePairsContext) AnnotatedQualifiedClassNameContext(org.apache.groovy.parser.antlr4.GroovyParser.AnnotatedQualifiedClassNameContext) SpreadExpression(org.codehaus.groovy.ast.expr.SpreadExpression) AnonymousInnerClassDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.AnonymousInnerClassDeclarationContext) ForInitContext(org.apache.groovy.parser.antlr4.GroovyParser.ForInitContext) VariableModifiersOptContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableModifiersOptContext) ArrayExpression(org.codehaus.groovy.ast.expr.ArrayExpression) MultiplicativeExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.MultiplicativeExprAltContext) SyntaxErrorMessage(org.codehaus.groovy.control.messages.SyntaxErrorMessage) AssignmentExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.AssignmentExprAltContext) CatchStatement(org.codehaus.groovy.ast.stmt.CatchStatement) TypeArgumentContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeArgumentContext) VariableDeclaratorsContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableDeclaratorsContext) TypeParameterContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeParameterContext) GroovyBugError(org.codehaus.groovy.GroovyBugError) ReturnStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ReturnStmtAltContext) List(java.util.List) BinaryExpression(org.codehaus.groovy.ast.expr.BinaryExpression) TypeParametersContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeParametersContext) ArgumentsContext(org.apache.groovy.parser.antlr4.GroovyParser.ArgumentsContext) BlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement) LE(org.apache.groovy.parser.antlr4.GroovyParser.LE) BlockStatementsContext(org.apache.groovy.parser.antlr4.GroovyParser.BlockStatementsContext) Optional(java.util.Optional) GstringPathContext(org.apache.groovy.parser.antlr4.GroovyParser.GstringPathContext) QualifiedStandardClassNameContext(org.apache.groovy.parser.antlr4.GroovyParser.QualifiedStandardClassNameContext) KeywordsContext(org.apache.groovy.parser.antlr4.GroovyParser.KeywordsContext) AdditiveExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.AdditiveExprAltContext) NodeMetaDataHandler(org.codehaus.groovy.ast.NodeMetaDataHandler) ClassicalForControlContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassicalForControlContext) Statement(org.codehaus.groovy.ast.stmt.Statement) ParseCancellationException(org.antlr.v4.runtime.misc.ParseCancellationException) CodeVisitorSupport(org.codehaus.groovy.ast.CodeVisitorSupport) ElvisOperatorExpression(org.codehaus.groovy.ast.expr.ElvisOperatorExpression) STATIC(org.apache.groovy.parser.antlr4.GroovyParser.STATIC) LT(org.apache.groovy.parser.antlr4.GroovyParser.LT) Deque(java.util.Deque) ResourceListContext(org.apache.groovy.parser.antlr4.GroovyParser.ResourceListContext) SwitchStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.SwitchStatementContext) SuperPrmrAltContext(org.apache.groovy.parser.antlr4.GroovyParser.SuperPrmrAltContext) EnumHelper(org.codehaus.groovy.antlr.EnumHelper) FormalParametersContext(org.apache.groovy.parser.antlr4.GroovyParser.FormalParametersContext) MethodCallExpression(org.codehaus.groovy.ast.expr.MethodCallExpression) DoWhileStatement(org.codehaus.groovy.ast.stmt.DoWhileStatement) ExpressionListElementContext(org.apache.groovy.parser.antlr4.GroovyParser.ExpressionListElementContext) LambdaBodyContext(org.apache.groovy.parser.antlr4.GroovyParser.LambdaBodyContext) ContinueStatement(org.codehaus.groovy.ast.stmt.ContinueStatement) QualifiedNameContext(org.apache.groovy.parser.antlr4.GroovyParser.QualifiedNameContext) SpreadMapExpression(org.codehaus.groovy.ast.expr.SpreadMapExpression) ResourcesContext(org.apache.groovy.parser.antlr4.GroovyParser.ResourcesContext) YieldStmtAltContext(org.apache.groovy.parser.antlr4.GroovyLangParser.YieldStmtAltContext) ADD(org.apache.groovy.parser.antlr4.GroovyParser.ADD) PostfixExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.PostfixExpressionContext) Iterator(java.util.Iterator) CASE(org.apache.groovy.parser.antlr4.GroovyParser.CASE) ExpressionInParContext(org.apache.groovy.parser.antlr4.GroovyParser.ExpressionInParContext) DimContext(org.apache.groovy.parser.antlr4.GroovyParser.DimContext) DeclarationExpression(org.codehaus.groovy.ast.expr.DeclarationExpression) ClosureExpression(org.codehaus.groovy.ast.expr.ClosureExpression) TypeContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeContext) SwitchStatement(org.codehaus.groovy.ast.stmt.SwitchStatement) FormalParameterListContext(org.apache.groovy.parser.antlr4.GroovyParser.FormalParameterListContext) ImportNode(org.codehaus.groovy.ast.ImportNode) QualifiedClassNameContext(org.apache.groovy.parser.antlr4.GroovyParser.QualifiedClassNameContext) LogicalOrExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.LogicalOrExprAltContext) FieldNode(org.codehaus.groovy.ast.FieldNode) AttributeExpression(org.codehaus.groovy.ast.expr.AttributeExpression) RANGE_INCLUSIVE(org.apache.groovy.parser.antlr4.GroovyParser.RANGE_INCLUSIVE) ClassOrInterfaceTypeContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassOrInterfaceTypeContext) Tuple.tuple(groovy.lang.Tuple.tuple) RANGE_EXCLUSIVE_LEFT(org.apache.groovy.parser.antlr4.GroovyParser.RANGE_EXCLUSIVE_LEFT) ClassOrInterfaceModifiersOptContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassOrInterfaceModifiersOptContext) MemberDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.MemberDeclarationContext) Collections(java.util.Collections) ModifiersContext(org.apache.groovy.parser.antlr4.GroovyParser.ModifiersContext) UnaryMinusExpression(org.codehaus.groovy.ast.expr.UnaryMinusExpression) ClosureListExpression(org.codehaus.groovy.ast.expr.ClosureListExpression) ArgumentListExpression(org.codehaus.groovy.ast.expr.ArgumentListExpression) MethodReferenceExpression(org.codehaus.groovy.ast.expr.MethodReferenceExpression) TernaryExpression(org.codehaus.groovy.ast.expr.TernaryExpression) PropertyExpression(org.codehaus.groovy.ast.expr.PropertyExpression) PrefixExpression(org.codehaus.groovy.ast.expr.PrefixExpression) PostfixExpression(org.codehaus.groovy.ast.expr.PostfixExpression) Expression(org.codehaus.groovy.ast.expr.Expression) UnaryPlusExpression(org.codehaus.groovy.ast.expr.UnaryPlusExpression) AnnotationConstantExpression(org.codehaus.groovy.ast.expr.AnnotationConstantExpression) BitwiseNegationExpression(org.codehaus.groovy.ast.expr.BitwiseNegationExpression) MapExpression(org.codehaus.groovy.ast.expr.MapExpression) ConstantExpression(org.codehaus.groovy.ast.expr.ConstantExpression) NotExpression(org.codehaus.groovy.ast.expr.NotExpression) EmptyExpression(org.codehaus.groovy.ast.expr.EmptyExpression) ConstructorCallExpression(org.codehaus.groovy.ast.expr.ConstructorCallExpression) ClassExpression(org.codehaus.groovy.ast.expr.ClassExpression) TupleExpression(org.codehaus.groovy.ast.expr.TupleExpression) MethodPointerExpression(org.codehaus.groovy.ast.expr.MethodPointerExpression) MapEntryExpression(org.codehaus.groovy.ast.expr.MapEntryExpression) VariableExpression(org.codehaus.groovy.ast.expr.VariableExpression) CastExpression(org.codehaus.groovy.ast.expr.CastExpression) BooleanExpression(org.codehaus.groovy.ast.expr.BooleanExpression) LambdaExpression(org.codehaus.groovy.ast.expr.LambdaExpression) GStringExpression(org.codehaus.groovy.ast.expr.GStringExpression) ListExpression(org.codehaus.groovy.ast.expr.ListExpression) RangeExpression(org.codehaus.groovy.ast.expr.RangeExpression) NamedArgumentListExpression(org.codehaus.groovy.ast.expr.NamedArgumentListExpression) SpreadExpression(org.codehaus.groovy.ast.expr.SpreadExpression) ArrayExpression(org.codehaus.groovy.ast.expr.ArrayExpression) BinaryExpression(org.codehaus.groovy.ast.expr.BinaryExpression) ElvisOperatorExpression(org.codehaus.groovy.ast.expr.ElvisOperatorExpression) MethodCallExpression(org.codehaus.groovy.ast.expr.MethodCallExpression) SpreadMapExpression(org.codehaus.groovy.ast.expr.SpreadMapExpression) DeclarationExpression(org.codehaus.groovy.ast.expr.DeclarationExpression) ClosureExpression(org.codehaus.groovy.ast.expr.ClosureExpression) AttributeExpression(org.codehaus.groovy.ast.expr.AttributeExpression) AssertStatement(org.codehaus.groovy.ast.stmt.AssertStatement) ExpressionStatement(org.codehaus.groovy.ast.stmt.ExpressionStatement) BreakStatement(org.codehaus.groovy.ast.stmt.BreakStatement) ReturnStatement(org.codehaus.groovy.ast.stmt.ReturnStatement) ForStatement(org.codehaus.groovy.ast.stmt.ForStatement) IfStatement(org.codehaus.groovy.ast.stmt.IfStatement) ThrowStatement(org.codehaus.groovy.ast.stmt.ThrowStatement) SynchronizedStatement(org.codehaus.groovy.ast.stmt.SynchronizedStatement) TryCatchStatement(org.codehaus.groovy.ast.stmt.TryCatchStatement) CaseStatement(org.codehaus.groovy.ast.stmt.CaseStatement) WhileStatement(org.codehaus.groovy.ast.stmt.WhileStatement) EmptyStatement(org.codehaus.groovy.ast.stmt.EmptyStatement) CatchStatement(org.codehaus.groovy.ast.stmt.CatchStatement) BlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement) Statement(org.codehaus.groovy.ast.stmt.Statement) DoWhileStatement(org.codehaus.groovy.ast.stmt.DoWhileStatement) ContinueStatement(org.codehaus.groovy.ast.stmt.ContinueStatement) SwitchStatement(org.codehaus.groovy.ast.stmt.SwitchStatement) Tuple2(groovy.lang.Tuple2) CaseStatement(org.codehaus.groovy.ast.stmt.CaseStatement) ArrayList(java.util.ArrayList) Token(org.antlr.v4.runtime.Token) LinkedList(java.util.LinkedList) ArrayList(java.util.ArrayList) List(java.util.List) BlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement)

Example 3 with DEFAULT

use of org.apache.groovy.parser.antlr4.GroovyLexer.DEFAULT in project groovy by apache.

the class AstBuilder method visitUnaryAddExprAlt.

@Override
public Expression visitUnaryAddExprAlt(final UnaryAddExprAltContext ctx) {
    ExpressionContext expressionCtx = ctx.expression();
    Expression expression = (Expression) this.visit(expressionCtx);
    switch(ctx.op.getType()) {
        case ADD:
            {
                if (isNonStringConstantOutsideParentheses(expression)) {
                    return configureAST(expression, ctx);
                }
                return configureAST(new UnaryPlusExpression(expression), ctx);
            }
        case SUB:
            {
                if (isNonStringConstantOutsideParentheses(expression)) {
                    ConstantExpression constantExpression = (ConstantExpression) expression;
                    try {
                        String integerLiteralText = constantExpression.getNodeMetaData(INTEGER_LITERAL_TEXT);
                        if (null != integerLiteralText) {
                            ConstantExpression result = new ConstantExpression(Numbers.parseInteger(SUB_STR + integerLiteralText));
                            // reset the numberFormatError
                            this.numberFormatError = null;
                            return configureAST(result, ctx);
                        }
                        String floatingPointLiteralText = constantExpression.getNodeMetaData(FLOATING_POINT_LITERAL_TEXT);
                        if (null != floatingPointLiteralText) {
                            ConstantExpression result = new ConstantExpression(Numbers.parseDecimal(SUB_STR + floatingPointLiteralText));
                            // reset the numberFormatError
                            this.numberFormatError = null;
                            return configureAST(result, ctx);
                        }
                    } catch (Exception e) {
                        throw createParsingFailedException(e.getMessage(), ctx);
                    }
                    throw new GroovyBugError("Failed to find the original number literal text: " + constantExpression.getText());
                }
                return configureAST(new UnaryMinusExpression(expression), ctx);
            }
        case INC:
        case DEC:
            return configureAST(new PrefixExpression(this.createGroovyToken(ctx.op), expression), ctx);
        default:
            throw createParsingFailedException("Unsupported unary operation: " + ctx.getText(), ctx);
    }
}
Also used : UnaryMinusExpression(org.codehaus.groovy.ast.expr.UnaryMinusExpression) CastParExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.CastParExpressionContext) PathExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.PathExpressionContext) EnhancedStatementExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.EnhancedStatementExpressionContext) ClosureOrLambdaExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.ClosureOrLambdaExpressionContext) CommandExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.CommandExpressionContext) StandardLambdaExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.StandardLambdaExpressionContext) ExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.ExpressionContext) ParExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.ParExpressionContext) SwitchExpressionContext(org.apache.groovy.parser.antlr4.GroovyLangParser.SwitchExpressionContext) PostfixExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.PostfixExpressionContext) UnaryMinusExpression(org.codehaus.groovy.ast.expr.UnaryMinusExpression) ClosureListExpression(org.codehaus.groovy.ast.expr.ClosureListExpression) ArgumentListExpression(org.codehaus.groovy.ast.expr.ArgumentListExpression) MethodReferenceExpression(org.codehaus.groovy.ast.expr.MethodReferenceExpression) TernaryExpression(org.codehaus.groovy.ast.expr.TernaryExpression) PropertyExpression(org.codehaus.groovy.ast.expr.PropertyExpression) PrefixExpression(org.codehaus.groovy.ast.expr.PrefixExpression) PostfixExpression(org.codehaus.groovy.ast.expr.PostfixExpression) Expression(org.codehaus.groovy.ast.expr.Expression) UnaryPlusExpression(org.codehaus.groovy.ast.expr.UnaryPlusExpression) AnnotationConstantExpression(org.codehaus.groovy.ast.expr.AnnotationConstantExpression) BitwiseNegationExpression(org.codehaus.groovy.ast.expr.BitwiseNegationExpression) MapExpression(org.codehaus.groovy.ast.expr.MapExpression) ConstantExpression(org.codehaus.groovy.ast.expr.ConstantExpression) NotExpression(org.codehaus.groovy.ast.expr.NotExpression) EmptyExpression(org.codehaus.groovy.ast.expr.EmptyExpression) ConstructorCallExpression(org.codehaus.groovy.ast.expr.ConstructorCallExpression) ClassExpression(org.codehaus.groovy.ast.expr.ClassExpression) TupleExpression(org.codehaus.groovy.ast.expr.TupleExpression) MethodPointerExpression(org.codehaus.groovy.ast.expr.MethodPointerExpression) MapEntryExpression(org.codehaus.groovy.ast.expr.MapEntryExpression) VariableExpression(org.codehaus.groovy.ast.expr.VariableExpression) CastExpression(org.codehaus.groovy.ast.expr.CastExpression) BooleanExpression(org.codehaus.groovy.ast.expr.BooleanExpression) LambdaExpression(org.codehaus.groovy.ast.expr.LambdaExpression) GStringExpression(org.codehaus.groovy.ast.expr.GStringExpression) ListExpression(org.codehaus.groovy.ast.expr.ListExpression) RangeExpression(org.codehaus.groovy.ast.expr.RangeExpression) NamedArgumentListExpression(org.codehaus.groovy.ast.expr.NamedArgumentListExpression) SpreadExpression(org.codehaus.groovy.ast.expr.SpreadExpression) ArrayExpression(org.codehaus.groovy.ast.expr.ArrayExpression) BinaryExpression(org.codehaus.groovy.ast.expr.BinaryExpression) ElvisOperatorExpression(org.codehaus.groovy.ast.expr.ElvisOperatorExpression) MethodCallExpression(org.codehaus.groovy.ast.expr.MethodCallExpression) SpreadMapExpression(org.codehaus.groovy.ast.expr.SpreadMapExpression) DeclarationExpression(org.codehaus.groovy.ast.expr.DeclarationExpression) ClosureExpression(org.codehaus.groovy.ast.expr.ClosureExpression) AttributeExpression(org.codehaus.groovy.ast.expr.AttributeExpression) AnnotationConstantExpression(org.codehaus.groovy.ast.expr.AnnotationConstantExpression) ConstantExpression(org.codehaus.groovy.ast.expr.ConstantExpression) PrefixExpression(org.codehaus.groovy.ast.expr.PrefixExpression) GroovyBugError(org.codehaus.groovy.GroovyBugError) UnaryPlusExpression(org.codehaus.groovy.ast.expr.UnaryPlusExpression) IOException(java.io.IOException) RecognitionException(org.antlr.v4.runtime.RecognitionException) SyntaxException(org.codehaus.groovy.syntax.SyntaxException) CompilationFailedException(org.codehaus.groovy.control.CompilationFailedException) ParseCancellationException(org.antlr.v4.runtime.misc.ParseCancellationException)

Example 4 with DEFAULT

use of org.apache.groovy.parser.antlr4.GroovyLexer.DEFAULT in project groovy by apache.

the class AstBuilder method visitSwitchExpression.

/**
 * <pre>
 * switch(a) {
 *     case 0, 1  ->   'a';
 *     case 2     ->   'b';
 *     default    ->   'z';
 * }
 * </pre>
 * the above code will be transformed to:
 * <pre>
 * {->
 *     switch(a) {
 *         case 0:
 *         case 1:  return 'a';
 *         case 2:  return 'b';
 *         default: return 'z';
 *     }
 * }()
 * </pre>
 *
 * @param ctx the parse tree
 * @return {@link MethodCallExpression} instance
 */
@Override
public MethodCallExpression visitSwitchExpression(SwitchExpressionContext ctx) {
    switchExpressionRuleContextStack.push(ctx);
    try {
        validateSwitchExpressionLabels(ctx);
        List<Tuple3<List<Statement>, Boolean, Boolean>> statementInfoList = ctx.switchBlockStatementExpressionGroup().stream().map(e -> this.visitSwitchBlockStatementExpressionGroup(e)).collect(Collectors.toList());
        if (statementInfoList.isEmpty()) {
            throw createParsingFailedException("`case` or `default` branches are expected", ctx.LBRACE());
        }
        Boolean isArrow = statementInfoList.get(0).getV2();
        if (!isArrow && statementInfoList.stream().noneMatch(e -> {
            Boolean hasYieldOrThrowStatement = e.getV3();
            return hasYieldOrThrowStatement;
        })) {
            throw createParsingFailedException("`yield` or `throw` is expected", ctx);
        }
        List<Statement> statementList = statementInfoList.stream().map(e -> e.getV1()).reduce(new LinkedList<>(), (r, e) -> {
            r.addAll(e);
            return r;
        });
        List<CaseStatement> caseStatementList = new LinkedList<>();
        List<Statement> defaultStatementList = new LinkedList<>();
        statementList.forEach(e -> {
            if (e instanceof CaseStatement) {
                caseStatementList.add((CaseStatement) e);
            } else if (isTrue(e, IS_SWITCH_DEFAULT)) {
                defaultStatementList.add(e);
            }
        });
        int defaultStatementListSize = defaultStatementList.size();
        if (defaultStatementListSize > 1) {
            throw createParsingFailedException("switch expression 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));
        }
        String variableName = "__$$sev" + switchExpressionVariableSeq++;
        Statement declarationStatement = declS(localVarX(variableName), this.visitExpressionInPar(ctx.expressionInPar()));
        SwitchStatement switchStatement = configureAST(new SwitchStatement(varX(variableName), caseStatementList, defaultStatementListSize == 0 ? EmptyStatement.INSTANCE : defaultStatementList.get(0)), ctx);
        MethodCallExpression callClosure = callX(configureAST(closureX(null, createBlockStatement(declarationStatement, switchStatement)), ctx), "call");
        callClosure.setImplicitThis(false);
        return configureAST(callClosure, ctx);
    } finally {
        switchExpressionRuleContextStack.pop();
    }
}
Also used : CastParExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.CastParExpressionContext) SUB(org.apache.groovy.parser.antlr4.GroovyParser.SUB) CastExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.CastExprAltContext) ConditionalExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ConditionalExprAltContext) DEFAULT(org.apache.groovy.parser.antlr4.GroovyParser.DEFAULT) IdentifierContext(org.apache.groovy.parser.antlr4.GroovyParser.IdentifierContext) SEALED(org.apache.groovy.parser.antlr4.GroovyParser.SEALED) QualifiedClassNameListContext(org.apache.groovy.parser.antlr4.GroovyParser.QualifiedClassNameListContext) ModifierContext(org.apache.groovy.parser.antlr4.GroovyParser.ModifierContext) ElementValuePairsContext(org.apache.groovy.parser.antlr4.GroovyParser.ElementValuePairsContext) BlockStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.BlockStatementContext) PathExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.PathExpressionContext) NonSealed(groovy.transform.NonSealed) EnumConstantsContext(org.apache.groovy.parser.antlr4.GroovyParser.EnumConstantsContext) Map(java.util.Map) ListContext(org.apache.groovy.parser.antlr4.GroovyParser.ListContext) Sealed(groovy.transform.Sealed) PropertyNode(org.codehaus.groovy.ast.PropertyNode) Trait(groovy.transform.Trait) TypeNamePairContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeNamePairContext) UnaryMinusExpression(org.codehaus.groovy.ast.expr.UnaryMinusExpression) ClosureListExpression(org.codehaus.groovy.ast.expr.ClosureListExpression) Recognizer(org.antlr.v4.runtime.Recognizer) QualifiedNameElementContext(org.apache.groovy.parser.antlr4.GroovyParser.QualifiedNameElementContext) EnhancedStatementExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.EnhancedStatementExpressionContext) EmptyDimsContext(org.apache.groovy.parser.antlr4.GroovyParser.EmptyDimsContext) ArgumentListExpression(org.codehaus.groovy.ast.expr.ArgumentListExpression) ClosureOrLambdaExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.ClosureOrLambdaExpressionContext) CommandExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.CommandExpressionContext) CommandExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.CommandExprAltContext) GstringValueContext(org.apache.groovy.parser.antlr4.GroovyParser.GstringValueContext) ArrayInitializerContext(org.apache.groovy.parser.antlr4.GroovyParser.ArrayInitializerContext) MethodReferenceExpression(org.codehaus.groovy.ast.expr.MethodReferenceExpression) Stream(java.util.stream.Stream) TernaryExpression(org.codehaus.groovy.ast.expr.TernaryExpression) AssertStatement(org.codehaus.groovy.ast.stmt.AssertStatement) DefaultGroovyMethods.asBoolean(org.codehaus.groovy.runtime.DefaultGroovyMethods.asBoolean) IdentifierPrmrAltContext(org.apache.groovy.parser.antlr4.GroovyParser.IdentifierPrmrAltContext) AndExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.AndExprAltContext) DEC(org.apache.groovy.parser.antlr4.GroovyParser.DEC) PropertyExpression(org.codehaus.groovy.ast.expr.PropertyExpression) DEF(org.apache.groovy.parser.antlr4.GroovyParser.DEF) GeneralUtils.declS(org.codehaus.groovy.ast.tools.GeneralUtils.declS) VariableDeclaratorIdContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableDeclaratorIdContext) YieldStatementContext(org.apache.groovy.parser.antlr4.GroovyLangParser.YieldStatementContext) LinkedHashMap(java.util.LinkedHashMap) EnhancedForControlContext(org.apache.groovy.parser.antlr4.GroovyParser.EnhancedForControlContext) PrefixExpression(org.codehaus.groovy.ast.expr.PrefixExpression) SystemUtil(org.apache.groovy.util.SystemUtil) ExpressionStatement(org.codehaus.groovy.ast.stmt.ExpressionStatement) GeneralUtils.returnS(org.codehaus.groovy.ast.tools.GeneralUtils.returnS) GroovyParserRuleContext(org.apache.groovy.parser.antlr4.GroovyParser.GroovyParserRuleContext) PowerExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.PowerExprAltContext) StandardLambdaExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.StandardLambdaExpressionContext) PostfixExpression(org.codehaus.groovy.ast.expr.PostfixExpression) StringUtils(org.apache.groovy.parser.antlr4.util.StringUtils) ElementValuePairContext(org.apache.groovy.parser.antlr4.GroovyParser.ElementValuePairContext) Expression(org.codehaus.groovy.ast.expr.Expression) AnnotationNameContext(org.apache.groovy.parser.antlr4.GroovyParser.AnnotationNameContext) FINAL(org.apache.groovy.parser.antlr4.GroovyParser.FINAL) Opcodes(org.objectweb.asm.Opcodes) CompileStatic(groovy.transform.CompileStatic) UnaryPlusExpression(org.codehaus.groovy.ast.expr.UnaryPlusExpression) SourceUnit(org.codehaus.groovy.control.SourceUnit) ClassNode(org.codehaus.groovy.ast.ClassNode) SwitchExpressionLabelContext(org.apache.groovy.parser.antlr4.GroovyLangParser.SwitchExpressionLabelContext) ForStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ForStmtAltContext) BreakStatement(org.codehaus.groovy.ast.stmt.BreakStatement) GeneralUtils.listX(org.codehaus.groovy.ast.tools.GeneralUtils.listX) GeneralUtils.localVarX(org.codehaus.groovy.ast.tools.GeneralUtils.localVarX) GenericsType(org.codehaus.groovy.ast.GenericsType) IOException(java.io.IOException) PredictionMode(org.antlr.v4.runtime.atn.PredictionMode) ForControlContext(org.apache.groovy.parser.antlr4.GroovyParser.ForControlContext) ReturnStatement(org.codehaus.groovy.ast.stmt.ReturnStatement) AnnotationConstantExpression(org.codehaus.groovy.ast.expr.AnnotationConstantExpression) VariableModifiersContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableModifiersContext) CompilationUnitContext(org.apache.groovy.parser.antlr4.GroovyParser.CompilationUnitContext) RecognitionException(org.antlr.v4.runtime.RecognitionException) BitwiseNegationExpression(org.codehaus.groovy.ast.expr.BitwiseNegationExpression) TupleConstructor(groovy.transform.TupleConstructor) ANTLRErrorListener(org.antlr.v4.runtime.ANTLRErrorListener) IfElseStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.IfElseStatementContext) MapEntryLabelContext(org.apache.groovy.parser.antlr4.GroovyParser.MapEntryLabelContext) AS(org.apache.groovy.parser.antlr4.GroovyParser.AS) EqualityExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.EqualityExprAltContext) GeneralUtils.stmt(org.codehaus.groovy.ast.tools.GeneralUtils.stmt) Interval(org.antlr.v4.runtime.misc.Interval) IntegerLiteralAltContext(org.apache.groovy.parser.antlr4.GroovyParser.IntegerLiteralAltContext) MapExpression(org.codehaus.groovy.ast.expr.MapExpression) TypeArgumentsContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeArgumentsContext) CompilePhase(org.codehaus.groovy.control.CompilePhase) TokenStream(org.antlr.v4.runtime.TokenStream) AtnManager(org.apache.groovy.parser.antlr4.internal.atnmanager.AtnManager) ExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.ExpressionContext) ConstantExpression(org.codehaus.groovy.ast.expr.ConstantExpression) ClosureUtils(org.codehaus.groovy.ast.tools.ClosureUtils) ModuleNode(org.codehaus.groovy.ast.ModuleNode) LogicalAndExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.LogicalAndExprAltContext) FormalParameterContext(org.apache.groovy.parser.antlr4.GroovyParser.FormalParameterContext) EnumConstantClassNode(org.codehaus.groovy.ast.EnumConstantClassNode) BlockContext(org.apache.groovy.parser.antlr4.GroovyParser.BlockContext) Numbers(org.codehaus.groovy.syntax.Numbers) SwitchLabelContext(org.apache.groovy.parser.antlr4.GroovyParser.SwitchLabelContext) BreakStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.BreakStatementContext) BuiltInTypeContext(org.apache.groovy.parser.antlr4.GroovyParser.BuiltInTypeContext) MethodNameContext(org.apache.groovy.parser.antlr4.GroovyParser.MethodNameContext) CreatorContext(org.apache.groovy.parser.antlr4.GroovyParser.CreatorContext) ForStatement(org.codehaus.groovy.ast.stmt.ForStatement) INC(org.apache.groovy.parser.antlr4.GroovyParser.INC) LabeledStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.LabeledStmtAltContext) MethodDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.MethodDeclarationContext) ScriptStatementsContext(org.apache.groovy.parser.antlr4.GroovyParser.ScriptStatementsContext) NamedPropertyArgsContext(org.apache.groovy.parser.antlr4.GroovyParser.NamedPropertyArgsContext) ExclusiveOrExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ExclusiveOrExprAltContext) Types(org.codehaus.groovy.syntax.Types) GeneralUtils.closureX(org.codehaus.groovy.ast.tools.GeneralUtils.closureX) DefaultGroovyMethods(org.codehaus.groovy.runtime.DefaultGroovyMethods) ThisPrmrAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ThisPrmrAltContext) SwitchBlockStatementGroupContext(org.apache.groovy.parser.antlr4.GroovyParser.SwitchBlockStatementGroupContext) StringGroovyMethods(org.codehaus.groovy.runtime.StringGroovyMethods) Collectors(java.util.stream.Collectors) NotExpression(org.codehaus.groovy.ast.expr.NotExpression) PrimitiveTypeContext(org.apache.groovy.parser.antlr4.GroovyParser.PrimitiveTypeContext) InnerClassNode(org.codehaus.groovy.ast.InnerClassNode) Objects(java.util.Objects) ARROW(org.apache.groovy.parser.antlr4.GroovyLangParser.ARROW) IfStatement(org.codehaus.groovy.ast.stmt.IfStatement) MapContext(org.apache.groovy.parser.antlr4.GroovyParser.MapContext) NewPrmrAltContext(org.apache.groovy.parser.antlr4.GroovyParser.NewPrmrAltContext) EnhancedArgumentListInParContext(org.apache.groovy.parser.antlr4.GroovyParser.EnhancedArgumentListInParContext) ForUpdateContext(org.apache.groovy.parser.antlr4.GroovyParser.ForUpdateContext) RegexExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.RegexExprAltContext) INSTANCEOF(org.apache.groovy.parser.antlr4.GroovyParser.INSTANCEOF) AnnotationNode(org.codehaus.groovy.ast.AnnotationNode) VariableDeclaratorContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableDeclaratorContext) CompactConstructorDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.CompactConstructorDeclarationContext) TypeArgumentsOrDiamondContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeArgumentsOrDiamondContext) Verifier(org.codehaus.groovy.classgen.Verifier) ContinueStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.ContinueStatementContext) Maps(org.apache.groovy.util.Maps) Tuple2(groovy.lang.Tuple2) NOT_IN(org.apache.groovy.parser.antlr4.GroovyParser.NOT_IN) Tuple3(groovy.lang.Tuple3) ThrowStatement(org.codehaus.groovy.ast.stmt.ThrowStatement) VariableNamesContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableNamesContext) GeneralUtils.varX(org.codehaus.groovy.ast.tools.GeneralUtils.varX) EmptyExpression(org.codehaus.groovy.ast.expr.EmptyExpression) LinkedList(java.util.LinkedList) AnnotationContext(org.apache.groovy.parser.antlr4.GroovyParser.AnnotationContext) GstringContext(org.apache.groovy.parser.antlr4.GroovyParser.GstringContext) ConstructorCallExpression(org.codehaus.groovy.ast.expr.ConstructorCallExpression) DynamicMemberNameContext(org.apache.groovy.parser.antlr4.GroovyParser.DynamicMemberNameContext) MapEntryContext(org.apache.groovy.parser.antlr4.GroovyParser.MapEntryContext) StatementContext(org.apache.groovy.parser.antlr4.GroovyParser.StatementContext) DoWhileStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.DoWhileStmtAltContext) ClassHelper(org.codehaus.groovy.ast.ClassHelper) GeneralUtils.cloneParams(org.codehaus.groovy.ast.tools.GeneralUtils.cloneParams) ShiftExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ShiftExprAltContext) ClassBodyDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassBodyDeclarationContext) DescriptiveErrorStrategy(org.apache.groovy.parser.antlr4.internal.DescriptiveErrorStrategy) TypeUtil.isPrimitiveType(org.codehaus.groovy.classgen.asm.util.TypeUtil.isPrimitiveType) SynchronizedStatement(org.codehaus.groovy.ast.stmt.SynchronizedStatement) ClassExpression(org.codehaus.groovy.ast.expr.ClassExpression) ReturnTypeContext(org.apache.groovy.parser.antlr4.GroovyParser.ReturnTypeContext) ASTNode(org.codehaus.groovy.ast.ASTNode) TupleExpression(org.codehaus.groovy.ast.expr.TupleExpression) NonWildcardTypeArgumentsContext(org.apache.groovy.parser.antlr4.GroovyParser.NonWildcardTypeArgumentsContext) ThisFormalParameterContext(org.apache.groovy.parser.antlr4.GroovyParser.ThisFormalParameterContext) TryCatchStatement(org.codehaus.groovy.ast.stmt.TryCatchStatement) RANGE_EXCLUSIVE_RIGHT(org.apache.groovy.parser.antlr4.GroovyParser.RANGE_EXCLUSIVE_RIGHT) MethodPointerExpression(org.codehaus.groovy.ast.expr.MethodPointerExpression) BooleanLiteralAltContext(org.apache.groovy.parser.antlr4.GroovyParser.BooleanLiteralAltContext) ConstructorNode(org.codehaus.groovy.ast.ConstructorNode) MapEntryExpression(org.codehaus.groovy.ast.expr.MapEntryExpression) ClassOrInterfaceModifierContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassOrInterfaceModifierContext) SyntaxException(org.codehaus.groovy.syntax.SyntaxException) PRIVATE(org.apache.groovy.parser.antlr4.GroovyParser.PRIVATE) InclusiveOrExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.InclusiveOrExprAltContext) ElementValueArrayInitializerContext(org.apache.groovy.parser.antlr4.GroovyParser.ElementValueArrayInitializerContext) Arrays(java.util.Arrays) Token(org.antlr.v4.runtime.Token) CharStreams(org.antlr.v4.runtime.CharStreams) NamePartContext(org.apache.groovy.parser.antlr4.GroovyParser.NamePartContext) GE(org.apache.groovy.parser.antlr4.GroovyParser.GE) EnumConstantContext(org.apache.groovy.parser.antlr4.GroovyParser.EnumConstantContext) LocalVariableDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.LocalVariableDeclarationContext) ClassBodyContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassBodyContext) MethodBodyContext(org.apache.groovy.parser.antlr4.GroovyParser.MethodBodyContext) WhileStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.WhileStmtAltContext) CaseStatement(org.codehaus.groovy.ast.stmt.CaseStatement) CommandArgumentContext(org.apache.groovy.parser.antlr4.GroovyParser.CommandArgumentContext) CreatedNameContext(org.apache.groovy.parser.antlr4.GroovyParser.CreatedNameContext) NOT_INSTANCEOF(org.apache.groovy.parser.antlr4.GroovyParser.NOT_INSTANCEOF) IndexPropertyArgsContext(org.apache.groovy.parser.antlr4.GroovyParser.IndexPropertyArgsContext) TypeBoundContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeBoundContext) GT(org.apache.groovy.parser.antlr4.GroovyParser.GT) ParExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.ParExpressionContext) ClosureContext(org.apache.groovy.parser.antlr4.GroovyParser.ClosureContext) VariableExpression(org.codehaus.groovy.ast.expr.VariableExpression) PackageNode(org.codehaus.groovy.ast.PackageNode) ModifierNode(org.codehaus.groovy.ast.ModifierNode) AnnotatedNodeUtils(org.apache.groovy.ast.tools.AnnotatedNodeUtils) ConditionalStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.ConditionalStatementContext) EnhancedArgumentListElementContext(org.apache.groovy.parser.antlr4.GroovyParser.EnhancedArgumentListElementContext) AssertStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.AssertStatementContext) ClassHelper.isPrimitiveVoid(org.codehaus.groovy.ast.ClassHelper.isPrimitiveVoid) NON_SEALED(org.apache.groovy.parser.antlr4.GroovyParser.NON_SEALED) GeneralUtils.callX(org.codehaus.groovy.ast.tools.GeneralUtils.callX) TerminalNode(org.antlr.v4.runtime.tree.TerminalNode) PositionConfigureUtils.configureAST(org.apache.groovy.parser.antlr4.util.PositionConfigureUtils.configureAST) SwitchExpressionContext(org.apache.groovy.parser.antlr4.GroovyLangParser.SwitchExpressionContext) CompilationFailedException(org.codehaus.groovy.control.CompilationFailedException) AnnotationsOptContext(org.apache.groovy.parser.antlr4.GroovyParser.AnnotationsOptContext) CastExpression(org.codehaus.groovy.ast.expr.CastExpression) ParserRuleContext(org.antlr.v4.runtime.ParserRuleContext) RelationalExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.RelationalExprAltContext) BooleanExpression(org.codehaus.groovy.ast.expr.BooleanExpression) BlockStatementsOptContext(org.apache.groovy.parser.antlr4.GroovyParser.BlockStatementsOptContext) ImportDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.ImportDeclarationContext) ThrowStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ThrowStmtAltContext) FieldDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.FieldDeclarationContext) FinallyBlockContext(org.apache.groovy.parser.antlr4.GroovyParser.FinallyBlockContext) StandardLambdaParametersContext(org.apache.groovy.parser.antlr4.GroovyParser.StandardLambdaParametersContext) LambdaExpression(org.codehaus.groovy.ast.expr.LambdaExpression) LoopStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.LoopStmtAltContext) WhileStatement(org.codehaus.groovy.ast.stmt.WhileStatement) ArrayList(java.util.ArrayList) StringLiteralContext(org.apache.groovy.parser.antlr4.GroovyParser.StringLiteralContext) CharStream(org.antlr.v4.runtime.CharStream) EmptyDimsOptContext(org.apache.groovy.parser.antlr4.GroovyParser.EmptyDimsOptContext) MethodNode(org.codehaus.groovy.ast.MethodNode) NullLiteralAltContext(org.apache.groovy.parser.antlr4.GroovyParser.NullLiteralAltContext) CatchClauseContext(org.apache.groovy.parser.antlr4.GroovyParser.CatchClauseContext) ClassDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassDeclarationContext) ParseTree(org.antlr.v4.runtime.tree.ParseTree) VariableInitializerContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableInitializerContext) MultipleAssignmentExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.MultipleAssignmentExprAltContext) RANGE_EXCLUSIVE_FULL(org.apache.groovy.parser.antlr4.GroovyParser.RANGE_EXCLUSIVE_FULL) Parameter(org.codehaus.groovy.ast.Parameter) VariableInitializersContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableInitializersContext) FloatingPointLiteralAltContext(org.apache.groovy.parser.antlr4.GroovyParser.FloatingPointLiteralAltContext) SwitchExprAltContext(org.apache.groovy.parser.antlr4.GroovyLangParser.SwitchExprAltContext) VAR(org.apache.groovy.parser.antlr4.GroovyParser.VAR) ClassOrInterfaceModifiersContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassOrInterfaceModifiersContext) IN(org.apache.groovy.parser.antlr4.GroovyParser.IN) ExpressionListContext(org.apache.groovy.parser.antlr4.GroovyParser.ExpressionListContext) EmptyStatement(org.codehaus.groovy.ast.stmt.EmptyStatement) TypeDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeDeclarationContext) ElementValuesContext(org.apache.groovy.parser.antlr4.GroovyParser.ElementValuesContext) PackageDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.PackageDeclarationContext) GStringExpression(org.codehaus.groovy.ast.expr.GStringExpression) BufferedReader(java.io.BufferedReader) ArrayDeque(java.util.ArrayDeque) DefaultGroovyMethods.last(org.codehaus.groovy.runtime.DefaultGroovyMethods.last) ResourceContext(org.apache.groovy.parser.antlr4.GroovyParser.ResourceContext) ListExpression(org.codehaus.groovy.ast.expr.ListExpression) SAFE_INDEX(org.apache.groovy.parser.antlr4.GroovyParser.SAFE_INDEX) TryCatchStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.TryCatchStatementContext) SynchronizedStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.SynchronizedStmtAltContext) MapEntryListContext(org.apache.groovy.parser.antlr4.GroovyParser.MapEntryListContext) ElementValueContext(org.apache.groovy.parser.antlr4.GroovyParser.ElementValueContext) VariableDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableDeclarationContext) CommonTokenStream(org.antlr.v4.runtime.CommonTokenStream) ClassNameContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassNameContext) TypeListContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeListContext) CatchTypeContext(org.apache.groovy.parser.antlr4.GroovyParser.CatchTypeContext) RangeExpression(org.codehaus.groovy.ast.expr.RangeExpression) UnaryNotExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.UnaryNotExprAltContext) GeneralUtils.assignX(org.codehaus.groovy.ast.tools.GeneralUtils.assignX) ModifiersOptContext(org.apache.groovy.parser.antlr4.GroovyParser.ModifiersOptContext) NamedArgumentListExpression(org.codehaus.groovy.ast.expr.NamedArgumentListExpression) VariableModifierContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableModifierContext) SwitchBlockStatementExpressionGroupContext(org.apache.groovy.parser.antlr4.GroovyLangParser.SwitchBlockStatementExpressionGroupContext) PathElementContext(org.apache.groovy.parser.antlr4.GroovyParser.PathElementContext) UnaryAddExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.UnaryAddExprAltContext) TypeNamePairsContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeNamePairsContext) AnnotatedQualifiedClassNameContext(org.apache.groovy.parser.antlr4.GroovyParser.AnnotatedQualifiedClassNameContext) SpreadExpression(org.codehaus.groovy.ast.expr.SpreadExpression) AnonymousInnerClassDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.AnonymousInnerClassDeclarationContext) ForInitContext(org.apache.groovy.parser.antlr4.GroovyParser.ForInitContext) VariableModifiersOptContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableModifiersOptContext) ArrayExpression(org.codehaus.groovy.ast.expr.ArrayExpression) MultiplicativeExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.MultiplicativeExprAltContext) SyntaxErrorMessage(org.codehaus.groovy.control.messages.SyntaxErrorMessage) AssignmentExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.AssignmentExprAltContext) CatchStatement(org.codehaus.groovy.ast.stmt.CatchStatement) TypeArgumentContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeArgumentContext) VariableDeclaratorsContext(org.apache.groovy.parser.antlr4.GroovyParser.VariableDeclaratorsContext) TypeParameterContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeParameterContext) GroovyBugError(org.codehaus.groovy.GroovyBugError) ReturnStmtAltContext(org.apache.groovy.parser.antlr4.GroovyParser.ReturnStmtAltContext) List(java.util.List) BinaryExpression(org.codehaus.groovy.ast.expr.BinaryExpression) TypeParametersContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeParametersContext) ArgumentsContext(org.apache.groovy.parser.antlr4.GroovyParser.ArgumentsContext) BlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement) LE(org.apache.groovy.parser.antlr4.GroovyParser.LE) BlockStatementsContext(org.apache.groovy.parser.antlr4.GroovyParser.BlockStatementsContext) Optional(java.util.Optional) GstringPathContext(org.apache.groovy.parser.antlr4.GroovyParser.GstringPathContext) QualifiedStandardClassNameContext(org.apache.groovy.parser.antlr4.GroovyParser.QualifiedStandardClassNameContext) KeywordsContext(org.apache.groovy.parser.antlr4.GroovyParser.KeywordsContext) AdditiveExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.AdditiveExprAltContext) NodeMetaDataHandler(org.codehaus.groovy.ast.NodeMetaDataHandler) ClassicalForControlContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassicalForControlContext) Statement(org.codehaus.groovy.ast.stmt.Statement) ParseCancellationException(org.antlr.v4.runtime.misc.ParseCancellationException) CodeVisitorSupport(org.codehaus.groovy.ast.CodeVisitorSupport) ElvisOperatorExpression(org.codehaus.groovy.ast.expr.ElvisOperatorExpression) STATIC(org.apache.groovy.parser.antlr4.GroovyParser.STATIC) LT(org.apache.groovy.parser.antlr4.GroovyParser.LT) Deque(java.util.Deque) ResourceListContext(org.apache.groovy.parser.antlr4.GroovyParser.ResourceListContext) SwitchStatementContext(org.apache.groovy.parser.antlr4.GroovyParser.SwitchStatementContext) SuperPrmrAltContext(org.apache.groovy.parser.antlr4.GroovyParser.SuperPrmrAltContext) EnumHelper(org.codehaus.groovy.antlr.EnumHelper) FormalParametersContext(org.apache.groovy.parser.antlr4.GroovyParser.FormalParametersContext) MethodCallExpression(org.codehaus.groovy.ast.expr.MethodCallExpression) DoWhileStatement(org.codehaus.groovy.ast.stmt.DoWhileStatement) ExpressionListElementContext(org.apache.groovy.parser.antlr4.GroovyParser.ExpressionListElementContext) LambdaBodyContext(org.apache.groovy.parser.antlr4.GroovyParser.LambdaBodyContext) ContinueStatement(org.codehaus.groovy.ast.stmt.ContinueStatement) QualifiedNameContext(org.apache.groovy.parser.antlr4.GroovyParser.QualifiedNameContext) SpreadMapExpression(org.codehaus.groovy.ast.expr.SpreadMapExpression) ResourcesContext(org.apache.groovy.parser.antlr4.GroovyParser.ResourcesContext) YieldStmtAltContext(org.apache.groovy.parser.antlr4.GroovyLangParser.YieldStmtAltContext) ADD(org.apache.groovy.parser.antlr4.GroovyParser.ADD) PostfixExpressionContext(org.apache.groovy.parser.antlr4.GroovyParser.PostfixExpressionContext) Iterator(java.util.Iterator) CASE(org.apache.groovy.parser.antlr4.GroovyParser.CASE) ExpressionInParContext(org.apache.groovy.parser.antlr4.GroovyParser.ExpressionInParContext) DimContext(org.apache.groovy.parser.antlr4.GroovyParser.DimContext) DeclarationExpression(org.codehaus.groovy.ast.expr.DeclarationExpression) ClosureExpression(org.codehaus.groovy.ast.expr.ClosureExpression) TypeContext(org.apache.groovy.parser.antlr4.GroovyParser.TypeContext) SwitchStatement(org.codehaus.groovy.ast.stmt.SwitchStatement) FormalParameterListContext(org.apache.groovy.parser.antlr4.GroovyParser.FormalParameterListContext) ImportNode(org.codehaus.groovy.ast.ImportNode) QualifiedClassNameContext(org.apache.groovy.parser.antlr4.GroovyParser.QualifiedClassNameContext) LogicalOrExprAltContext(org.apache.groovy.parser.antlr4.GroovyParser.LogicalOrExprAltContext) FieldNode(org.codehaus.groovy.ast.FieldNode) AttributeExpression(org.codehaus.groovy.ast.expr.AttributeExpression) RANGE_INCLUSIVE(org.apache.groovy.parser.antlr4.GroovyParser.RANGE_INCLUSIVE) ClassOrInterfaceTypeContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassOrInterfaceTypeContext) Tuple.tuple(groovy.lang.Tuple.tuple) RANGE_EXCLUSIVE_LEFT(org.apache.groovy.parser.antlr4.GroovyParser.RANGE_EXCLUSIVE_LEFT) ClassOrInterfaceModifiersOptContext(org.apache.groovy.parser.antlr4.GroovyParser.ClassOrInterfaceModifiersOptContext) MemberDeclarationContext(org.apache.groovy.parser.antlr4.GroovyParser.MemberDeclarationContext) Collections(java.util.Collections) ModifiersContext(org.apache.groovy.parser.antlr4.GroovyParser.ModifiersContext) AssertStatement(org.codehaus.groovy.ast.stmt.AssertStatement) ExpressionStatement(org.codehaus.groovy.ast.stmt.ExpressionStatement) BreakStatement(org.codehaus.groovy.ast.stmt.BreakStatement) ReturnStatement(org.codehaus.groovy.ast.stmt.ReturnStatement) ForStatement(org.codehaus.groovy.ast.stmt.ForStatement) IfStatement(org.codehaus.groovy.ast.stmt.IfStatement) ThrowStatement(org.codehaus.groovy.ast.stmt.ThrowStatement) SynchronizedStatement(org.codehaus.groovy.ast.stmt.SynchronizedStatement) TryCatchStatement(org.codehaus.groovy.ast.stmt.TryCatchStatement) CaseStatement(org.codehaus.groovy.ast.stmt.CaseStatement) WhileStatement(org.codehaus.groovy.ast.stmt.WhileStatement) EmptyStatement(org.codehaus.groovy.ast.stmt.EmptyStatement) CatchStatement(org.codehaus.groovy.ast.stmt.CatchStatement) BlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement) Statement(org.codehaus.groovy.ast.stmt.Statement) DoWhileStatement(org.codehaus.groovy.ast.stmt.DoWhileStatement) ContinueStatement(org.codehaus.groovy.ast.stmt.ContinueStatement) SwitchStatement(org.codehaus.groovy.ast.stmt.SwitchStatement) CaseStatement(org.codehaus.groovy.ast.stmt.CaseStatement) LinkedList(java.util.LinkedList) SwitchStatement(org.codehaus.groovy.ast.stmt.SwitchStatement) MethodCallExpression(org.codehaus.groovy.ast.expr.MethodCallExpression) Tuple3(groovy.lang.Tuple3) DefaultGroovyMethods.asBoolean(org.codehaus.groovy.runtime.DefaultGroovyMethods.asBoolean)

Aggregations

IOException (java.io.IOException)4 RecognitionException (org.antlr.v4.runtime.RecognitionException)4 ParseCancellationException (org.antlr.v4.runtime.misc.ParseCancellationException)4 SwitchExpressionContext (org.apache.groovy.parser.antlr4.GroovyLangParser.SwitchExpressionContext)3 CastParExpressionContext (org.apache.groovy.parser.antlr4.GroovyParser.CastParExpressionContext)3 ClosureOrLambdaExpressionContext (org.apache.groovy.parser.antlr4.GroovyParser.ClosureOrLambdaExpressionContext)3 CommandExpressionContext (org.apache.groovy.parser.antlr4.GroovyParser.CommandExpressionContext)3 EnhancedStatementExpressionContext (org.apache.groovy.parser.antlr4.GroovyParser.EnhancedStatementExpressionContext)3 ExpressionContext (org.apache.groovy.parser.antlr4.GroovyParser.ExpressionContext)3 ParExpressionContext (org.apache.groovy.parser.antlr4.GroovyParser.ParExpressionContext)3 PathExpressionContext (org.apache.groovy.parser.antlr4.GroovyParser.PathExpressionContext)3 PostfixExpressionContext (org.apache.groovy.parser.antlr4.GroovyParser.PostfixExpressionContext)3 StandardLambdaExpressionContext (org.apache.groovy.parser.antlr4.GroovyParser.StandardLambdaExpressionContext)3 GroovyBugError (org.codehaus.groovy.GroovyBugError)3 AnnotationConstantExpression (org.codehaus.groovy.ast.expr.AnnotationConstantExpression)3 ArgumentListExpression (org.codehaus.groovy.ast.expr.ArgumentListExpression)3 ArrayExpression (org.codehaus.groovy.ast.expr.ArrayExpression)3 AttributeExpression (org.codehaus.groovy.ast.expr.AttributeExpression)3 BinaryExpression (org.codehaus.groovy.ast.expr.BinaryExpression)3 BitwiseNegationExpression (org.codehaus.groovy.ast.expr.BitwiseNegationExpression)3