Search in sources :

Example 71 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method param_dcl.

public final void param_dcl() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST param_dcl_AST = null;
    try {
        // for error handling
        {
            switch(LA(1)) {
                case LITERAL_in:
                    {
                        AST tmp174_AST = null;
                        tmp174_AST = astFactory.create(LT(1));
                        astFactory.makeASTRoot(currentAST, tmp174_AST);
                        match(LITERAL_in);
                        break;
                    }
                case LITERAL_out:
                    {
                        AST tmp175_AST = null;
                        tmp175_AST = astFactory.create(LT(1));
                        astFactory.makeASTRoot(currentAST, tmp175_AST);
                        match(LITERAL_out);
                        break;
                    }
                case LITERAL_inout:
                    {
                        AST tmp176_AST = null;
                        tmp176_AST = astFactory.create(LT(1));
                        astFactory.makeASTRoot(currentAST, tmp176_AST);
                        match(LITERAL_inout);
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        param_type_spec();
        astFactory.addASTChild(currentAST, returnAST);
        simple_declarator();
        astFactory.addASTChild(currentAST, returnAST);
        param_dcl_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_29);
        } else {
            throw ex;
        }
    }
    returnAST = param_dcl_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 72 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method type_prefix_dcl.

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

Example 73 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method consumes_dcl.

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

Example 74 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method emits_dcl.

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

Example 75 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method string_literal.

public final void string_literal() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST string_literal_AST = null;
    try {
        // for error handling
        {
            int _cnt285 = 0;
            _loop285: do {
                if ((LA(1) == STRING_LITERAL)) {
                    AST tmp110_AST = null;
                    tmp110_AST = astFactory.create(LT(1));
                    astFactory.addASTChild(currentAST, tmp110_AST);
                    match(STRING_LITERAL);
                } else {
                    if (_cnt285 >= 1) {
                        break _loop285;
                    } else {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
                }
                _cnt285++;
            } while (true);
        }
        string_literal_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_42);
        } else {
            throw ex;
        }
    }
    returnAST = string_literal_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