Search in sources :

Example 91 with CommonTree

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

the class JavaParser method interfaceFieldDeclaratorList.

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

Example 92 with CommonTree

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

the class JavaParser method enumBody.

// $ANTLR start "enumBody"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:494:1: enumBody : LCURLY enumScopeDeclarations RCURLY -> ^( ENUM_TOP_LEVEL_SCOPE[$LCURLY, \"ENUM_TOP_LEVEL_SCOPE\"] enumScopeDeclarations ) ;
public final JavaParser.enumBody_return enumBody() throws RecognitionException {
    JavaParser.enumBody_return retval = new JavaParser.enumBody_return();
    retval.start = input.LT(1);
    int enumBody_StartIndex = input.index();
    CommonTree root_0 = null;
    Token LCURLY51 = null;
    Token RCURLY53 = null;
    JavaParser.enumScopeDeclarations_return enumScopeDeclarations52 = null;
    CommonTree LCURLY51_tree = null;
    CommonTree RCURLY53_tree = null;
    RewriteRuleTokenStream stream_LCURLY = new RewriteRuleTokenStream(adaptor, "token LCURLY");
    RewriteRuleTokenStream stream_RCURLY = new RewriteRuleTokenStream(adaptor, "token RCURLY");
    RewriteRuleSubtreeStream stream_enumScopeDeclarations = new RewriteRuleSubtreeStream(adaptor, "rule enumScopeDeclarations");
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 16)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:495:5: ( LCURLY enumScopeDeclarations RCURLY -> ^( ENUM_TOP_LEVEL_SCOPE[$LCURLY, \"ENUM_TOP_LEVEL_SCOPE\"] enumScopeDeclarations ) )
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:495:9: LCURLY enumScopeDeclarations RCURLY
        {
            LCURLY51 = (Token) match(input, LCURLY, FOLLOW_LCURLY_in_enumBody5246);
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_LCURLY.add(LCURLY51);
            }
            pushFollow(FOLLOW_enumScopeDeclarations_in_enumBody5248);
            enumScopeDeclarations52 = enumScopeDeclarations();
            state._fsp--;
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_enumScopeDeclarations.add(enumScopeDeclarations52.getTree());
            }
            RCURLY53 = (Token) match(input, RCURLY, FOLLOW_RCURLY_in_enumBody5250);
            if (state.failed) {
                return retval;
            }
            if (state.backtracking == 0) {
                stream_RCURLY.add(RCURLY53);
            }
            // wildcard labels:
            if (state.backtracking == 0) {
                retval.tree = root_0;
                RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval != null ? retval.tree : null);
                root_0 = (CommonTree) adaptor.nil();
                // 496:9: -> ^( ENUM_TOP_LEVEL_SCOPE[$LCURLY, \"ENUM_TOP_LEVEL_SCOPE\"] enumScopeDeclarations )
                {
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:496:13: ^( ENUM_TOP_LEVEL_SCOPE[$LCURLY, \"ENUM_TOP_LEVEL_SCOPE\"] enumScopeDeclarations )
                    {
                        CommonTree root_1 = (CommonTree) adaptor.nil();
                        root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(ENUM_TOP_LEVEL_SCOPE, LCURLY51, "ENUM_TOP_LEVEL_SCOPE"), root_1);
                        adaptor.addChild(root_1, stream_enumScopeDeclarations.nextTree());
                        adaptor.addChild(root_0, root_1);
                    }
                }
                retval.tree = root_0;
            }
        }
        retval.stop = input.LT(-1);
        if (state.backtracking == 0) {
            retval.tree = (CommonTree) adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
        }
    } catch (RecognitionException re) {
        reportError(re);
        recover(input, re);
        retval.tree = (CommonTree) adaptor.errorNode(input, retval.start, input.LT(-1), re);
    } finally {
        if (state.backtracking > 0) {
            memoize(input, 16, enumBody_StartIndex);
        }
    }
    return retval;
}
Also used : RewriteRuleTokenStream(org.antlr.runtime.tree.RewriteRuleTokenStream) CommonTree(org.antlr.runtime.tree.CommonTree) RewriteRuleSubtreeStream(org.antlr.runtime.tree.RewriteRuleSubtreeStream) Token(org.antlr.runtime.Token) RecognitionException(org.antlr.runtime.RecognitionException)

