Search in sources :

Example 61 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method signed_longlong_int.

public final void signed_longlong_int() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST signed_longlong_int_AST = null;
    try {
        // for error handling
        AST tmp144_AST = null;
        tmp144_AST = astFactory.create(LT(1));
        astFactory.addASTChild(currentAST, tmp144_AST);
        match(LITERAL_long);
        AST tmp145_AST = null;
        tmp145_AST = astFactory.create(LT(1));
        astFactory.addASTChild(currentAST, tmp145_AST);
        match(LITERAL_long);
        signed_longlong_int_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_35);
        } else {
            throw ex;
        }
    }
    returnAST = signed_longlong_int_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) RecognitionException(antlr.RecognitionException)

Example 62 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method event.

public final void event() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST event_AST = null;
    try {
        // for error handling
        {
            switch(LA(1)) {
                case LITERAL_abstract:
                    {
                        event_abs();
                        astFactory.addASTChild(currentAST, returnAST);
                        break;
                    }
                case LITERAL_custom:
                    {
                        event_custom();
                        astFactory.addASTChild(currentAST, returnAST);
                        break;
                    }
                case LITERAL_eventtype:
                    {
                        event_dcl();
                        astFactory.addASTChild(currentAST, returnAST);
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        event_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_10);
        } else {
            throw ex;
        }
    }
    returnAST = event_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 63 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method sequence_type.

public final void sequence_type() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST sequence_type_AST = null;
    try {
        // for error handling
        AST tmp134_AST = null;
        tmp134_AST = astFactory.create(LT(1));
        astFactory.makeASTRoot(currentAST, tmp134_AST);
        match(LITERAL_sequence);
        match(LT);
        simple_type_spec();
        astFactory.addASTChild(currentAST, returnAST);
        opt_pos_int();
        astFactory.addASTChild(currentAST, returnAST);
        match(GT);
        sequence_type_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_36);
        } else {
            throw ex;
        }
    }
    returnAST = sequence_type_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) RecognitionException(antlr.RecognitionException)

Example 64 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method value_forward_dcl.

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

Example 65 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method fixed_pt_literal.

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