*** empty log message ***

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@22 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 58973855f5
commit b6eb6a495b
  1. 15
      jode/jode/flow/FlowBlock.java
  2. 15
      jode/jode/flow/StructuredBlock.java
  3. 3
      jode/jode/flow/jode.ppl

@ -217,7 +217,7 @@ public class FlowBlock {
elseBlock.outer instanceof SequentialBlock &&
elseBlock.outer.getSubBlocks()[0] instanceof IfThenElseBlock &&
(elseBlock.outer.getNextFlowBlock() == successor ||
elseBlock.outer.jumpMayBeChanged()) {
elseBlock.outer.jumpMayBeChanged())) {
IfThenElseBlock ifBlock =
(IfThenElseBlock)elseBlock.outer.getSubBlocks()[0];
if (ifBlock.getElseBlock() == null) {
@ -228,7 +228,7 @@ public class FlowBlock {
} else {
jump.parent.removeJump();
}
ifBlock.replace(elseBlock.outer)
ifBlock.replace(elseBlock.outer);
ifBlock.setElseBlock(elseBlock);
if (appendBlock = elseBlock.outer)
appendBlock = ifBlock;
@ -447,6 +447,13 @@ public class FlowBlock {
* to the do/while block.
*/
/* Merge the sucessors from the successing flow block
*/
enum = succ.successors.elements();
while (enum.hasMoreElements()) {
successors.addElement(enum.nextElement());
}
/* Believe it or not: Now the rule, that the first part of a
* SequentialBlock shouldn't be another SequentialBlock is
* fulfilled. <p>
@ -501,7 +508,3 @@ public class FlowBlock {
successors.setElementAt(null, successors.indexOf(jump));
}
}

@ -236,6 +236,21 @@ public abstract class StructuredBlock {
return false;
}
/**
* Get the unique predecessor which mustn't be a conditional jump
* @return the predecessor or null if there isn't a such a thing
*/
public StructuredBlock getSimpleUniquePredecessor() {
SequentialBlock sequ;
if (outer instanceof SequentialBlock) {
if (outer.getSubBlocks()[1] == this)
return outer.getSubBlocks()[0];
else if (outer.outer instanceof SequentialBlock)
return outer.outer.getSubBlocks[0];
}
return null;
}
/**
* Print the source code for this structured block. This may be
* called only once, because it remembers which local variables

@ -35,4 +35,5 @@
auf klo
1998-09-17 17:11:45 ei
1998-09-17 17:49:35 ecd
1998-09-19 10:46:01 bcd
1998-09-19 11:00:08 ecd
Loading…
Cancel
Save