Search in sources :

Example 6 with RewriteEarlyExitException

use of org.antlr.runtime.tree.RewriteEarlyExitException in project freud by LMAX-Exchange.

the class JavaParser method qualifiedTypeIdentSimplified.

// $ANTLR start "qualifiedTypeIdentSimplified"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:672:1: qualifiedTypeIdentSimplified : typeIdentSimplified ( DOT typeIdentSimplified )* -> ^( QUALIFIED_TYPE_IDENT ( typeIdentSimplified )+ ) ;
public final JavaParser.qualifiedTypeIdentSimplified_return qualifiedTypeIdentSimplified() throws RecognitionException {
    JavaParser.qualifiedTypeIdentSimplified_return retval = new JavaParser.qualifiedTypeIdentSimplified_return();
    retval.start = input.LT(1);
    int qualifiedTypeIdentSimplified_StartIndex = input.index();
    CommonTree root_0 = null;
    Token DOT178 = null;
    JavaParser.typeIdentSimplified_return typeIdentSimplified177 = null;
    JavaParser.typeIdentSimplified_return typeIdentSimplified179 = null;
    CommonTree DOT178_tree = null;
    RewriteRuleTokenStream stream_DOT = new RewriteRuleTokenStream(adaptor, "token DOT");
    RewriteRuleSubtreeStream stream_typeIdentSimplified = new RewriteRuleSubtreeStream(adaptor, "rule typeIdentSimplified");
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 46)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:673:5: ( typeIdentSimplified ( DOT typeIdentSimplified )* -> ^( QUALIFIED_TYPE_IDENT ( typeIdentSimplified )+ ) )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:673:9: typeIdentSimplified ( DOT typeIdentSimplified )*
        {
            pushFollow(FOLLOW_typeIdentSimplified_in_qualifiedTypeIdentSimplified7045);
            typeIdentSimplified177 = typeIdentSimplified();
            state._fsp--;
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_typeIdentSimplified.add(typeIdentSimplified177.getTree());
            }
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:673:29: ( DOT typeIdentSimplified )*
            loop63: do {
                int alt63 = 2;
                int LA63_0 = input.LA(1);
                if ((LA63_0 == DOT)) {
                    alt63 = 1;
                }
                switch(alt63) {
                    case 1:
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:673:30: DOT typeIdentSimplified
                        {
                            DOT178 = (Token) match(input, DOT, FOLLOW_DOT_in_qualifiedTypeIdentSimplified7048);
                            if (state.failed) {
                                return retval;
                            }
                            if (state.backtracking == 0) {
                                stream_DOT.add(DOT178);
                            }
                            pushFollow(FOLLOW_typeIdentSimplified_in_qualifiedTypeIdentSimplified7050);
                            typeIdentSimplified179 = typeIdentSimplified();
                            state._fsp--;
                            if (state.failed) {
                                return retval;
                            }
                            if (state.backtracking == 0) {
                                stream_typeIdentSimplified.add(typeIdentSimplified179.getTree());
                            }
                        }
                        break;
                    default:
                        break loop63;
                }
            } while (true);
            // wildcard labels:
            if (state.backtracking == 0) {
                retval.tree = root_0;
                RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                root_0 = (CommonTree) adaptor.nil();
                // 674:9: -> ^( QUALIFIED_TYPE_IDENT ( typeIdentSimplified )+ )
                {
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:674:13: ^( QUALIFIED_TYPE_IDENT ( typeIdentSimplified )+ )
                    {
                        CommonTree root_1 = (CommonTree) adaptor.nil();
                        root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(QUALIFIED_TYPE_IDENT, "QUALIFIED_TYPE_IDENT"), root_1);
                        if (!(stream_typeIdentSimplified.hasNext())) {
                            throw new RewriteEarlyExitException();
                        }
                        while (stream_typeIdentSimplified.hasNext()) {
                            adaptor.addChild(root_1, stream_typeIdentSimplified.nextTree());
                        }
                        stream_typeIdentSimplified.reset();
                        adaptor.addChild(root_0, root_1);
                    }
                }
                retval.tree = root_0;
            }
        }
        retval.stop = input.LT(-1);
        if (state.backtracking == 0) {
            retval.tree = (CommonTree) adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
        }
    } catch (RecognitionException re) {
        reportError(re);
        recover(input, re);
        retval.tree = (CommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
    } finally {
        if (state.backtracking > 0) {
            memoize(input, 46, qualifiedTypeIdentSimplified_StartIndex);
        }
    }
    return retval;
}
Also used : RewriteRuleTokenStream(org.antlr.runtime.tree.RewriteRuleTokenStream) CommonTree(org.antlr.runtime.tree.CommonTree) RewriteRuleSubtreeStream(org.antlr.runtime.tree.RewriteRuleSubtreeStream) Token(org.antlr.runtime.Token) RewriteEarlyExitException(org.antlr.runtime.tree.RewriteEarlyExitException) RecognitionException(org.antlr.runtime.RecognitionException)

