Package jadx.core.dex.visitors.regions

Source Code of jadx.core.dex.visitors.regions.TracedRegionVisitor

package jadx.core.dex.visitors.regions;

import jadx.core.dex.nodes.IBlock;
import jadx.core.dex.nodes.IRegion;
import jadx.core.dex.nodes.MethodNode;

import java.util.ArrayDeque;
import java.util.Deque;

public abstract class TracedRegionVisitor implements IRegionVisitor {

  protected final Deque<IRegion> regionStack = new ArrayDeque<IRegion>();

  @Override
  public final void enterRegion(MethodNode mth, IRegion region) {
    regionStack.push(region);
  }

  @Override
  public final void processBlock(MethodNode mth, IBlock container) {
    IRegion curRegion = regionStack.peek();
    processBlockTraced(mth, container, curRegion);
  }

  public abstract void processBlockTraced(MethodNode mth, IBlock container, IRegion currentRegion);

  @Override
  public final void leaveRegion(MethodNode mth, IRegion region) {
    regionStack.pop();
  }
}
TOP

Related Classes of jadx.core.dex.visitors.regions.TracedRegionVisitor

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.