Search in sources :

Example 86 with CommonTree

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

the class JavaParser method enumTypeDeclaration.

// $ANTLR start "enumTypeDeclaration"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:489:1: enumTypeDeclaration[CommonTree modifiers] : ENUM IDENT ( implementsClause )? enumBody -> ^( ENUM IDENT ( implementsClause )? enumBody ) ;
public final JavaParser.enumTypeDeclaration_return enumTypeDeclaration(CommonTree modifiers) throws RecognitionException {
    JavaParser.enumTypeDeclaration_return retval = new JavaParser.enumTypeDeclaration_return();
    retval.start = input.LT(1);
    int enumTypeDeclaration_StartIndex = input.index();
    CommonTree root_0 = null;
    Token ENUM47 = null;
    Token IDENT48 = null;
    JavaParser.implementsClause_return implementsClause49 = null;
    JavaParser.enumBody_return enumBody50 = null;
    CommonTree ENUM47_tree = null;
    CommonTree IDENT48_tree = null;
    RewriteRuleTokenStream stream_IDENT = new RewriteRuleTokenStream(adaptor, "token IDENT");
    RewriteRuleTokenStream stream_ENUM = new RewriteRuleTokenStream(adaptor, "token ENUM");
    RewriteRuleSubtreeStream stream_implementsClause = new RewriteRuleSubtreeStream(adaptor, "rule implementsClause");
    RewriteRuleSubtreeStream stream_enumBody = new RewriteRuleSubtreeStream(adaptor, "rule enumBody");
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 15)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:490:5: ( ENUM IDENT ( implementsClause )? enumBody -> ^( ENUM IDENT ( implementsClause )? enumBody ) )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:490:9: ENUM IDENT ( implementsClause )? enumBody
        {
            ENUM47 = (Token) match(input, ENUM, FOLLOW_ENUM_in_enumTypeDeclaration5196);
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_ENUM.add(ENUM47);
            }
            IDENT48 = (Token) match(input, IDENT, FOLLOW_IDENT_in_enumTypeDeclaration5198);
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_IDENT.add(IDENT48);
            }
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:490:20: ( implementsClause )?
            int alt15 = 2;
            int LA15_0 = input.LA(1);
            if ((LA15_0 == IMPLEMENTS)) {
                alt15 = 1;
            }
            switch(alt15) {
                case 1:
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: implementsClause
                    {
                        pushFollow(FOLLOW_implementsClause_in_enumTypeDeclaration5200);
                        implementsClause49 = implementsClause();
                        state._fsp--;
                        if (state.failed) {
                            return retval;
                        }
                        if (state.backtracking == 0) {
                            stream_implementsClause.add(implementsClause49.getTree());
                        }
                    }
                    break;
            }
            pushFollow(FOLLOW_enumBody_in_enumTypeDeclaration5203);
            enumBody50 = enumBody();
            state._fsp--;
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_enumBody.add(enumBody50.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();
                // 491:9: -> ^( ENUM IDENT ( implementsClause )? enumBody )
                {
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:491:13: ^( ENUM IDENT ( implementsClause )? enumBody )
                    {
                        CommonTree root_1 = (CommonTree) adaptor.nil();
                        root_1 = (CommonTree) adaptor.becomeRoot(stream_ENUM.nextNode(), root_1);
                        adaptor.addChild(root_1, modifiers);
                        adaptor.addChild(root_1, stream_IDENT.nextNode());
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:491:39: ( implementsClause )?
                        if (stream_implementsClause.hasNext()) {
                            adaptor.addChild(root_1, stream_implementsClause.nextTree());
                        }
                        stream_implementsClause.reset();
                        adaptor.addChild(root_1, stream_enumBody.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, 15, enumTypeDeclaration_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 87 with CommonTree

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

the class JavaParser method localVariableDeclaration.

// $ANTLR start "localVariableDeclaration"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:836:1: localVariableDeclaration : localModifierList type classFieldDeclaratorList -> ^( VAR_DECLARATION localModifierList type classFieldDeclaratorList ) ;
public final JavaParser.localVariableDeclaration_return localVariableDeclaration() throws RecognitionException {
    JavaParser.localVariableDeclaration_return retval = new JavaParser.localVariableDeclaration_return();
    retval.start = input.LT(1);
    int localVariableDeclaration_StartIndex = input.index();
    CommonTree root_0 = null;
    JavaParser.localModifierList_return localModifierList272 = null;
    JavaParser.type_return type273 = null;
    JavaParser.classFieldDeclaratorList_return classFieldDeclaratorList274 = null;
    RewriteRuleSubtreeStream stream_localModifierList = new RewriteRuleSubtreeStream(adaptor, "rule localModifierList");
    RewriteRuleSubtreeStream stream_type = new RewriteRuleSubtreeStream(adaptor, "rule type");
    RewriteRuleSubtreeStream stream_classFieldDeclaratorList = new RewriteRuleSubtreeStream(adaptor, "rule classFieldDeclaratorList");
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 74)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:837:5: ( localModifierList type classFieldDeclaratorList -> ^( VAR_DECLARATION localModifierList type classFieldDeclaratorList ) )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:837:9: localModifierList type classFieldDeclaratorList
        {
            pushFollow(FOLLOW_localModifierList_in_localVariableDeclaration8498);
            localModifierList272 = localModifierList();
            state._fsp--;
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_localModifierList.add(localModifierList272.getTree());
            }
            pushFollow(FOLLOW_type_in_localVariableDeclaration8500);
            type273 = type();
            state._fsp--;
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_type.add(type273.getTree());
            }
            pushFollow(FOLLOW_classFieldDeclaratorList_in_localVariableDeclaration8502);
            classFieldDeclaratorList274 = classFieldDeclaratorList();
            state._fsp--;
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_classFieldDeclaratorList.add(classFieldDeclaratorList274.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();
                // 838:9: -> ^( VAR_DECLARATION localModifierList type classFieldDeclaratorList )
                {
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:838:13: ^( VAR_DECLARATION localModifierList type classFieldDeclaratorList )
                    {
                        CommonTree root_1 = (CommonTree) adaptor.nil();
                        root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(VAR_DECLARATION, "VAR_DECLARATION"), root_1);
                        adaptor.addChild(root_1, stream_localModifierList.nextTree());
                        adaptor.addChild(root_1, stream_type.nextTree());
                        adaptor.addChild(root_1, stream_classFieldDeclaratorList.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, 74, localVariableDeclaration_StartIndex);
        }
    }
    return retval;
}
Also used : CommonTree(org.antlr.runtime.tree.CommonTree) RewriteRuleSubtreeStream(org.antlr.runtime.tree.RewriteRuleSubtreeStream) RecognitionException(org.antlr.runtime.RecognitionException)

Example 88 with CommonTree

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

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

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

the class JavaParser method assignmentExpression.

// $ANTLR start "assignmentExpression"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:934:1: assignmentExpression : conditionalExpression ( ( ASSIGN | PLUS_ASSIGN | MINUS_ASSIGN | STAR_ASSIGN | DIV_ASSIGN | AND_ASSIGN | OR_ASSIGN | XOR_ASSIGN | MOD_ASSIGN | SHIFT_LEFT_ASSIGN | SHIFT_RIGHT_ASSIGN | BIT_SHIFT_RIGHT_ASSIGN ) assignmentExpression )? ;
public final JavaParser.assignmentExpression_return assignmentExpression() throws RecognitionException {
    JavaParser.assignmentExpression_return retval = new JavaParser.assignmentExpression_return();
    retval.start = input.LT(1);
    int assignmentExpression_StartIndex = input.index();
    CommonTree root_0 = null;
    Token ASSIGN367 = null;
    Token PLUS_ASSIGN368 = null;
    Token MINUS_ASSIGN369 = null;
    Token STAR_ASSIGN370 = null;
    Token DIV_ASSIGN371 = null;
    Token AND_ASSIGN372 = null;
    Token OR_ASSIGN373 = null;
    Token XOR_ASSIGN374 = null;
    Token MOD_ASSIGN375 = null;
    Token SHIFT_LEFT_ASSIGN376 = null;
    Token SHIFT_RIGHT_ASSIGN377 = null;
    Token BIT_SHIFT_RIGHT_ASSIGN378 = null;
    JavaParser.conditionalExpression_return conditionalExpression366 = null;
    JavaParser.assignmentExpression_return assignmentExpression379 = null;
    CommonTree ASSIGN367_tree = null;
    CommonTree PLUS_ASSIGN368_tree = null;
    CommonTree MINUS_ASSIGN369_tree = null;
    CommonTree STAR_ASSIGN370_tree = null;
    CommonTree DIV_ASSIGN371_tree = null;
    CommonTree AND_ASSIGN372_tree = null;
    CommonTree OR_ASSIGN373_tree = null;
    CommonTree XOR_ASSIGN374_tree = null;
    CommonTree MOD_ASSIGN375_tree = null;
    CommonTree SHIFT_LEFT_ASSIGN376_tree = null;
    CommonTree SHIFT_RIGHT_ASSIGN377_tree = null;
    CommonTree BIT_SHIFT_RIGHT_ASSIGN378_tree = null;
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 89)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:935:5: ( conditionalExpression ( ( ASSIGN | PLUS_ASSIGN | MINUS_ASSIGN | STAR_ASSIGN | DIV_ASSIGN | AND_ASSIGN | OR_ASSIGN | XOR_ASSIGN | MOD_ASSIGN | SHIFT_LEFT_ASSIGN | SHIFT_RIGHT_ASSIGN | BIT_SHIFT_RIGHT_ASSIGN ) assignmentExpression )? )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:935:9: conditionalExpression ( ( ASSIGN | PLUS_ASSIGN | MINUS_ASSIGN | STAR_ASSIGN | DIV_ASSIGN | AND_ASSIGN | OR_ASSIGN | XOR_ASSIGN | MOD_ASSIGN | SHIFT_LEFT_ASSIGN | SHIFT_RIGHT_ASSIGN | BIT_SHIFT_RIGHT_ASSIGN ) assignmentExpression )?
        {
            root_0 = (CommonTree) adaptor.nil();
            pushFollow(FOLLOW_conditionalExpression_in_assignmentExpression10252);
            conditionalExpression366 = conditionalExpression();
            state._fsp--;
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                adaptor.addChild(root_0, conditionalExpression366.getTree());
            }
            // /home/langera/dev/freud/trunk/src/grammar/Java.g:936:9: ( ( ASSIGN | PLUS_ASSIGN | MINUS_ASSIGN | STAR_ASSIGN | DIV_ASSIGN | AND_ASSIGN | OR_ASSIGN | XOR_ASSIGN | MOD_ASSIGN | SHIFT_LEFT_ASSIGN | SHIFT_RIGHT_ASSIGN | BIT_SHIFT_RIGHT_ASSIGN ) assignmentExpression )?
            int alt109 = 2;
            int LA109_0 = input.LA(1);
            if (((LA109_0 >= AND_ASSIGN && LA109_0 <= ASSIGN) || LA109_0 == BIT_SHIFT_RIGHT_ASSIGN || LA109_0 == DIV_ASSIGN || LA109_0 == MINUS_ASSIGN || LA109_0 == MOD_ASSIGN || LA109_0 == OR_ASSIGN || LA109_0 == PLUS_ASSIGN || LA109_0 == SHIFT_LEFT_ASSIGN || LA109_0 == SHIFT_RIGHT_ASSIGN || LA109_0 == STAR_ASSIGN || LA109_0 == XOR_ASSIGN)) {
                alt109 = 1;
            }
            switch(alt109) {
                case 1:
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:936:13: ( ASSIGN | PLUS_ASSIGN | MINUS_ASSIGN | STAR_ASSIGN | DIV_ASSIGN | AND_ASSIGN | OR_ASSIGN | XOR_ASSIGN | MOD_ASSIGN | SHIFT_LEFT_ASSIGN | SHIFT_RIGHT_ASSIGN | BIT_SHIFT_RIGHT_ASSIGN ) assignmentExpression
                    {
                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:936:13: ( ASSIGN | PLUS_ASSIGN | MINUS_ASSIGN | STAR_ASSIGN | DIV_ASSIGN | AND_ASSIGN | OR_ASSIGN | XOR_ASSIGN | MOD_ASSIGN | SHIFT_LEFT_ASSIGN | SHIFT_RIGHT_ASSIGN | BIT_SHIFT_RIGHT_ASSIGN )
                        int alt108 = 12;
                        switch(input.LA(1)) {
                            case ASSIGN:
                                {
                                    alt108 = 1;
                                }
                                break;
                            case PLUS_ASSIGN:
                                {
                                    alt108 = 2;
                                }
                                break;
                            case MINUS_ASSIGN:
                                {
                                    alt108 = 3;
                                }
                                break;
                            case STAR_ASSIGN:
                                {
                                    alt108 = 4;
                                }
                                break;
                            case DIV_ASSIGN:
                                {
                                    alt108 = 5;
                                }
                                break;
                            case AND_ASSIGN:
                                {
                                    alt108 = 6;
                                }
                                break;
                            case OR_ASSIGN:
                                {
                                    alt108 = 7;
                                }
                                break;
                            case XOR_ASSIGN:
                                {
                                    alt108 = 8;
                                }
                                break;
                            case MOD_ASSIGN:
                                {
                                    alt108 = 9;
                                }
                                break;
                            case SHIFT_LEFT_ASSIGN:
                                {
                                    alt108 = 10;
                                }
                                break;
                            case SHIFT_RIGHT_ASSIGN:
                                {
                                    alt108 = 11;
                                }
                                break;
                            case BIT_SHIFT_RIGHT_ASSIGN:
                                {
                                    alt108 = 12;
                                }
                                break;
                            default:
                                if (state.backtracking > 0) {
                                    state.failed = true;
                                    return retval;
                                }
                                NoViableAltException nvae = new NoViableAltException("", 108, 0, input);
                                throw nvae;
                        }
                        switch(alt108) {
                            case 1:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:936:17: ASSIGN
                                {
                                    ASSIGN367 = (Token) match(input, ASSIGN, FOLLOW_ASSIGN_in_assignmentExpression10270);
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        ASSIGN367_tree = (CommonTree) adaptor.create(ASSIGN367);
                                        root_0 = (CommonTree) adaptor.becomeRoot(ASSIGN367_tree, root_0);
                                    }
                                }
                                break;
                            case 2:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:937:17: PLUS_ASSIGN
                                {
                                    PLUS_ASSIGN368 = (Token) match(input, PLUS_ASSIGN, FOLLOW_PLUS_ASSIGN_in_assignmentExpression10289);
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        PLUS_ASSIGN368_tree = (CommonTree) adaptor.create(PLUS_ASSIGN368);
                                        root_0 = (CommonTree) adaptor.becomeRoot(PLUS_ASSIGN368_tree, root_0);
                                    }
                                }
                                break;
                            case 3:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:938:17: MINUS_ASSIGN
                                {
                                    MINUS_ASSIGN369 = (Token) match(input, MINUS_ASSIGN, FOLLOW_MINUS_ASSIGN_in_assignmentExpression10308);
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        MINUS_ASSIGN369_tree = (CommonTree) adaptor.create(MINUS_ASSIGN369);
                                        root_0 = (CommonTree) adaptor.becomeRoot(MINUS_ASSIGN369_tree, root_0);
                                    }
                                }
                                break;
                            case 4:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:939:17: STAR_ASSIGN
                                {
                                    STAR_ASSIGN370 = (Token) match(input, STAR_ASSIGN, FOLLOW_STAR_ASSIGN_in_assignmentExpression10327);
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        STAR_ASSIGN370_tree = (CommonTree) adaptor.create(STAR_ASSIGN370);
                                        root_0 = (CommonTree) adaptor.becomeRoot(STAR_ASSIGN370_tree, root_0);
                                    }
                                }
                                break;
                            case 5:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:940:17: DIV_ASSIGN
                                {
                                    DIV_ASSIGN371 = (Token) match(input, DIV_ASSIGN, FOLLOW_DIV_ASSIGN_in_assignmentExpression10346);
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        DIV_ASSIGN371_tree = (CommonTree) adaptor.create(DIV_ASSIGN371);
                                        root_0 = (CommonTree) adaptor.becomeRoot(DIV_ASSIGN371_tree, root_0);
                                    }
                                }
                                break;
                            case 6:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:941:17: AND_ASSIGN
                                {
                                    AND_ASSIGN372 = (Token) match(input, AND_ASSIGN, FOLLOW_AND_ASSIGN_in_assignmentExpression10365);
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        AND_ASSIGN372_tree = (CommonTree) adaptor.create(AND_ASSIGN372);
                                        root_0 = (CommonTree) adaptor.becomeRoot(AND_ASSIGN372_tree, root_0);
                                    }
                                }
                                break;
                            case 7:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:942:17: OR_ASSIGN
                                {
                                    OR_ASSIGN373 = (Token) match(input, OR_ASSIGN, FOLLOW_OR_ASSIGN_in_assignmentExpression10384);
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        OR_ASSIGN373_tree = (CommonTree) adaptor.create(OR_ASSIGN373);
                                        root_0 = (CommonTree) adaptor.becomeRoot(OR_ASSIGN373_tree, root_0);
                                    }
                                }
                                break;
                            case 8:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:943:17: XOR_ASSIGN
                                {
                                    XOR_ASSIGN374 = (Token) match(input, XOR_ASSIGN, FOLLOW_XOR_ASSIGN_in_assignmentExpression10403);
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        XOR_ASSIGN374_tree = (CommonTree) adaptor.create(XOR_ASSIGN374);
                                        root_0 = (CommonTree) adaptor.becomeRoot(XOR_ASSIGN374_tree, root_0);
                                    }
                                }
                                break;
                            case 9:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:944:17: MOD_ASSIGN
                                {
                                    MOD_ASSIGN375 = (Token) match(input, MOD_ASSIGN, FOLLOW_MOD_ASSIGN_in_assignmentExpression10422);
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        MOD_ASSIGN375_tree = (CommonTree) adaptor.create(MOD_ASSIGN375);
                                        root_0 = (CommonTree) adaptor.becomeRoot(MOD_ASSIGN375_tree, root_0);
                                    }
                                }
                                break;
                            case 10:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:945:17: SHIFT_LEFT_ASSIGN
                                {
                                    SHIFT_LEFT_ASSIGN376 = (Token) match(input, SHIFT_LEFT_ASSIGN, FOLLOW_SHIFT_LEFT_ASSIGN_in_assignmentExpression10441);
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        SHIFT_LEFT_ASSIGN376_tree = (CommonTree) adaptor.create(SHIFT_LEFT_ASSIGN376);
                                        root_0 = (CommonTree) adaptor.becomeRoot(SHIFT_LEFT_ASSIGN376_tree, root_0);
                                    }
                                }
                                break;
                            case 11:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:946:17: SHIFT_RIGHT_ASSIGN
                                {
                                    SHIFT_RIGHT_ASSIGN377 = (Token) match(input, SHIFT_RIGHT_ASSIGN, FOLLOW_SHIFT_RIGHT_ASSIGN_in_assignmentExpression10460);
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        SHIFT_RIGHT_ASSIGN377_tree = (CommonTree) adaptor.create(SHIFT_RIGHT_ASSIGN377);
                                        root_0 = (CommonTree) adaptor.becomeRoot(SHIFT_RIGHT_ASSIGN377_tree, root_0);
                                    }
                                }
                                break;
                            case 12:
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:947:17: BIT_SHIFT_RIGHT_ASSIGN
                                {
                                    BIT_SHIFT_RIGHT_ASSIGN378 = (Token) match(input, BIT_SHIFT_RIGHT_ASSIGN, FOLLOW_BIT_SHIFT_RIGHT_ASSIGN_in_assignmentExpression10479);
                                    if (state.failed) {
                                        return retval;
                                    }
                                    if (state.backtracking == 0) {
                                        BIT_SHIFT_RIGHT_ASSIGN378_tree = (CommonTree) adaptor.create(BIT_SHIFT_RIGHT_ASSIGN378);
                                        root_0 = (CommonTree) adaptor.becomeRoot(BIT_SHIFT_RIGHT_ASSIGN378_tree, root_0);
                                    }
                                }
                                break;
                        }
                        pushFollow(FOLLOW_assignmentExpression_in_assignmentExpression10500);
                        assignmentExpression379 = assignmentExpression();
                        state._fsp--;
                        if (state.failed) {
                            return retval;
                        }
                        if (state.backtracking == 0) {
                            adaptor.addChild(root_0, assignmentExpression379.getTree());
                        }
                    }
                    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, 89, assignmentExpression_StartIndex);
        }
    }
    return retval;
}
Also used : CommonTree(org.antlr.runtime.tree.CommonTree) NoViableAltException(org.antlr.runtime.NoViableAltException) Token(org.antlr.runtime.Token) RecognitionException(org.antlr.runtime.RecognitionException)

