Search in sources :

Example 96 with RewriteRuleTokenStream

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

the class JavaParser method bound.

// $ANTLR start "bound"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:484:1: bound : EXTENDS type ( AND type )* -> ^( EXTENDS_BOUND_LIST[$EXTENDS, \"EXTENDS_BOUND_LIST\"] ( type )+ ) ;
public final JavaParser.bound_return bound() throws RecognitionException {
    JavaParser.bound_return retval = new JavaParser.bound_return();
    retval.start = input.LT(1);
    int bound_StartIndex = input.index();
    CommonTree root_0 = null;
    Token EXTENDS43 = null;
    Token AND45 = null;
    JavaParser.type_return type44 = null;
    JavaParser.type_return type46 = null;
    CommonTree EXTENDS43_tree = null;
    CommonTree AND45_tree = null;
    RewriteRuleTokenStream stream_AND = new RewriteRuleTokenStream(adaptor, "token AND");
    RewriteRuleTokenStream stream_EXTENDS = new RewriteRuleTokenStream(adaptor, "token EXTENDS");
    RewriteRuleSubtreeStream stream_type = new RewriteRuleSubtreeStream(adaptor, "rule type");
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 14)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:485:5: ( EXTENDS type ( AND type )* -> ^( EXTENDS_BOUND_LIST[$EXTENDS, \"EXTENDS_BOUND_LIST\"] ( type )+ ) )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:485:9: EXTENDS type ( AND type )*
        {
            EXTENDS43 = (Token) match(input, EXTENDS, FOLLOW_EXTENDS_in_bound5148);
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_EXTENDS.add(EXTENDS43);
            }
            pushFollow(FOLLOW_type_in_bound5150);
            type44 = type();
            state._fsp--;
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_type.add(type44.getTree());
            }
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:485:22: ( AND type )*
            loop14: do {
                int alt14 = 2;
                int LA14_0 = input.LA(1);
                if ((LA14_0 == AND)) {
                    alt14 = 1;
                }
                switch(alt14) {
                    case 1:
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:485:23: AND type
                        {
                            AND45 = (Token) match(input, AND, FOLLOW_AND_in_bound5153);
                            if (state.failed) {
                                return retval;
                            }
                            if (state.backtracking == 0) {
                                stream_AND.add(AND45);
                            }
                            pushFollow(FOLLOW_type_in_bound5155);
                            type46 = type();
                            state._fsp--;
                            if (state.failed) {
                                return retval;
                            }
                            if (state.backtracking == 0) {
                                stream_type.add(type46.getTree());
                            }
                        }
                        break;
                    default:
                        break loop14;
                }
            } 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();
                // 486:9: -> ^( EXTENDS_BOUND_LIST[$EXTENDS, \"EXTENDS_BOUND_LIST\"] ( type )+ )
                {
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:486:13: ^( EXTENDS_BOUND_LIST[$EXTENDS, \"EXTENDS_BOUND_LIST\"] ( type )+ )
                    {
                        CommonTree root_1 = (CommonTree) adaptor.nil();
                        root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(EXTENDS_BOUND_LIST, EXTENDS43, "EXTENDS_BOUND_LIST"), root_1);
                        if (!(stream_type.hasNext())) {
                            throw new RewriteEarlyExitException();
                        }
                        while (stream_type.hasNext()) {
                            adaptor.addChild(root_1, stream_type.nextTree());
                        }
                        stream_type.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, 14, bound_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 97 with RewriteRuleTokenStream

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

Example 98 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)

Example 99 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 100 with RewriteRuleTokenStream

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

the class JavaParser method arrayInitializer.

// $ANTLR start "arrayInitializer"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:608:1: arrayInitializer : LCURLY ( variableInitializer ( COMMA variableInitializer )* ( COMMA )? )? RCURLY -> ^( ARRAY_INITIALIZER[$LCURLY, \"ARRAY_INITIALIZER\"] ( variableInitializer )* ) ;
public final JavaParser.arrayInitializer_return arrayInitializer() throws RecognitionException {
    JavaParser.arrayInitializer_return retval = new JavaParser.arrayInitializer_return();
    retval.start = input.LT(1);
    int arrayInitializer_StartIndex = input.index();
    CommonTree root_0 = null;
    Token LCURLY143 = null;
    Token COMMA145 = null;
    Token COMMA147 = null;
    Token RCURLY148 = null;
    JavaParser.variableInitializer_return variableInitializer144 = null;
    JavaParser.variableInitializer_return variableInitializer146 = null;
    CommonTree LCURLY143_tree = null;
    CommonTree COMMA145_tree = null;
    CommonTree COMMA147_tree = null;
    CommonTree RCURLY148_tree = null;
    RewriteRuleTokenStream stream_LCURLY = new RewriteRuleTokenStream(adaptor, "token LCURLY");
    RewriteRuleTokenStream stream_COMMA = new RewriteRuleTokenStream(adaptor, "token COMMA");
    RewriteRuleTokenStream stream_RCURLY = new RewriteRuleTokenStream(adaptor, "token RCURLY");
    RewriteRuleSubtreeStream stream_variableInitializer = new RewriteRuleSubtreeStream(adaptor, "rule variableInitializer");
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 35)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:609:5: ( LCURLY ( variableInitializer ( COMMA variableInitializer )* ( COMMA )? )? RCURLY -> ^( ARRAY_INITIALIZER[$LCURLY, \"ARRAY_INITIALIZER\"] ( variableInitializer )* ) )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:609:9: LCURLY ( variableInitializer ( COMMA variableInitializer )* ( COMMA )? )? RCURLY
        {
            LCURLY143 = (Token) match(input, LCURLY, FOLLOW_LCURLY_in_arrayInitializer6527);
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_LCURLY.add(LCURLY143);
            }
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:609:16: ( variableInitializer ( COMMA variableInitializer )* ( COMMA )? )?
            int alt53 = 2;
            int LA53_0 = input.LA(1);
            if ((LA53_0 == DEC || LA53_0 == INC || LA53_0 == LCURLY || LA53_0 == LESS_THAN || LA53_0 == LOGICAL_NOT || (LA53_0 >= LPAREN && LA53_0 <= MINUS) || LA53_0 == NOT || LA53_0 == PLUS || LA53_0 == BOOLEAN || LA53_0 == BYTE || LA53_0 == CHAR || LA53_0 == DOUBLE || LA53_0 == FALSE || LA53_0 == FLOAT || (LA53_0 >= INT && LA53_0 <= LONG) || (LA53_0 >= NEW && LA53_0 <= NULL) || LA53_0 == SHORT || LA53_0 == SUPER || LA53_0 == THIS || LA53_0 == TRUE || LA53_0 == VOID || (LA53_0 >= IDENT && LA53_0 <= STRING_LITERAL))) {
                alt53 = 1;
            }
            switch(alt53) {
                case 1:
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:609:17: variableInitializer ( COMMA variableInitializer )* ( COMMA )?
                    {
                        pushFollow(FOLLOW_variableInitializer_in_arrayInitializer6530);
                        variableInitializer144 = variableInitializer();
                        state._fsp--;
                        if (state.failed) {
                            return retval;
                        }
                        if (state.backtracking == 0) {
                            stream_variableInitializer.add(variableInitializer144.getTree());
                        }
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:609:37: ( COMMA variableInitializer )*
                        loop51: do {
                            int alt51 = 2;
                            int LA51_0 = input.LA(1);
                            if ((LA51_0 == COMMA)) {
                                int LA51_1 = input.LA(2);
                                if ((LA51_1 == DEC || LA51_1 == INC || LA51_1 == LCURLY || LA51_1 == LESS_THAN || LA51_1 == LOGICAL_NOT || (LA51_1 >= LPAREN && LA51_1 <= MINUS) || LA51_1 == NOT || LA51_1 == PLUS || LA51_1 == BOOLEAN || LA51_1 == BYTE || LA51_1 == CHAR || LA51_1 == DOUBLE || LA51_1 == FALSE || LA51_1 == FLOAT || (LA51_1 >= INT && LA51_1 <= LONG) || (LA51_1 >= NEW && LA51_1 <= NULL) || LA51_1 == SHORT || LA51_1 == SUPER || LA51_1 == THIS || LA51_1 == TRUE || LA51_1 == VOID || (LA51_1 >= IDENT && LA51_1 <= STRING_LITERAL))) {
                                    alt51 = 1;
                                }
                            }
                            switch(alt51) {
                                case 1:
                                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:609:38: COMMA variableInitializer
                                    {
                                        COMMA145 = (Token) match(input, COMMA, FOLLOW_COMMA_in_arrayInitializer6533);
                                        if (state.failed) {
                                            return retval;
                                        }
                                        if (state.backtracking == 0) {
                                            stream_COMMA.add(COMMA145);
                                        }
                                        pushFollow(FOLLOW_variableInitializer_in_arrayInitializer6535);
                                        variableInitializer146 = variableInitializer();
                                        state._fsp--;
                                        if (state.failed) {
                                            return retval;
                                        }
                                        if (state.backtracking == 0) {
                                            stream_variableInitializer.add(variableInitializer146.getTree());
                                        }
                                    }
                                    break;
                                default:
                                    break loop51;
                            }
                        } while (true);
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:609:66: ( COMMA )?
                        int alt52 = 2;
                        int LA52_0 = input.LA(1);
                        if ((LA52_0 == COMMA)) {
                            alt52 = 1;
                        }
                        switch(alt52) {
                            case 1:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: COMMA
                                {
                                    COMMA147 = (Token) match(input, COMMA, FOLLOW_COMMA_in_arrayInitializer6539);
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        stream_COMMA.add(COMMA147);
                                    }
                                }
                                break;
                        }
                    }
                    break;
            }
            RCURLY148 = (Token) match(input, RCURLY, FOLLOW_RCURLY_in_arrayInitializer6544);
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_RCURLY.add(RCURLY148);
            }
            // 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();
                // 610:9: -> ^( ARRAY_INITIALIZER[$LCURLY, \"ARRAY_INITIALIZER\"] ( variableInitializer )* )
                {
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:610:13: ^( ARRAY_INITIALIZER[$LCURLY, \"ARRAY_INITIALIZER\"] ( variableInitializer )* )
                    {
                        CommonTree root_1 = (CommonTree) adaptor.nil();
                        root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(ARRAY_INITIALIZER, LCURLY143, "ARRAY_INITIALIZER"), root_1);
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:610:63: ( variableInitializer )*
                        while (stream_variableInitializer.hasNext()) {
                            adaptor.addChild(root_1, stream_variableInitializer.nextTree());
                        }
                        stream_variableInitializer.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, 35, arrayInitializer_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)

Aggregations

RewriteRuleSubtreeStream (org.antlr.runtime.tree.RewriteRuleSubtreeStream)123 RewriteRuleTokenStream (org.antlr.runtime.tree.RewriteRuleTokenStream)123 RecognitionException (org.antlr.runtime.RecognitionException)83 Token (org.antlr.runtime.Token)83 CommonTree (org.antlr.runtime.tree.CommonTree)62 NoViableAltException (org.antlr.runtime.NoViableAltException)24 CommonToken (org.antlr.runtime.CommonToken)18 RewriteEarlyExitException (org.antlr.runtime.tree.RewriteEarlyExitException)12 FailedPredicateException (org.antlr.runtime.FailedPredicateException)8 ParserRuleReturnScope (org.antlr.runtime.ParserRuleReturnScope)8 RewriteEmptyStreamException (org.antlr.runtime.tree.RewriteEmptyStreamException)2 EarlyExitException (org.antlr.runtime.EarlyExitException)1