Search in sources :

Example 41 with RewriteRuleTokenStream

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

the class JavaParser method newExpression.

// $ANTLR start "newExpression"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1128:1: newExpression : NEW ( primitiveType newArrayConstruction -> ^( STATIC_ARRAY_CREATOR[$NEW, \"STATIC_ARRAY_CREATOR\"] primitiveType newArrayConstruction ) | ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified ( newArrayConstruction -> ^( STATIC_ARRAY_CREATOR[$NEW, \"STATIC_ARRAY_CREATOR\"] ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified newArrayConstruction ) | arguments ( classBody )? -> ^( CLASS_CONSTRUCTOR_CALL[$NEW, \"STATIC_ARRAY_CREATOR\"] ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified arguments ( classBody )? ) ) ) ;
public final JavaParser.newExpression_return newExpression() throws RecognitionException {
    JavaParser.newExpression_return retval = new JavaParser.newExpression_return();
    retval.start = input.LT(1);
    int newExpression_StartIndex = input.index();
    CommonTree root_0 = null;
    Token NEW509 = null;
    JavaParser.primitiveType_return primitiveType510 = null;
    JavaParser.newArrayConstruction_return newArrayConstruction511 = null;
    JavaParser.genericTypeArgumentListSimplified_return genericTypeArgumentListSimplified512 = null;
    JavaParser.qualifiedTypeIdentSimplified_return qualifiedTypeIdentSimplified513 = null;
    JavaParser.newArrayConstruction_return newArrayConstruction514 = null;
    JavaParser.arguments_return arguments515 = null;
    JavaParser.classBody_return classBody516 = null;
    CommonTree NEW509_tree = null;
    RewriteRuleTokenStream stream_NEW = new RewriteRuleTokenStream(adaptor, "token NEW");
    RewriteRuleSubtreeStream stream_newArrayConstruction = new RewriteRuleSubtreeStream(adaptor, "rule newArrayConstruction");
    RewriteRuleSubtreeStream stream_arguments = new RewriteRuleSubtreeStream(adaptor, "rule arguments");
    RewriteRuleSubtreeStream stream_qualifiedTypeIdentSimplified = new RewriteRuleSubtreeStream(adaptor, "rule qualifiedTypeIdentSimplified");
    RewriteRuleSubtreeStream stream_primitiveType = new RewriteRuleSubtreeStream(adaptor, "rule primitiveType");
    RewriteRuleSubtreeStream stream_classBody = new RewriteRuleSubtreeStream(adaptor, "rule classBody");
    RewriteRuleSubtreeStream stream_genericTypeArgumentListSimplified = new RewriteRuleSubtreeStream(adaptor, "rule genericTypeArgumentListSimplified");
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 107)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1129:5: ( NEW ( primitiveType newArrayConstruction -> ^( STATIC_ARRAY_CREATOR[$NEW, \"STATIC_ARRAY_CREATOR\"] primitiveType newArrayConstruction ) | ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified ( newArrayConstruction -> ^( STATIC_ARRAY_CREATOR[$NEW, \"STATIC_ARRAY_CREATOR\"] ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified newArrayConstruction ) | arguments ( classBody )? -> ^( CLASS_CONSTRUCTOR_CALL[$NEW, \"STATIC_ARRAY_CREATOR\"] ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified arguments ( classBody )? ) ) ) )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1129:9: NEW ( primitiveType newArrayConstruction -> ^( STATIC_ARRAY_CREATOR[$NEW, \"STATIC_ARRAY_CREATOR\"] primitiveType newArrayConstruction ) | ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified ( newArrayConstruction -> ^( STATIC_ARRAY_CREATOR[$NEW, \"STATIC_ARRAY_CREATOR\"] ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified newArrayConstruction ) | arguments ( classBody )? -> ^( CLASS_CONSTRUCTOR_CALL[$NEW, \"STATIC_ARRAY_CREATOR\"] ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified arguments ( classBody )? ) ) )
        {
            NEW509 = (Token) match(input, NEW, FOLLOW_NEW_in_newExpression14040);
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_NEW.add(NEW509);
            }
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1130:9: ( primitiveType newArrayConstruction -> ^( STATIC_ARRAY_CREATOR[$NEW, \"STATIC_ARRAY_CREATOR\"] primitiveType newArrayConstruction ) | ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified ( newArrayConstruction -> ^( STATIC_ARRAY_CREATOR[$NEW, \"STATIC_ARRAY_CREATOR\"] ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified newArrayConstruction ) | arguments ( classBody )? -> ^( CLASS_CONSTRUCTOR_CALL[$NEW, \"STATIC_ARRAY_CREATOR\"] ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified arguments ( classBody )? ) ) )
            int alt148 = 2;
            int LA148_0 = input.LA(1);
            if ((LA148_0 == BOOLEAN || LA148_0 == BYTE || LA148_0 == CHAR || LA148_0 == DOUBLE || LA148_0 == FLOAT || (LA148_0 >= INT && LA148_0 <= LONG) || LA148_0 == SHORT)) {
                alt148 = 1;
            } else if ((LA148_0 == LESS_THAN || LA148_0 == IDENT)) {
                alt148 = 2;
            } else {
                if (state.backtracking > 0) {
                    state.failed = true;
                    return retval;
                }
                NoViableAltException nvae = new NoViableAltException("", 148, 0, input);
                throw nvae;
            }
            switch(alt148) {
                case 1:
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1130:13: primitiveType newArrayConstruction
                    {
                        pushFollow(FOLLOW_primitiveType_in_newExpression14054);
                        primitiveType510 = primitiveType();
                        state._fsp--;
                        if (state.failed) {
                            return retval;
                        }
                        if (state.backtracking == 0) {
                            stream_primitiveType.add(primitiveType510.getTree());
                        }
                        pushFollow(FOLLOW_newArrayConstruction_in_newExpression14056);
                        newArrayConstruction511 = newArrayConstruction();
                        state._fsp--;
                        if (state.failed) {
                            return retval;
                        }
                        if (state.backtracking == 0) {
                            stream_newArrayConstruction.add(newArrayConstruction511.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();
                            // 1131:13: -> ^( STATIC_ARRAY_CREATOR[$NEW, \"STATIC_ARRAY_CREATOR\"] primitiveType newArrayConstruction )
                            {
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1131:17: ^( STATIC_ARRAY_CREATOR[$NEW, \"STATIC_ARRAY_CREATOR\"] primitiveType newArrayConstruction )
                                {
                                    CommonTree root_1 = (CommonTree) adaptor.nil();
                                    root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(STATIC_ARRAY_CREATOR, NEW509, "STATIC_ARRAY_CREATOR"), root_1);
                                    adaptor.addChild(root_1, stream_primitiveType.nextTree());
                                    adaptor.addChild(root_1, stream_newArrayConstruction.nextTree());
                                    adaptor.addChild(root_0, root_1);
                                }
                            }
                            retval.tree = root_0;
                        }
                    }
                    break;
                case 2:
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1132:13: ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified ( newArrayConstruction -> ^( STATIC_ARRAY_CREATOR[$NEW, \"STATIC_ARRAY_CREATOR\"] ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified newArrayConstruction ) | arguments ( classBody )? -> ^( CLASS_CONSTRUCTOR_CALL[$NEW, \"STATIC_ARRAY_CREATOR\"] ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified arguments ( classBody )? ) )
                    {
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1132:13: ( genericTypeArgumentListSimplified )?
                        int alt145 = 2;
                        int LA145_0 = input.LA(1);
                        if ((LA145_0 == LESS_THAN)) {
                            alt145 = 1;
                        }
                        switch(alt145) {
                            case 1:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: genericTypeArgumentListSimplified
                                {
                                    pushFollow(FOLLOW_genericTypeArgumentListSimplified_in_newExpression14100);
                                    genericTypeArgumentListSimplified512 = genericTypeArgumentListSimplified();
                                    state._fsp--;
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        stream_genericTypeArgumentListSimplified.add(genericTypeArgumentListSimplified512.getTree());
                                    }
                                }
                                break;
                        }
                        pushFollow(FOLLOW_qualifiedTypeIdentSimplified_in_newExpression14103);
                        qualifiedTypeIdentSimplified513 = qualifiedTypeIdentSimplified();
                        state._fsp--;
                        if (state.failed) {
                            return retval;
                        }
                        if (state.backtracking == 0) {
                            stream_qualifiedTypeIdentSimplified.add(qualifiedTypeIdentSimplified513.getTree());
                        }
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1133:13: ( newArrayConstruction -> ^( STATIC_ARRAY_CREATOR[$NEW, \"STATIC_ARRAY_CREATOR\"] ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified newArrayConstruction ) | arguments ( classBody )? -> ^( CLASS_CONSTRUCTOR_CALL[$NEW, \"STATIC_ARRAY_CREATOR\"] ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified arguments ( classBody )? ) )
                        int alt147 = 2;
                        int LA147_0 = input.LA(1);
                        if ((LA147_0 == LBRACK)) {
                            alt147 = 1;
                        } else if ((LA147_0 == LPAREN)) {
                            alt147 = 2;
                        } else {
                            if (state.backtracking > 0) {
                                state.failed = true;
                                return retval;
                            }
                            NoViableAltException nvae = new NoViableAltException("", 147, 0, input);
                            throw nvae;
                        }
                        switch(alt147) {
                            case 1:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1133:17: newArrayConstruction
                                {
                                    pushFollow(FOLLOW_newArrayConstruction_in_newExpression14121);
                                    newArrayConstruction514 = newArrayConstruction();
                                    state._fsp--;
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        stream_newArrayConstruction.add(newArrayConstruction514.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();
                                        // 1134:17: -> ^( STATIC_ARRAY_CREATOR[$NEW, \"STATIC_ARRAY_CREATOR\"] ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified newArrayConstruction )
                                        {
                                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1134:21: ^( STATIC_ARRAY_CREATOR[$NEW, \"STATIC_ARRAY_CREATOR\"] ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified newArrayConstruction )
                                            {
                                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                                root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(STATIC_ARRAY_CREATOR, NEW509, "STATIC_ARRAY_CREATOR"), root_1);
                                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1134:74: ( genericTypeArgumentListSimplified )?
                                                if (stream_genericTypeArgumentListSimplified.hasNext()) {
                                                    adaptor.addChild(root_1, stream_genericTypeArgumentListSimplified.nextTree());
                                                }
                                                stream_genericTypeArgumentListSimplified.reset();
                                                adaptor.addChild(root_1, stream_qualifiedTypeIdentSimplified.nextTree());
                                                adaptor.addChild(root_1, stream_newArrayConstruction.nextTree());
                                                adaptor.addChild(root_0, root_1);
                                            }
                                        }
                                        retval.tree = root_0;
                                    }
                                }
                                break;
                            case 2:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1135:17: arguments ( classBody )?
                                {
                                    pushFollow(FOLLOW_arguments_in_newExpression14186);
                                    arguments515 = arguments();
                                    state._fsp--;
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        stream_arguments.add(arguments515.getTree());
                                    }
                                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1135:27: ( classBody )?
                                    int alt146 = 2;
                                    int LA146_0 = input.LA(1);
                                    if ((LA146_0 == LCURLY)) {
                                        alt146 = 1;
                                    }
                                    switch(alt146) {
                                        case 1:
                                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: classBody
                                            {
                                                pushFollow(FOLLOW_classBody_in_newExpression14188);
                                                classBody516 = classBody();
                                                state._fsp--;
                                                if (state.failed) {
                                                    return retval;
                                                }
                                                if (state.backtracking == 0) {
                                                    stream_classBody.add(classBody516.getTree());
                                                }
                                            }
                                            break;
                                    }
                                    // 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();
                                        // 1136:17: -> ^( CLASS_CONSTRUCTOR_CALL[$NEW, \"STATIC_ARRAY_CREATOR\"] ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified arguments ( classBody )? )
                                        {
                                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1136:21: ^( CLASS_CONSTRUCTOR_CALL[$NEW, \"STATIC_ARRAY_CREATOR\"] ( genericTypeArgumentListSimplified )? qualifiedTypeIdentSimplified arguments ( classBody )? )
                                            {
                                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                                root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(CLASS_CONSTRUCTOR_CALL, NEW509, "STATIC_ARRAY_CREATOR"), root_1);
                                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1136:76: ( genericTypeArgumentListSimplified )?
                                                if (stream_genericTypeArgumentListSimplified.hasNext()) {
                                                    adaptor.addChild(root_1, stream_genericTypeArgumentListSimplified.nextTree());
                                                }
                                                stream_genericTypeArgumentListSimplified.reset();
                                                adaptor.addChild(root_1, stream_qualifiedTypeIdentSimplified.nextTree());
                                                adaptor.addChild(root_1, stream_arguments.nextTree());
                                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1136:150: ( classBody )?
                                                if (stream_classBody.hasNext()) {
                                                    adaptor.addChild(root_1, stream_classBody.nextTree());
                                                }
                                                stream_classBody.reset();
                                                adaptor.addChild(root_0, root_1);
                                            }
                                        }
                                        retval.tree = root_0;
                                    }
                                }
                                break;
                        }
                    }
                    break;
            }
        }
        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, 107, newExpression_StartIndex);
        }
    }
    return retval;
}
Also used : CommonTree(org.antlr.runtime.tree.CommonTree) RewriteRuleSubtreeStream(org.antlr.runtime.tree.RewriteRuleSubtreeStream) Token(org.antlr.runtime.Token) RewriteRuleTokenStream(org.antlr.runtime.tree.RewriteRuleTokenStream) NoViableAltException(org.antlr.runtime.NoViableAltException) RecognitionException(org.antlr.runtime.RecognitionException)

Example 42 with RewriteRuleTokenStream

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

the class JavaParser method qualifiedIdentExpression.

// $ANTLR start "qualifiedIdentExpression"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1104:1: qualifiedIdentExpression : ( qualifiedIdentifier -> qualifiedIdentifier ) ( ( arrayDeclarator -> ^( arrayDeclarator $qualifiedIdentExpression) )+ ( DOT CLASS -> ^( DOT $qualifiedIdentExpression CLASS ) ) | arguments -> ^( METHOD_CALL qualifiedIdentifier arguments ) | outerDot= DOT ( CLASS -> ^( DOT qualifiedIdentifier CLASS ) | genericTypeArgumentListSimplified (Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments ) | SUPER innerDot= DOT IDENT arguments -> ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments ) | IDENT arguments -> ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments ) ) | THIS -> ^( DOT qualifiedIdentifier THIS ) | Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier arguments ) | innerNewExpression -> ^( DOT qualifiedIdentifier innerNewExpression ) ) )? ;
public final JavaParser.qualifiedIdentExpression_return qualifiedIdentExpression() throws RecognitionException {
    JavaParser.qualifiedIdentExpression_return retval = new JavaParser.qualifiedIdentExpression_return();
    retval.start = input.LT(1);
    int qualifiedIdentExpression_StartIndex = input.index();
    CommonTree root_0 = null;
    Token outerDot = null;
    Token Super = null;
    Token innerDot = null;
    Token DOT495 = null;
    Token CLASS496 = null;
    Token CLASS498 = null;
    Token SUPER501 = null;
    Token IDENT502 = null;
    Token IDENT504 = null;
    Token THIS506 = null;
    JavaParser.qualifiedIdentifier_return qualifiedIdentifier493 = null;
    JavaParser.arrayDeclarator_return arrayDeclarator494 = null;
    JavaParser.arguments_return arguments497 = null;
    JavaParser.genericTypeArgumentListSimplified_return genericTypeArgumentListSimplified499 = null;
    JavaParser.arguments_return arguments500 = null;
    JavaParser.arguments_return arguments503 = null;
    JavaParser.arguments_return arguments505 = null;
    JavaParser.arguments_return arguments507 = null;
    JavaParser.innerNewExpression_return innerNewExpression508 = null;
    CommonTree outerDot_tree = null;
    CommonTree Super_tree = null;
    CommonTree innerDot_tree = null;
    CommonTree DOT495_tree = null;
    CommonTree CLASS496_tree = null;
    CommonTree CLASS498_tree = null;
    CommonTree SUPER501_tree = null;
    CommonTree IDENT502_tree = null;
    CommonTree IDENT504_tree = null;
    CommonTree THIS506_tree = null;
    RewriteRuleTokenStream stream_IDENT = new RewriteRuleTokenStream(adaptor, "token IDENT");
    RewriteRuleTokenStream stream_CLASS = new RewriteRuleTokenStream(adaptor, "token CLASS");
    RewriteRuleTokenStream stream_SUPER = new RewriteRuleTokenStream(adaptor, "token SUPER");
    RewriteRuleTokenStream stream_DOT = new RewriteRuleTokenStream(adaptor, "token DOT");
    RewriteRuleTokenStream stream_THIS = new RewriteRuleTokenStream(adaptor, "token THIS");
    RewriteRuleSubtreeStream stream_arrayDeclarator = new RewriteRuleSubtreeStream(adaptor, "rule arrayDeclarator");
    RewriteRuleSubtreeStream stream_arguments = new RewriteRuleSubtreeStream(adaptor, "rule arguments");
    RewriteRuleSubtreeStream stream_qualifiedIdentifier = new RewriteRuleSubtreeStream(adaptor, "rule qualifiedIdentifier");
    RewriteRuleSubtreeStream stream_genericTypeArgumentListSimplified = new RewriteRuleSubtreeStream(adaptor, "rule genericTypeArgumentListSimplified");
    RewriteRuleSubtreeStream stream_innerNewExpression = new RewriteRuleSubtreeStream(adaptor, "rule innerNewExpression");
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 106)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1106:5: ( ( qualifiedIdentifier -> qualifiedIdentifier ) ( ( arrayDeclarator -> ^( arrayDeclarator $qualifiedIdentExpression) )+ ( DOT CLASS -> ^( DOT $qualifiedIdentExpression CLASS ) ) | arguments -> ^( METHOD_CALL qualifiedIdentifier arguments ) | outerDot= DOT ( CLASS -> ^( DOT qualifiedIdentifier CLASS ) | genericTypeArgumentListSimplified (Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments ) | SUPER innerDot= DOT IDENT arguments -> ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments ) | IDENT arguments -> ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments ) ) | THIS -> ^( DOT qualifiedIdentifier THIS ) | Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier arguments ) | innerNewExpression -> ^( DOT qualifiedIdentifier innerNewExpression ) ) )? )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1106:9: ( qualifiedIdentifier -> qualifiedIdentifier ) ( ( arrayDeclarator -> ^( arrayDeclarator $qualifiedIdentExpression) )+ ( DOT CLASS -> ^( DOT $qualifiedIdentExpression CLASS ) ) | arguments -> ^( METHOD_CALL qualifiedIdentifier arguments ) | outerDot= DOT ( CLASS -> ^( DOT qualifiedIdentifier CLASS ) | genericTypeArgumentListSimplified (Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments ) | SUPER innerDot= DOT IDENT arguments -> ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments ) | IDENT arguments -> ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments ) ) | THIS -> ^( DOT qualifiedIdentifier THIS ) | Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier arguments ) | innerNewExpression -> ^( DOT qualifiedIdentifier innerNewExpression ) ) )?
        {
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1106:9: ( qualifiedIdentifier -> qualifiedIdentifier )
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1106:13: qualifiedIdentifier
            {
                pushFollow(FOLLOW_qualifiedIdentifier_in_qualifiedIdentExpression13286);
                qualifiedIdentifier493 = qualifiedIdentifier();
                state._fsp--;
                if (state.failed) {
                    return retval;
                }
                if (state.backtracking == 0) {
                    stream_qualifiedIdentifier.add(qualifiedIdentifier493.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();
                    // 1106:61: -> qualifiedIdentifier
                    {
                        adaptor.addChild(root_0, stream_qualifiedIdentifier.nextTree());
                    }
                    retval.tree = root_0;
                }
            }
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1109:9: ( ( arrayDeclarator -> ^( arrayDeclarator $qualifiedIdentExpression) )+ ( DOT CLASS -> ^( DOT $qualifiedIdentExpression CLASS ) ) | arguments -> ^( METHOD_CALL qualifiedIdentifier arguments ) | outerDot= DOT ( CLASS -> ^( DOT qualifiedIdentifier CLASS ) | genericTypeArgumentListSimplified (Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments ) | SUPER innerDot= DOT IDENT arguments -> ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments ) | IDENT arguments -> ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments ) ) | THIS -> ^( DOT qualifiedIdentifier THIS ) | Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier arguments ) | innerNewExpression -> ^( DOT qualifiedIdentifier innerNewExpression ) ) )?
            int alt144 = 4;
            alt144 = dfa144.predict(input);
            switch(alt144) {
                case 1:
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1109:13: ( arrayDeclarator -> ^( arrayDeclarator $qualifiedIdentExpression) )+ ( DOT CLASS -> ^( DOT $qualifiedIdentExpression CLASS ) )
                    {
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1109:13: ( arrayDeclarator -> ^( arrayDeclarator $qualifiedIdentExpression) )+
                        int cnt141 = 0;
                        loop141: do {
                            int alt141 = 2;
                            int LA141_0 = input.LA(1);
                            if ((LA141_0 == LBRACK)) {
                                alt141 = 1;
                            }
                            switch(alt141) {
                                case 1:
                                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1109:17: arrayDeclarator
                                    {
                                        pushFollow(FOLLOW_arrayDeclarator_in_qualifiedIdentExpression13356);
                                        arrayDeclarator494 = arrayDeclarator();
                                        state._fsp--;
                                        if (state.failed) {
                                            return retval;
                                        }
                                        if (state.backtracking == 0) {
                                            stream_arrayDeclarator.add(arrayDeclarator494.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();
                                            // 1109:57: -> ^( arrayDeclarator $qualifiedIdentExpression)
                                            {
                                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1109:61: ^( arrayDeclarator $qualifiedIdentExpression)
                                                {
                                                    CommonTree root_1 = (CommonTree) adaptor.nil();
                                                    root_1 = (CommonTree) adaptor.becomeRoot(stream_arrayDeclarator.nextNode(), root_1);
                                                    adaptor.addChild(root_1, stream_retval.nextTree());
                                                    adaptor.addChild(root_0, root_1);
                                                }
                                            }
                                            retval.tree = root_0;
                                        }
                                    }
                                    break;
                                default:
                                    if (cnt141 >= 1) {
                                        break loop141;
                                    }
                                    if (state.backtracking > 0) {
                                        state.failed = true;
                                        return retval;
                                    }
                                    EarlyExitException eee = new EarlyExitException(141, input);
                                    throw eee;
                            }
                            cnt141++;
                        } while (true);
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1111:13: ( DOT CLASS -> ^( DOT $qualifiedIdentExpression CLASS ) )
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1111:17: DOT CLASS
                        {
                            DOT495 = (Token) match(input, DOT, FOLLOW_DOT_in_qualifiedIdentExpression13423);
                            if (state.failed) {
                                return retval;
                            }
                            if (state.backtracking == 0) {
                                stream_DOT.add(DOT495);
                            }
                            CLASS496 = (Token) match(input, CLASS, FOLLOW_CLASS_in_qualifiedIdentExpression13425);
                            if (state.failed) {
                                return retval;
                            }
                            if (state.backtracking == 0) {
                                stream_CLASS.add(CLASS496);
                            }
                            // 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();
                                // 1111:57: -> ^( DOT $qualifiedIdentExpression CLASS )
                                {
                                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1111:61: ^( DOT $qualifiedIdentExpression CLASS )
                                    {
                                        CommonTree root_1 = (CommonTree) adaptor.nil();
                                        root_1 = (CommonTree) adaptor.becomeRoot(stream_DOT.nextNode(), root_1);
                                        adaptor.addChild(root_1, stream_retval.nextTree());
                                        adaptor.addChild(root_1, stream_CLASS.nextNode());
                                        adaptor.addChild(root_0, root_1);
                                    }
                                }
                                retval.tree = root_0;
                            }
                        }
                    }
                    break;
                case 2:
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1113:13: arguments
                    {
                        pushFollow(FOLLOW_arguments_in_qualifiedIdentExpression13495);
                        arguments497 = arguments();
                        state._fsp--;
                        if (state.failed) {
                            return retval;
                        }
                        if (state.backtracking == 0) {
                            stream_arguments.add(arguments497.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();
                            // 1113:57: -> ^( METHOD_CALL qualifiedIdentifier arguments )
                            {
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1113:61: ^( METHOD_CALL qualifiedIdentifier arguments )
                                {
                                    CommonTree root_1 = (CommonTree) adaptor.nil();
                                    root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(METHOD_CALL, "METHOD_CALL"), root_1);
                                    adaptor.addChild(root_1, stream_qualifiedIdentifier.nextTree());
                                    adaptor.addChild(root_1, stream_arguments.nextTree());
                                    adaptor.addChild(root_0, root_1);
                                }
                            }
                            retval.tree = root_0;
                        }
                    }
                    break;
                case 3:
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1114:13: outerDot= DOT ( CLASS -> ^( DOT qualifiedIdentifier CLASS ) | genericTypeArgumentListSimplified (Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments ) | SUPER innerDot= DOT IDENT arguments -> ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments ) | IDENT arguments -> ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments ) ) | THIS -> ^( DOT qualifiedIdentifier THIS ) | Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier arguments ) | innerNewExpression -> ^( DOT qualifiedIdentifier innerNewExpression ) )
                    {
                        outerDot = (Token) match(input, DOT, FOLLOW_DOT_in_qualifiedIdentExpression13556);
                        if (state.failed) {
                            return retval;
                        }
                        if (state.backtracking == 0) {
                            stream_DOT.add(outerDot);
                        }
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1115:13: ( CLASS -> ^( DOT qualifiedIdentifier CLASS ) | genericTypeArgumentListSimplified (Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments ) | SUPER innerDot= DOT IDENT arguments -> ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments ) | IDENT arguments -> ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments ) ) | THIS -> ^( DOT qualifiedIdentifier THIS ) | Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier arguments ) | innerNewExpression -> ^( DOT qualifiedIdentifier innerNewExpression ) )
                        int alt143 = 5;
                        switch(input.LA(1)) {
                            case CLASS:
                                {
                                    alt143 = 1;
                                }
                                break;
                            case LESS_THAN:
                                {
                                    alt143 = 2;
                                }
                                break;
                            case THIS:
                                {
                                    alt143 = 3;
                                }
                                break;
                            case SUPER:
                                {
                                    alt143 = 4;
                                }
                                break;
                            case NEW:
                                {
                                    alt143 = 5;
                                }
                                break;
                            default:
                                if (state.backtracking > 0) {
                                    state.failed = true;
                                    return retval;
                                }
                                NoViableAltException nvae = new NoViableAltException("", 143, 0, input);
                                throw nvae;
                        }
                        switch(alt143) {
                            case 1:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1115:17: CLASS
                                {
                                    CLASS498 = (Token) match(input, CLASS, FOLLOW_CLASS_in_qualifiedIdentExpression13574);
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        stream_CLASS.add(CLASS498);
                                    }
                                    // 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();
                                        // 1115:57: -> ^( DOT qualifiedIdentifier CLASS )
                                        {
                                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1115:61: ^( DOT qualifiedIdentifier CLASS )
                                            {
                                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                                root_1 = (CommonTree) adaptor.becomeRoot(stream_DOT.nextNode(), root_1);
                                                adaptor.addChild(root_1, stream_qualifiedIdentifier.nextTree());
                                                adaptor.addChild(root_1, stream_CLASS.nextNode());
                                                adaptor.addChild(root_0, root_1);
                                            }
                                        }
                                        retval.tree = root_0;
                                    }
                                }
                                break;
                            case 2:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1116:17: genericTypeArgumentListSimplified (Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments ) | SUPER innerDot= DOT IDENT arguments -> ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments ) | IDENT arguments -> ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments ) )
                                {
                                    pushFollow(FOLLOW_genericTypeArgumentListSimplified_in_qualifiedIdentExpression13637);
                                    genericTypeArgumentListSimplified499 = genericTypeArgumentListSimplified();
                                    state._fsp--;
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        stream_genericTypeArgumentListSimplified.add(genericTypeArgumentListSimplified499.getTree());
                                    }
                                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:1117:17: (Super= SUPER arguments -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments ) | SUPER innerDot= DOT IDENT arguments -> ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments ) | IDENT arguments -> ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments ) )
                                    int alt142 = 3;
                                    int LA142_0 = input.LA(1);
                                    if ((LA142_0 == SUPER)) {
                                        int LA142_1 = input.LA(2);
                                        if ((LA142_1 == DOT)) {
                                            alt142 = 2;
                                        } else if ((LA142_1 == LPAREN)) {
                                            alt142 = 1;
                                        } else {
                                            if (state.backtracking > 0) {
                                                state.failed = true;
                                                return retval;
                                            }
                                            NoViableAltException nvae = new NoViableAltException("", 142, 1, input);
                                            throw nvae;
                                        }
                                    } else if ((LA142_0 == IDENT)) {
                                        alt142 = 3;
                                    } else {
                                        if (state.backtracking > 0) {
                                            state.failed = true;
                                            return retval;
                                        }
                                        NoViableAltException nvae = new NoViableAltException("", 142, 0, input);
                                        throw nvae;
                                    }
                                    switch(alt142) {
                                        case 1:
                                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1117:21: Super= SUPER arguments
                                            {
                                                Super = (Token) match(input, SUPER, FOLLOW_SUPER_in_qualifiedIdentExpression13661);
                                                if (state.failed) {
                                                    return retval;
                                                }
                                                if (state.backtracking == 0) {
                                                    stream_SUPER.add(Super);
                                                }
                                                pushFollow(FOLLOW_arguments_in_qualifiedIdentExpression13663);
                                                arguments500 = arguments();
                                                state._fsp--;
                                                if (state.failed) {
                                                    return retval;
                                                }
                                                if (state.backtracking == 0) {
                                                    stream_arguments.add(arguments500.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();
                                                    // 1117:57: -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments )
                                                    {
                                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1117:61: ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier genericTypeArgumentListSimplified arguments )
                                                        {
                                                            CommonTree root_1 = (CommonTree) adaptor.nil();
                                                            root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(SUPER_CONSTRUCTOR_CALL, Super, "SUPER_CONSTRUCTOR_CALL"), root_1);
                                                            adaptor.addChild(root_1, stream_qualifiedIdentifier.nextTree());
                                                            adaptor.addChild(root_1, stream_genericTypeArgumentListSimplified.nextTree());
                                                            adaptor.addChild(root_1, stream_arguments.nextTree());
                                                            adaptor.addChild(root_0, root_1);
                                                        }
                                                    }
                                                    retval.tree = root_0;
                                                }
                                            }
                                            break;
                                        case 2:
                                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1118:21: SUPER innerDot= DOT IDENT arguments
                                            {
                                                SUPER501 = (Token) match(input, SUPER, FOLLOW_SUPER_in_qualifiedIdentExpression13713);
                                                if (state.failed) {
                                                    return retval;
                                                }
                                                if (state.backtracking == 0) {
                                                    stream_SUPER.add(SUPER501);
                                                }
                                                innerDot = (Token) match(input, DOT, FOLLOW_DOT_in_qualifiedIdentExpression13717);
                                                if (state.failed) {
                                                    return retval;
                                                }
                                                if (state.backtracking == 0) {
                                                    stream_DOT.add(innerDot);
                                                }
                                                IDENT502 = (Token) match(input, IDENT, FOLLOW_IDENT_in_qualifiedIdentExpression13719);
                                                if (state.failed) {
                                                    return retval;
                                                }
                                                if (state.backtracking == 0) {
                                                    stream_IDENT.add(IDENT502);
                                                }
                                                pushFollow(FOLLOW_arguments_in_qualifiedIdentExpression13721);
                                                arguments503 = arguments();
                                                state._fsp--;
                                                if (state.failed) {
                                                    return retval;
                                                }
                                                if (state.backtracking == 0) {
                                                    stream_arguments.add(arguments503.getTree());
                                                }
                                                // wildcard labels:
                                                if (state.backtracking == 0) {
                                                    retval.tree = root_0;
                                                    RewriteRuleTokenStream stream_outerDot = new RewriteRuleTokenStream(adaptor, "token outerDot", outerDot);
                                                    RewriteRuleTokenStream stream_innerDot = new RewriteRuleTokenStream(adaptor, "token innerDot", innerDot);
                                                    RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                                                    root_0 = (CommonTree) adaptor.nil();
                                                    // 1118:57: -> ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments )
                                                    {
                                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1118:61: ^( METHOD_CALL ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT ) genericTypeArgumentListSimplified arguments )
                                                        {
                                                            CommonTree root_1 = (CommonTree) adaptor.nil();
                                                            root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(METHOD_CALL, "METHOD_CALL"), root_1);
                                                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1118:75: ^( $innerDot ^( $outerDot qualifiedIdentifier SUPER ) IDENT )
                                                            {
                                                                CommonTree root_2 = (CommonTree) adaptor.nil();
                                                                root_2 = (CommonTree) adaptor.becomeRoot(stream_innerDot.nextNode(), root_2);
                                                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1118:87: ^( $outerDot qualifiedIdentifier SUPER )
                                                                {
                                                                    CommonTree root_3 = (CommonTree) adaptor.nil();
                                                                    root_3 = (CommonTree) adaptor.becomeRoot(stream_outerDot.nextNode(), root_3);
                                                                    adaptor.addChild(root_3, stream_qualifiedIdentifier.nextTree());
                                                                    adaptor.addChild(root_3, stream_SUPER.nextNode());
                                                                    adaptor.addChild(root_2, root_3);
                                                                }
                                                                adaptor.addChild(root_2, stream_IDENT.nextNode());
                                                                adaptor.addChild(root_1, root_2);
                                                            }
                                                            adaptor.addChild(root_1, stream_genericTypeArgumentListSimplified.nextTree());
                                                            adaptor.addChild(root_1, stream_arguments.nextTree());
                                                            adaptor.addChild(root_0, root_1);
                                                        }
                                                    }
                                                    retval.tree = root_0;
                                                }
                                            }
                                            break;
                                        case 3:
                                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1119:21: IDENT arguments
                                            {
                                                IDENT504 = (Token) match(input, IDENT, FOLLOW_IDENT_in_qualifiedIdentExpression13771);
                                                if (state.failed) {
                                                    return retval;
                                                }
                                                if (state.backtracking == 0) {
                                                    stream_IDENT.add(IDENT504);
                                                }
                                                pushFollow(FOLLOW_arguments_in_qualifiedIdentExpression13773);
                                                arguments505 = arguments();
                                                state._fsp--;
                                                if (state.failed) {
                                                    return retval;
                                                }
                                                if (state.backtracking == 0) {
                                                    stream_arguments.add(arguments505.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();
                                                    // 1119:57: -> ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments )
                                                    {
                                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1119:61: ^( METHOD_CALL ^( DOT qualifiedIdentifier IDENT ) genericTypeArgumentListSimplified arguments )
                                                        {
                                                            CommonTree root_1 = (CommonTree) adaptor.nil();
                                                            root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(METHOD_CALL, "METHOD_CALL"), root_1);
                                                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1119:75: ^( DOT qualifiedIdentifier IDENT )
                                                            {
                                                                CommonTree root_2 = (CommonTree) adaptor.nil();
                                                                root_2 = (CommonTree) adaptor.becomeRoot(stream_DOT.nextNode(), root_2);
                                                                adaptor.addChild(root_2, stream_qualifiedIdentifier.nextTree());
                                                                adaptor.addChild(root_2, stream_IDENT.nextNode());
                                                                adaptor.addChild(root_1, root_2);
                                                            }
                                                            adaptor.addChild(root_1, stream_genericTypeArgumentListSimplified.nextTree());
                                                            adaptor.addChild(root_1, stream_arguments.nextTree());
                                                            adaptor.addChild(root_0, root_1);
                                                        }
                                                    }
                                                    retval.tree = root_0;
                                                }
                                            }
                                            break;
                                    }
                                }
                                break;
                            case 3:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1121:17: THIS
                                {
                                    THIS506 = (Token) match(input, THIS, FOLLOW_THIS_in_qualifiedIdentExpression13848);
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        stream_THIS.add(THIS506);
                                    }
                                    // 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();
                                        // 1121:57: -> ^( DOT qualifiedIdentifier THIS )
                                        {
                                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1121:61: ^( DOT qualifiedIdentifier THIS )
                                            {
                                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                                root_1 = (CommonTree) adaptor.becomeRoot(stream_DOT.nextNode(), root_1);
                                                adaptor.addChild(root_1, stream_qualifiedIdentifier.nextTree());
                                                adaptor.addChild(root_1, stream_THIS.nextNode());
                                                adaptor.addChild(root_0, root_1);
                                            }
                                        }
                                        retval.tree = root_0;
                                    }
                                }
                                break;
                            case 4:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1122:17: Super= SUPER arguments
                                {
                                    Super = (Token) match(input, SUPER, FOLLOW_SUPER_in_qualifiedIdentExpression13914);
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        stream_SUPER.add(Super);
                                    }
                                    pushFollow(FOLLOW_arguments_in_qualifiedIdentExpression13916);
                                    arguments507 = arguments();
                                    state._fsp--;
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        stream_arguments.add(arguments507.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();
                                        // 1122:57: -> ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier arguments )
                                        {
                                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1122:61: ^( SUPER_CONSTRUCTOR_CALL[$Super, \"SUPER_CONSTRUCTOR_CALL\"] qualifiedIdentifier arguments )
                                            {
                                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                                root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(SUPER_CONSTRUCTOR_CALL, Super, "SUPER_CONSTRUCTOR_CALL"), root_1);
                                                adaptor.addChild(root_1, stream_qualifiedIdentifier.nextTree());
                                                adaptor.addChild(root_1, stream_arguments.nextTree());
                                                adaptor.addChild(root_0, root_1);
                                            }
                                        }
                                        retval.tree = root_0;
                                    }
                                }
                                break;
                            case 5:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1123:17: innerNewExpression
                                {
                                    pushFollow(FOLLOW_innerNewExpression_in_qualifiedIdentExpression13964);
                                    innerNewExpression508 = innerNewExpression();
                                    state._fsp--;
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        stream_innerNewExpression.add(innerNewExpression508.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();
                                        // 1123:57: -> ^( DOT qualifiedIdentifier innerNewExpression )
                                        {
                                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1123:61: ^( DOT qualifiedIdentifier innerNewExpression )
                                            {
                                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                                root_1 = (CommonTree) adaptor.becomeRoot(stream_DOT.nextNode(), root_1);
                                                adaptor.addChild(root_1, stream_qualifiedIdentifier.nextTree());
                                                adaptor.addChild(root_1, stream_innerNewExpression.nextTree());
                                                adaptor.addChild(root_0, root_1);
                                            }
                                        }
                                        retval.tree = root_0;
                                    }
                                }
                                break;
                        }
                    }
                    break;
            }
        }
        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, 106, qualifiedIdentExpression_StartIndex);
        }
    }
    return retval;
}
Also used : CommonTree(org.antlr.runtime.tree.CommonTree) RewriteRuleSubtreeStream(org.antlr.runtime.tree.RewriteRuleSubtreeStream) Token(org.antlr.runtime.Token) RewriteRuleTokenStream(org.antlr.runtime.tree.RewriteRuleTokenStream) NoViableAltException(org.antlr.runtime.NoViableAltException) EarlyExitException(org.antlr.runtime.EarlyExitException) RewriteEarlyExitException(org.antlr.runtime.tree.RewriteEarlyExitException) RecognitionException(org.antlr.runtime.RecognitionException)

