Search in sources :

Example 41 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method floating_pt_type.

public final void floating_pt_type() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST floating_pt_type_AST = null;
    try {
        // for error handling
        switch(LA(1)) {
            case LITERAL_float:
                {
                    AST tmp80_AST = null;
                    tmp80_AST = astFactory.create(LT(1));
                    astFactory.addASTChild(currentAST, tmp80_AST);
                    match(LITERAL_float);
                    floating_pt_type_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_double:
                {
                    AST tmp81_AST = null;
                    tmp81_AST = astFactory.create(LT(1));
                    astFactory.addASTChild(currentAST, tmp81_AST);
                    match(LITERAL_double);
                    floating_pt_type_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_long:
                {
                    AST tmp82_AST = null;
                    tmp82_AST = astFactory.create(LT(1));
                    astFactory.makeASTRoot(currentAST, tmp82_AST);
                    match(LITERAL_long);
                    AST tmp83_AST = null;
                    tmp83_AST = astFactory.create(LT(1));
                    astFactory.addASTChild(currentAST, tmp83_AST);
                    match(LITERAL_double);
                    floating_pt_type_AST = (AST) currentAST.root;
                    break;
                }
            default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
        }
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_36);
        } else {
            throw ex;
        }
    }
    returnAST = floating_pt_type_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 42 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method struct_type.

public final void struct_type() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST struct_type_AST = null;
    try {
        // for error handling
        AST tmp117_AST = null;
        tmp117_AST = astFactory.create(LT(1));
        astFactory.makeASTRoot(currentAST, tmp117_AST);
        match(LITERAL_struct);
        identifier();
        astFactory.addASTChild(currentAST, returnAST);
        match(LCURLY);
        member_list();
        astFactory.addASTChild(currentAST, returnAST);
        match(RCURLY);
        struct_type_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_23);
        } else {
            throw ex;
        }
    }
    returnAST = struct_type_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) RecognitionException(antlr.RecognitionException)

Example 43 with RecognitionException

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

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method array_declarator.

public final void array_declarator() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST array_declarator_AST = null;
    try {
        // for error handling
        AST tmp141_AST = null;
        tmp141_AST = astFactory.create(LT(1));
        astFactory.makeASTRoot(currentAST, tmp141_AST);
        match(IDENT);
        {
            int _cnt176 = 0;
            _loop176: do {
                if ((LA(1) == LBRACK)) {
                    fixed_array_size();
                    astFactory.addASTChild(currentAST, returnAST);
                } else {
                    if (_cnt176 >= 1) {
                        break _loop176;
                    } else {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
                }
                _cnt176++;
            } while (true);
        }
        array_declarator_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_50);
        } else {
            throw ex;
        }
    }
    returnAST = array_declarator_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 45 with RecognitionException

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

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