Source code

    001/*
    002 * Licensed to the Apache Software Foundation (ASF) under one or more
    003 * contributor license agreements.  See the NOTICE file distributed with
    004 * this work for additional information regarding copyright ownership.
    005 * The ASF licenses this file to You under the Apache License, Version 2.0
    006 * (the "License"); you may not use this file except in compliance with
    007 * the License.  You may obtain a copy of the License at
    008 *
    009 *      http://www.apache.org/licenses/LICENSE-2.0
    010 *
    011 *  Unless required by applicable law or agreed to in writing, software
    012 *  distributed under the License is distributed on an "AS IS" BASIS,
    013 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    014 *  See the License for the specific language governing permissions and
    015 *  limitations under the License.
    016 *
    017 */
    018package org.apache.bcel.generic;
    019
    020/**
    021 * Interface implementing the Visitor pattern programming style.
    022 * I.e., a class that implements this interface can handle all types of
    023 * instructions with the properly typed methods just by calling the accept()
    024 * method.
    025 *
    026 */
    027public interface Visitor {
    028
    029    void visitStackInstruction( StackInstruction obj );
    030
    031
    032    void visitLocalVariableInstruction( LocalVariableInstruction obj );
    033
    034
    035    void visitBranchInstruction( BranchInstruction obj );
    036
    037
    038    void visitLoadClass( LoadClass obj );
    039
    040
    041    void visitFieldInstruction( FieldInstruction obj );
    042
    043
    044    void visitIfInstruction( IfInstruction obj );
    045
    046
    047    void visitConversionInstruction( ConversionInstruction obj );
    048
    049
    050    void visitPopInstruction( PopInstruction obj );
    051
    052
    053    void visitStoreInstruction( StoreInstruction obj );
    054
    055
    056    void visitTypedInstruction( TypedInstruction obj );
    057
    058
    059    void visitSelect( Select obj );
    060
    061
    062    void visitJsrInstruction( JsrInstruction obj );
    063
    064
    065    void visitGotoInstruction( GotoInstruction obj );
    066
    067
    068    void visitUnconditionalBranch( UnconditionalBranch obj );
    069
    070
    071    void visitPushInstruction( PushInstruction obj );
    072
    073
    074    void visitArithmeticInstruction( ArithmeticInstruction obj );
    075
    076
    077    void visitCPInstruction( CPInstruction obj );
    078
    079
    080    void visitInvokeInstruction( InvokeInstruction obj );
    081
    082
    083    void visitArrayInstruction( ArrayInstruction obj );
    084
    085
    086    void visitAllocationInstruction( AllocationInstruction obj );
    087
    088
    089    void visitReturnInstruction( ReturnInstruction obj );
    090
    091
    092    void visitFieldOrMethod( FieldOrMethod obj );
    093
    094
    095    void visitConstantPushInstruction( ConstantPushInstruction obj );
    096
    097
    098    void visitExceptionThrower( ExceptionThrower obj );
    099
    100
    101    void visitLoadInstruction( LoadInstruction obj );
    102
    103
    104    void visitVariableLengthInstruction( VariableLengthInstruction obj );
    105
    106
    107    void visitStackProducer( StackProducer obj );
    108
    109
    110    void visitStackConsumer( StackConsumer obj );
    111
    112
    113    void visitACONST_NULL( ACONST_NULL obj );
    114
    115
    116    void visitGETSTATIC( GETSTATIC obj );
    117
    118
    119    void visitIF_ICMPLT( IF_ICMPLT obj );
    120
    121
    122    void visitMONITOREXIT( MONITOREXIT obj );
    123
    124
    125    void visitIFLT( IFLT obj );
    126
    127
    128    void visitLSTORE( LSTORE obj );
    129
    130
    131    void visitPOP2( POP2 obj );
    132
    133
    134    void visitBASTORE( BASTORE obj );
    135
    136
    137    void visitISTORE( ISTORE obj );
    138
    139
    140    void visitCHECKCAST( CHECKCAST obj );
    141
    142
    143    void visitFCMPG( FCMPG obj );
    144
    145
    146    void visitI2F( I2F obj );
    147
    148
    149    void visitATHROW( ATHROW obj );
    150
    151
    152    void visitDCMPL( DCMPL obj );
    153
    154
    155    void visitARRAYLENGTH( ARRAYLENGTH obj );
    156
    157
    158    void visitDUP( DUP obj );
    159
    160
    161    void visitINVOKESTATIC( INVOKESTATIC obj );
    162
    163
    164    void visitLCONST( LCONST obj );
    165
    166
    167    void visitDREM( DREM obj );
    168
    169
    170    void visitIFGE( IFGE obj );
    171
    172
    173    void visitCALOAD( CALOAD obj );
    174
    175
    176    void visitLASTORE( LASTORE obj );
    177
    178
    179    void visitI2D( I2D obj );
    180
    181
    182    void visitDADD( DADD obj );
    183
    184
    185    void visitINVOKESPECIAL( INVOKESPECIAL obj );
    186
    187
    188    void visitIAND( IAND obj );
    189
    190
    191    void visitPUTFIELD( PUTFIELD obj );
    192
    193
    194    void visitILOAD( ILOAD obj );
    195
    196
    197    void visitDLOAD( DLOAD obj );
    198
    199
    200    void visitDCONST( DCONST obj );
    201
    202
    203    void visitNEW( NEW obj );
    204
    205
    206    void visitIFNULL( IFNULL obj );
    207
    208
    209    void visitLSUB( LSUB obj );
    210
    211
    212    void visitL2I( L2I obj );
    213
    214
    215    void visitISHR( ISHR obj );
    216
    217
    218    void visitTABLESWITCH( TABLESWITCH obj );
    219
    220
    221    void visitIINC( IINC obj );
    222
    223
    224    void visitDRETURN( DRETURN obj );
    225
    226
    227    void visitFSTORE( FSTORE obj );
    228
    229
    230    void visitDASTORE( DASTORE obj );
    231
    232
    233    void visitIALOAD( IALOAD obj );
    234
    235
    236    void visitDDIV( DDIV obj );
    237
    238
    239    void visitIF_ICMPGE( IF_ICMPGE obj );
    240
    241
    242    void visitLAND( LAND obj );
    243
    244
    245    void visitIDIV( IDIV obj );
    246
    247
    248    void visitLOR( LOR obj );
    249
    250
    251    void visitCASTORE( CASTORE obj );
    252
    253
    254    void visitFREM( FREM obj );
    255
    256
    257    void visitLDC( LDC obj );
    258
    259
    260    void visitBIPUSH( BIPUSH obj );
    261
    262
    263    void visitDSTORE( DSTORE obj );
    264
    265
    266    void visitF2L( F2L obj );
    267
    268
    269    void visitFMUL( FMUL obj );
    270
    271
    272    void visitLLOAD( LLOAD obj );
    273
    274
    275    void visitJSR( JSR obj );
    276
    277
    278    void visitFSUB( FSUB obj );
    279
    280
    281    void visitSASTORE( SASTORE obj );
    282
    283
    284    void visitALOAD( ALOAD obj );
    285
    286
    287    void visitDUP2_X2( DUP2_X2 obj );
    288
    289
    290    void visitRETURN( RETURN obj );
    291
    292
    293    void visitDALOAD( DALOAD obj );
    294
    295
    296    void visitSIPUSH( SIPUSH obj );
    297
    298
    299    void visitDSUB( DSUB obj );
    300
    301
    302    void visitL2F( L2F obj );
    303
    304
    305    void visitIF_ICMPGT( IF_ICMPGT obj );
    306
    307
    308    void visitF2D( F2D obj );
    309
    310
    311    void visitI2L( I2L obj );
    312
    313
    314    void visitIF_ACMPNE( IF_ACMPNE obj );
    315
    316
    317    void visitPOP( POP obj );
    318
    319
    320    void visitI2S( I2S obj );
    321
    322
    323    void visitIFEQ( IFEQ obj );
    324
    325
    326    void visitSWAP( SWAP obj );
    327
    328
    329    void visitIOR( IOR obj );
    330
    331
    332    void visitIREM( IREM obj );
    333
    334
    335    void visitIASTORE( IASTORE obj );
    336
    337
    338    void visitNEWARRAY( NEWARRAY obj );
    339
    340
    341    void visitINVOKEINTERFACE( INVOKEINTERFACE obj );
    342
    343
    344    void visitINEG( INEG obj );
    345
    346
    347    void visitLCMP( LCMP obj );
    348
    349
    350    void visitJSR_W( JSR_W obj );
    351
    352
    353    void visitMULTIANEWARRAY( MULTIANEWARRAY obj );
    354
    355
    356    void visitDUP_X2( DUP_X2 obj );
    357
    358
    359    void visitSALOAD( SALOAD obj );
    360
    361
    362    void visitIFNONNULL( IFNONNULL obj );
    363
    364
    365    void visitDMUL( DMUL obj );
    366
    367
    368    void visitIFNE( IFNE obj );
    369
    370
    371    void visitIF_ICMPLE( IF_ICMPLE obj );
    372
    373
    374    void visitLDC2_W( LDC2_W obj );
    375
    376
    377    void visitGETFIELD( GETFIELD obj );
    378
    379
    380    void visitLADD( LADD obj );
    381
    382
    383    void visitNOP( NOP obj );
    384
    385
    386    void visitFALOAD( FALOAD obj );
    387
    388
    389    void visitINSTANCEOF( INSTANCEOF obj );
    390
    391
    392    void visitIFLE( IFLE obj );
    393
    394
    395    void visitLXOR( LXOR obj );
    396
    397
    398    void visitLRETURN( LRETURN obj );
    399
    400
    401    void visitFCONST( FCONST obj );
    402
    403
    404    void visitIUSHR( IUSHR obj );
    405
    406
    407    void visitBALOAD( BALOAD obj );
    408
    409
    410    void visitDUP2( DUP2 obj );
    411
    412
    413    void visitIF_ACMPEQ( IF_ACMPEQ obj );
    414
    415
    416    void visitIMPDEP1( IMPDEP1 obj );
    417
    418
    419    void visitMONITORENTER( MONITORENTER obj );
    420
    421
    422    void visitLSHL( LSHL obj );
    423
    424
    425    void visitDCMPG( DCMPG obj );
    426
    427
    428    void visitD2L( D2L obj );
    429
    430
    431    void visitIMPDEP2( IMPDEP2 obj );
    432
    433
    434    void visitL2D( L2D obj );
    435
    436
    437    void visitRET( RET obj );
    438
    439
    440    void visitIFGT( IFGT obj );
    441
    442
    443    void visitIXOR( IXOR obj );
    444
    445
    446    void visitINVOKEVIRTUAL( INVOKEVIRTUAL obj );
    447
    448
    449    /**
    450     * @since 6.0
    451     */
    452    void visitINVOKEDYNAMIC( INVOKEDYNAMIC obj );
    453
    454
    455    void visitFASTORE( FASTORE obj );
    456
    457
    458    void visitIRETURN( IRETURN obj );
    459
    460
    461    void visitIF_ICMPNE( IF_ICMPNE obj );
    462
    463
    464    void visitFLOAD( FLOAD obj );
    465
    466
    467    void visitLDIV( LDIV obj );
    468
    469
    470    void visitPUTSTATIC( PUTSTATIC obj );
    471
    472
    473    void visitAALOAD( AALOAD obj );
    474
    475
    476    void visitD2I( D2I obj );
    477
    478
    479    void visitIF_ICMPEQ( IF_ICMPEQ obj );
    480
    481
    482    void visitAASTORE( AASTORE obj );
    483
    484
    485    void visitARETURN( ARETURN obj );
    486
    487
    488    void visitDUP2_X1( DUP2_X1 obj );
    489
    490
    491    void visitFNEG( FNEG obj );
    492
    493
    494    void visitGOTO_W( GOTO_W obj );
    495
    496
    497    void visitD2F( D2F obj );
    498
    499
    500    void visitGOTO( GOTO obj );
    501
    502
    503    void visitISUB( ISUB obj );
    504
    505
    506    void visitF2I( F2I obj );
    507
    508
    509    void visitDNEG( DNEG obj );
    510
    511
    512    void visitICONST( ICONST obj );
    513
    514
    515    void visitFDIV( FDIV obj );
    516
    517
    518    void visitI2B( I2B obj );
    519
    520
    521    void visitLNEG( LNEG obj );
    522
    523
    524    void visitLREM( LREM obj );
    525
    526
    527    void visitIMUL( IMUL obj );
    528
    529
    530    void visitIADD( IADD obj );
    531
    532
    533    void visitLSHR( LSHR obj );
    534
    535
    536    void visitLOOKUPSWITCH( LOOKUPSWITCH obj );
    537
    538
    539    void visitDUP_X1( DUP_X1 obj );
    540
    541
    542    void visitFCMPL( FCMPL obj );
    543
    544
    545    void visitI2C( I2C obj );
    546
    547
    548    void visitLMUL( LMUL obj );
    549
    550
    551    void visitLUSHR( LUSHR obj );
    552
    553
    554    void visitISHL( ISHL obj );
    555
    556
    557    void visitLALOAD( LALOAD obj );
    558
    559
    560    void visitASTORE( ASTORE obj );
    561
    562
    563    void visitANEWARRAY( ANEWARRAY obj );
    564
    565
    566    void visitFRETURN( FRETURN obj );
    567
    568
    569    void visitFADD( FADD obj );
    570
    571
    572    void visitBREAKPOINT( BREAKPOINT obj );
    573}