Package net.sf.jcontracts.antlr

Examples of net.sf.jcontracts.antlr.NoViableAltException


                                    case JavaTokenTypes.SEMI:
                                        match(JavaTokenTypes.SEMI);
                                        break;

                                    default:
                                        throw new NoViableAltException(LT(1));
                                }
                                if (guessing == 0)
                                {
                                    if (cc != null)
                                    {
                                        m.setCodeComment((CodeComment) ((ExtendedToken) cc).getData());
                                    }
                                    m.setModifiers(mods);
                                    if (pos != null)
                                    {
                                        m.setStartAndEndOfBody(pos[0].getEnd(), pos[1].getStart());
                                        m.setBodyIndentation(pos[2].getCharDistanceToLastNewline());
                                        if (pos[3] != null)
                                        {
                                            m.setStartAndEndOfLastStatement(pos[3].getStart(), pos[3].getEnd());
                                        }
                                    }
                                    m.setReturnType(ts);
                                    m.setParent(tmc);
                                    tmc.addElement(m);
                                }
                            }
                            else if (la_1 == JavaTokenTypes.IDENT && TOKEN_SET_23.member(la_2))
                            {
                                v = variableDeclarator();
                                if (guessing == 0)
                                {
                                    addAnnotation(v);
                                    if (cc != null)
                                    {
                                        v.setCodeComment((CodeComment) ((ExtendedToken) cc).getData());
                                    }
                                    v.setModifiers(mods);
                                    v.setType(ts);
                                    v.setParent(tmc);
                                    tmc.addElement(v);
                                    addAnnotation(v);
                                }
                                do
                                {
                                    if (la_1 != JavaTokenTypes.COMMA)
                                    {
                                        break;
                                    }
                                    match(JavaTokenTypes.COMMA);
                                    v = variableDeclarator();
                                    if (guessing == 0)
                                    {
                                        if (cc != null)
                                        {
                                            v.setCodeComment((CodeComment) ((ExtendedToken) cc).getData());
                                        }
                                        v.setModifiers(mods);
                                        v.setType(ts);
                                        v.setParent(tmc);
                                        tmc.addElement(v);
                                    }
                                }
                                while (true);
                                match(JavaTokenTypes.SEMI);
                            }
                            else
                            {
                                throw new NoViableAltException(LT(1));
                            }
                        }
                        else
                        {
                            throw new NoViableAltException(LT(1));
                        }
                        break;
                }
            }
            else
            {
                boolean synPredMatched74 = false;
                if (la_1 == JavaTokenTypes.LITERAL_static && la_2 == JavaTokenTypes.LCURLY)
                {
                    int _m74 = mark();
                    synPredMatched74 = true;
                    guessing++;
                    try
                    {
                        match(JavaTokenTypes.LITERAL_static);
                        match(JavaTokenTypes.LCURLY);
                    }
                    catch (ParserException _ex)
                    {
                        synPredMatched74 = false;
                    }
                    rewind(_m74);
                    guessing--;
                }
                if (synPredMatched74)
                {
                    match(JavaTokenTypes.LITERAL_static);
                    compoundStatement();
                }
                else if (la_1 == JavaTokenTypes.LCURLY)
                {
                    compoundStatement();
                }
                else
                {
                    throw new NoViableAltException(LT(1));
                }
            }
        }
        catch (ParserException ex)
        {
View Full Code Here


                    }
                    while (true);
                    break;

                default:
                    throw new NoViableAltException(LT(1));

                case JavaTokenTypes.LCURLY:
                    break;
            }
        }
View Full Code Here

                case JavaTokenTypes.LCURLY:
                    arrayInitializer();
                    break;

                default:
                    throw new NoViableAltException(LT(1));
            }
        }
        catch (ParserException ex)
        {
            if (guessing == 0)
View Full Code Here

                    }
                    while (true);
                    break;

                default:
                    throw new NoViableAltException(LT(1));

                case JavaTokenTypes.LCURLY:
                    break;
            }
        }
View Full Code Here

                        m = "const";
                    }
                    break;

                default:
                    throw new NoViableAltException(LT(1));
            }
        }
        catch (ParserException ex)
        {
            if (guessing == 0)
View Full Code Here

                    case JavaTokenTypes.MOD:
                        match(JavaTokenTypes.MOD);
                        break;

                    default:
                        throw new NoViableAltException(LT(1));
                }
            }

        }
        catch (ParserException ex)
