00001 package de.fub.bytecode.generic;
00002
00003 import java.io.*;
00004 import de.fub.bytecode.ExceptionConstants;
00005
00006
00007
00008
00009
00010
00011
00012
00013 public class NEW extends CPInstruction
00014 implements LoadClass, AllocationInstruction, ExceptionThrower, StackProducer {
00015
00016
00017
00018
00019 NEW() {}
00020 public NEW(int index) {
00021 super(de.fub.bytecode.Constants.NEW, index);
00022 }
00023
00024
00025
00026
00027
00028
00029
00030
00031 public void accept(Visitor v) {
00032 v.visitLoadClass(this);
00033 v.visitAllocationInstruction(this);
00034 v.visitExceptionThrower(this);
00035 v.visitStackProducer(this);
00036 v.visitTypedInstruction(this);
00037 v.visitCPInstruction(this);
00038 v.visitNEW(this);
00039 }
00040 public Class[] getExceptions(){
00041 Class[] cs = new Class[2 + ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length];
00042
00043 System.arraycopy(ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION, 0,
00044 cs, 0, ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length);
00045
00046 cs[ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length+1] = ExceptionConstants.INSTANTIATION_ERROR;
00047 cs[ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length] = ExceptionConstants.ILLEGAL_ACCESS_ERROR;
00048
00049 return cs;
00050 }
00051 }