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