Example 43 with RewriteRuleTokenStream

use of org.antlr.runtime.tree.RewriteRuleTokenStream 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 44 with RewriteRuleTokenStream

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

the class JavaParser method enumBody.

// $ANTLR start "enumBody"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:494:1: enumBody : LCURLY enumScopeDeclarations RCURLY -> ^( ENUM_TOP_LEVEL_SCOPE[$LCURLY, \"ENUM_TOP_LEVEL_SCOPE\"] enumScopeDeclarations ) ;
public final JavaParser.enumBody_return enumBody() throws RecognitionException {
    JavaParser.enumBody_return retval = new JavaParser.enumBody_return();
    retval.start = input.LT(1);
    int enumBody_StartIndex = input.index();
    CommonTree root_0 = null;
    Token LCURLY51 = null;
    Token RCURLY53 = null;
    JavaParser.enumScopeDeclarations_return enumScopeDeclarations52 = null;
    CommonTree LCURLY51_tree = null;
    CommonTree RCURLY53_tree = null;
    RewriteRuleTokenStream stream_LCURLY = new RewriteRuleTokenStream(adaptor, "token LCURLY");
    RewriteRuleTokenStream stream_RCURLY = new RewriteRuleTokenStream(adaptor, "token RCURLY");
    RewriteRuleSubtreeStream stream_enumScopeDeclarations = new RewriteRuleSubtreeStream(adaptor, "rule enumScopeDeclarations");
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 16)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:495:5: ( LCURLY enumScopeDeclarations RCURLY -> ^( ENUM_TOP_LEVEL_SCOPE[$LCURLY, \"ENUM_TOP_LEVEL_SCOPE\"] enumScopeDeclarations ) )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:495:9: LCURLY enumScopeDeclarations RCURLY
        {
            LCURLY51 = (Token) match(input, LCURLY, FOLLOW_LCURLY_in_enumBody5246);
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_LCURLY.add(LCURLY51);
            }
            pushFollow(FOLLOW_enumScopeDeclarations_in_enumBody5248);
            enumScopeDeclarations52 = enumScopeDeclarations();
            state._fsp--;
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_enumScopeDeclarations.add(enumScopeDeclarations52.getTree());
            }
            RCURLY53 = (Token) match(input, RCURLY, FOLLOW_RCURLY_in_enumBody5250);
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_RCURLY.add(RCURLY53);
            }
            // 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();
                // 496:9: -> ^( ENUM_TOP_LEVEL_SCOPE[$LCURLY, \"ENUM_TOP_LEVEL_SCOPE\"] enumScopeDeclarations )
                {
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:496:13: ^( ENUM_TOP_LEVEL_SCOPE[$LCURLY, \"ENUM_TOP_LEVEL_SCOPE\"] enumScopeDeclarations )
                    {
                        CommonTree root_1 = (CommonTree) adaptor.nil();
                        root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(ENUM_TOP_LEVEL_SCOPE, LCURLY51, "ENUM_TOP_LEVEL_SCOPE"), root_1);
                        adaptor.addChild(root_1, stream_enumScopeDeclarations.nextTree());
                        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, 16, enumBody_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) RecognitionException(org.antlr.runtime.RecognitionException)

Example 45 with RewriteRuleTokenStream

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

the class JavaParser method classTypeDeclaration.

// $ANTLR start "classTypeDeclaration"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:444:1: classTypeDeclaration[CommonTree modifiers] : CLASS IDENT ( genericTypeParameterList )? ( classExtendsClause )? ( implementsClause )? classBody -> ^( CLASS IDENT ( genericTypeParameterList )? ( classExtendsClause )? ( implementsClause )? classBody ) ;
public final JavaParser.classTypeDeclaration_return classTypeDeclaration(CommonTree modifiers) throws RecognitionException {
    JavaParser.classTypeDeclaration_return retval = new JavaParser.classTypeDeclaration_return();
    retval.start = input.LT(1);
    int classTypeDeclaration_StartIndex = input.index();
    CommonTree root_0 = null;
    Token CLASS21 = null;
    Token IDENT22 = null;
    JavaParser.genericTypeParameterList_return genericTypeParameterList23 = null;
    JavaParser.classExtendsClause_return classExtendsClause24 = null;
    JavaParser.implementsClause_return implementsClause25 = null;
    JavaParser.classBody_return classBody26 = null;
    CommonTree CLASS21_tree = null;
    CommonTree IDENT22_tree = null;
    RewriteRuleTokenStream stream_IDENT = new RewriteRuleTokenStream(adaptor, "token IDENT");
    RewriteRuleTokenStream stream_CLASS = new RewriteRuleTokenStream(adaptor, "token CLASS");
    RewriteRuleSubtreeStream stream_genericTypeParameterList = new RewriteRuleSubtreeStream(adaptor, "rule genericTypeParameterList");
    RewriteRuleSubtreeStream stream_classExtendsClause = new RewriteRuleSubtreeStream(adaptor, "rule classExtendsClause");
    RewriteRuleSubtreeStream stream_implementsClause = new RewriteRuleSubtreeStream(adaptor, "rule implementsClause");
    RewriteRuleSubtreeStream stream_classBody = new RewriteRuleSubtreeStream(adaptor, "rule classBody");
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 7)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:445:5: ( CLASS IDENT ( genericTypeParameterList )? ( classExtendsClause )? ( implementsClause )? classBody -> ^( CLASS IDENT ( genericTypeParameterList )? ( classExtendsClause )? ( implementsClause )? classBody ) )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:445:9: CLASS IDENT ( genericTypeParameterList )? ( classExtendsClause )? ( implementsClause )? classBody
        {
            CLASS21 = (Token) match(input, CLASS, FOLLOW_CLASS_in_classTypeDeclaration4755);
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_CLASS.add(CLASS21);
            }
            IDENT22 = (Token) match(input, IDENT, FOLLOW_IDENT_in_classTypeDeclaration4757);
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_IDENT.add(IDENT22);
            }
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:445:21: ( genericTypeParameterList )?
            int alt8 = 2;
            int LA8_0 = input.LA(1);
            if ((LA8_0 == LESS_THAN)) {
                alt8 = 1;
            }
            switch(alt8) {
                case 1:
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: genericTypeParameterList
                    {
                        pushFollow(FOLLOW_genericTypeParameterList_in_classTypeDeclaration4759);
                        genericTypeParameterList23 = genericTypeParameterList();
                        state._fsp--;
                        if (state.failed) {
                            return retval;
                        }
                        if (state.backtracking == 0) {
                            stream_genericTypeParameterList.add(genericTypeParameterList23.getTree());
                        }
                    }
                    break;
            }
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:445:47: ( classExtendsClause )?
            int alt9 = 2;
            int LA9_0 = input.LA(1);
            if ((LA9_0 == EXTENDS)) {
                alt9 = 1;
            }
            switch(alt9) {
                case 1:
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: classExtendsClause
                    {
                        pushFollow(FOLLOW_classExtendsClause_in_classTypeDeclaration4762);
                        classExtendsClause24 = classExtendsClause();
                        state._fsp--;
                        if (state.failed) {
                            return retval;
                        }
                        if (state.backtracking == 0) {
                            stream_classExtendsClause.add(classExtendsClause24.getTree());
                        }
                    }
                    break;
            }
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:445:67: ( implementsClause )?
            int alt10 = 2;
            int LA10_0 = input.LA(1);
            if ((LA10_0 == IMPLEMENTS)) {
                alt10 = 1;
            }
            switch(alt10) {
                case 1:
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: implementsClause
                    {
                        pushFollow(FOLLOW_implementsClause_in_classTypeDeclaration4765);
                        implementsClause25 = implementsClause();
                        state._fsp--;
                        if (state.failed) {
                            return retval;
                        }
                        if (state.backtracking == 0) {
                            stream_implementsClause.add(implementsClause25.getTree());
                        }
                    }
                    break;
            }
            pushFollow(FOLLOW_classBody_in_classTypeDeclaration4768);
            classBody26 = classBody();
            state._fsp--;
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_classBody.add(classBody26.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();
                // 446:9: -> ^( CLASS IDENT ( genericTypeParameterList )? ( classExtendsClause )? ( implementsClause )? classBody )
                {
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:446:13: ^( CLASS IDENT ( genericTypeParameterList )? ( classExtendsClause )? ( implementsClause )? classBody )
                    {
                        CommonTree root_1 = (CommonTree) adaptor.nil();
                        root_1 = (CommonTree) adaptor.becomeRoot(stream_CLASS.nextNode(), root_1);
                        adaptor.addChild(root_1, modifiers);
                        adaptor.addChild(root_1, stream_IDENT.nextNode());
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:446:40: ( genericTypeParameterList )?
                        if (stream_genericTypeParameterList.hasNext()) {
                            adaptor.addChild(root_1, stream_genericTypeParameterList.nextTree());
                        }
                        stream_genericTypeParameterList.reset();
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:446:66: ( classExtendsClause )?
                        if (stream_classExtendsClause.hasNext()) {
                            adaptor.addChild(root_1, stream_classExtendsClause.nextTree());
                        }
                        stream_classExtendsClause.reset();
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:446:86: ( implementsClause )?
                        if (stream_implementsClause.hasNext()) {
                            adaptor.addChild(root_1, stream_implementsClause.nextTree());
                        }
                        stream_implementsClause.reset();
                        adaptor.addChild(root_1, stream_classBody.nextTree());
                        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, 7, classTypeDeclaration_StartIndex);
        }
    }
    return retval;
}
Also used : CommonTree(org.antlr.runtime.tree.CommonTree) RewriteRuleSubtreeStream(org.antlr.runtime.tree.RewriteRuleSubtreeStream) Token(org.antlr.runtime.Token) RewriteRuleTokenStream(org.antlr.runtime.tree.RewriteRuleTokenStream) RecognitionException(org.antlr.runtime.RecognitionException)

Aggregations

RecognitionException (org.antlr.runtime.RecognitionException)74 Token (org.antlr.runtime.Token)74 RewriteRuleSubtreeStream (org.antlr.runtime.tree.RewriteRuleSubtreeStream)74 RewriteRuleTokenStream (org.antlr.runtime.tree.RewriteRuleTokenStream)74 CommonTree (org.antlr.runtime.tree.CommonTree)62 NoViableAltException (org.antlr.runtime.NoViableAltException)22 RewriteEarlyExitException (org.antlr.runtime.tree.RewriteEarlyExitException)12 CommonToken (org.antlr.runtime.CommonToken)9 FailedPredicateException (org.antlr.runtime.FailedPredicateException)4 ParserRuleReturnScope (org.antlr.runtime.ParserRuleReturnScope)4 EarlyExitException (org.antlr.runtime.EarlyExitException)1 RewriteEmptyStreamException (org.antlr.runtime.tree.RewriteEmptyStreamException)1