Search in sources :

Example 51 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 52 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method constr_type_spec.

public final void constr_type_spec() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST constr_type_spec_AST = null;
    try {
        // for error handling
        switch(LA(1)) {
            case LITERAL_struct:
                {
                    struct_type();
                    astFactory.addASTChild(currentAST, returnAST);
                    constr_type_spec_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_union:
                {
                    union_type();
                    astFactory.addASTChild(currentAST, returnAST);
                    constr_type_spec_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_enum:
                {
                    enum_type();
                    astFactory.addASTChild(currentAST, returnAST);
                    constr_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 = constr_type_spec_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 53 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 54 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method literal.

public final void literal() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST literal_AST = null;
    try {
        // for error handling
        switch(LA(1)) {
            case INT:
            case OCTAL:
            case HEX:
                {
                    integer_literal();
                    astFactory.addASTChild(currentAST, returnAST);
                    literal_AST = (AST) currentAST.root;
                    break;
                }
            case STRING_LITERAL:
                {
                    string_literal();
                    astFactory.addASTChild(currentAST, returnAST);
                    literal_AST = (AST) currentAST.root;
                    break;
                }
            case WIDE_STRING_LITERAL:
                {
                    wide_string_literal();
                    astFactory.addASTChild(currentAST, returnAST);
                    literal_AST = (AST) currentAST.root;
                    break;
                }
            case CHAR_LITERAL:
                {
                    character_literal();
                    astFactory.addASTChild(currentAST, returnAST);
                    literal_AST = (AST) currentAST.root;
                    break;
                }
            case WIDE_CHAR_LITERAL:
                {
                    wide_character_literal();
                    astFactory.addASTChild(currentAST, returnAST);
                    literal_AST = (AST) currentAST.root;
                    break;
                }
            case FIXED:
                {
                    fixed_pt_literal();
                    astFactory.addASTChild(currentAST, returnAST);
                    literal_AST = (AST) currentAST.root;
                    break;
                }
            case FLOAT:
                {
                    floating_pt_literal();
                    astFactory.addASTChild(currentAST, returnAST);
                    literal_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_TRUE:
            case LITERAL_FALSE:
                {
                    boolean_literal();
                    astFactory.addASTChild(currentAST, returnAST);
                    literal_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 = literal_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 55 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method imported_scope.

public final void imported_scope() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST imported_scope_AST = null;
    try {
        // for error handling
        switch(LA(1)) {
            case SCOPEOP:
            case IDENT:
                {
                    scoped_name();
                    astFactory.addASTChild(currentAST, returnAST);
                    imported_scope_AST = (AST) currentAST.root;
                    break;
                }
            case STRING_LITERAL:
                {
                    string_literal();
                    astFactory.addASTChild(currentAST, returnAST);
                    imported_scope_AST = (AST) currentAST.root;
                    break;
                }
            default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
        }
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_10);
        } else {
            throw ex;
        }
    }
    returnAST = imported_scope_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