Search in sources :

Example 41 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method definition.

public final void definition() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST definition_AST = null;
    try {
        // for error handling
        {
            switch(LA(1)) {
                case LITERAL_typedef:
                case LITERAL_native:
                case LITERAL_struct:
                case LITERAL_union:
                case LITERAL_enum:
                    {
                        type_dcl();
                        astFactory.addASTChild(currentAST, returnAST);
                        match(SEMI);
                        break;
                    }
                case LITERAL_const:
                    {
                        const_dcl();
                        astFactory.addASTChild(currentAST, returnAST);
                        match(SEMI);
                        break;
                    }
                case LITERAL_exception:
                    {
                        except_dcl();
                        astFactory.addASTChild(currentAST, returnAST);
                        match(SEMI);
                        break;
                    }
                case LITERAL_module:
                    {
                        module();
                        astFactory.addASTChild(currentAST, returnAST);
                        match(SEMI);
                        break;
                    }
                case LITERAL_typeid:
                    {
                        type_id_dcl();
                        astFactory.addASTChild(currentAST, returnAST);
                        match(SEMI);
                        break;
                    }
                case LITERAL_typeprefix:
                    {
                        type_prefix_dcl();
                        astFactory.addASTChild(currentAST, returnAST);
                        match(SEMI);
                        break;
                    }
                case LITERAL_component:
                    {
                        component();
                        astFactory.addASTChild(currentAST, returnAST);
                        match(SEMI);
                        break;
                    }
                case LITERAL_home:
                    {
                        home_dcl();
                        astFactory.addASTChild(currentAST, returnAST);
                        match(SEMI);
                        break;
                    }
                default:
                    boolean synPredMatched10 = false;
                    if ((((LA(1) >= LITERAL_abstract && LA(1) <= LITERAL_interface)) && (LA(2) == LITERAL_interface || LA(2) == IDENT) && (_tokenSet_3.member(LA(3))) && (_tokenSet_4.member(LA(4))))) {
                        int _m10 = mark();
                        synPredMatched10 = true;
                        inputState.guessing++;
                        try {
                            {
                                {
                                    switch(LA(1)) {
                                        case LITERAL_abstract:
                                            {
                                                match(LITERAL_abstract);
                                                break;
                                            }
                                        case LITERAL_local:
                                            {
                                                match(LITERAL_local);
                                                break;
                                            }
                                        case LITERAL_interface:
                                            {
                                                break;
                                            }
                                        default:
                                            {
                                                throw new NoViableAltException(LT(1), getFilename());
                                            }
                                    }
                                }
                                match(LITERAL_interface);
                            }
                        } catch (RecognitionException pe) {
                            synPredMatched10 = false;
                        }
                        rewind(_m10);
                        inputState.guessing--;
                    }
                    if (synPredMatched10) {
                        interf();
                        astFactory.addASTChild(currentAST, returnAST);
                        match(SEMI);
                    } else {
                        boolean synPredMatched13 = false;
                        if (((LA(1) == LITERAL_abstract || LA(1) == LITERAL_custom || LA(1) == LITERAL_valuetype) && (LA(2) == LITERAL_valuetype || LA(2) == IDENT) && (_tokenSet_5.member(LA(3))) && (_tokenSet_6.member(LA(4))))) {
                            int _m13 = mark();
                            synPredMatched13 = true;
                            inputState.guessing++;
                            try {
                                {
                                    {
                                        switch(LA(1)) {
                                            case LITERAL_abstract:
                                                {
                                                    match(LITERAL_abstract);
                                                    break;
                                                }
                                            case LITERAL_custom:
                                                {
                                                    match(LITERAL_custom);
                                                    break;
                                                }
                                            case LITERAL_valuetype:
                                                {
                                                    break;
                                                }
                                            default:
                                                {
                                                    throw new NoViableAltException(LT(1), getFilename());
                                                }
                                        }
                                    }
                                    match(LITERAL_valuetype);
                                }
                            } catch (RecognitionException pe) {
                                synPredMatched13 = false;
                            }
                            rewind(_m13);
                            inputState.guessing--;
                        }
                        if (synPredMatched13) {
                            value();
                            astFactory.addASTChild(currentAST, returnAST);
                            match(SEMI);
                        } else {
                            boolean synPredMatched16 = false;
                            if (((LA(1) == LITERAL_abstract || LA(1) == LITERAL_custom || LA(1) == LITERAL_eventtype) && (LA(2) == LITERAL_eventtype || LA(2) == IDENT) && (_tokenSet_7.member(LA(3))) && (_tokenSet_8.member(LA(4))))) {
                                int _m16 = mark();
                                synPredMatched16 = true;
                                inputState.guessing++;
                                try {
                                    {
                                        {
                                            switch(LA(1)) {
                                                case LITERAL_abstract:
                                                    {
                                                        match(LITERAL_abstract);
                                                        break;
                                                    }
                                                case LITERAL_custom:
                                                    {
                                                        match(LITERAL_custom);
                                                        break;
                                                    }
                                                case LITERAL_eventtype:
                                                    {
                                                        break;
                                                    }
                                                default:
                                                    {
                                                        throw new NoViableAltException(LT(1), getFilename());
                                                    }
                                            }
                                        }
                                        match(LITERAL_eventtype);
                                    }
                                } catch (RecognitionException pe) {
                                    synPredMatched16 = false;
                                }
                                rewind(_m16);
                                inputState.guessing--;
                            }
                            if (synPredMatched16) {
                                event();
                                astFactory.addASTChild(currentAST, returnAST);
                                match(SEMI);
                            } else {
                                throw new NoViableAltException(LT(1), getFilename());
                            }
                        }
                    }
            }
        }
        definition_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_9);
        } else {
            throw ex;
        }
    }
    returnAST = definition_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 42 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method value_element.

