Search in sources :

Example 66 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method positive_int_const.

public final void positive_int_const() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST positive_int_const_AST = null;
    try {
        // for error handling
        const_exp();
        astFactory.addASTChild(currentAST, returnAST);
        positive_int_const_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_43);
        } else {
            throw ex;
        }
    }
    returnAST = positive_int_const_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) RecognitionException(antlr.RecognitionException)

Example 67 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method simple_declarator.

public final void simple_declarator() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST simple_declarator_AST = null;
    try {
        // for error handling
        identifier();
        astFactory.addASTChild(currentAST, returnAST);
        simple_declarator_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_32);
        } else {
            throw ex;
        }
    }
    returnAST = simple_declarator_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) RecognitionException(antlr.RecognitionException)

Example 68 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method shift_expr.

public final void shift_expr() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST shift_expr_AST = null;
    try {
        // for error handling
        add_expr();
        astFactory.addASTChild(currentAST, returnAST);
        {
            _loop97: do {
                if ((LA(1) == LSHIFT || LA(1) == RSHIFT)) {
                    {
                        switch(LA(1)) {
                            case LSHIFT:
                                {
                                    AST tmp95_AST = null;
                                    tmp95_AST = astFactory.create(LT(1));
                                    astFactory.makeASTRoot(currentAST, tmp95_AST);
                                    match(LSHIFT);
                                    break;
                                }
                            case RSHIFT:
                                {
                                    AST tmp96_AST = null;
                                    tmp96_AST = astFactory.create(LT(1));
                                    astFactory.makeASTRoot(currentAST, tmp96_AST);
                                    match(RSHIFT);
                                    break;
                                }
                            default:
                                {
                                    throw new NoViableAltException(LT(1), getFilename());
                                }
                        }
                    }
                    add_expr();
                    astFactory.addASTChild(currentAST, returnAST);
                } else {
                    break _loop97;
                }
            } while (true);
        }
        shift_expr_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_39);
        } else {
            throw ex;
        }
    }
    returnAST = shift_expr_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 69 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method param_type_spec.

public final void param_type_spec() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST param_type_spec_AST = null;
    try {
        // for error handling
        switch(LA(1)) {
            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_ValueBase:
                {
                    base_type_spec();
                    astFactory.addASTChild(currentAST, returnAST);
                    param_type_spec_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_string:
                {
                    string_type();
                    astFactory.addASTChild(currentAST, returnAST);
                    param_type_spec_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_wstring:
                {
                    wide_string_type();
                    astFactory.addASTChild(currentAST, returnAST);
                    param_type_spec_AST = (AST) currentAST.root;
                    break;
                }
            case SCOPEOP:
            case IDENT:
                {
                    scoped_name();
                    astFactory.addASTChild(currentAST, returnAST);
                    param_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_31);
        } else {
            throw ex;
        }
    }
    returnAST = param_type_spec_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 70 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method provides_dcl.

public final void provides_dcl() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST provides_dcl_AST = null;
    try {
        // for error handling
        AST tmp196_AST = null;
        tmp196_AST = astFactory.create(LT(1));
        astFactory.makeASTRoot(currentAST, tmp196_AST);
        match(LITERAL_provides);
        interface_type();
        astFactory.addASTChild(currentAST, returnAST);
        identifier();
        astFactory.addASTChild(currentAST, returnAST);
        provides_dcl_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_10);
        } else {
            throw ex;
        }
    }
    returnAST = provides_dcl_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) 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