Example 7 with RewriteEarlyExitException

use of org.antlr.runtime.tree.RewriteEarlyExitException in project freud by LMAX-Exchange.

the class JavaParser method genericTypeArgumentListSimplified.

// $ANTLR start "genericTypeArgumentListSimplified"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:711:1: genericTypeArgumentListSimplified : LESS_THAN genericTypeArgumentSimplified ( COMMA genericTypeArgumentSimplified )* genericTypeListClosing -> ^( GENERIC_TYPE_ARG_LIST[$LESS_THAN, \"GENERIC_TYPE_ARG_LIST\"] ( genericTypeArgumentSimplified )+ ) ;
public final JavaParser.genericTypeArgumentListSimplified_return genericTypeArgumentListSimplified() throws RecognitionException {
    JavaParser.genericTypeArgumentListSimplified_return retval = new JavaParser.genericTypeArgumentListSimplified_return();
    retval.start = input.LT(1);
    int genericTypeArgumentListSimplified_StartIndex = input.index();
    CommonTree root_0 = null;
    Token LESS_THAN195 = null;
    Token COMMA197 = null;
    JavaParser.genericTypeArgumentSimplified_return genericTypeArgumentSimplified196 = null;
    JavaParser.genericTypeArgumentSimplified_return genericTypeArgumentSimplified198 = null;
    JavaParser.genericTypeListClosing_return genericTypeListClosing199 = null;
    CommonTree LESS_THAN195_tree = null;
    CommonTree COMMA197_tree = null;
    RewriteRuleTokenStream stream_COMMA = new RewriteRuleTokenStream(adaptor, "token COMMA");
    RewriteRuleTokenStream stream_LESS_THAN = new RewriteRuleTokenStream(adaptor, "token LESS_THAN");
    RewriteRuleSubtreeStream stream_genericTypeArgumentSimplified = new RewriteRuleSubtreeStream(adaptor, "rule genericTypeArgumentSimplified");
    RewriteRuleSubtreeStream stream_genericTypeListClosing = new RewriteRuleSubtreeStream(adaptor, "rule genericTypeListClosing");
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 53)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:712:5: ( LESS_THAN genericTypeArgumentSimplified ( COMMA genericTypeArgumentSimplified )* genericTypeListClosing -> ^( GENERIC_TYPE_ARG_LIST[$LESS_THAN, \"GENERIC_TYPE_ARG_LIST\"] ( genericTypeArgumentSimplified )+ ) )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:712:9: LESS_THAN genericTypeArgumentSimplified ( COMMA genericTypeArgumentSimplified )* genericTypeListClosing
        {
            LESS_THAN195 = (Token) match(input, LESS_THAN, FOLLOW_LESS_THAN_in_genericTypeArgumentListSimplified7351);
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_LESS_THAN.add(LESS_THAN195);
            }
            pushFollow(FOLLOW_genericTypeArgumentSimplified_in_genericTypeArgumentListSimplified7353);
            genericTypeArgumentSimplified196 = genericTypeArgumentSimplified();
            state._fsp--;
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_genericTypeArgumentSimplified.add(genericTypeArgumentSimplified196.getTree());
            }
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:712:49: ( COMMA genericTypeArgumentSimplified )*
            loop69: do {
                int alt69 = 2;
                int LA69_0 = input.LA(1);
                if ((LA69_0 == COMMA)) {
                    alt69 = 1;
                }
                switch(alt69) {
                    case 1:
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:712:50: COMMA genericTypeArgumentSimplified
                        {
                            COMMA197 = (Token) match(input, COMMA, FOLLOW_COMMA_in_genericTypeArgumentListSimplified7356);
                            if (state.failed) {
                                return retval;
                            }
                            if (state.backtracking == 0) {
                                stream_COMMA.add(COMMA197);
                            }
                            pushFollow(FOLLOW_genericTypeArgumentSimplified_in_genericTypeArgumentListSimplified7358);
                            genericTypeArgumentSimplified198 = genericTypeArgumentSimplified();
                            state._fsp--;
                            if (state.failed) {
                                return retval;
                            }
                            if (state.backtracking == 0) {
                                stream_genericTypeArgumentSimplified.add(genericTypeArgumentSimplified198.getTree());
                            }
                        }
                        break;
                    default:
                        break loop69;
                }
            } while (true);
            pushFollow(FOLLOW_genericTypeListClosing_in_genericTypeArgumentListSimplified7362);
            genericTypeListClosing199 = genericTypeListClosing();
            state._fsp--;
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_genericTypeListClosing.add(genericTypeListClosing199.getTree());
            }
            // wildcard labels:
            if (state.backtracking == 0) {
                retval.tree = root_0;
                RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                root_0 = (CommonTree) adaptor.nil();
                // 713:9: -> ^( GENERIC_TYPE_ARG_LIST[$LESS_THAN, \"GENERIC_TYPE_ARG_LIST\"] ( genericTypeArgumentSimplified )+ )
                {
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:713:13: ^( GENERIC_TYPE_ARG_LIST[$LESS_THAN, \"GENERIC_TYPE_ARG_LIST\"] ( genericTypeArgumentSimplified )+ )
                    {
                        CommonTree root_1 = (CommonTree) adaptor.nil();
                        root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(GENERIC_TYPE_ARG_LIST, LESS_THAN195, "GENERIC_TYPE_ARG_LIST"), root_1);
                        if (!(stream_genericTypeArgumentSimplified.hasNext())) {
                            throw new RewriteEarlyExitException();
                        }
                        while (stream_genericTypeArgumentSimplified.hasNext()) {
                            adaptor.addChild(root_1, stream_genericTypeArgumentSimplified.nextTree());
                        }
                        stream_genericTypeArgumentSimplified.reset();
                        adaptor.addChild(root_0, root_1);
                    }
                }
                retval.tree = root_0;
            }
        }
        retval.stop = input.LT(-1);
        if (state.backtracking == 0) {
            retval.tree = (CommonTree) adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
        }
    } catch (RecognitionException re) {
        reportError(re);
        recover(input, re);
        retval.tree = (CommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
    } finally {
        if (state.backtracking > 0) {
            memoize(input, 53, genericTypeArgumentListSimplified_StartIndex);
        }
    }
    return retval;
}
Also used : RewriteRuleTokenStream(org.antlr.runtime.tree.RewriteRuleTokenStream) CommonTree(org.antlr.runtime.tree.CommonTree) RewriteRuleSubtreeStream(org.antlr.runtime.tree.RewriteRuleSubtreeStream) Token(org.antlr.runtime.Token) RewriteEarlyExitException(org.antlr.runtime.tree.RewriteEarlyExitException) RecognitionException(org.antlr.runtime.RecognitionException)

