Search in sources :

Example 36 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method unary_expr.

public final void unary_expr() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST unary_expr_AST = null;
    try {
        // for error handling
        switch(LA(1)) {
            case PLUS:
            case MINUS:
            case TILDE:
                {
                    {
                        switch(LA(1)) {
                            case MINUS:
                                {
                                    AST tmp102_AST = null;
                                    tmp102_AST = astFactory.create(LT(1));
                                    astFactory.makeASTRoot(currentAST, tmp102_AST);
                                    match(MINUS);
                                    break;
                                }
                            case PLUS:
                                {
                                    AST tmp103_AST = null;
                                    tmp103_AST = astFactory.create(LT(1));
                                    astFactory.makeASTRoot(currentAST, tmp103_AST);
                                    match(PLUS);
                                    break;
                                }
                            case TILDE:
                                {
                                    AST tmp104_AST = null;
                                    tmp104_AST = astFactory.create(LT(1));
                                    astFactory.makeASTRoot(currentAST, tmp104_AST);
                                    match(TILDE);
                                    break;
                                }
                            default:
                                {
                                    throw new NoViableAltException(LT(1), getFilename());
                                }
                        }
                    }
                    primary_expr();
                    astFactory.addASTChild(currentAST, returnAST);
                    unary_expr_AST = (AST) currentAST.root;
                    break;
                }
            case SCOPEOP:
            case IDENT:
            case LPAREN:
            case LITERAL_TRUE:
            case LITERAL_FALSE:
            case INT:
            case OCTAL:
            case HEX:
            case STRING_LITERAL:
            case WIDE_STRING_LITERAL:
            case CHAR_LITERAL:
            case WIDE_CHAR_LITERAL:
            case FIXED:
            case FLOAT:
                {
                    primary_expr();
                    astFactory.addASTChild(currentAST, returnAST);
                    unary_expr_AST = (AST) currentAST.root;
                    break;
                }
            default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
        }
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_42);
        } else {
            throw ex;
        }
    }
    returnAST = unary_expr_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 37 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method event_dcl.

public final void event_dcl() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST event_dcl_AST = null;
    try {
        // for error handling
        event_header();
        astFactory.addASTChild(currentAST, returnAST);
        {
            switch(LA(1)) {
                case LCURLY:
                case COLON:
                case LITERAL_supports:
                    {
                        event_elem_dcl();
                        astFactory.addASTChild(currentAST, returnAST);
                        break;
                    }
                case SEMI:
                    {
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        event_dcl_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_10);
        } else {
            throw ex;
        }
    }
    returnAST = event_dcl_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 38 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method export.

public final void export() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST export_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_readonly:
                case LITERAL_attribute:
                    {
                        attr_dcl();
                        astFactory.addASTChild(currentAST, returnAST);
                        match(SEMI);
                        break;
                    }
                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_string:
                case LITERAL_wstring:
                case LITERAL_oneway:
                case LITERAL_void:
                case LITERAL_ValueBase:
                    {
                        op_dcl();
                        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;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        export_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_18);
        } else {
            throw ex;
        }
    }
    returnAST = export_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 39 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method interf.

public final void interf() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST interf_AST = null;
    try {
        // for error handling
        {
            if (((LA(1) >= LITERAL_abstract && LA(1) <= LITERAL_interface)) && (LA(2) == LITERAL_interface || LA(2) == IDENT) && (LA(3) == LCURLY || LA(3) == COLON || LA(3) == IDENT) && (_tokenSet_11.member(LA(4)))) {
                interface_dcl();
                astFactory.addASTChild(currentAST, returnAST);
            } else if (((LA(1) >= LITERAL_abstract && LA(1) <= LITERAL_interface)) && (LA(2) == LITERAL_interface || LA(2) == IDENT) && (LA(3) == SEMI || LA(3) == IDENT) && (_tokenSet_12.member(LA(4)))) {
                forward_dcl();
                astFactory.addASTChild(currentAST, returnAST);
            } else {
                throw new NoViableAltException(LT(1), getFilename());
            }
        }
        interf_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_10);
        } else {
            throw ex;
        }
    }
    returnAST = interf_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 40 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method case_stmt_list.

public final void case_stmt_list() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST case_stmt_list_AST = null;
    try {
        // for error handling
        {
            int _cnt157 = 0;
            _loop157: do {
                if ((LA(1) == LITERAL_case || LA(1) == LITERAL_default)) {
                    case_stmt();
                    astFactory.addASTChild(currentAST, returnAST);
                } else {
                    if (_cnt157 >= 1) {
                        break _loop157;
                    } else {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
                }
                _cnt157++;
            } while (true);
        }
        case_stmt_list_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_15);
        } else {
            throw ex;
        }
    }
    returnAST = case_stmt_list_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