Search in sources :

Example 26 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method or_expr.

public final void or_expr() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST or_expr_AST = null;
    try {
        // for error handling
        xor_expr();
        astFactory.addASTChild(currentAST, returnAST);
        {
            _loop87: do {
                if ((LA(1) == OR)) {
                    AST tmp92_AST = null;
                    tmp92_AST = astFactory.create(LT(1));
                    astFactory.makeASTRoot(currentAST, tmp92_AST);
                    match(OR);
                    xor_expr();
                    astFactory.addASTChild(currentAST, returnAST);
                } else {
                    break _loop87;
                }
            } while (true);
        }
        or_expr_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_34);
        } else {
            throw ex;
        }
    }
    returnAST = or_expr_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) RecognitionException(antlr.RecognitionException)

Example 27 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method event_dcl.

public final void event_dcl() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST event_dcl_AST = null;
    try {
        // for error handling
        event_header();
        astFactory.addASTChild(currentAST, returnAST);
        {
            switch(LA(1)) {
                case LCURLY:
                case COLON:
                case LITERAL_supports:
                    {
                        event_elem_dcl();
                        astFactory.addASTChild(currentAST, returnAST);
                        break;
                    }
                case SEMI:
                    {
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        event_dcl_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_10);
        } else {
            throw ex;
        }
    }
    returnAST = event_dcl_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 28 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method interface_inheritance_spec.

public final void interface_inheritance_spec() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST interface_inheritance_spec_AST = null;
    try {
        // for error handling
        AST tmp36_AST = null;
        tmp36_AST = astFactory.create(LT(1));
        astFactory.makeASTRoot(currentAST, tmp36_AST);
        match(COLON);
        scoped_name_list();
        astFactory.addASTChild(currentAST, returnAST);
        interface_inheritance_spec_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_16);
        } else {
            throw ex;
        }
    }
    returnAST = interface_inheritance_spec_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) RecognitionException(antlr.RecognitionException)

Example 29 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method member_list.

public final void member_list() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST member_list_AST = null;
    try {
        // for error handling
        {
            int _cnt150 = 0;
            _loop150: do {
                if ((_tokenSet_13.member(LA(1)))) {
                    member();
                    astFactory.addASTChild(currentAST, returnAST);
                } else {
                    if (_cnt150 >= 1) {
                        break _loop150;
                    } else {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
                }
                _cnt150++;
            } while (true);
        }
        member_list_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_15);
        } else {
            throw ex;
        }
    }
    returnAST = member_list_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 30 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method component_body.

public final void component_body() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST component_body_AST = null;
    try {
        // for error handling
        {
            _loop241: do {
                if ((_tokenSet_66.member(LA(1)))) {
                    component_export();
                    astFactory.addASTChild(currentAST, returnAST);
                } else {
                    break _loop241;
                }
            } while (true);
        }
        component_body_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_15);
        } else {
            throw ex;
        }
    }
    returnAST = component_body_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