Search in sources :

Example 16 with RecognitionException

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

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

Example 18 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method state_member.

public final void state_member() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST state_member_AST = null;
    try {
        // for error handling
        {
            switch(LA(1)) {
                case LITERAL_public:
                    {
                        AST tmp64_AST = null;
                        tmp64_AST = astFactory.create(LT(1));
                        astFactory.addASTChild(currentAST, tmp64_AST);
                        match(LITERAL_public);
                        break;
                    }
                case LITERAL_private:
                    {
                        AST tmp65_AST = null;
                        tmp65_AST = astFactory.create(LT(1));
                        astFactory.addASTChild(currentAST, tmp65_AST);
                        match(LITERAL_private);
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        type_spec();
        astFactory.addASTChild(currentAST, returnAST);
        declarators();
        astFactory.addASTChild(currentAST, returnAST);
        match(SEMI);
        state_member_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_24);
        } else {
            throw ex;
        }
    }
    returnAST = state_member_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 19 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method and_expr.

public final void and_expr() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST and_expr_AST = null;
    try {
        // for error handling
        shift_expr();
        astFactory.addASTChild(currentAST, returnAST);
        {
            _loop93: do {
                if ((LA(1) == AND)) {
                    AST tmp94_AST = null;
                    tmp94_AST = astFactory.create(LT(1));
                    astFactory.makeASTRoot(currentAST, tmp94_AST);
                    match(AND);
                    shift_expr();
                    astFactory.addASTChild(currentAST, returnAST);
                } else {
                    break _loop93;
                }
            } while (true);
        }
        and_expr_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_38);
        } else {
            throw ex;
        }
    }
    returnAST = and_expr_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) RecognitionException(antlr.RecognitionException)

Example 20 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method home_export.

public final void home_export() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST home_export_AST = null;
    try {
        // for error handling
        {
            switch(LA(1)) {
                case SCOPEOP:
                case IDENT:
                case LITERAL_const:
                case LITERAL_typedef:
                case LITERAL_native:
                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_struct:
                case LITERAL_union:
                case LITERAL_enum:
                case LITERAL_string:
                case LITERAL_wstring:
                case LITERAL_exception:
                case LITERAL_oneway:
                case LITERAL_void:
                case LITERAL_ValueBase:
                case LITERAL_typeid:
                case LITERAL_typeprefix:
                case LITERAL_readonly:
                case LITERAL_attribute:
                    {
                        export();
                        astFactory.addASTChild(currentAST, returnAST);
                        break;
                    }
                case LITERAL_factory:
                    {
                        factory_dcl();
                        astFactory.addASTChild(currentAST, returnAST);
                        match(SEMI);
                        break;
                    }
                case LITERAL_finder:
                    {
                        finder_dcl();
                        astFactory.addASTChild(currentAST, returnAST);
                        match(SEMI);
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        home_export_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_70);
        } else {
            throw ex;
        }
    }
    returnAST = home_export_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