Search in sources :

Example 26 with NoViableAltException

use of org.antlr.runtime.NoViableAltException in project pentaho-kettle by pentaho.

the class FastSimpleGenericEdifactDirectXMLParser method composite_data_item_val.

// $ANTLR start "composite_data_item_val"
// C:\\workspace-sts\\Kettle trunk -
// restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\FastSimpleGenericEdifactDirectXML.g:105:1:
// composite_data_item_val : ( txt |);
public final FastSimpleGenericEdifactDirectXMLParser.composite_data_item_val_return composite_data_item_val() throws RecognitionException {
    FastSimpleGenericEdifactDirectXMLParser.composite_data_item_val_return retval = new FastSimpleGenericEdifactDirectXMLParser.composite_data_item_val_return();
    retval.start = input.LT(1);
    try {
        // C:\\workspace-sts\\Kettle trunk -
        // restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\
        // FastSimpleGenericEdifactDirectXML.g:105:25:
        // ( txt |)
        int alt6 = 2;
        int LA6_0 = input.LA(1);
        if ((LA6_0 == TEXT_DATA)) {
            alt6 = 1;
        } else if (((LA6_0 >= COMPLEX_ELEMENT_ITEM_SEPARATOR && LA6_0 <= ELEMENT_SEPARATOR) || LA6_0 == SEGMENT_TERMINATOR)) {
            alt6 = 2;
        } else {
            NoViableAltException nvae = new NoViableAltException("", 6, 0, input);
            throw nvae;
        }
        switch(alt6) {
            case 1:
                // C:\\workspace-sts\\Kettle trunk -
                // restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\
                // FastSimpleGenericEdifactDirectXML.g:105:27:
                // txt
                pushFollow(FOLLOW_txt_in_composite_data_item_val193);
                txt();
                state._fsp--;
                break;
            case 2:
                // FastSimpleGenericEdifactDirectXML.g:105:31:
                break;
        }
        retval.stop = input.LT(-1);
    } catch (RecognitionException e) {
        // do not try to recover from parse errors, propagate the error instead
        throw e;
    }
    return retval;
}
Also used : NoViableAltException(org.antlr.runtime.NoViableAltException) RecognitionException(org.antlr.runtime.RecognitionException)

Example 27 with NoViableAltException

use of org.antlr.runtime.NoViableAltException in project pentaho-kettle by pentaho.

the class FastSimpleGenericEdifactDirectXMLParser method tag_index_id_val.

// $ANTLR start "tag_index_id_val"
// C:\\workspace-sts\\Kettle trunk -
// restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\FastSimpleGenericEdifactDirectXML.g:116:1:
// tag_index_id_val : ( txt |);
public final FastSimpleGenericEdifactDirectXMLParser.tag_index_id_val_return tag_index_id_val() throws RecognitionException {
    FastSimpleGenericEdifactDirectXMLParser.tag_index_id_val_return retval = new FastSimpleGenericEdifactDirectXMLParser.tag_index_id_val_return();
    retval.start = input.LT(1);
    try {
        // C:\\workspace-sts\\Kettle trunk -
        // restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\
        // FastSimpleGenericEdifactDirectXML.g:116:18:
        // ( txt |)
        int alt8 = 2;
        int LA8_0 = input.LA(1);
        if ((LA8_0 == TEXT_DATA)) {
            alt8 = 1;
        } else if (((LA8_0 >= COMPLEX_ELEMENT_ITEM_SEPARATOR && LA8_0 <= ELEMENT_SEPARATOR) || LA8_0 == SEGMENT_TERMINATOR)) {
            alt8 = 2;
        } else {
            NoViableAltException nvae = new NoViableAltException("", 8, 0, input);
            throw nvae;
        }
        switch(alt8) {
            case 1:
                // C:\\workspace-sts\\Kettle trunk -
                // restruct\\engine\\src\\org\\pentaho\\di\\trans\\steps\\edi2xml\\grammar\\
                // FastSimpleGenericEdifactDirectXML.g:116:20:
                // txt
                pushFollow(FOLLOW_txt_in_tag_index_id_val258);
                txt();
                state._fsp--;
                break;
            case 2:
                // FastSimpleGenericEdifactDirectXML.g:116:24:
                break;
        }
        retval.stop = input.LT(-1);
    } catch (RecognitionException e) {
        // do not try to recover from parse errors, propagate the error instead
        throw e;
    }
    return retval;
}
Also used : NoViableAltException(org.antlr.runtime.NoViableAltException) RecognitionException(org.antlr.runtime.RecognitionException)

