Search in sources :

Example 76 with RecognitionException

use of antlr.RecognitionException 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 77 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method complex_declarator.

public final void complex_declarator() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST complex_declarator_AST = null;
    try {
        // for error handling
        array_declarator();
        astFactory.addASTChild(currentAST, returnAST);
        complex_declarator_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_50);
        } else {
            throw ex;
        }
    }
    returnAST = complex_declarator_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) RecognitionException(antlr.RecognitionException)

Example 78 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method signed_int.

public final void signed_int() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST signed_int_AST = null;
    try {
        // for error handling
        if ((LA(1) == LITERAL_short)) {
            signed_short_int();
            astFactory.addASTChild(currentAST, returnAST);
            signed_int_AST = (AST) currentAST.root;
        } else if ((LA(1) == LITERAL_long) && (_tokenSet_35.member(LA(2)))) {
            signed_long_int();
            astFactory.addASTChild(currentAST, returnAST);
            signed_int_AST = (AST) currentAST.root;
        } else if ((LA(1) == LITERAL_long) && (LA(2) == LITERAL_long)) {
            signed_longlong_int();
            astFactory.addASTChild(currentAST, returnAST);
            signed_int_AST = (AST) currentAST.root;
        } else {
            throw new NoViableAltException(LT(1), getFilename());
        }
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_35);
        } else {
            throw ex;
        }
    }
    returnAST = signed_int_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 79 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method get_excep_expr.

public final void get_excep_expr() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST get_excep_expr_AST = null;
    try {
        // for error handling
        AST tmp180_AST = null;
        tmp180_AST = astFactory.create(LT(1));
        astFactory.makeASTRoot(currentAST, tmp180_AST);
        match(LITERAL_getraises);
        exception_list();
        astFactory.addASTChild(currentAST, returnAST);
        get_excep_expr_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_64);
        } else {
            throw ex;
        }
    }
    returnAST = get_excep_expr_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) RecognitionException(antlr.RecognitionException)

Example 80 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method type_declarator.

public final void type_declarator() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST type_declarator_AST = null;
    try {
        // for error handling
        type_spec();
        astFactory.addASTChild(currentAST, returnAST);
        declarators();
        astFactory.addASTChild(currentAST, returnAST);
        type_declarator_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_10);
        } else {
            throw ex;
        }
    }
    returnAST = type_declarator_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) RecognitionException(antlr.RecognitionException)

Aggregations

RecognitionException (antlr.RecognitionException)170 AST (antlr.collections.AST)155 ASTPair (antlr.ASTPair)154 NoViableAltException (antlr.NoViableAltException)68 TokenStreamException (antlr.TokenStreamException)10 GroovyRecognizer (org.codehaus.groovy.antlr.parser.GroovyRecognizer)6 TokenStreamRecognitionException (antlr.TokenStreamRecognitionException)5 StringReader (java.io.StringReader)4 GroovyLexer (org.codehaus.groovy.antlr.parser.GroovyLexer)4 Token (antlr.Token)3 CharStreamException (antlr.CharStreamException)2 CharStreamIOException (antlr.CharStreamIOException)2 CommonToken (antlr.CommonToken)2 NoViableAltForCharException (antlr.NoViableAltForCharException)2 TokenStreamIOException (antlr.TokenStreamIOException)2 CheckstyleException (com.puppycrawl.tools.checkstyle.api.CheckstyleException)2 DetailAST (com.puppycrawl.tools.checkstyle.api.DetailAST)2 FileContents (com.puppycrawl.tools.checkstyle.api.FileContents)2 IncorrectTypeHintException (groovy.transform.stc.IncorrectTypeHintException)2 BufferedReader (java.io.BufferedReader)2