Package org.objectweb.asm.tree.analysis

Examples of org.objectweb.asm.tree.analysis.BasicInterpreter


*/
public class CyclomaticComplexity {
 
  public int getCyclomaticComplexity(String owner, MethodNode mn)
      throws AnalyzerException {
    Analyzer a = new Analyzer(new BasicInterpreter()) {
      protected Frame newFrame(int nLocals, int nStack) {
        return new Node(nLocals, nStack);
      }

      protected Frame newFrame(Frame src) {
View Full Code Here


    next = mv;
  }

  public void visitEnd() {
    MethodNode mn = (MethodNode) mv;
    Analyzer a = new Analyzer(new BasicInterpreter());
    try {
      a.analyze(owner, mn);
      Frame[] frames = a.getFrames();
      AbstractInsnNode[] insns = mn.instructions.toArray();
      for (int i = 0; i < frames.length; ++i) {
View Full Code Here

        cr.accept(cn, 0);
        List methods = cn.methods;
        for (int k = 0; k < methods.size(); ++k) {
          MethodNode method = (MethodNode) methods.get(k);
          if (method.instructions.size() > 0) {
            Analyzer a = new Analyzer(new BasicInterpreter());
            try {
              a.analyze(cn.name, method);
            } catch (Throwable th) {
              ++errors;
            }
View Full Code Here

  private Set<Edge> exceptionEdges = Collections.emptySet();
 
  private final boolean exceptionFlow;
 
  public EdgeAnalyzer(final boolean exceptionFlow) {
    super(new BasicInterpreter());
    this.exceptionFlow = exceptionFlow;
  }
View Full Code Here

   }
  
   Map<Integer, List<Integer>> fromto = new HashMap<Integer, List<Integer>>();
   CFG(String internalName, MethodNode m) throws AnalyzerException
   {
      Analyzer a = new Analyzer(new BasicInterpreter()){
         @Override protected void newControlFlowEdge(final int insn, final int successor) {
            if (!fromto.containsKey(insn))
               fromto.put(insn, new Vector<Integer>());
            fromto.get(insn).add(successor);
         }
View Full Code Here

   }
  
   Map<Integer, List<Integer>> fromto = new HashMap<Integer, List<Integer>>();
   CFG(String internalName, MethodNode m) throws AnalyzerException
   {
      Analyzer a = new Analyzer(new BasicInterpreter()){
         @Override protected void newControlFlowEdge(final int insn, final int successor) {
            if (!fromto.containsKey(insn))
               fromto.put(insn, new Vector<Integer>());
            fromto.get(insn).add(successor);
         }
View Full Code Here

TOP

Related Classes of org.objectweb.asm.tree.analysis.BasicInterpreter

Copyright © 2018 www.massapicom. 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.