Search in sources :

Example 31 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method floating_pt_literal.

public final void floating_pt_literal() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST floating_pt_literal_AST = null;
    Token f = null;
    AST f_AST = null;
    try {
        // for error handling
        f = LT(1);
        f_AST = astFactory.create(f);
        astFactory.addASTChild(currentAST, f_AST);
        match(FLOAT);
        floating_pt_literal_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_42);
        } else {
            throw ex;
        }
    }
    returnAST = floating_pt_literal_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) Token(antlr.Token) RecognitionException(antlr.RecognitionException)

Example 32 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method simple_type_spec.

public final void simple_type_spec() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST simple_type_spec_AST = null;
    try {
        // for error handling
        switch(LA(1)) {
            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_ValueBase:
                {
                    base_type_spec();
                    astFactory.addASTChild(currentAST, returnAST);
                    simple_type_spec_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_sequence:
            case LITERAL_string:
            case LITERAL_wstring:
            case LITERAL_fixed:
                {
                    template_type_spec();
                    astFactory.addASTChild(currentAST, returnAST);
                    simple_type_spec_AST = (AST) currentAST.root;
                    break;
                }
            case SCOPEOP:
            case IDENT:
                {
                    scoped_name();
                    astFactory.addASTChild(currentAST, returnAST);
                    simple_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_36);
        } else {
            throw ex;
        }
    }
    returnAST = simple_type_spec_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 33 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method event_abs.

public final void event_abs() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST event_abs_AST = null;
    try {
        // for error handling
        AST tmp217_AST = null;
        tmp217_AST = astFactory.create(LT(1));
        astFactory.makeASTRoot(currentAST, tmp217_AST);
        match(LITERAL_abstract);
        event_header();
        astFactory.addASTChild(currentAST, returnAST);
        {
            switch(LA(1)) {
                case LCURLY:
                case COLON:
                case LITERAL_supports:
                    {
                        event_abs_dcl();
                        astFactory.addASTChild(currentAST, returnAST);
                        break;
                    }
                case SEMI:
                    {
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        event_abs_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_10);
        } else {
            throw ex;
        }
    }
    returnAST = event_abs_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 34 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method boolean_type.

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

Example 35 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method boolean_literal.

public final void boolean_literal() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST boolean_literal_AST = null;
    try {
        // for error handling
        switch(LA(1)) {
            case LITERAL_TRUE:
                {
                    AST tmp115_AST = null;
                    tmp115_AST = astFactory.create(LT(1));
                    astFactory.addASTChild(currentAST, tmp115_AST);
                    match(LITERAL_TRUE);
                    boolean_literal_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_FALSE:
                {
                    AST tmp116_AST = null;
                    tmp116_AST = astFactory.create(LT(1));
                    astFactory.addASTChild(currentAST, tmp116_AST);
                    match(LITERAL_FALSE);
                    boolean_literal_AST = (AST) currentAST.root;
                    break;
                }
            default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
        }
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_42);
        } else {
            throw ex;
        }
    }
    returnAST = boolean_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