Search in sources :

Example 21 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method value_value_inheritance_spec.

public final void value_value_inheritance_spec() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST value_value_inheritance_spec_AST = null;
    try {
        // for error handling
        AST tmp59_AST = null;
        tmp59_AST = astFactory.create(LT(1));
        astFactory.makeASTRoot(currentAST, tmp59_AST);
        match(COLON);
        {
            switch(LA(1)) {
                case LITERAL_truncatable:
                    {
                        AST tmp60_AST = null;
                        tmp60_AST = astFactory.create(LT(1));
                        astFactory.addASTChild(currentAST, tmp60_AST);
                        match(LITERAL_truncatable);
                        break;
                    }
                case SCOPEOP:
                case IDENT:
                    {
                        break;
                    }
                default:
                    {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
            }
        }
        value_name();
        astFactory.addASTChild(currentAST, returnAST);
        {
            _loop63: do {
                if ((LA(1) == COMMA)) {
                    match(COMMA);
                    value_name();
                    astFactory.addASTChild(currentAST, returnAST);
                } else {
                    break _loop63;
                }
            } while (true);
        }
        value_value_inheritance_spec_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_25);
        } else {
            throw ex;
        }
    }
    returnAST = value_value_inheritance_spec_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 22 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method char_type.

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

Example 23 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method wide_char_type.

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

Example 24 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method constr_type_spec.

public final void constr_type_spec() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST constr_type_spec_AST = null;
    try {
        // for error handling
        switch(LA(1)) {
            case LITERAL_struct:
                {
                    struct_type();
                    astFactory.addASTChild(currentAST, returnAST);
                    constr_type_spec_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_union:
                {
                    union_type();
                    astFactory.addASTChild(currentAST, returnAST);
                    constr_type_spec_AST = (AST) currentAST.root;
                    break;
                }
            case LITERAL_enum:
                {
                    enum_type();
                    astFactory.addASTChild(currentAST, returnAST);
                    constr_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 = constr_type_spec_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 25 with RecognitionException

use of antlr.RecognitionException in project cxf by apache.

the class IDLParser method imported_scope.

public final void imported_scope() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST imported_scope_AST = null;
    try {
        // for error handling
        switch(LA(1)) {
            case SCOPEOP:
            case IDENT:
                {
                    scoped_name();
                    astFactory.addASTChild(currentAST, returnAST);
                    imported_scope_AST = (AST) currentAST.root;
                    break;
                }
            case STRING_LITERAL:
                {
                    string_literal();
                    astFactory.addASTChild(currentAST, returnAST);
                    imported_scope_AST = (AST) currentAST.root;
                    break;
                }
            default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
        }
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_10);
        } else {
            throw ex;
        }
    }
    returnAST = imported_scope_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