Package antlr

Examples of antlr.NoViableAltException


                {
                    break;
                }
                default :
                {
                    throw new NoViableAltException( LT( 1 ),
                                                    getFilename() );
                }
            }
        }
        if ( inputState.guessing == 0 )
View Full Code Here


                                            {
                                                break;
                                            }
                                            default :
                                            {
                                                throw new NoViableAltException( LT( 1 ),
                                                                                getFilename() );
                                            }
                                        }
                                    }
                                    {
                                        switch ( LA( 1 ) )
                                        {
                                            case LCURLY :
                                            {
                                                compoundStatement();
                                                s2_AST = (AST) returnAST;
                                                break;
                                            }
                                            case SEMI :
                                            {
                                                AST tmp71_AST = null;
                                                tmp71_AST = astFactory.create( LT( 1 ) );
                                                match( SEMI );
                                                break;
                                            }
                                            default :
                                            {
                                                throw new NoViableAltException( LT( 1 ),
                                                                                getFilename() );
                                            }
                                        }
                                    }
                                    if ( inputState.guessing == 0 )
                                    {
                                        field_AST = (AST) currentAST.root;
                                        field_AST = (AST) astFactory.make( (new ASTArray( 7 )).add( astFactory.create( METHOD_DEF,
                                                                                                                       "METHOD_DEF" ) ).add( mods_AST ).add( (AST) astFactory.make( (new ASTArray( 2 )).add( astFactory.create( TYPE,
                                                                                                                                                                                                                                "TYPE" ) ).add( rt_AST ) ) ).add( tmp68_AST ).add( param_AST ).add( tc_AST ).add( s2_AST ) );
                                        currentAST.root = field_AST;
                                        currentAST.child = field_AST != null && field_AST.getFirstChild() != null ? field_AST.getFirstChild() : field_AST;
                                        currentAST.advanceChildToEnd();
                                    }
                                }
                                else if ( (LA( 1 ) == IDENT) && (_tokenSet_12.member( LA( 2 ) )) )
                                {
                                    variableDefinitions( mods_AST,
                                                         t_AST );
                                    v_AST = (AST) returnAST;
                                    AST tmp72_AST = null;
                                    tmp72_AST = astFactory.create( LT( 1 ) );
                                    match( SEMI );
                                    if ( inputState.guessing == 0 )
                                    {
                                        field_AST = (AST) currentAST.root;
                                        field_AST = v_AST;
                                        currentAST.root = field_AST;
                                        currentAST.child = field_AST != null && field_AST.getFirstChild() != null ? field_AST.getFirstChild() : field_AST;
                                        currentAST.advanceChildToEnd();
                                    }
                                }
                                else
                                {
                                    throw new NoViableAltException( LT( 1 ),
                                                                    getFilename() );
                                }

                            }
                        }
                        else
                        {
                            throw new NoViableAltException( LT( 1 ),
                                                            getFilename() );
                        }
                }
            }
        }
        else if ( (LA( 1 ) == LITERAL_static) && (LA( 2 ) == LCURLY) )
        {
            match( LITERAL_static );
            compoundStatement();
            s3_AST = (AST) returnAST;
            if ( inputState.guessing == 0 )
            {
                field_AST = (AST) currentAST.root;
                field_AST = (AST) astFactory.make( (new ASTArray( 2 )).add( astFactory.create( STATIC_INIT,
                                                                                               "STATIC_INIT" ) ).add( s3_AST ) );
                currentAST.root = field_AST;
                currentAST.child = field_AST != null && field_AST.getFirstChild() != null ? field_AST.getFirstChild() : field_AST;
                currentAST.advanceChildToEnd();
            }
        }
        else if ( (LA( 1 ) == LCURLY) )
        {
            compoundStatement();
            s4_AST = (AST) returnAST;
            if ( inputState.guessing == 0 )
            {
                field_AST = (AST) currentAST.root;
                field_AST = (AST) astFactory.make( (new ASTArray( 2 )).add( astFactory.create( INSTANCE_INIT,
                                                                                               "INSTANCE_INIT" ) ).add( s4_AST ) );
                currentAST.root = field_AST;
                currentAST.child = field_AST != null && field_AST.getFirstChild() != null ? field_AST.getFirstChild() : field_AST;
                currentAST.advanceChildToEnd();
            }
        }
        else
        {
            throw new NoViableAltException( LT( 1 ),
                                            getFilename() );
        }

        returnAST = field_AST;
    }
View Full Code Here

                {
                    break;
                }
                default :
                {
                    throw new NoViableAltException( LT( 1 ),
                                                    getFilename() );
                }
            }
        }
        ctorHead_AST = (AST) currentAST.root;
View Full Code Here

            else if ( (_tokenSet_15.member( LA( 1 ) )) && (_tokenSet_16.member( LA( 2 ) )) )
            {
            }
            else
            {
                throw new NoViableAltException( LT( 1 ),
                                                getFilename() );
            }

        }
        {
View Full Code Here

                    lp3_AST.setType( SUPER_CTOR_CALL );
                }
            }
            else
            {
                throw new NoViableAltException( LT( 1 ),
                                                getFilename() );
            }

        }
        explicitConstructorInvocation_AST = (AST) currentAST.root;
View Full Code Here

                    else if ( (_tokenSet_17.member( LA( 1 ) )) && (_tokenSet_18.member( LA( 2 ) )) )
                    {
                    }
                    else
                    {
                        throw new NoViableAltException( LT( 1 ),
                                                        getFilename() );
                    }

                }
                statement_AST = (AST) currentAST.root;
                break;
            }
            case LITERAL_for :
            {
                AST tmp95_AST = null;
                tmp95_AST = astFactory.create( LT( 1 ) );
                astFactory.makeASTRoot( currentAST,
                                        tmp95_AST );
                match( LITERAL_for );
                match( LPAREN );
                forInit();
                astFactory.addASTChild( currentAST,
                                        returnAST );
                match( SEMI );
                forCond();
                astFactory.addASTChild( currentAST,
                                        returnAST );
                match( SEMI );
                forIter();
                astFactory.addASTChild( currentAST,
                                        returnAST );
                match( RPAREN );
                statement();
                astFactory.addASTChild( currentAST,
                                        returnAST );
                statement_AST = (AST) currentAST.root;
                break;
            }
            case LITERAL_while :
            {
                AST tmp100_AST = null;
                tmp100_AST = astFactory.create( LT( 1 ) );
                astFactory.makeASTRoot( currentAST,
                                        tmp100_AST );
                match( LITERAL_while );
                match( LPAREN );
                expression();
                astFactory.addASTChild( currentAST,
                                        returnAST );
                match( RPAREN );
                statement();
                astFactory.addASTChild( currentAST,
                                        returnAST );
                statement_AST = (AST) currentAST.root;
                break;
            }
            case LITERAL_do :
            {
                AST tmp103_AST = null;
                tmp103_AST = astFactory.create( LT( 1 ) );
                astFactory.makeASTRoot( currentAST,
                                        tmp103_AST );
                match( LITERAL_do );
                statement();
                astFactory.addASTChild( currentAST,
                                        returnAST );
                match( LITERAL_while );
                match( LPAREN );
                expression();
                astFactory.addASTChild( currentAST,
                                        returnAST );
                match( RPAREN );
                match( SEMI );
                statement_AST = (AST) currentAST.root;
                break;
            }
            case LITERAL_break :
            {
                AST tmp108_AST = null;
                tmp108_AST = astFactory.create( LT( 1 ) );
                astFactory.makeASTRoot( currentAST,
                                        tmp108_AST );
                match( LITERAL_break );
                {
                    switch ( LA( 1 ) )
                    {
                        case IDENT :
                        {
                            AST tmp109_AST = null;
                            tmp109_AST = astFactory.create( LT( 1 ) );
                            astFactory.addASTChild( currentAST,
                                                    tmp109_AST );
                            match( IDENT );
                            break;
                        }
                        case SEMI :
                        {
                            break;
                        }
                        default :
                        {
                            throw new NoViableAltException( LT( 1 ),
                                                            getFilename() );
                        }
                    }
                }
                match( SEMI );
                statement_AST = (AST) currentAST.root;
                break;
            }
            case LITERAL_continue :
            {
                AST tmp111_AST = null;
                tmp111_AST = astFactory.create( LT( 1 ) );
                astFactory.makeASTRoot( currentAST,
                                        tmp111_AST );
                match( LITERAL_continue );
                {
                    switch ( LA( 1 ) )
                    {
                        case IDENT :
                        {
                            AST tmp112_AST = null;
                            tmp112_AST = astFactory.create( LT( 1 ) );
                            astFactory.addASTChild( currentAST,
                                                    tmp112_AST );
                            match( IDENT );
                            break;
                        }
                        case SEMI :
                        {
                            break;
                        }
                        default :
                        {
                            throw new NoViableAltException( LT( 1 ),
                                                            getFilename() );
                        }
                    }
                }
                match( SEMI );
                statement_AST = (AST) currentAST.root;
                break;
            }
            case LITERAL_return :
            {
                AST tmp114_AST = null;
                tmp114_AST = astFactory.create( LT( 1 ) );
                astFactory.makeASTRoot( currentAST,
                                        tmp114_AST );
                match( LITERAL_return );
                {
                    switch ( LA( 1 ) )
                    {
                        case IDENT :
                        case LPAREN :
                        case LITERAL_void :
                        case LITERAL_boolean :
                        case LITERAL_byte :
                        case LITERAL_char :
                        case LITERAL_short :
                        case LITERAL_int :
                        case LITERAL_float :
                        case LITERAL_long :
                        case LITERAL_double :
                        case LITERAL_this :
                        case LITERAL_super :
                        case PLUS :
                        case MINUS :
                        case INC :
                        case DEC :
                        case BNOT :
                        case LNOT :
                        case LITERAL_true :
                        case LITERAL_false :
                        case LITERAL_null :
                        case LITERAL_new :
                        case NUM_INT :
                        case CHAR_LITERAL :
                        case STRING_LITERAL :
                        case NUM_FLOAT :
                        case NUM_LONG :
                        case NUM_DOUBLE :
                        {
                            expression();
                            astFactory.addASTChild( currentAST,
                                                    returnAST );
                            break;
                        }
                        case SEMI :
                        {
                            break;
                        }
                        default :
                        {
                            throw new NoViableAltException( LT( 1 ),
                                                            getFilename() );
                        }
                    }
                }
                match( SEMI );
                statement_AST = (AST) currentAST.root;
                break;
            }
            case LITERAL_switch :
            {
                AST tmp116_AST = null;
                tmp116_AST = astFactory.create( LT( 1 ) );
                astFactory.makeASTRoot( currentAST,
                                        tmp116_AST );
                match( LITERAL_switch );
                match( LPAREN );
                expression();
                astFactory.addASTChild( currentAST,
                                        returnAST );
                match( RPAREN );
                match( LCURLY );
                {
                    _loop115 : do
                    {
                        if ( (LA( 1 ) == LITERAL_case || LA( 1 ) == LITERAL_default) )
                        {
                            casesGroup();
                            astFactory.addASTChild( currentAST,
                                                    returnAST );
                        }
                        else
                        {
                            break _loop115;
                        }

                    }
                    while ( true );
                }
                match( RCURLY );
                statement_AST = (AST) currentAST.root;
                break;
            }
            case LITERAL_try :
            {
                tryBlock();
                astFactory.addASTChild( currentAST,
                                        returnAST );
                statement_AST = (AST) currentAST.root;
                break;
            }
            case LITERAL_throw :
            {
                AST tmp121_AST = null;
                tmp121_AST = astFactory.create( LT( 1 ) );
                astFactory.makeASTRoot( currentAST,
                                        tmp121_AST );
                match( LITERAL_throw );
                expression();
                astFactory.addASTChild( currentAST,
                                        returnAST );
                match( SEMI );
                statement_AST = (AST) currentAST.root;
                break;
            }
            case SEMI :
            {
                s = LT( 1 );
                s_AST = astFactory.create( s );
                astFactory.addASTChild( currentAST,
                                        s_AST );
                match( SEMI );
                if ( inputState.guessing == 0 )
                {
                    s_AST.setType( EMPTY_STAT );
                }
                statement_AST = (AST) currentAST.root;
                break;
            }
            default :
                boolean synPredMatched109 = false;
                if ( ((_tokenSet_19.member( LA( 1 ) )) && (_tokenSet_20.member( LA( 2 ) ))) )
                {
                    int _m109 = mark();
                    synPredMatched109 = true;
                    inputState.guessing++;
                    try
                    {
                        {
                            declaration();
                        }
                    }
                    catch ( RecognitionException pe )
                    {
                        synPredMatched109 = false;
                    }
                    rewind( _m109 );
                    inputState.guessing--;
                }
                if ( synPredMatched109 )
                {
                    declaration();
                    astFactory.addASTChild( currentAST,
                                            returnAST );
                    match( SEMI );
                    statement_AST = (AST) currentAST.root;
                }
                else if ( (_tokenSet_4.member( LA( 1 ) )) && (_tokenSet_21.member( LA( 2 ) )) )
                {
                    expression();
                    astFactory.addASTChild( currentAST,
                                            returnAST );
                    match( SEMI );
                    statement_AST = (AST) currentAST.root;
                }
                else if ( (_tokenSet_22.member( LA( 1 ) )) && (_tokenSet_23.member( LA( 2 ) )) )
                {
                    modifiers();
                    m_AST = (AST) returnAST;
                    classDefinition( m_AST );
                    astFactory.addASTChild( currentAST,
                                            returnAST );
                    statement_AST = (AST) currentAST.root;
                }
                else if ( (LA( 1 ) == IDENT) && (LA( 2 ) == COLON) )
                {
                    AST tmp125_AST = null;
                    tmp125_AST = astFactory.create( LT( 1 ) );
                    astFactory.addASTChild( currentAST,
                                            tmp125_AST );
                    match( IDENT );
                    c = LT( 1 );
                    c_AST = astFactory.create( c );
                    astFactory.makeASTRoot( currentAST,
                                            c_AST );
                    match( COLON );
                    if ( inputState.guessing == 0 )
                    {
                        c_AST.setType( LABELED_STAT );
                    }
                    statement();
                    astFactory.addASTChild( currentAST,
                                            returnAST );
                    statement_AST = (AST) currentAST.root;
                }
                else if ( (LA( 1 ) == LITERAL_synchronized) && (LA( 2 ) == LPAREN) )
                {
                    AST tmp126_AST = null;
                    tmp126_AST = astFactory.create( LT( 1 ) );
                    astFactory.makeASTRoot( currentAST,
                                            tmp126_AST );
                    match( LITERAL_synchronized );
                    match( LPAREN );
                    expression();
                    astFactory.addASTChild( currentAST,
                                            returnAST );
                    match( RPAREN );
                    compoundStatement();
                    astFactory.addASTChild( currentAST,
                                            returnAST );
                    statement_AST = (AST) currentAST.root;
                }
                else
                {
                    throw new NoViableAltException( LT( 1 ),
                                                    getFilename() );
                }
        }
        returnAST = statement_AST;
    }
View Full Code Here

                    }
                    break;
                }
                default :
                {
                    throw new NoViableAltException( LT( 1 ),
                                                    getFilename() );
                }
            }
        }
        argList_AST = (AST) currentAST.root;
View Full Code Here

                primaryExpression_AST = (AST) currentAST.root;
                break;
            }
            default :
            {
                throw new NoViableAltException( LT( 1 ),
                                                getFilename() );
            }
        }
        returnAST = primaryExpression_AST;
    }
View Full Code Here

                {
                    break;
                }
                default :
                {
                    throw new NoViableAltException( LT( 1 ),
                                                    getFilename() );
                }
            }
        }
        varInitializer_AST = (AST) currentAST.root;
View Full Code Here

                initializer_AST = (AST) currentAST.root;
                break;
            }
            default :
            {
                throw new NoViableAltException( LT( 1 ),
                                                getFilename() );
            }
        }
        returnAST = initializer_AST;
    }
View Full Code Here

TOP

Related Classes of 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.