Example 8 with RewriteEarlyExitException

use of org.antlr.runtime.tree.RewriteEarlyExitException in project freud by LMAX-Exchange.

the class JavaParser method interfaceFieldDeclaratorList.

// $ANTLR start "interfaceFieldDeclaratorList"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:579:1: interfaceFieldDeclaratorList : interfaceFieldDeclarator ( COMMA interfaceFieldDeclarator )* -> ^( VAR_DECLARATOR_LIST ( interfaceFieldDeclarator )+ ) ;
public final JavaParser.interfaceFieldDeclaratorList_return interfaceFieldDeclaratorList() throws RecognitionException {
    JavaParser.interfaceFieldDeclaratorList_return retval = new JavaParser.interfaceFieldDeclaratorList_return();
    retval.start = input.LT(1);
    int interfaceFieldDeclaratorList_StartIndex = input.index();
    CommonTree root_0 = null;
    Token COMMA131 = null;
    JavaParser.interfaceFieldDeclarator_return interfaceFieldDeclarator130 = null;
    JavaParser.interfaceFieldDeclarator_return interfaceFieldDeclarator132 = null;
    CommonTree COMMA131_tree = null;
    RewriteRuleTokenStream stream_COMMA = new RewriteRuleTokenStream(adaptor, "token COMMA");
    RewriteRuleSubtreeStream stream_interfaceFieldDeclarator = new RewriteRuleSubtreeStream(adaptor, "rule interfaceFieldDeclarator");
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 29)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:580:5: ( interfaceFieldDeclarator ( COMMA interfaceFieldDeclarator )* -> ^( VAR_DECLARATOR_LIST ( interfaceFieldDeclarator )+ ) )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:580:9: interfaceFieldDeclarator ( COMMA interfaceFieldDeclarator )*
        {
            pushFollow(FOLLOW_interfaceFieldDeclarator_in_interfaceFieldDeclaratorList6315);
            interfaceFieldDeclarator130 = interfaceFieldDeclarator();
            state._fsp--;
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_interfaceFieldDeclarator.add(interfaceFieldDeclarator130.getTree());
            }
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:580:34: ( COMMA interfaceFieldDeclarator )*
            loop47: do {
                int alt47 = 2;
                int LA47_0 = input.LA(1);
                if ((LA47_0 == COMMA)) {
                    alt47 = 1;
                }
                switch(alt47) {
                    case 1:
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:580:35: COMMA interfaceFieldDeclarator
                        {
                            COMMA131 = (Token) match(input, COMMA, FOLLOW_COMMA_in_interfaceFieldDeclaratorList6318);
                            if (state.failed) {
                                return retval;
                            }
                            if (state.backtracking == 0) {
                                stream_COMMA.add(COMMA131);
                            }
                            pushFollow(FOLLOW_interfaceFieldDeclarator_in_interfaceFieldDeclaratorList6320);
                            interfaceFieldDeclarator132 = interfaceFieldDeclarator();
                            state._fsp--;
                            if (state.failed) {
                                return retval;
                            }
                            if (state.backtracking == 0) {
                                stream_interfaceFieldDeclarator.add(interfaceFieldDeclarator132.getTree());
                            }
                        }
                        break;
                    default:
                        break loop47;
                }
            } while (true);
            // wildcard labels:
            if (state.backtracking == 0) {
                retval.tree = root_0;
                RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                root_0 = (CommonTree) adaptor.nil();
                // 581:9: -> ^( VAR_DECLARATOR_LIST ( interfaceFieldDeclarator )+ )
                {
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:581:13: ^( VAR_DECLARATOR_LIST ( interfaceFieldDeclarator )+ )
                    {
                        CommonTree root_1 = (CommonTree) adaptor.nil();
                        root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(VAR_DECLARATOR_LIST, "VAR_DECLARATOR_LIST"), root_1);
                        if (!(stream_interfaceFieldDeclarator.hasNext())) {
                            throw new RewriteEarlyExitException();
                        }
                        while (stream_interfaceFieldDeclarator.hasNext()) {
                            adaptor.addChild(root_1, stream_interfaceFieldDeclarator.nextTree());
                        }
                        stream_interfaceFieldDeclarator.reset();
                        adaptor.addChild(root_0, root_1);
                    }
                }
                retval.tree = root_0;
            }
        }
        retval.stop = input.LT(-1);
        if (state.backtracking == 0) {
            retval.tree = (CommonTree) adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
        }
    } catch (RecognitionException re) {
        reportError(re);
        recover(input, re);
        retval.tree = (CommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
    } finally {
        if (state.backtracking > 0) {
            memoize(input, 29, interfaceFieldDeclaratorList_StartIndex);
        }
    }
    return retval;
}
Also used : RewriteRuleTokenStream(org.antlr.runtime.tree.RewriteRuleTokenStream) CommonTree(org.antlr.runtime.tree.CommonTree) RewriteRuleSubtreeStream(org.antlr.runtime.tree.RewriteRuleSubtreeStream) Token(org.antlr.runtime.Token) RewriteEarlyExitException(org.antlr.runtime.tree.RewriteEarlyExitException) RecognitionException(org.antlr.runtime.RecognitionException)

