Search in sources :

Example 1 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method finder_dcl.

public final void finder_dcl() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST finder_dcl_AST = null;
    try {
        // for error handling
        AST tmp214_AST = null;
        tmp214_AST = astFactory.create(LT(1));
        astFactory.makeASTRoot(currentAST, tmp214_AST);
        match(LITERAL_finder);
        identifier();
        astFactory.addASTChild(currentAST, returnAST);
        match(LPAREN);
        init_param_decls();
        astFactory.addASTChild(currentAST, returnAST);
        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());
                    }
            }
        }
        finder_dcl_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_10);
        } else {
            throw ex;
        }
    }
    returnAST = finder_dcl_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 2 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method attr_declarator.

public final void attr_declarator() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST attr_declarator_AST = null;
    try {
        // for error handling
        simple_declarator();
        astFactory.addASTChild(currentAST, returnAST);
        {
            boolean synPredMatched219 = false;
            if (((LA(1) == SEMI || LA(1) == LITERAL_getraises || LA(1) == LITERAL_setraises) && (_tokenSet_58.member(LA(2))) && (_tokenSet_59.member(LA(3))) && (_tokenSet_60.member(LA(4))))) {
                int _m219 = mark();
                synPredMatched219 = true;
                inputState.guessing++;
                try {
                    {
                        switch(LA(1)) {
                            case LITERAL_getraises:
                                {
                                    match(LITERAL_getraises);
                                    break;
                                }
                            case LITERAL_setraises:
                                {
                                    match(LITERAL_setraises);
                                    break;
                                }
                            default:
                                {
                                    throw new NoViableAltException(LT(1), getFilename());
                                }
                        }
                    }
                } catch (RecognitionException pe) {
                    synPredMatched219 = false;
                }
                rewind(_m219);
                inputState.guessing--;
            }
            if (synPredMatched219) {
                attr_raises_expr();
                astFactory.addASTChild(currentAST, returnAST);
            } else if ((LA(1) == SEMI || LA(1) == COMMA) && (_tokenSet_61.member(LA(2))) && (_tokenSet_62.member(LA(3))) && (_tokenSet_63.member(LA(4)))) {
                {
                    _loop221: do {
                        if ((LA(1) == COMMA)) {
                            match(COMMA);
                            simple_declarator();
                            astFactory.addASTChild(currentAST, returnAST);
                        } else {
                            break _loop221;
                        }
                    } while (true);
                }
            } else {
                throw new NoViableAltException(LT(1), getFilename());
            }
        }
        attr_declarator_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_10);
        } else {
            throw ex;
        }
    }
    returnAST = attr_declarator_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 3 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method type_spec.

public final void type_spec() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST type_spec_AST = null;
    try {
        // for error handling
        switch(LA(1)) {
            case SCOPEOP:
            case IDENT:
            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_sequence:
            case LITERAL_string:
            case LITERAL_wstring:
            case LITERAL_fixed:
            case LITERAL_ValueBase:
                {
                    simple_type_spec();
                    astFactory.addASTChild(currentAST, returnAST);
                    type_spec_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_struct:
            case LITERAL_union:
            case LITERAL_enum:
                {
                    constr_type_spec();
                    astFactory.addASTChild(currentAST, returnAST);
                    type_spec_AST = (AST) currentAST.root;
                    break;
                }
            default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
        }
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_23);
        } else {
            throw ex;
        }
    }
    returnAST = type_spec_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 4 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method wide_string_type.

public final void wide_string_type() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST wide_string_type_AST = null;
    try {
        // for error handling
        AST tmp87_AST = null;
        tmp87_AST = astFactory.create(LT(1));
        astFactory.makeASTRoot(currentAST, tmp87_AST);
        match(LITERAL_wstring);
        {
            switch(LA(1)) {
                case LT:
                    {
                        match(LT);
                        positive_int_const();
                        astFactory.addASTChild(currentAST, returnAST);
                        match(GT);
                        break;
                    }
                case SEMI:
                case COMMA:
                case IDENT:
                case GT:
                    {
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        wide_string_type_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_36);
        } else {
            throw ex;
        }
    }
    returnAST = wide_string_type_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 5 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method interface_dcl.

public final void interface_dcl() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST interface_dcl_AST = null;
    try {
        // for error handling
        {
            {
                switch(LA(1)) {
                    case LITERAL_abstract:
                        {
                            AST tmp28_AST = null;
                            tmp28_AST = astFactory.create(LT(1));
                            astFactory.addASTChild(currentAST, tmp28_AST);
                            match(LITERAL_abstract);
                            break;
                        }
                    case LITERAL_local:
                        {
                            AST tmp29_AST = null;
                            tmp29_AST = astFactory.create(LT(1));
                            astFactory.addASTChild(currentAST, tmp29_AST);
                            match(LITERAL_local);
                            break;
                        }
                    case LITERAL_interface:
                        {
                            break;
                        }
                    default:
                        {
                            throw new NoViableAltException(LT(1), getFilename());
                        }
                }
            }
            AST tmp30_AST = null;
            tmp30_AST = astFactory.create(LT(1));
            astFactory.makeASTRoot(currentAST, tmp30_AST);
            match(LITERAL_interface);
            identifier();
            astFactory.addASTChild(currentAST, returnAST);
            {
                switch(LA(1)) {
                    case COLON:
                        {
                            interface_inheritance_spec();
                            astFactory.addASTChild(currentAST, returnAST);
                            break;
                        }
                    case LCURLY:
                        {
                            break;
                        }
                    default:
                        {
                            throw new NoViableAltException(LT(1), getFilename());
                        }
                }
            }
            AST tmp31_AST = null;
            tmp31_AST = astFactory.create(LT(1));
            astFactory.addASTChild(currentAST, tmp31_AST);
            match(LCURLY);
            interface_body();
            astFactory.addASTChild(currentAST, returnAST);
            AST tmp32_AST = null;
            tmp32_AST = astFactory.create(LT(1));
            astFactory.addASTChild(currentAST, tmp32_AST);
            match(RCURLY);
        }
        interface_dcl_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_10);
        } else {
            throw ex;
        }
    }
    returnAST = interface_dcl_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