Search in sources :

Example 86 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method wide_string_literal.

public final void wide_string_literal() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST wide_string_literal_AST = null;
    try {
        // for error handling
        {
            int _cnt288 = 0;
            _loop288: do {
                if ((LA(1) == WIDE_STRING_LITERAL)) {
                    AST tmp111_AST = null;
                    tmp111_AST = astFactory.create(LT(1));
                    astFactory.addASTChild(currentAST, tmp111_AST);
                    match(WIDE_STRING_LITERAL);
                } else {
                    if (_cnt288 >= 1) {
                        break _loop288;
                    } else {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
                }
                _cnt288++;
            } while (true);
        }
        wide_string_literal_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_42);
        } else {
            throw ex;
        }
    }
    returnAST = wide_string_literal_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 87 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method value_abs_dcl.

public final void value_abs_dcl() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST value_abs_dcl_AST = null;
    try {
        // for error handling
        AST tmp51_AST = null;
        tmp51_AST = astFactory.create(LT(1));
        astFactory.addASTChild(currentAST, tmp51_AST);
        match(LITERAL_abstract);
        AST tmp52_AST = null;
        tmp52_AST = astFactory.create(LT(1));
        astFactory.makeASTRoot(currentAST, tmp52_AST);
        match(LITERAL_valuetype);
        identifier();
        astFactory.addASTChild(currentAST, returnAST);
        {
            switch(LA(1)) {
                case LCURLY:
                case COLON:
                case LITERAL_supports:
                    {
                        value_abs_full_dcl();
                        astFactory.addASTChild(currentAST, returnAST);
                        break;
                    }
                case SEMI:
                    {
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        value_abs_dcl_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_10);
        } else {
            throw ex;
        }
    }
    returnAST = value_abs_dcl_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 88 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method integer_literal.

public final void integer_literal() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST integer_literal_AST = null;
    try {
        // for error handling
        switch(LA(1)) {
            case INT:
                {
                    AST tmp107_AST = null;
                    tmp107_AST = astFactory.create(LT(1));
                    astFactory.addASTChild(currentAST, tmp107_AST);
                    match(INT);
                    integer_literal_AST = (AST) currentAST.root;
                    break;
                }
            case OCTAL:
                {
                    AST tmp108_AST = null;
                    tmp108_AST = astFactory.create(LT(1));
                    astFactory.addASTChild(currentAST, tmp108_AST);
                    match(OCTAL);
                    integer_literal_AST = (AST) currentAST.root;
                    break;
                }
            case HEX:
                {
                    AST tmp109_AST = null;
                    tmp109_AST = astFactory.create(LT(1));
                    astFactory.addASTChild(currentAST, tmp109_AST);
                    match(HEX);
                    integer_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 = integer_literal_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 89 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method base_type_spec.

public final void base_type_spec() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST base_type_spec_AST = null;
    try {
        // for error handling
        switch(LA(1)) {
            case LITERAL_char:
                {
                    char_type();
                    astFactory.addASTChild(currentAST, returnAST);
                    base_type_spec_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_wchar:
                {
                    wide_char_type();
                    astFactory.addASTChild(currentAST, returnAST);
                    base_type_spec_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_boolean:
                {
                    boolean_type();
                    astFactory.addASTChild(currentAST, returnAST);
                    base_type_spec_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_octet:
                {
                    octet_type();
                    astFactory.addASTChild(currentAST, returnAST);
                    base_type_spec_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_any:
                {
                    any_type();
                    astFactory.addASTChild(currentAST, returnAST);
                    base_type_spec_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_Object:
                {
                    object_type();
                    astFactory.addASTChild(currentAST, returnAST);
                    base_type_spec_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_ValueBase:
                {
                    value_base_type();
                    astFactory.addASTChild(currentAST, returnAST);
                    base_type_spec_AST = (AST) currentAST.root;
                    break;
                }
            default:
                boolean synPredMatched122 = false;
                if ((((LA(1) >= LITERAL_float && LA(1) <= LITERAL_long)) && (_tokenSet_45.member(LA(2))) && (_tokenSet_46.member(LA(3))) && (_tokenSet_47.member(LA(4))))) {
                    int _m122 = mark();
                    synPredMatched122 = true;
                    inputState.guessing++;
                    try {
                        {
                            floating_pt_type();
                        }
                    } catch (RecognitionException pe) {
                        synPredMatched122 = false;
                    }
                    rewind(_m122);
                    inputState.guessing--;
                }
                if (synPredMatched122) {
                    floating_pt_type();
                    astFactory.addASTChild(currentAST, returnAST);
                    base_type_spec_AST = (AST) currentAST.root;
                } else if (((LA(1) >= LITERAL_long && LA(1) <= LITERAL_unsigned)) && (_tokenSet_48.member(LA(2))) && (_tokenSet_49.member(LA(3))) && (_tokenSet_47.member(LA(4)))) {
                    integer_type();
                    astFactory.addASTChild(currentAST, returnAST);
                    base_type_spec_AST = (AST) currentAST.root;
                } else {
                    throw new NoViableAltException(LT(1), getFilename());
                }
        }
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_36);
        } else {
            throw ex;
        }
    }
    returnAST = base_type_spec_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 90 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method home_header.

public final void home_header() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST home_header_AST = null;
    try {
        // for error handling
        AST tmp203_AST = null;
        tmp203_AST = astFactory.create(LT(1));
        astFactory.makeASTRoot(currentAST, tmp203_AST);
        match(LITERAL_home);
        identifier();
        astFactory.addASTChild(currentAST, returnAST);
        {
            switch(LA(1)) {
                case COLON:
                    {
                        home_inheritance_spec();
                        astFactory.addASTChild(currentAST, returnAST);
                        break;
                    }
                case LITERAL_supports:
                case LITERAL_manages:
                    {
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        {
            switch(LA(1)) {
                case LITERAL_supports:
                    {
                        supported_interface_spec();
                        astFactory.addASTChild(currentAST, returnAST);
                        break;
                    }
                case LITERAL_manages:
                    {
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        match(LITERAL_manages);
        scoped_name();
        astFactory.addASTChild(currentAST, returnAST);
        {
            switch(LA(1)) {
                case LITERAL_primarykey:
                    {
                        primary_key_spec();
                        astFactory.addASTChild(currentAST, returnAST);
                        break;
                    }
                case LCURLY:
                    {
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        home_header_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_16);
        } else {
            throw ex;
        }
    }
    returnAST = home_header_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