Search in sources :

Example 51 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method forward_dcl.

public final void forward_dcl() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST forward_dcl_AST = null;
    try {
        // for error handling
        {
            switch(LA(1)) {
                case LITERAL_abstract:
                    {
                        AST tmp33_AST = null;
                        tmp33_AST = astFactory.create(LT(1));
                        astFactory.addASTChild(currentAST, tmp33_AST);
                        match(LITERAL_abstract);
                        break;
                    }
                case LITERAL_local:
                    {
                        AST tmp34_AST = null;
                        tmp34_AST = astFactory.create(LT(1));
                        astFactory.addASTChild(currentAST, tmp34_AST);
                        match(LITERAL_local);
                        break;
                    }
                case LITERAL_interface:
                    {
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        AST tmp35_AST = null;
        tmp35_AST = astFactory.create(LT(1));
        astFactory.makeASTRoot(currentAST, tmp35_AST);
        match(LITERAL_interface);
        identifier();
        astFactory.addASTChild(currentAST, returnAST);
        forward_dcl_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_10);
        } else {
            throw ex;
        }
    }
    returnAST = forward_dcl_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 52 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method value_box_dcl.

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

Example 53 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method event_header.

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

Example 54 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method param_dcl_list.

public final void param_dcl_list() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST param_dcl_list_AST = null;
    try {
        // for error handling
        param_dcl();
        astFactory.addASTChild(currentAST, returnAST);
        {
            _loop193: do {
                if ((LA(1) == COMMA)) {
                    match(COMMA);
                    param_dcl();
                    astFactory.addASTChild(currentAST, returnAST);
                } else {
                    break _loop193;
                }
            } while (true);
        }
        param_dcl_list_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_27);
        } else {
            throw ex;
        }
    }
    returnAST = param_dcl_list_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) RecognitionException(antlr.RecognitionException)

Example 55 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method interf.

public final void interf() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST interf_AST = null;
    try {
        // for error handling
        {
            if (((LA(1) >= LITERAL_abstract && LA(1) <= LITERAL_interface)) && (LA(2) == LITERAL_interface || LA(2) == IDENT) && (LA(3) == LCURLY || LA(3) == COLON || LA(3) == IDENT) && (_tokenSet_11.member(LA(4)))) {
                interface_dcl();
                astFactory.addASTChild(currentAST, returnAST);
            } else if (((LA(1) >= LITERAL_abstract && LA(1) <= LITERAL_interface)) && (LA(2) == LITERAL_interface || LA(2) == IDENT) && (LA(3) == SEMI || LA(3) == IDENT) && (_tokenSet_12.member(LA(4)))) {
                forward_dcl();
                astFactory.addASTChild(currentAST, returnAST);
            } else {
                throw new NoViableAltException(LT(1), getFilename());
            }
        }
        interf_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_10);
        } else {
            throw ex;
        }
    }
    returnAST = interf_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