Example 28 with NoViableAltException

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

the class JavaParser method synpred52_Java_fragment.

// $ANTLR end synpred51_Java
// $ANTLR start synpred52_Java
public final void synpred52_Java_fragment() throws RecognitionException {
    // /home/langera/dev/freud/trunk/src/grammar/Java.g:555:9: ( modifierList ( ( genericTypeParameterList )? ( type IDENT formalParameterList ( arrayDeclaratorList )? ( throwsClause )? SEMI | VOID IDENT formalParameterList ( throwsClause )? SEMI ) | type interfaceFieldDeclaratorList SEMI ) )
    // /home/langera/dev/freud/trunk/src/grammar/Java.g:555:9: modifierList ( ( genericTypeParameterList )? ( type IDENT formalParameterList ( arrayDeclaratorList )? ( throwsClause )? SEMI | VOID IDENT formalParameterList ( throwsClause )? SEMI ) | type interfaceFieldDeclaratorList SEMI )
    {
        pushFollow(FOLLOW_modifierList_in_synpred52_Java5971);
        modifierList();
        state._fsp--;
        if (state.failed) {
            return;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:556:9: ( ( genericTypeParameterList )? ( type IDENT formalParameterList ( arrayDeclaratorList )? ( throwsClause )? SEMI | VOID IDENT formalParameterList ( throwsClause )? SEMI ) | type interfaceFieldDeclaratorList SEMI )
        int alt189 = 2;
        switch(input.LA(1)) {
            case LESS_THAN:
            case VOID:
                {
                    alt189 = 1;
                }
                break;
            case BOOLEAN:
            case BYTE:
            case CHAR:
            case DOUBLE:
            case FLOAT:
            case INT:
            case LONG:
            case SHORT:
                {
                    int LA189_2 = input.LA(2);
                    if ((synpred51_Java())) {
                        alt189 = 1;
                    } else if ((true)) {
                        alt189 = 2;
                    } else {
                        if (state.backtracking > 0) {
                            state.failed = true;
                            return;
                        }
                        NoViableAltException nvae = new NoViableAltException("", 189, 2, input);
                        throw nvae;
                    }
                }
                break;
            case IDENT:
                {
                    int LA189_3 = input.LA(2);
                    if ((synpred51_Java())) {
                        alt189 = 1;
                    } else if ((true)) {
                        alt189 = 2;
                    } else {
                        if (state.backtracking > 0) {
                            state.failed = true;
                            return;
                        }
                        NoViableAltException nvae = new NoViableAltException("", 189, 3, input);
                        throw nvae;
                    }
                }
                break;
            default:
                if (state.backtracking > 0) {
                    state.failed = true;
                    return;
                }
                NoViableAltException nvae = new NoViableAltException("", 189, 0, input);
                throw nvae;
        }
        switch(alt189) {
            case 1:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:556:13: ( genericTypeParameterList )? ( type IDENT formalParameterList ( arrayDeclaratorList )? ( throwsClause )? SEMI | VOID IDENT formalParameterList ( throwsClause )? SEMI )
                {
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:556:13: ( genericTypeParameterList )?
                    int alt184 = 2;
                    int LA184_0 = input.LA(1);
                    if ((LA184_0 == LESS_THAN)) {
                        alt184 = 1;
                    }
                    switch(alt184) {
                        case 1:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: genericTypeParameterList
                            {
                                pushFollow(FOLLOW_genericTypeParameterList_in_synpred52_Java5985);
                                genericTypeParameterList();
                                state._fsp--;
                                if (state.failed) {
                                    return;
                                }
                            }
                            break;
                    }
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:557:13: ( type IDENT formalParameterList ( arrayDeclaratorList )? ( throwsClause )? SEMI | VOID IDENT formalParameterList ( throwsClause )? SEMI )
                    int alt188 = 2;
                    int LA188_0 = input.LA(1);
                    if ((LA188_0 == BOOLEAN || LA188_0 == BYTE || LA188_0 == CHAR || LA188_0 == DOUBLE || LA188_0 == FLOAT || (LA188_0 >= INT && LA188_0 <= LONG) || LA188_0 == SHORT || LA188_0 == IDENT)) {
                        alt188 = 1;
                    } else if ((LA188_0 == VOID)) {
                        alt188 = 2;
                    } else {
                        if (state.backtracking > 0) {
                            state.failed = true;
                            return;
                        }
                        NoViableAltException nvae = new NoViableAltException("", 188, 0, input);
                        throw nvae;
                    }
                    switch(alt188) {
                        case 1:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:557:17: type IDENT formalParameterList ( arrayDeclaratorList )? ( throwsClause )? SEMI
                            {
                                pushFollow(FOLLOW_type_in_synpred52_Java6004);
                                type();
                                state._fsp--;
                                if (state.failed) {
                                    return;
                                }
                                match(input, IDENT, FOLLOW_IDENT_in_synpred52_Java6006);
                                if (state.failed) {
                                    return;
                                }
                                pushFollow(FOLLOW_formalParameterList_in_synpred52_Java6008);
                                formalParameterList();
                                state._fsp--;
                                if (state.failed) {
                                    return;
                                }
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:557:48: ( arrayDeclaratorList )?
                                int alt185 = 2;
                                int LA185_0 = input.LA(1);
                                if ((LA185_0 == LBRACK)) {
                                    alt185 = 1;
                                }
                                switch(alt185) {
                                    case 1:
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: arrayDeclaratorList
                                        {
                                            pushFollow(FOLLOW_arrayDeclaratorList_in_synpred52_Java6010);
                                            arrayDeclaratorList();
                                            state._fsp--;
                                            if (state.failed) {
                                                return;
                                            }
                                        }
                                        break;
                                }
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:557:69: ( throwsClause )?
                                int alt186 = 2;
                                int LA186_0 = input.LA(1);
                                if ((LA186_0 == THROWS)) {
                                    alt186 = 1;
                                }
                                switch(alt186) {
                                    case 1:
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: throwsClause
                                        {
                                            pushFollow(FOLLOW_throwsClause_in_synpred52_Java6013);
                                            throwsClause();
                                            state._fsp--;
                                            if (state.failed) {
                                                return;
                                            }
                                        }
                                        break;
                                }
                                match(input, SEMI, FOLLOW_SEMI_in_synpred52_Java6016);
                                if (state.failed) {
                                    return;
                                }
                            }
                            break;
                        case 2:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:559:17: VOID IDENT formalParameterList ( throwsClause )? SEMI
                            {
                                match(input, VOID, FOLLOW_VOID_in_synpred52_Java6074);
                                if (state.failed) {
                                    return;
                                }
                                match(input, IDENT, FOLLOW_IDENT_in_synpred52_Java6076);
                                if (state.failed) {
                                    return;
                                }
                                pushFollow(FOLLOW_formalParameterList_in_synpred52_Java6078);
                                formalParameterList();
                                state._fsp--;
                                if (state.failed) {
                                    return;
                                }
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:559:48: ( throwsClause )?
                                int alt187 = 2;
                                int LA187_0 = input.LA(1);
                                if ((LA187_0 == THROWS)) {
                                    alt187 = 1;
                                }
                                switch(alt187) {
                                    case 1:
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: throwsClause
                                        {
                                            pushFollow(FOLLOW_throwsClause_in_synpred52_Java6080);
                                            throwsClause();
                                            state._fsp--;
                                            if (state.failed) {
                                                return;
                                            }
                                        }
                                        break;
                                }
                                match(input, SEMI, FOLLOW_SEMI_in_synpred52_Java6083);
                                if (state.failed) {
                                    return;
                                }
                            }
                            break;
                    }
                }
                break;
            case 2:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:562:13: type interfaceFieldDeclaratorList SEMI
                {
                    pushFollow(FOLLOW_type_in_synpred52_Java6146);
                    type();
                    state._fsp--;
                    if (state.failed) {
                        return;
                    }
                    pushFollow(FOLLOW_interfaceFieldDeclaratorList_in_synpred52_Java6148);
                    interfaceFieldDeclaratorList();
                    state._fsp--;
                    if (state.failed) {
                        return;
                    }
                    match(input, SEMI, FOLLOW_SEMI_in_synpred52_Java6150);
                    if (state.failed) {
                        return;
                    }
                }
                break;
        }
    }
}
Also used : NoViableAltException(org.antlr.runtime.NoViableAltException)

Example 29 with NoViableAltException

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

the class JavaParser method synpred44_Java_fragment.

// $ANTLR end synpred43_Java
// $ANTLR start synpred44_Java
public final void synpred44_Java_fragment() throws RecognitionException {
    Token ident = null;
    // /home/langera/dev/freud/trunk/src/grammar/Java.g:538:9: ( modifierList ( ( genericTypeParameterList )? ( type IDENT formalParameterList ( arrayDeclaratorList )? ( throwsClause )? ( block | SEMI ) | VOID IDENT formalParameterList ( throwsClause )? ( block | SEMI ) | ident= IDENT formalParameterList ( throwsClause )? block ) | type classFieldDeclaratorList SEMI ) )
    // /home/langera/dev/freud/trunk/src/grammar/Java.g:538:9: modifierList ( ( genericTypeParameterList )? ( type IDENT formalParameterList ( arrayDeclaratorList )? ( throwsClause )? ( block | SEMI ) | VOID IDENT formalParameterList ( throwsClause )? ( block | SEMI ) | ident= IDENT formalParameterList ( throwsClause )? block ) | type classFieldDeclaratorList SEMI )
    {
        pushFollow(FOLLOW_modifierList_in_synpred44_Java5636);
        modifierList();
        state._fsp--;
        if (state.failed) {
            return;
        }
        // /home/langera/dev/freud/trunk/src/grammar/Java.g:539:9: ( ( genericTypeParameterList )? ( type IDENT formalParameterList ( arrayDeclaratorList )? ( throwsClause )? ( block | SEMI ) | VOID IDENT formalParameterList ( throwsClause )? ( block | SEMI ) | ident= IDENT formalParameterList ( throwsClause )? block ) | type classFieldDeclaratorList SEMI )
        int alt176 = 2;
        switch(input.LA(1)) {
            case LESS_THAN:
            case VOID:
                {
                    alt176 = 1;
                }
                break;
            case BOOLEAN:
            case BYTE:
            case CHAR:
            case DOUBLE:
            case FLOAT:
            case INT:
            case LONG:
            case SHORT:
                {
                    int LA176_2 = input.LA(2);
                    if ((synpred43_Java())) {
                        alt176 = 1;
                    } else if ((true)) {
                        alt176 = 2;
                    } else {
                        if (state.backtracking > 0) {
                            state.failed = true;
                            return;
                        }
                        NoViableAltException nvae = new NoViableAltException("", 176, 2, input);
                        throw nvae;
                    }
                }
                break;
            case IDENT:
                {
                    int LA176_3 = input.LA(2);
                    if ((synpred43_Java())) {
                        alt176 = 1;
                    } else if ((true)) {
                        alt176 = 2;
                    } else {
                        if (state.backtracking > 0) {
                            state.failed = true;
                            return;
                        }
                        NoViableAltException nvae = new NoViableAltException("", 176, 3, input);
                        throw nvae;
                    }
                }
                break;
            default:
                if (state.backtracking > 0) {
                    state.failed = true;
                    return;
                }
                NoViableAltException nvae = new NoViableAltException("", 176, 0, input);
                throw nvae;
        }
        switch(alt176) {
            case 1:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:539:13: ( genericTypeParameterList )? ( type IDENT formalParameterList ( arrayDeclaratorList )? ( throwsClause )? ( block | SEMI ) | VOID IDENT formalParameterList ( throwsClause )? ( block | SEMI ) | ident= IDENT formalParameterList ( throwsClause )? block )
                {
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:539:13: ( genericTypeParameterList )?
                    int alt168 = 2;
                    int LA168_0 = input.LA(1);
                    if ((LA168_0 == LESS_THAN)) {
                        alt168 = 1;
                    }
                    switch(alt168) {
                        case 1:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: genericTypeParameterList
                            {
                                pushFollow(FOLLOW_genericTypeParameterList_in_synpred44_Java5650);
                                genericTypeParameterList();
                                state._fsp--;
                                if (state.failed) {
                                    return;
                                }
                            }
                            break;
                    }
                    // /home/langera/dev/freud/trunk/src/grammar/Java.g:540:13: ( type IDENT formalParameterList ( arrayDeclaratorList )? ( throwsClause )? ( block | SEMI ) | VOID IDENT formalParameterList ( throwsClause )? ( block | SEMI ) | ident= IDENT formalParameterList ( throwsClause )? block )
                    int alt175 = 3;
                    switch(input.LA(1)) {
                        case BOOLEAN:
                        case BYTE:
                        case CHAR:
                        case DOUBLE:
                        case FLOAT:
                        case INT:
                        case LONG:
                        case SHORT:
                            {
                                alt175 = 1;
                            }
                            break;
                        case IDENT:
                            {
                                int LA175_2 = input.LA(2);
                                if ((LA175_2 == LPAREN)) {
                                    alt175 = 3;
                                } else if ((LA175_2 == DOT || LA175_2 == LBRACK || LA175_2 == LESS_THAN || LA175_2 == IDENT)) {
                                    alt175 = 1;
                                } else {
                                    if (state.backtracking > 0) {
                                        state.failed = true;
                                        return;
                                    }
                                    NoViableAltException nvae = new NoViableAltException("", 175, 2, input);
                                    throw nvae;
                                }
                            }
                            break;
                        case VOID:
                            {
                                alt175 = 2;
                            }
                            break;
                        default:
                            if (state.backtracking > 0) {
                                state.failed = true;
                                return;
                            }
                            NoViableAltException nvae = new NoViableAltException("", 175, 0, input);
                            throw nvae;
                    }
                    switch(alt175) {
                        case 1:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:540:17: type IDENT formalParameterList ( arrayDeclaratorList )? ( throwsClause )? ( block | SEMI )
                            {
                                pushFollow(FOLLOW_type_in_synpred44_Java5669);
                                type();
                                state._fsp--;
                                if (state.failed) {
                                    return;
                                }
                                match(input, IDENT, FOLLOW_IDENT_in_synpred44_Java5671);
                                if (state.failed) {
                                    return;
                                }
                                pushFollow(FOLLOW_formalParameterList_in_synpred44_Java5673);
                                formalParameterList();
                                state._fsp--;
                                if (state.failed) {
                                    return;
                                }
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:540:48: ( arrayDeclaratorList )?
                                int alt169 = 2;
                                int LA169_0 = input.LA(1);
                                if ((LA169_0 == LBRACK)) {
                                    alt169 = 1;
                                }
                                switch(alt169) {
                                    case 1:
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: arrayDeclaratorList
                                        {
                                            pushFollow(FOLLOW_arrayDeclaratorList_in_synpred44_Java5675);
                                            arrayDeclaratorList();
                                            state._fsp--;
                                            if (state.failed) {
                                                return;
                                            }
                                        }
                                        break;
                                }
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:540:69: ( throwsClause )?
                                int alt170 = 2;
                                int LA170_0 = input.LA(1);
                                if ((LA170_0 == THROWS)) {
                                    alt170 = 1;
                                }
                                switch(alt170) {
                                    case 1:
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: throwsClause
                                        {
                                            pushFollow(FOLLOW_throwsClause_in_synpred44_Java5678);
                                            throwsClause();
                                            state._fsp--;
                                            if (state.failed) {
                                                return;
                                            }
                                        }
                                        break;
                                }
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:540:83: ( block | SEMI )
                                int alt171 = 2;
                                int LA171_0 = input.LA(1);
                                if ((LA171_0 == LCURLY)) {
                                    alt171 = 1;
                                } else if ((LA171_0 == SEMI)) {
                                    alt171 = 2;
                                } else {
                                    if (state.backtracking > 0) {
                                        state.failed = true;
                                        return;
                                    }
                                    NoViableAltException nvae = new NoViableAltException("", 171, 0, input);
                                    throw nvae;
                                }
                                switch(alt171) {
                                    case 1:
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:540:84: block
                                        {
                                            pushFollow(FOLLOW_block_in_synpred44_Java5682);
                                            block();
                                            state._fsp--;
                                            if (state.failed) {
                                                return;
                                            }
                                        }
                                        break;
                                    case 2:
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:540:92: SEMI
                                        {
                                            match(input, SEMI, FOLLOW_SEMI_in_synpred44_Java5686);
                                            if (state.failed) {
                                                return;
                                            }
                                        }
                                        break;
                                }
                            }
                            break;
                        case 2:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:542:17: VOID IDENT formalParameterList ( throwsClause )? ( block | SEMI )
                            {
                                match(input, VOID, FOLLOW_VOID_in_synpred44_Java5748);
                                if (state.failed) {
                                    return;
                                }
                                match(input, IDENT, FOLLOW_IDENT_in_synpred44_Java5750);
                                if (state.failed) {
                                    return;
                                }
                                pushFollow(FOLLOW_formalParameterList_in_synpred44_Java5752);
                                formalParameterList();
                                state._fsp--;
                                if (state.failed) {
                                    return;
                                }
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:542:48: ( throwsClause )?
                                int alt172 = 2;
                                int LA172_0 = input.LA(1);
                                if ((LA172_0 == THROWS)) {
                                    alt172 = 1;
                                }
                                switch(alt172) {
                                    case 1:
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: throwsClause
                                        {
                                            pushFollow(FOLLOW_throwsClause_in_synpred44_Java5754);
                                            throwsClause();
                                            state._fsp--;
                                            if (state.failed) {
                                                return;
                                            }
                                        }
                                        break;
                                }
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:542:62: ( block | SEMI )
                                int alt173 = 2;
                                int LA173_0 = input.LA(1);
                                if ((LA173_0 == LCURLY)) {
                                    alt173 = 1;
                                } else if ((LA173_0 == SEMI)) {
                                    alt173 = 2;
                                } else {
                                    if (state.backtracking > 0) {
                                        state.failed = true;
                                        return;
                                    }
                                    NoViableAltException nvae = new NoViableAltException("", 173, 0, input);
                                    throw nvae;
                                }
                                switch(alt173) {
                                    case 1:
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:542:63: block
                                        {
                                            pushFollow(FOLLOW_block_in_synpred44_Java5758);
                                            block();
                                            state._fsp--;
                                            if (state.failed) {
                                                return;
                                            }
                                        }
                                        break;
                                    case 2:
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:542:71: SEMI
                                        {
                                            match(input, SEMI, FOLLOW_SEMI_in_synpred44_Java5762);
                                            if (state.failed) {
                                                return;
                                            }
                                        }
                                        break;
                                }
                            }
                            break;
                        case 3:
                            // /home/langera/dev/freud/trunk/src/grammar/Java.g:544:17: ident= IDENT formalParameterList ( throwsClause )? block
                            {
                                ident = (Token) match(input, IDENT, FOLLOW_IDENT_in_synpred44_Java5821);
                                if (state.failed) {
                                    return;
                                }
                                pushFollow(FOLLOW_formalParameterList_in_synpred44_Java5823);
                                formalParameterList();
                                state._fsp--;
                                if (state.failed) {
                                    return;
                                }
                                // /home/langera/dev/freud/trunk/src/grammar/Java.g:544:49: ( throwsClause )?
                                int alt174 = 2;
                                int LA174_0 = input.LA(1);
                                if ((LA174_0 == THROWS)) {
                                    alt174 = 1;
                                }
                                switch(alt174) {
                                    case 1:
                                        // /home/langera/dev/freud/trunk/src/grammar/Java.g:0:0: throwsClause
                                        {
                                            pushFollow(FOLLOW_throwsClause_in_synpred44_Java5825);
                                            throwsClause();
                                            state._fsp--;
                                            if (state.failed) {
                                                return;
                                            }
                                        }
                                        break;
                                }
                                pushFollow(FOLLOW_block_in_synpred44_Java5828);
                                block();
                                state._fsp--;
                                if (state.failed) {
                                    return;
                                }
                            }
                            break;
                    }
                }
                break;
            case 2:
                // /home/langera/dev/freud/trunk/src/grammar/Java.g:547:13: type classFieldDeclaratorList SEMI
                {
                    pushFollow(FOLLOW_type_in_synpred44_Java5892);
                    type();
                    state._fsp--;
                    if (state.failed) {
                        return;
                    }
                    pushFollow(FOLLOW_classFieldDeclaratorList_in_synpred44_Java5894);
                    classFieldDeclaratorList();
                    state._fsp--;
                    if (state.failed) {
                        return;
                    }
                    match(input, SEMI, FOLLOW_SEMI_in_synpred44_Java5896);
                    if (state.failed) {
                        return;
                    }
                }
                break;
        }
    }
}
Also used : NoViableAltException(org.antlr.runtime.NoViableAltException) Token(org.antlr.runtime.Token)

Example 30 with NoViableAltException

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

Aggregations

NoViableAltException (org.antlr.runtime.NoViableAltException)68 RecognitionException (org.antlr.runtime.RecognitionException)50 Token (org.antlr.runtime.Token)43 CommonTree (org.antlr.runtime.tree.CommonTree)33 RewriteRuleSubtreeStream (org.antlr.runtime.tree.RewriteRuleSubtreeStream)28 RewriteRuleTokenStream (org.antlr.runtime.tree.RewriteRuleTokenStream)24 ParserRuleReturnScope (org.antlr.runtime.ParserRuleReturnScope)10 CommonToken (org.antlr.runtime.CommonToken)7 MismatchedSetException (org.antlr.runtime.MismatchedSetException)6 EarlyExitException (org.antlr.runtime.EarlyExitException)4 FailedPredicateException (org.antlr.runtime.FailedPredicateException)3 RewriteEarlyExitException (org.antlr.runtime.tree.RewriteEarlyExitException)3 ArrayList (java.util.ArrayList)2 MismatchedNotSetException (org.antlr.runtime.MismatchedNotSetException)2 MismatchedTokenException (org.antlr.runtime.MismatchedTokenException)2 MismatchedTreeNodeException (org.antlr.runtime.MismatchedTreeNodeException)2 RewriteEmptyStreamException (org.antlr.runtime.tree.RewriteEmptyStreamException)2