public final void value_element() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST value_element_AST = null;
    try {
        // for error handling
        {
            switch(LA(1)) {
                case SCOPEOP:
                case IDENT:
                case LITERAL_const:
                case LITERAL_typedef:
                case LITERAL_native:
                case LITERAL_float:
                case LITERAL_double:
                case LITERAL_long:
                case LITERAL_short:
                case LITERAL_unsigned:
                case LITERAL_char:
                case LITERAL_wchar:
                case LITERAL_boolean:
                case LITERAL_octet:
                case LITERAL_any:
                case LITERAL_Object:
                case LITERAL_struct:
                case LITERAL_union:
                case LITERAL_enum:
                case LITERAL_string:
                case LITERAL_wstring:
                case LITERAL_exception:
                case LITERAL_oneway:
                case LITERAL_void:
                case LITERAL_ValueBase:
                case LITERAL_typeid:
                case LITERAL_typeprefix:
                case LITERAL_readonly:
                case LITERAL_attribute:
                    {
                        export();
                        astFactory.addASTChild(currentAST, returnAST);
                        break;
                    }
                case LITERAL_public:
                case LITERAL_private:
                    {
                        state_member();
                        astFactory.addASTChild(currentAST, returnAST);
                        break;
                    }
                case LITERAL_factory:
                    {
                        init_dcl();
                        astFactory.addASTChild(currentAST, returnAST);
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        value_element_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_24);
        } else {
            throw ex;
        }
    }
    returnAST = value_element_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 43 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method init_dcl.

public final void init_dcl() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST init_dcl_AST = null;
    try {
        // for error handling
        AST tmp67_AST = null;
        tmp67_AST = astFactory.create(LT(1));
        astFactory.makeASTRoot(currentAST, tmp67_AST);
        match(LITERAL_factory);
        identifier();
        astFactory.addASTChild(currentAST, returnAST);
        match(LPAREN);
        {
            switch(LA(1)) {
                case LITERAL_in:
                    {
                        init_param_decls();
                        astFactory.addASTChild(currentAST, returnAST);
                        break;
                    }
                case RPAREN:
                    {
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        match(RPAREN);
        {
            switch(LA(1)) {
                case LITERAL_raises:
                    {
                        raises_expr();
                        astFactory.addASTChild(currentAST, returnAST);
                        break;
                    }
                case SEMI:
                    {
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        match(SEMI);
        init_dcl_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_24);
        } else {
            throw ex;
        }
    }
    returnAST = init_dcl_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 44 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method value_value_inheritance_spec.

public final void value_value_inheritance_spec() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST value_value_inheritance_spec_AST = null;
    try {
        // for error handling
        AST tmp59_AST = null;
        tmp59_AST = astFactory.create(LT(1));
        astFactory.makeASTRoot(currentAST, tmp59_AST);
        match(COLON);
        {
            switch(LA(1)) {
                case LITERAL_truncatable:
                    {
                        AST tmp60_AST = null;
                        tmp60_AST = astFactory.create(LT(1));
                        astFactory.addASTChild(currentAST, tmp60_AST);
                        match(LITERAL_truncatable);
                        break;
                    }
                case SCOPEOP:
                case IDENT:
                    {
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        value_name();
        astFactory.addASTChild(currentAST, returnAST);
        {
            _loop63: do {
                if ((LA(1) == COMMA)) {
                    match(COMMA);
                    value_name();
                    astFactory.addASTChild(currentAST, returnAST);
                } else {
                    break _loop63;
                }
            } while (true);
        }
        value_value_inheritance_spec_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_25);
        } else {
            throw ex;
        }
    }
    returnAST = value_value_inheritance_spec_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 45 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method parameter_dcls.

public final void parameter_dcls() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST parameter_dcls_AST = null;
    try {
        // for error handling
        match(LPAREN);
        {
            switch(LA(1)) {
                case LITERAL_in:
                case LITERAL_out:
                case LITERAL_inout:
                    {
                        param_dcl_list();
                        astFactory.addASTChild(currentAST, returnAST);
                        break;
                    }
                case RPAREN:
                    {
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        match(RPAREN);
        parameter_dcls_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_57);
        } else {
            throw ex;
        }
    }
    returnAST = parameter_dcls_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Aggregations

NoViableAltException (antlr.NoViableAltException)132 RecognitionException (antlr.RecognitionException)114 ASTPair (antlr.ASTPair)68 AST (antlr.collections.AST)68 Token (antlr.Token)33 MismatchedCharException (antlr.MismatchedCharException)2 MismatchedTokenException (antlr.MismatchedTokenException)2 NoViableAltForCharException (antlr.NoViableAltForCharException)2 Message (org.codehaus.groovy.control.messages.Message)2 SimpleMessage (org.codehaus.groovy.control.messages.SimpleMessage)2 SyntaxErrorMessage (org.codehaus.groovy.control.messages.SyntaxErrorMessage)2