Example 9 with RewriteEarlyExitException

use of org.antlr.runtime.tree.RewriteEarlyExitException in project freud by LMAX-Exchange.

the class JavaParser method catches.

// $ANTLR start "catches"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:871:1: catches : ( catchClause )+ -> ^( CATCH_CLAUSE_LIST ( catchClause )+ ) ;
public final JavaParser.catches_return catches() throws RecognitionException {
    JavaParser.catches_return retval = new JavaParser.catches_return();
    retval.start = input.LT(1);
    int catches_StartIndex = input.index();
    CommonTree root_0 = null;
    JavaParser.catchClause_return catchClause338 = null;
    RewriteRuleSubtreeStream stream_catchClause = new RewriteRuleSubtreeStream(adaptor, "rule catchClause");
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 76)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:872:5: ( ( catchClause )+ -> ^( CATCH_CLAUSE_LIST ( catchClause )+ ) )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:872:9: ( catchClause )+
        {
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:872:9: ( catchClause )+
            int cnt99 = 0;
            loop99: do {
                int alt99 = 2;
                int LA99_0 = input.LA(1);
                if ((LA99_0 == CATCH)) {
                    alt99 = 1;
                }
                switch(alt99) {
                    case 1:
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: catchClause
                        {
                            pushFollow(FOLLOW_catchClause_in_catches9734);
                            catchClause338 = catchClause();
                            state._fsp--;
                            if (state.failed) {
                                return retval;
                            }
                            if (state.backtracking == 0) {
                                stream_catchClause.add(catchClause338.getTree());
                            }
                        }
                        break;
                    default:
                        if (cnt99 >= 1) {
                            break loop99;
                        }
                        if (state.backtracking > 0) {
                            state.failed = true;
                            return retval;
                        }
                        EarlyExitException eee = new EarlyExitException(99, input);
                        throw eee;
                }
                cnt99++;
            } while (true);
            // wildcard labels:
            if (state.backtracking == 0) {
                retval.tree = root_0;
                RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                root_0 = (CommonTree) adaptor.nil();
                // 873:9: -> ^( CATCH_CLAUSE_LIST ( catchClause )+ )
                {
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:873:13: ^( CATCH_CLAUSE_LIST ( catchClause )+ )
                    {
                        CommonTree root_1 = (CommonTree) adaptor.nil();
                        root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(CATCH_CLAUSE_LIST, "CATCH_CLAUSE_LIST"), root_1);
                        if (!(stream_catchClause.hasNext())) {
                            throw new RewriteEarlyExitException();
                        }
                        while (stream_catchClause.hasNext()) {
                            adaptor.addChild(root_1, stream_catchClause.nextTree());
                        }
                        stream_catchClause.reset();
                        adaptor.addChild(root_0, root_1);
                    }
                }
                retval.tree = root_0;
            }
        }
        retval.stop = input.LT(-1);
        if (state.backtracking == 0) {
            retval.tree = (CommonTree) adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
        }
    } catch (RecognitionException re) {
        reportError(re);
        recover(input, re);
        retval.tree = (CommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
    } finally {
        if (state.backtracking > 0) {
            memoize(input, 76, catches_StartIndex);
        }
    }
    return retval;
}
Also used : CommonTree(org.antlr.runtime.tree.CommonTree) RewriteRuleSubtreeStream(org.antlr.runtime.tree.RewriteRuleSubtreeStream) EarlyExitException(org.antlr.runtime.EarlyExitException) RewriteEarlyExitException(org.antlr.runtime.tree.RewriteEarlyExitException) RewriteEarlyExitException(org.antlr.runtime.tree.RewriteEarlyExitException) RecognitionException(org.antlr.runtime.RecognitionException)

