Search in sources :

Example 26 with NoViableAltException

use of antlr.NoViableAltException in project ili2db by claeis.

the class SqlSyntax method predicate.

public final void predicate() throws RecognitionException, TokenStreamException {
    if ((LA(1) == NAME)) {
        {
            columnname();
            match(LITERAL_IS);
            {
                if ((LA(1) == LITERAL_NOT)) {
                    match(LITERAL_NOT);
                } else if ((LA(1) == LITERAL_NULL)) {
                } else {
                    throw new NoViableAltException(LT(1), getFilename());
                }
            }
            match(LITERAL_NULL);
        }
    } else if ((_tokenSet_1.member(LA(1)))) {
        {
            expression();
            {
                if ((LA(1) == LITERAL_NOT)) {
                    match(LITERAL_NOT);
                } else if ((LA(1) == LITERAL_LIKE)) {
                } else {
                    throw new NoViableAltException(LT(1), getFilename());
                }
            }
            match(LITERAL_LIKE);
            pattern();
            {
                if ((LA(1) == LITERAL_ESCAPE)) {
                    match(LITERAL_ESCAPE);
                    escape_character();
                } else if ((_tokenSet_3.member(LA(1)))) {
                } else {
                    throw new NoViableAltException(LT(1), getFilename());
                }
            }
        }
    } else if ((_tokenSet_1.member(LA(1)))) {
        {
            expression();
            {
                if ((LA(1) == LITERAL_NOT)) {
                    match(LITERAL_NOT);
                } else if ((LA(1) == LITERAL_IN)) {
                } else {
                    throw new NoViableAltException(LT(1), getFilename());
                }
            }
            match(LITERAL_IN);
            match(LPAREN);
            value();
            {
                _loop67: do {
                    if ((LA(1) == COMMA)) {
                        match(COMMA);
                        value();
                    } else {
                        break _loop67;
                    }
                } while (true);
            }
            match(RPAREN);
        }
    } else if ((_tokenSet_1.member(LA(1)))) {
        {
            expression();
            {
                if ((LA(1) == LITERAL_NOT)) {
                    match(LITERAL_NOT);
                } else if ((LA(1) == LITERAL_IN)) {
                } else {
                    throw new NoViableAltException(LT(1), getFilename());
                }
            }
            match(LITERAL_IN);
            match(LPAREN);
            sub_query();
            match(RPAREN);
        }
    } else if ((_tokenSet_1.member(LA(1)))) {
        {
            expression();
            comparison_operator();
            expression();
        }
    } else if ((_tokenSet_1.member(LA(1)))) {
        {
            expression();
            {
                if ((LA(1) == LITERAL_NOT)) {
                    match(LITERAL_NOT);
                } else if ((LA(1) == LITERAL_BETWEEN)) {
                } else {
                    throw new NoViableAltException(LT(1), getFilename());
                }
            }
            match(LITERAL_BETWEEN);
            expression();
            match(LITERAL_AND);
            expression();
        }
    } else if ((LA(1) == LITERAL_EXISTS)) {
        {
            match(LITERAL_EXISTS);
            match(LPAREN);
            sub_query();
            match(RPAREN);
        }
    } else {
        throw new NoViableAltException(LT(1), getFilename());
    }
}
Also used : NoViableAltException(antlr.NoViableAltException)

Example 27 with NoViableAltException

use of antlr.NoViableAltException in project ili2db by claeis.

the class SqlSyntax method column_definition.

public final void column_definition() throws RecognitionException, TokenStreamException {
    columnname();
    data_type();
    {
        if ((LA(1) == LITERAL_DEFAULT)) {
            match(LITERAL_DEFAULT);
            default_value();
        } else if ((LA(1) == EOF || LA(1) == LITERAL_NULL || LA(1) == LITERAL_NOT)) {
        } else {
            throw new NoViableAltException(LT(1), getFilename());
        }
    }
    {
        if ((LA(1) == LITERAL_NULL || LA(1) == LITERAL_NOT)) {
            {
                if ((LA(1) == LITERAL_NOT)) {
                    match(LITERAL_NOT);
                } else if ((LA(1) == LITERAL_NULL)) {
                } else {
                    throw new NoViableAltException(LT(1), getFilename());
                }
            }
            match(LITERAL_NULL);
        } else if ((LA(1) == EOF)) {
        } else {
            throw new NoViableAltException(LT(1), getFilename());
        }
    }
}
Also used : NoViableAltException(antlr.NoViableAltException)

Example 28 with NoViableAltException

use of antlr.NoViableAltException in project ili2db by claeis.

the class SqlSyntax method character_string_type.

public final void character_string_type() throws RecognitionException, TokenStreamException {
    if ((LA(1) == LITERAL_CHAR)) {
        {
            match(LITERAL_CHAR);
            match(LPAREN);
            length();
            match(RPAREN);
        }
    } else if ((LA(1) == LITERAL_VARCHAR)) {
        {
            match(LITERAL_VARCHAR);
            match(LPAREN);
            length();
            match(RPAREN);
        }
    } else {
        throw new NoViableAltException(LT(1), getFilename());
    }
}
Also used : NoViableAltException(antlr.NoViableAltException)

Example 29 with NoViableAltException

use of antlr.NoViableAltException in project cxf by apache.

the class IDLParser method member_list.

public final void member_list() throws RecognitionException, TokenStreamException {
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST member_list_AST = null;
    try {
        // for error handling
        {
            int _cnt150 = 0;
            _loop150: do {
                if ((_tokenSet_13.member(LA(1)))) {
                    member();
                    astFactory.addASTChild(currentAST, returnAST);
                } else {
                    if (_cnt150 >= 1) {
                        break _loop150;
                    } else {
                        throw new NoViableAltException(LT(1), getFilename());
                    }
                }
                _cnt150++;
            } while (true);
        }
        member_list_AST = (AST) currentAST.root;
    } catch (RecognitionException ex) {
        if (inputState.guessing == 0) {
            reportError(ex);
            consume();
            consumeUntil(_tokenSet_15);
        } else {
            throw ex;
        }
    }
    returnAST = member_list_AST;
}
Also used : ASTPair(antlr.ASTPair) AST(antlr.collections.AST) NoViableAltException(antlr.NoViableAltException) RecognitionException(antlr.RecognitionException)

Example 30 with NoViableAltException

use of antlr.NoViableAltException 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)

Aggregations

NoViableAltException (antlr.NoViableAltException)132 RecognitionException (antlr.RecognitionException)114 ASTPair (antlr.ASTPair)68 AST (antlr.collections.AST)68 Token (antlr.Token)33 MismatchedCharException (antlr.MismatchedCharException)2 MismatchedTokenException (antlr.MismatchedTokenException)2 NoViableAltForCharException (antlr.NoViableAltForCharException)2 Message (org.codehaus.groovy.control.messages.Message)2 SimpleMessage (org.codehaus.groovy.control.messages.SimpleMessage)2 SyntaxErrorMessage (org.codehaus.groovy.control.messages.SyntaxErrorMessage)2