1 11 package org.eclipse.jdt.internal.compiler.ast; 12 13 import org.eclipse.jdt.internal.compiler.codegen.CodeStream; 14 import org.eclipse.jdt.internal.compiler.codegen.ExceptionLabel; 15 import org.eclipse.jdt.internal.compiler.lookup.BlockScope; 16 import org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding; 17 18 21 public abstract class SubRoutineStatement extends Statement { 22 23 public static void reenterAllExceptionHandlers(SubRoutineStatement[] subroutines, int max, CodeStream codeStream) { 24 if (subroutines == null) return; 25 if (max < 0) max = subroutines.length; 26 for (int i = 0; i < max; i++) { 27 SubRoutineStatement sub = subroutines[i]; 28 sub.enterAnyExceptionHandler(codeStream); 29 sub.enterDeclaredExceptionHandlers(codeStream); 30 } 31 } 32 33 ExceptionLabel anyExceptionLabel; 34 35 public ExceptionLabel enterAnyExceptionHandler(CodeStream codeStream) { 36 37 if (this.anyExceptionLabel == null) { 38 this.anyExceptionLabel = new ExceptionLabel(codeStream, null ); 39 } 40 this.anyExceptionLabel.placeStart(); 41 return this.anyExceptionLabel; 42 } 43 44 public void enterDeclaredExceptionHandlers(CodeStream codeStream) { 45 } 47 48 public void exitAnyExceptionHandler() { 49 if (this.anyExceptionLabel != null) { 50 this.anyExceptionLabel.placeEnd(); 51 } 52 } 53 54 public void exitDeclaredExceptionHandlers(CodeStream codeStream) { 55 } 57 58 59 public abstract boolean generateSubRoutineInvocation(BlockScope currentScope, CodeStream codeStream, Object targetLocation, int stateIndex, LocalVariableBinding secretLocal); 60 61 public abstract boolean isSubRoutineEscaping(); 62 63 public void placeAllAnyExceptionHandler() { 64 this.anyExceptionLabel.place(); 65 } 66 } 67 | Popular Tags |