All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.googlecode.dex2jar.ir.stmt.IfStmt Maven / Gradle / Ivy

package com.googlecode.dex2jar.ir.stmt;

import com.googlecode.dex2jar.ir.LabelAndLocalMapper;
import com.googlecode.dex2jar.ir.expr.Value;
import com.googlecode.dex2jar.ir.stmt.Stmt.E1Stmt;

/**
 * Represent a IF statement
 *
 * @author Panxiaobo
 * @version $Rev: 9fd8005bbaa4 $
 * @see ST#IF
 */
public class IfStmt extends E1Stmt implements JumpStmt {

    public LabelStmt target;

    public LabelStmt getTarget() {
        return target;
    }

    public void setTarget(LabelStmt target) {
        this.target = target;
    }

    public IfStmt(ST type, Value condition, LabelStmt target) {
        super(type, condition);
        this.target = target;
    }

    @Override
    public Stmt clone(LabelAndLocalMapper mapper) {
        LabelStmt nTarget = mapper.map(target);
        return new IfStmt(st, op.clone(mapper), nTarget);
    }

    @Override
    public String toString() {
        return "if " + op + " GOTO " + target.getDisplayName();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy