Search in sources :

Example 11 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method value_header.

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

Example 12 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method type_spec.

public final void type_spec() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST type_spec_AST = null;
    try {
        // for error handling
        switch(LA(1)) {
            case SCOPEOP:
            case IDENT:
            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_sequence:
            case LITERAL_string:
            case LITERAL_wstring:
            case LITERAL_fixed:
            case LITERAL_ValueBase:
                {
                    simple_type_spec();
                    astFactory.addASTChild(currentAST, returnAST);
                    type_spec_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_struct:
            case LITERAL_union:
            case LITERAL_enum:
                {
                    constr_type_spec();
                    astFactory.addASTChild(currentAST, returnAST);
                    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_23);
        } else {
            throw ex;
        }
    }
    returnAST = type_spec_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 13 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method type_id_dcl.

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

Example 14 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method switch_body.

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

Example 15 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method op_attribute.

public final void op_attribute() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST op_attribute_AST = null;
    try {
        // for error handling
        AST tmp166_AST = null;
        tmp166_AST = astFactory.create(LT(1));
        astFactory.addASTChild(currentAST, tmp166_AST);
        match(LITERAL_oneway);
        op_attribute_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_56);
        } else {
            throw ex;
        }
    }
    returnAST = op_attribute_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