git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@79 379699f6-c40d-0410-875b-85095c16579estable
parent
dff23235cc
commit
92a21fac32
@ -1,37 +1,54 @@ |
|||||||
/* jode.flow.FinallyBlock (c) 1998 Jochen Hoenicke |
/* FinallyBlock Copyright (C) 1997-1998 Jochen Hoenicke. |
||||||
* |
* |
||||||
* You may distribute under the terms of the GNU General Public License. |
* This program is free software; you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU General Public License as published by |
||||||
|
* the Free Software Foundation; either version 2, or (at your option) |
||||||
|
* any later version. |
||||||
* |
* |
||||||
* IN NO EVENT SHALL JOCHEN HOENICKE BE LIABLE TO ANY PARTY FOR DIRECT, |
* This program is distributed in the hope that it will be useful, |
||||||
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
* THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF JOCHEN HOENICKE |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
* HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
* GNU General Public License for more details. |
||||||
* |
* |
||||||
* JOCHEN HOENICKE SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT |
* You should have received a copy of the GNU General Public License |
||||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
* along with this program; see the file COPYING. If not, write to |
||||||
* PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" |
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
||||||
* BASIS, AND JOCHEN HOENICKE HAS NO OBLIGATION TO PROVIDE MAINTENANCE, |
|
||||||
* SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
|
||||||
* |
* |
||||||
* $Id$ |
* $Id$ |
||||||
*/ |
*/ |
||||||
|
|
||||||
package jode.flow; |
package jode.flow; |
||||||
import jode.TabbedPrintWriter; |
|
||||||
|
|
||||||
/** |
/** |
||||||
* A FinallyBlock represents the instructions and try catch regions |
|
||||||
* that are generated by javac when you write a finally block. |
|
||||||
* |
* |
||||||
* We detect such a block when we look at the exception table. There |
* @author Jochen Hoenicke |
||||||
* is always an "any"-exception region (exception class is null) that |
*/ |
||||||
* surrounds the first block. The synchronized-blocks create the same |
public class FinallyBlock extends CatchBlock { |
||||||
* region, so we have to take care of this. |
|
||||||
|
public FinallyBlock() { |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Returns the block where the control will normally flow to, when |
||||||
|
* the given sub block is finished (<em>not</em> ignoring the jump |
||||||
|
* after this block). FinallyBlock have a special behaviour, since |
||||||
|
* the finally block has no default successor at all (it is more a |
||||||
|
* subroutine) that will be called by try or any exception. |
||||||
|
* |
||||||
|
* @return null, if the control flows to another FlowBlock. |
||||||
*/ |
*/ |
||||||
|
public StructuredBlock getNextBlock(StructuredBlock subBlock) { |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
public FlowBlock getNextFlowBlock(StructuredBlock subBlock) { |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
public class FinallyBlock extends StructuredBlock { |
public void dumpInstruction(jode.TabbedPrintWriter writer) |
||||||
public void dumpInstruction(TabbedPrintWriter writer) |
|
||||||
throws java.io.IOException { |
throws java.io.IOException { |
||||||
writer.println("IMPLEMENT FINALLY"); |
writer.println("} finally {"); |
||||||
|
writer.tab(); |
||||||
|
catchBlock.dumpSource(writer); |
||||||
|
writer.untab(); |
||||||
} |
} |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue