javatreeparser.java

来自「drools 一个开放源码的规则引擎」· Java 代码 · 共 2,194 行 · 第 1/5 页

JAVA
2,194
字号

        AST initializer_AST_in = (AST) _t;

        try
        { // for error handling
            if ( _t == null ) _t = ASTNULL;
            switch ( _t.getType() )
            {
                case EXPR :
                {
                    expression( _t );
                    _t = _retTree;
                    break;
                }
                case ARRAY_INIT :
                {
                    arrayInitializer( _t );
                    _t = _retTree;
                    break;
                }
                default :
                {
                    throw new NoViableAltException( _t );
                }
            }
        }
        catch ( RecognitionException ex )
        {
            reportError( ex );
            if ( _t != null )
            {
                _t = _t.getNextSibling();
            }
        }
        _retTree = _t;
    }

    public final void expression(AST _t) throws RecognitionException
    {

        AST expression_AST_in = (AST) _t;

        try
        { // for error handling
            AST __t468 = _t;
            AST tmp69_AST_in = (AST) _t;
            match( _t,
                   EXPR );
            _t = _t.getFirstChild();
            expr( _t );
            _t = _retTree;
            _t = __t468;
            _t = _t.getNextSibling();
        }
        catch ( RecognitionException ex )
        {
            reportError( ex );
            if ( _t != null )
            {
                _t = _t.getNextSibling();
            }
        }
        _retTree = _t;
    }

    public final void arrayInitializer(AST _t) throws RecognitionException
    {

        AST arrayInitializer_AST_in = (AST) _t;

        try
        { // for error handling
            AST __t400 = _t;
            AST tmp70_AST_in = (AST) _t;
            match( _t,
                   ARRAY_INIT );
            _t = _t.getFirstChild();
            {
                _loop402 : do
                {
                    if ( _t == null ) _t = ASTNULL;
                    if ( (_t.getType() == EXPR || _t.getType() == ARRAY_INIT) )
                    {
                        initializer( _t );
                        _t = _retTree;
                    }
                    else
                    {
                        break _loop402;
                    }

                }
                while ( true );
            }
            _t = __t400;
            _t = _t.getNextSibling();
        }
        catch ( RecognitionException ex )
        {
            reportError( ex );
            if ( _t != null )
            {
                _t = _t.getNextSibling();
            }
        }
        _retTree = _t;
    }

    public final void throwsClause(AST _t) throws RecognitionException
    {

        AST throwsClause_AST_in = (AST) _t;

        try
        { // for error handling
            AST __t409 = _t;
            AST tmp71_AST_in = (AST) _t;
            match( _t,
                   LITERAL_throws );
            _t = _t.getFirstChild();
            {
                _loop411 : do
                {
                    if ( _t == null ) _t = ASTNULL;
                    if ( (_t.getType() == IDENT || _t.getType() == DOT) )
                    {
                        identifier( _t );
                        _t = _retTree;
                    }
                    else
                    {
                        break _loop411;
                    }

                }
                while ( true );
            }
            _t = __t409;
            _t = _t.getNextSibling();
        }
        catch ( RecognitionException ex )
        {
            reportError( ex );
            if ( _t != null )
            {
                _t = _t.getNextSibling();
            }
        }
        _retTree = _t;
    }

    public final void ctorCall(AST _t) throws RecognitionException
    {

        AST ctorCall_AST_in = (AST) _t;

        try
        { // for error handling
            if ( _t == null ) _t = ASTNULL;
            switch ( _t.getType() )
            {
                case CTOR_CALL :
                {
                    AST __t524 = _t;
                    AST tmp72_AST_in = (AST) _t;
                    match( _t,
                           CTOR_CALL );
                    _t = _t.getFirstChild();
                    elist( _t );
                    _t = _retTree;
                    _t = __t524;
                    _t = _t.getNextSibling();
                    break;
                }
                case SUPER_CTOR_CALL :
                {
                    AST __t525 = _t;
                    AST tmp73_AST_in = (AST) _t;
                    match( _t,
                           SUPER_CTOR_CALL );
                    _t = _t.getFirstChild();
                    {
                        if ( _t == null ) _t = ASTNULL;
                        switch ( _t.getType() )
                        {
                            case ELIST :
                            {
                                elist( _t );
                                _t = _retTree;
                                break;
                            }
                            case TYPE :
                            case TYPECAST :
                            case INDEX_OP :
                            case METHOD_CALL :
                            case IDENT :
                            case DOT :
                            case LITERAL_this :
                            case LITERAL_super :
                            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 :
                            {
                                primaryExpression( _t );
                                _t = _retTree;
                                elist( _t );
                                _t = _retTree;
                                break;
                            }
                            default :
                            {
                                throw new NoViableAltException( _t );
                            }
                        }
                    }
                    _t = __t525;
                    _t = _t.getNextSibling();
                    break;
                }
                default :
                {
                    throw new NoViableAltException( _t );
                }
            }
        }
        catch ( RecognitionException ex )
        {
            reportError( ex );
            if ( _t != null )
            {
                _t = _t.getNextSibling();
            }
        }
        _retTree = _t;
    }

    public final void stat(AST _t) throws RecognitionException
    {

        AST stat_AST_in = (AST) _t;

        try
        { // for error handling
            if ( _t == null ) _t = ASTNULL;
            switch ( _t.getType() )
            {
                case CLASS_DEF :
                case INTERFACE_DEF :
                {
                    typeDefinition( _t );
                    _t = _retTree;
                    break;
                }
                case VARIABLE_DEF :
                {
                    variableDef( _t );
                    _t = _retTree;
                    break;
                }
                case EXPR :
                {
                    expression( _t );
                    _t = _retTree;
                    break;
                }
                case LABELED_STAT :
                {
                    AST __t427 = _t;
                    AST tmp74_AST_in = (AST) _t;
                    match( _t,
                           LABELED_STAT );
                    _t = _t.getFirstChild();
                    AST tmp75_AST_in = (AST) _t;
                    match( _t,
                           IDENT );
                    _t = _t.getNextSibling();
                    stat( _t );
                    _t = _retTree;
                    _t = __t427;
                    _t = _t.getNextSibling();
                    break;
                }
                case LITERAL_if :
                {
                    AST __t428 = _t;
                    AST tmp76_AST_in = (AST) _t;
                    match( _t,
                           LITERAL_if );
                    _t = _t.getFirstChild();
                    expression( _t );
                    _t = _retTree;
                    stat( _t );
                    _t = _retTree;
                    {
                        if ( _t == null ) _t = ASTNULL;
                        switch ( _t.getType() )
                        {
                            case SLIST :
                            case VARIABLE_DEF :
                            case CLASS_DEF :
                            case INTERFACE_DEF :
                            case LABELED_STAT :
                            case EXPR :
                            case EMPTY_STAT :
                            case LITERAL_synchronized :
                            case LITERAL_if :
                            case LITERAL_for :
                            case LITERAL_while :
                            case LITERAL_do :
                            case LITERAL_break :
                            case LITERAL_continue :
                            case LITERAL_return :
                            case LITERAL_switch :
                            case LITERAL_throw :
                            case LITERAL_try :
                            {
                                stat( _t );
                                _t = _retTree;
                                break;
                            }
                            case 3 :
                            {
                                break;
                            }
                            default :
                            {
                                throw new NoViableAltException( _t );
                            }
                        }
                    }
                    _t = __t428;
                    _t = _t.getNextSibling();
                    break;
                }
                case LITERAL_for :
                {
                    AST __t430 = _t;
                    AST tmp77_AST_in = (AST) _t;
                    match( _t,
                           LITERAL_for );
                    _t = _t.getFirstChild();
                    AST __t431 = _t;
                    AST tmp78_AST_in = (AST) _t;
                    match( _t,
                           FOR_INIT );
                    _t = _t.getFirstChild();
                    {
                        if ( _t == null ) _t = ASTNULL;
                        switch ( _t.getType() )
                        {
                            case VARIABLE_DEF :
                            {
                                variableDef( _t );
                                _t = _retTree;
                                break;
                            }
                            case ELIST :
                            {
                                elist( _t );
                                _t = _retTree;
                                break;
                            }
                            case 3 :
                            {
                                break;
                            }
                            default :
                            {
                                throw new NoViableAltException( _t );
                            }
                        }
                    }
                    _t = __t431;
                    _t = _t.getNextSibling();
                    AST __t433 = _t;
                    AST tmp79_AST_in = (AST) _t;
                    match( _t,
                           FOR_CONDITION );
                    _t = _t.getFirstChild();
                    {
                        if ( _t == null ) _t = ASTNULL;
                        switch ( _t.getType() )
                        {
                            case EXPR :
                            {
                                expression( _t );
                                _t = _retTree;
                                break;
                            }
                            case 3 :
                            {
                                break;
                            }
                            default :
                            {
                                throw new NoViableAltException( _t );
                            }
                        }
                    }
                    _t = __t433;
                    _t = _t.getNextSibling();
                    AST __t435 = _t;
                    AST tmp80_AST_in = (AST) _t;
                    match( _t,
                           FOR_ITERATOR );
                    _t = _t.getFirstChild();
                    {
                        if ( _t == null ) _t = ASTNULL;
                        switch ( _t.getType() )
                        {
                            case ELIST :
                            {
                                elist( _t );
                                _t = _retTree;
                                break;
                            }
                            case 3 :
                            {
                                break;
                            }
                            default :
                            {
                                throw new NoViableAltException( _t );
                            }
                        }
                    }
                    _t = __t435;
                    _t = _t.getNextSibling();
                    stat( _t );
                    _t = _retTree;
            

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?