Aggregations

CommonTree (org.antlr.runtime.tree.CommonTree)155 RecognitionException (org.antlr.runtime.RecognitionException)132 Token (org.antlr.runtime.Token)106 RewriteRuleSubtreeStream (org.antlr.runtime.tree.RewriteRuleSubtreeStream)81 RewriteRuleTokenStream (org.antlr.runtime.tree.RewriteRuleTokenStream)62 NoViableAltException (org.antlr.runtime.NoViableAltException)33 RewriteEarlyExitException (org.antlr.runtime.tree.RewriteEarlyExitException)15 CommonTokenStream (org.antlr.runtime.CommonTokenStream)12 CommonTreeNodeStream (org.antlr.runtime.tree.CommonTreeNodeStream)8 ANTLRStringStream (org.antlr.runtime.ANTLRStringStream)6 EarlyExitException (org.antlr.runtime.EarlyExitException)4 MismatchedSetException (org.antlr.runtime.MismatchedSetException)4 WindowingException (com.sap.hadoop.windowing.WindowingException)3 FileInputStream (java.io.FileInputStream)3 InputStreamReader (java.io.InputStreamReader)3 CharStream (org.antlr.runtime.CharStream)3 Tree (org.antlr.runtime.tree.Tree)3 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 TokenSource (org.antlr.runtime.TokenSource)2