Example 93 with CommonTree

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

the class JavaParser method classTypeDeclaration.

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

Example 94 with CommonTree

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

the class JavaParser method blockStatement.

// $ANTLR start "blockStatement"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:830:1: blockStatement : ( localVariableDeclaration SEMI | typeDeclaration | statement );
public final JavaParser.blockStatement_return blockStatement() throws RecognitionException {
    JavaParser.blockStatement_return retval = new JavaParser.blockStatement_return();
    retval.start = input.LT(1);
    int blockStatement_StartIndex = input.index();
    CommonTree root_0 = null;
    Token SEMI269 = null;
    JavaParser.localVariableDeclaration_return localVariableDeclaration268 = null;
    JavaParser.typeDeclaration_return typeDeclaration270 = null;
    JavaParser.statement_return statement271 = null;
    CommonTree SEMI269_tree = null;
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 73)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:831:5: ( localVariableDeclaration SEMI | typeDeclaration | statement )
        int alt89 = 3;
        alt89 = dfa89.predict(input);
        switch(alt89) {
            case 1:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:831:9: localVariableDeclaration SEMI
                {
                    root_0 = (CommonTree) adaptor.nil();
                    pushFollow(FOLLOW_localVariableDeclaration_in_blockStatement8456);
                    localVariableDeclaration268 = localVariableDeclaration();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        adaptor.addChild(root_0, localVariableDeclaration268.getTree());
                    }
                    SEMI269 = (Token) match(input, SEMI, FOLLOW_SEMI_in_blockStatement8458);
                    if (state.failed) {
                        return retval;
                    }
                }
                break;
            case 2:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:832:9: typeDeclaration
                {
                    root_0 = (CommonTree) adaptor.nil();
                    pushFollow(FOLLOW_typeDeclaration_in_blockStatement8469);
                    typeDeclaration270 = typeDeclaration();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        adaptor.addChild(root_0, typeDeclaration270.getTree());
                    }
                }
                break;
            case 3:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:833:9: statement
                {
                    root_0 = (CommonTree) adaptor.nil();
                    pushFollow(FOLLOW_statement_in_blockStatement8479);
                    statement271 = statement();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        adaptor.addChild(root_0, statement271.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, 73, blockStatement_StartIndex);
        }
    }
    return retval;
}
Also used : CommonTree(org.antlr.runtime.tree.CommonTree) Token(org.antlr.runtime.Token) RecognitionException(org.antlr.runtime.RecognitionException)

Example 95 with CommonTree

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

the class JavaParser method unaryExpressionAll.

