Search in sources :

Example 46 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method except_dcl.

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

Example 47 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method home_body.

public final void home_body() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST home_body_AST = null;
    try {
        // for error handling
        match(LCURLY);
        {
            _loop261: do {
                if ((_tokenSet_68.member(LA(1)))) {
                    home_export();
                    astFactory.addASTChild(currentAST, returnAST);
                } else {
                    break _loop261;
                }
            } while (true);
        }
        match(RCURLY);
        home_body_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_10);
        } else {
            throw ex;
        }
    }
    returnAST = home_body_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) RecognitionException(antlr.RecognitionException)

Example 48 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method home_dcl.

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

Example 49 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method interface_name.

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

Example 50 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method unsigned_int.

public final void unsigned_int() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST unsigned_int_AST = null;
    try {
        // for error handling
        if ((LA(1) == LITERAL_unsigned) && (LA(2) == LITERAL_short)) {
            unsigned_short_int();
            astFactory.addASTChild(currentAST, returnAST);
            unsigned_int_AST = (AST) currentAST.root;
        } else if ((LA(1) == LITERAL_unsigned) && (LA(2) == LITERAL_long) && (_tokenSet_35.member(LA(3)))) {
            unsigned_long_int();
            astFactory.addASTChild(currentAST, returnAST);
            unsigned_int_AST = (AST) currentAST.root;
        } else if ((LA(1) == LITERAL_unsigned) && (LA(2) == LITERAL_long) && (LA(3) == LITERAL_long)) {
            unsigned_longlong_int();
            astFactory.addASTChild(currentAST, returnAST);
            unsigned_int_AST = (AST) currentAST.root;
        } else {
            throw new NoViableAltException(LT(1), getFilename());
        }
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_35);
        } else {
            throw ex;
        }
    }
    returnAST = unsigned_int_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