/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache BCEL" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache BCEL", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
*/
/**
* Abstract super class for all Java byte codes.
*
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
*/
/**
* Empty constructor needed for the Class.newInstance() statement in
* Instruction.readInstruction(). Not to be used otherwise.
*/
Instruction() {}
}
/**
* Dump instruction as byte code to stream out.
* @param out Output stream
*/
}
/** @return name of instruction, i.e., opcode name
*/
}
/**
* Long output format:
*
* <name of opcode> "["<opcode number>"]"
* "("<length of instruction>")"
*
* @return mnemonic for instruction
*/
if(verbose)
else
return getName();
}
/**
* @return mnemonic for instruction in verbose format
*/
return toString(true);
}
/**
* @return mnemonic for instruction with sumbolic references resolved
*/
return toString(false);
}
/**
* Use with caution, since `BranchInstruction's have a `target' reference which
* is not copied correctly (only basic types are). This also applies for
* `Select' instructions with their multiple branch targets.
*
* @see BranchInstruction
* @return (shallow) copy of an instruction
*/
Instruction i = null;
// "Constant" instruction, no need to duplicate
i = this;
else {
try {
i = (Instruction)clone();
} catch(CloneNotSupportedException e) {
}
}
return i;
}
/**
* Read needed data (e.g. index) from file.
*
* @param bytes byte sequence to read from
* @param wide "wide" instruction flag
*/
throws IOException
{}
/**
* Read an instruction from (byte code) input stream and return the
* appropiate object.
*
* @param file file to read from
* @return instruction object being read
*/
throws IOException
{
boolean wide = false;
wide = true;
}
/* Find appropiate class, instantiate an (empty) instruction object
* and initialize it by hand.
*/
try {
} catch (ClassNotFoundException cnfe){
// If a class by that name does not exist, the opcode is illegal.
// Note that IMPDEP1, IMPDEP2, BREAKPOINT are also illegal in a sense.
throw new ClassGenException("Illegal opcode detected.");
}
try {
// Byte code offset set in InstructionList
return obj;
}
/* ICONST_0, etc. will be shortened to ICONST, etc., since ICONST_0 and the like
* are not implemented (directly).
*/
try {
name = "ICONST";
return "com.sun.org.apache.bcel.internal.generic." + name;
}
/**
* This method also gives right results for instructions whose
* effect on the stack depends on the constant pool entry they
* reference.
* @return Number of words consumed from stack by this instruction,
* or Constants.UNPREDICTABLE, if this can not be computed statically
*/
}
/**
* This method also gives right results for instructions whose
* effect on the stack depends on the constant pool entry they
* reference.
* @return Number of words produced onto stack by this instruction,
* or Constants.UNPREDICTABLE, if this can not be computed statically
*/
}
/**
* @return this instructions opcode
*/
/**
* @return length (in bytes) of instruction
*/
/**
* Needed in readInstruction.
*/
/** Some instructions may be reused, so don't do anything by default.
*/
void dispose() {}
/**
* Call corresponding visitor method(s). The order is:
* Call visitor methods of implemented interfaces first, then
* call methods according to the class hierarchy in descending order,
* i.e., the most specific visitXXX() call comes last.
*
* @param v Visitor object
*/
/** Get Comparator object used in the equals() method to determine
* equality of instructions.
*
* @return currently used comparator for equals()
*/
/** Set comparator to be used for equals().
*/
/** Check for equality, delegated to comparator
* @return true if that is an Instruction and has the same opcode
*/
return (that instanceof Instruction)?
}
}