Beispiel #1
0
 @Override
 public void run() {
   while (running) {
     AbstractAST stat = eval.getCurrentAST();
     if (stat != null) {
       Count currentCount = data.get(stat);
       if (currentCount == null) data.put(stat, new Count());
       else currentCount.increment();
     }
     try {
       sleep(resolution);
     } catch (InterruptedException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
     }
   }
 }
Beispiel #2
0
  @Override
  public void run() {
    while (running) {
      AbstractAST current = eval.getCurrentAST();
      Environment env = eval.getCurrentEnvt();
      String name = env.getName();

      if (current != null) {
        ISourceLocation stat = current.getLocation();
        if (stat != null) {
          Count currentCount = ast.get(stat);
          if (currentCount == null) {
            ast.put(stat, new Count());
            names.put(stat, name);
          } else {
            currentCount.increment();
          }
        }
        while (env.getParent() != null && !env.getParent().isRootScope()) {
          env = env.getParent();
        }
        if (env != null) {
          Count currentCount = frame.get(env.getLocation());
          if (currentCount == null) {
            frame.put(env.getLocation(), new Count());
            names.put(env.getLocation(), env.getName());
          } else {
            currentCount.increment();
          }
        }
      }
      try {
        sleep(resolution);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
    }
  }