Search in sources :

Example 1 with SwitchBlock

use of org.candle.decompiler.ast.swtch.SwitchBlock in project candle-decompiler by bradsdavis.

the class BlockVisitor method visitSwitchIntermediate.

@Override
public void visitSwitchIntermediate(SwitchIntermediate line) {
    if (seen.contains(line)) {
        // do nothing.
        return;
    } else {
        seen.add(line);
    }
    SwitchBlock switchBlock = new SwitchBlock(line);
    current.addChild(switchBlock);
    current = switchBlock;
    List<CaseIntermediate> cases = igc.getCases(line);
    for (CaseIntermediate switchCase : cases) {
        switchCase.accept(this);
        // reset current to switch
        current = switchBlock;
    }
}
Also used : SwitchBlock(org.candle.decompiler.ast.swtch.SwitchBlock) CaseIntermediate(org.candle.decompiler.intermediate.code.CaseIntermediate)

Aggregations

SwitchBlock (org.candle.decompiler.ast.swtch.SwitchBlock)1 CaseIntermediate (org.candle.decompiler.intermediate.code.CaseIntermediate)1