Search in sources :

Example 1 with Break

use of org.candle.decompiler.intermediate.expression.Break in project candle-decompiler by bradsdavis.

the class SwitchGotoToBreak method transformGotoToBreak.

public void transformGotoToBreak(GoToIntermediate gotoStatement) {
    Break breakExpression = new Break(gotoStatement.getInstruction());
    StatementIntermediate breakStatement = new StatementIntermediate(gotoStatement.getInstruction(), breakExpression);
    igc.getGraph().addVertex(breakStatement);
    igc.redirectPredecessors(gotoStatement, breakStatement);
    igc.redirectSuccessors(gotoStatement, breakStatement);
    igc.getGraph().removeVertex(gotoStatement);
}
Also used : StatementIntermediate(org.candle.decompiler.intermediate.code.StatementIntermediate) Break(org.candle.decompiler.intermediate.expression.Break)

Example 2 with Break

use of org.candle.decompiler.intermediate.expression.Break in project candle-decompiler by bradsdavis.

the class LoopGotoToBreak method transformGotoToBreak.

public void transformGotoToBreak(GoToIntermediate gotoStatement) {
    Break breakExpression = new Break(gotoStatement.getInstruction());
    StatementIntermediate breakStatement = new StatementIntermediate(gotoStatement.getInstruction(), breakExpression);
    igc.getGraph().addVertex(breakStatement);
    igc.redirectPredecessors(gotoStatement, breakStatement);
    igc.redirectSuccessors(gotoStatement, breakStatement);
    igc.getGraph().removeVertex(gotoStatement);
}
Also used : StatementIntermediate(org.candle.decompiler.intermediate.code.StatementIntermediate) Break(org.candle.decompiler.intermediate.expression.Break)

Aggregations

StatementIntermediate (org.candle.decompiler.intermediate.code.StatementIntermediate)2 Break (org.candle.decompiler.intermediate.expression.Break)2