// $ANTLR start "unaryExpressionAll"
// /home/langera/dev/freud/trunk/src/grammar/Java.g:1029:1: unaryExpressionAll : ( PLUS unaryExpressionAll -> ^( UNARY_PLUS[$PLUS, \"UNARY_PLUS\"] unaryExpressionAll ) | MINUS unaryExpressionAll -> ^( UNARY_MINUS[$MINUS, \"UNARY_MINUS\"] unaryExpressionAll ) | INC postfixedExpression -> ^( PRE_INC[$INC, \"PRE_INC\"] postfixedExpression ) | DEC postfixedExpression -> ^( PRE_DEC[$DEC, \"PRE_DEC\"] postfixedExpression ) | unaryExpressionRest );
public final JavaParser.unaryExpressionAll_return unaryExpressionAll() throws RecognitionException {
    JavaParser.unaryExpressionAll_return retval = new JavaParser.unaryExpressionAll_return();
    retval.start = input.LT(1);
    int unaryExpressionAll_StartIndex = input.index();
    CommonTree root_0 = null;
    Token PLUS427 = null;
    Token MINUS429 = null;
    Token INC431 = null;
    Token DEC433 = null;
    JavaParser.unaryExpressionAll_return unaryExpressionAll428 = null;
    JavaParser.unaryExpressionAll_return unaryExpressionAll430 = null;
    JavaParser.postfixedExpression_return postfixedExpression432 = null;
    JavaParser.postfixedExpression_return postfixedExpression434 = null;
    JavaParser.unaryExpressionRest_return unaryExpressionRest435 = null;
    CommonTree PLUS427_tree = null;
    CommonTree MINUS429_tree = null;
    CommonTree INC431_tree = null;
    CommonTree DEC433_tree = null;
    RewriteRuleTokenStream stream_DEC = new RewriteRuleTokenStream(adaptor, "token DEC");
    RewriteRuleTokenStream stream_INC = new RewriteRuleTokenStream(adaptor, "token INC");
    RewriteRuleTokenStream stream_PLUS = new RewriteRuleTokenStream(adaptor, "token PLUS");
    RewriteRuleTokenStream stream_MINUS = new RewriteRuleTokenStream(adaptor, "token MINUS");
    RewriteRuleSubtreeStream stream_postfixedExpression = new RewriteRuleSubtreeStream(adaptor, "rule postfixedExpression");
    RewriteRuleSubtreeStream stream_unaryExpressionAll = new RewriteRuleSubtreeStream(adaptor, "rule unaryExpressionAll");
    try {
        if (state.backtracking > 0 && alreadyParsedRule(input, 102)) {
            return retval;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:1030:5: ( PLUS unaryExpressionAll -> ^( UNARY_PLUS[$PLUS, \"UNARY_PLUS\"] unaryExpressionAll ) | MINUS unaryExpressionAll -> ^( UNARY_MINUS[$MINUS, \"UNARY_MINUS\"] unaryExpressionAll ) | INC postfixedExpression -> ^( PRE_INC[$INC, \"PRE_INC\"] postfixedExpression ) | DEC postfixedExpression -> ^( PRE_DEC[$DEC, \"PRE_DEC\"] postfixedExpression ) | unaryExpressionRest )
        int alt127 = 5;
        switch(input.LA(1)) {
            case PLUS:
                {
                    alt127 = 1;
                }
                break;
            case MINUS:
                {
                    alt127 = 2;
                }
                break;
            case INC:
                {
                    alt127 = 3;
                }
                break;
            case DEC:
                {
                    alt127 = 4;
                }
                break;
            case LESS_THAN:
            case LOGICAL_NOT:
            case LPAREN:
            case NOT:
            case BOOLEAN:
            case BYTE:
            case CHAR:
            case DOUBLE:
            case FALSE:
            case FLOAT:
            case INT:
            case LONG:
            case NEW:
            case NULL:
            case SHORT:
            case SUPER:
            case THIS:
            case TRUE:
            case VOID:
            case IDENT:
            case HEX_LITERAL:
            case OCTAL_LITERAL:
            case DECIMAL_LITERAL:
            case FLOATING_POINT_LITERAL:
            case CHARACTER_LITERAL:
            case STRING_LITERAL:
                {
                    alt127 = 5;
                }
                break;
            default:
                if (state.backtracking > 0) {
                    state.failed = true;
                    return retval;
                }
                NoViableAltException nvae = new NoViableAltException("", 127, 0, input);
                throw nvae;
        }
        switch(alt127) {
            case 1:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1030:9: PLUS unaryExpressionAll
                {
                    PLUS427 = (Token) match(input, PLUS, FOLLOW_PLUS_in_unaryExpressionAll11271);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_PLUS.add(PLUS427);
                    }
                    pushFollow(FOLLOW_unaryExpressionAll_in_unaryExpressionAll11273);
                    unaryExpressionAll428 = unaryExpressionAll();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_unaryExpressionAll.add(unaryExpressionAll428.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();
                        // 1030:37: -> ^( UNARY_PLUS[$PLUS, \"UNARY_PLUS\"] unaryExpressionAll )
                        {
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1030:41: ^( UNARY_PLUS[$PLUS, \"UNARY_PLUS\"] unaryExpressionAll )
                            {
                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(UNARY_PLUS, PLUS427, "UNARY_PLUS"), root_1);
                                adaptor.addChild(root_1, stream_unaryExpressionAll.nextTree());
                                adaptor.addChild(root_0, root_1);
                            }
                        }
                        retval.tree = root_0;
                    }
                }
                break;
            case 2:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1031:9: MINUS unaryExpressionAll
                {
                    MINUS429 = (Token) match(input, MINUS, FOLLOW_MINUS_in_unaryExpressionAll11297);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_MINUS.add(MINUS429);
                    }
                    pushFollow(FOLLOW_unaryExpressionAll_in_unaryExpressionAll11299);
                    unaryExpressionAll430 = unaryExpressionAll();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_unaryExpressionAll.add(unaryExpressionAll430.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();
                        // 1031:37: -> ^( UNARY_MINUS[$MINUS, \"UNARY_MINUS\"] unaryExpressionAll )
                        {
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1031:41: ^( UNARY_MINUS[$MINUS, \"UNARY_MINUS\"] unaryExpressionAll )
                            {
                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(UNARY_MINUS, MINUS429, "UNARY_MINUS"), root_1);
                                adaptor.addChild(root_1, stream_unaryExpressionAll.nextTree());
                                adaptor.addChild(root_0, root_1);
                            }
                        }
                        retval.tree = root_0;
                    }
                }
                break;
            case 3:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1032:9: INC postfixedExpression
                {
                    INC431 = (Token) match(input, INC, FOLLOW_INC_in_unaryExpressionAll11322);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_INC.add(INC431);
                    }
                    pushFollow(FOLLOW_postfixedExpression_in_unaryExpressionAll11324);
                    postfixedExpression432 = postfixedExpression();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_postfixedExpression.add(postfixedExpression432.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();
                        // 1032:37: -> ^( PRE_INC[$INC, \"PRE_INC\"] postfixedExpression )
                        {
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1032:41: ^( PRE_INC[$INC, \"PRE_INC\"] postfixedExpression )
                            {
                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(PRE_INC, INC431, "PRE_INC"), root_1);
                                adaptor.addChild(root_1, stream_postfixedExpression.nextTree());
                                adaptor.addChild(root_0, root_1);
                            }
                        }
                        retval.tree = root_0;
                    }
                }
                break;
            case 4:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1033:9: DEC postfixedExpression
                {
                    DEC433 = (Token) match(input, DEC, FOLLOW_DEC_in_unaryExpressionAll11348);
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_DEC.add(DEC433);
                    }
                    pushFollow(FOLLOW_postfixedExpression_in_unaryExpressionAll11350);
                    postfixedExpression434 = postfixedExpression();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        stream_postfixedExpression.add(postfixedExpression434.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();
                        // 1033:37: -> ^( PRE_DEC[$DEC, \"PRE_DEC\"] postfixedExpression )
                        {
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:1033:41: ^( PRE_DEC[$DEC, \"PRE_DEC\"] postfixedExpression )
                            {
                                CommonTree root_1 = (CommonTree) adaptor.nil();
                                root_1 = (CommonTree) adaptor.becomeRoot((CommonTree) adaptor.create(PRE_DEC, DEC433, "PRE_DEC"), root_1);
                                adaptor.addChild(root_1, stream_postfixedExpression.nextTree());
                                adaptor.addChild(root_0, root_1);
                            }
                        }
                        retval.tree = root_0;
                    }
                }
                break;
            case 5:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:1034:9: unaryExpressionRest
                {
                    root_0 = (CommonTree) adaptor.nil();
                    pushFollow(FOLLOW_unaryExpressionRest_in_unaryExpressionAll11374);
                    unaryExpressionRest435 = unaryExpressionRest();
                    state._fsp--;
                    if (state.failed) {
                        return retval;
                    }
                    if (state.backtracking == 0) {
                        adaptor.addChild(root_0, unaryExpressionRest435.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, 102, unaryExpressionAll_StartIndex);
        }
    }
    return retval;
}
Also used : RewriteRuleTokenStream(org.antlr.runtime.tree.RewriteRuleTokenStream) CommonTree(org.antlr.runtime.tree.CommonTree) NoViableAltException(org.antlr.runtime.NoViableAltException) RewriteRuleSubtreeStream(org.antlr.runtime.tree.RewriteRuleSubtreeStream) 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