Example 10 with RewriteEarlyExitException

use of org.antlr.runtime.tree.RewriteEarlyExitException in project freud by LMAX-Exchange.

the class JavaParser method genericTypeArgumentList.

// $ANTLR start "genericTypeArgumentList"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:696:1: genericTypeArgumentList : LESS_THAN genericTypeArgument ( COMMA genericTypeArgument )* genericTypeListClosing -> ^( GENERIC_TYPE_ARG_LIST[$LESS_THAN, \"GENERIC_TYPE_ARG_LIST\"] ( genericTypeArgument )+ ) ;
public final JavaParser.genericTypeArgumentList_return genericTypeArgumentList() throws RecognitionException {
    JavaParser.genericTypeArgumentList_return retval = new JavaParser.genericTypeArgumentList_return();
    retval.start = input.LT(1);
    int genericTypeArgumentList_StartIndex = input.index();
    CommonTree root_0 = null;
    Token LESS_THAN185 = null;
    Token COMMA187 = null;
    JavaParser.genericTypeArgument_return genericTypeArgument186 = null;
    JavaParser.genericTypeArgument_return genericTypeArgument188 = null;
    JavaParser.genericTypeListClosing_return genericTypeListClosing189 = null;
    CommonTree LESS_THAN185_tree = null;
    CommonTree COMMA187_tree = null;
    RewriteRuleTokenStream stream_COMMA = new RewriteRuleTokenStream(adaptor, "token COMMA");
    RewriteRuleTokenStream stream_LESS_THAN = new RewriteRuleTokenStream(adaptor, "token LESS_THAN");
    RewriteRuleSubtreeStream stream_genericTypeArgument = new RewriteRuleSubtreeStream(adaptor, "rule genericTypeArgument");
    RewriteRuleSubtreeStream stream_genericTypeListClosing = new RewriteRuleSubtreeStream(adaptor, "rule genericTypeListClosing");
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 50)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:697:5: ( LESS_THAN genericTypeArgument ( COMMA genericTypeArgument )* genericTypeListClosing -> ^( GENERIC_TYPE_ARG_LIST[$LESS_THAN, \"GENERIC_TYPE_ARG_LIST\"] ( genericTypeArgument )+ ) )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:697:9: LESS_THAN genericTypeArgument ( COMMA genericTypeArgument )* genericTypeListClosing
        {
            LESS_THAN185 = (Token) match(input, LESS_THAN, FOLLOW_LESS_THAN_in_genericTypeArgumentList7224);
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_LESS_THAN.add(LESS_THAN185);
            }
            pushFollow(FOLLOW_genericTypeArgument_in_genericTypeArgumentList7226);
            genericTypeArgument186 = genericTypeArgument();
            state._fsp--;
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_genericTypeArgument.add(genericTypeArgument186.getTree());
            }
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:697:39: ( COMMA genericTypeArgument )*
            loop66: do {
                int alt66 = 2;
                int LA66_0 = input.LA(1);
                if ((LA66_0 == COMMA)) {
                    int LA66_2 = input.LA(2);
                    if ((synpred91_Java())) {
                        alt66 = 1;
                    }
                }
                switch(alt66) {
                    case 1:
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:697:40: COMMA genericTypeArgument
                        {
                            COMMA187 = (Token) match(input, COMMA, FOLLOW_COMMA_in_genericTypeArgumentList7229);
                            if (state.failed) {
                                return retval;
                            }
                            if (state.backtracking == 0) {
                                stream_COMMA.add(COMMA187);
                            }
                            pushFollow(FOLLOW_genericTypeArgument_in_genericTypeArgumentList7231);
                            genericTypeArgument188 = genericTypeArgument();
                            state._fsp--;
                            if (state.failed) {
                                return retval;
                            }
                            if (state.backtracking == 0) {
                                stream_genericTypeArgument.add(genericTypeArgument188.getTree());
                            }
                        }
                        break;
                    default:
                        break loop66;
                }
            } while (true);
            pushFollow(FOLLOW_genericTypeListClosing_in_genericTypeArgumentList7235);
            genericTypeListClosing189 = genericTypeListClosing();
            state._fsp--;
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_genericTypeListClosing.add(genericTypeListClosing189.getTree());
            }
            // wildcard labels:
            if (state.backtracking == 0) {
                retval.tree = root_0;
                RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                root_0 = (CommonTree) adaptor.nil();
                // 698:9: -> ^( GENERIC_TYPE_ARG_LIST[$LESS_THAN, \"GENERIC_TYPE_ARG_LIST\"] ( genericTypeArgument )+ )
                {
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:698:13: ^( GENERIC_TYPE_ARG_LIST[$LESS_THAN, \"GENERIC_TYPE_ARG_LIST\"] ( genericTypeArgument )+ )
                    {
                        CommonTree root_1 = (CommonTree) adaptor.nil();
                        root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(GENERIC_TYPE_ARG_LIST, LESS_THAN185, "GENERIC_TYPE_ARG_LIST"), root_1);
                        if (!(stream_genericTypeArgument.hasNext())) {
                            throw new RewriteEarlyExitException();
                        }
                        while (stream_genericTypeArgument.hasNext()) {
                            adaptor.addChild(root_1, stream_genericTypeArgument.nextTree());
                        }
                        stream_genericTypeArgument.reset();
                        adaptor.addChild(root_0, root_1);
                    }
                }
                retval.tree = root_0;
            }
        }
        retval.stop = input.LT(-1);
        if (state.backtracking == 0) {
            retval.tree = (CommonTree) adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
        }
    } catch (RecognitionException re) {
        reportError(re);
        recover(input, re);
        retval.tree = (CommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
    } finally {
        if (state.backtracking > 0) {
            memoize(input, 50, genericTypeArgumentList_StartIndex);
        }
    }
    return retval;
}
Also used : RewriteRuleTokenStream(org.antlr.runtime.tree.RewriteRuleTokenStream) CommonTree(org.antlr.runtime.tree.CommonTree) RewriteRuleSubtreeStream(org.antlr.runtime.tree.RewriteRuleSubtreeStream) Token(org.antlr.runtime.Token) RewriteEarlyExitException(org.antlr.runtime.tree.RewriteEarlyExitException) RecognitionException(org.antlr.runtime.RecognitionException)

Aggregations

RecognitionException (org.antlr.runtime.RecognitionException)13 CommonTree (org.antlr.runtime.tree.CommonTree)13 RewriteEarlyExitException (org.antlr.runtime.tree.RewriteEarlyExitException)13 RewriteRuleSubtreeStream (org.antlr.runtime.tree.RewriteRuleSubtreeStream)13 Token (org.antlr.runtime.Token)11 RewriteRuleTokenStream (org.antlr.runtime.tree.RewriteRuleTokenStream)11 EarlyExitException (org.antlr.runtime.EarlyExitException)2 NoViableAltException (org.antlr.runtime.NoViableAltException)2