View Full Code Here

                case JavaTokenTypes.LITERAL_double:
                    builtInType();
                    break;

                default:
                    throw new NoViableAltException(LT(1));
            }
            switch (la_1)
            {
                case JavaTokenTypes.LPAREN:
                    match(JavaTokenTypes.LPAREN);
                    switch (la_1)
                    {
                        default:
                            throw new NoViableAltException(LT(1));

                        case JavaTokenTypes.LITERAL_void:
                        case JavaTokenTypes.LITERAL_boolean:
                        case JavaTokenTypes.LITERAL_byte:
                        case JavaTokenTypes.LITERAL_char:
                        case JavaTokenTypes.LITERAL_short:
                        case JavaTokenTypes.LITERAL_int:
                        case JavaTokenTypes.LITERAL_float:
                        case JavaTokenTypes.LITERAL_long:
                        case JavaTokenTypes.LITERAL_double:
                        case JavaTokenTypes.IDENT:
                        case JavaTokenTypes.DOT:
                        case JavaTokenTypes.LPAREN:
                        case JavaTokenTypes.PLUS:
                        case JavaTokenTypes.MINUS:
                        case JavaTokenTypes.INC:
                        case JavaTokenTypes.DEC:
                        case JavaTokenTypes.BNOT:
                        case JavaTokenTypes.LNOT:
                        case JavaTokenTypes.LITERAL_this:
                        case JavaTokenTypes.LITERAL_super:
                        case JavaTokenTypes.LITERAL_true:
                        case JavaTokenTypes.LITERAL_false:
                        case JavaTokenTypes.LITERAL_null:
                        case JavaTokenTypes.LITERAL_new:
                        case JavaTokenTypes.NUM_INT:
                        case JavaTokenTypes.CHAR_LITERAL:
                        case JavaTokenTypes.STRING_LITERAL:
                        case JavaTokenTypes.NUM_FLOAT:
                            expressionList();
                            // fall through

                        case JavaTokenTypes.RPAREN: // '+'
                            match(JavaTokenTypes.RPAREN);
                            break;
                    }
                    if (la_1 == JavaTokenTypes.LCURLY)
                    {
                        cl = anonymousClassDefinition(outer_scope.getName() + ".", (ExtendedToken) t);
                        if (guessing == 0)
                        {
                            cl.setIsLocal();
                            outer_scope.addElement(cl);
                            cl.setParent(outer_scope);
                        }
                    }
                    break;

                case JavaTokenTypes.LBRACK:
                    int _cnt = 0;
                    do
                    {
                        if (la_1 == JavaTokenTypes.LBRACK && TOKEN_SET_56.member(la_2))
                        {
                            match(JavaTokenTypes.LBRACK);
                            if (TOKEN_SET_36.member(la_1))
                            {
                                expression();
                            }
                            match(JavaTokenTypes.RBRACK);
                        }
                        else
                        {
                            if (_cnt < 1)
                            {
                                throw new NoViableAltException(LT(1));
                            }
                            break;
                        }
                        _cnt++;
                    }
                    while (true);
                    if (la_1 == JavaTokenTypes.LCURLY)
                    {
                        arrayInitializer();
                    }
                    break;

                default:
                    throw new NoViableAltException(LT(1));
            }
        }
        catch (ParserException ex)
        {
            if (guessing == 0)
View Full Code Here

                            case JavaTokenTypes.LITERAL_class:
                                match(JavaTokenTypes.LITERAL_class);
                                break;

                            default:
                                throw new NoViableAltException(LT(1));
                        }
                        break;

                    case JavaTokenTypes.LBRACK:
                        match(JavaTokenTypes.LBRACK);
                        expression();
                        match(JavaTokenTypes.RBRACK);
                        break;

                    case JavaTokenTypes.LPAREN:
                        match(JavaTokenTypes.LPAREN);
                        if (TOKEN_SET_36.member(la_1))
                        {
                            expressionList();
                        }
                        match(JavaTokenTypes.RPAREN);
                        break;

                    default:
                        switch (la_1)
                        {
                            case JavaTokenTypes.INC:
                                match(JavaTokenTypes.INC);
                                break;

                            case JavaTokenTypes.DEC:
                                match(JavaTokenTypes.DEC);
                                break;

                            default:
                                if ((!TOKEN_SET_55.member(la_1) || !TOKEN_SET_17.member(la_2))
                                        && (!TOKEN_SET_55.member(la_1) || !TOKEN_SET_17.member(la_2)))
                                {
                                    throw new NoViableAltException(LT(1));
                                }
                                break;
                        }
                        break label0;
                }
View Full Code Here

                    expression();
                    match(JavaTokenTypes.RPAREN);
                    break;

                default:
                    throw new NoViableAltException(LT(1));
            }
        }
        catch (ParserException ex)
        {
            if (guessing == 0)
View Full Code Here

                    case JavaTokenTypes.GE:
                        match(JavaTokenTypes.GE);
                        break;

                    default:
                        throw new NoViableAltException(LT(1));
                }
                shiftExpression();
            }
        }
        catch (ParserException ex)
View Full Code Here

TOP

Related Classes of net.sf.jcontracts.antlr.NoViableAltException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.