Пример #1
0
 public void setPath(String path) {
   this.path = path;
   for (Binding b : bindings) b.setPath(path);
   init.setPath(path);
   name.setPath(path);
   for (BArm b : arms) b.setPath(path);
 }
Пример #2
0
  public int maxLocals() {

    // This does not remove those bindings that will be implemented as
    // dynamic variables, however it is fail safe...

    int maxLocals = name.maxLocals() + init.maxLocals() + Binding.valueBindings(bindings).length;
    for (BArm arm : arms) maxLocals += arm.maxLocals();
    int valueLocals = 0;
    for (Binding b : Binding.valueBindings(bindings))
      valueLocals = Math.max(valueLocals, b.getValue().maxLocals());
    return maxLocals + valueLocals;
  }
Пример #3
0
 public void FV(HashSet<String> vars) {
   HashSet<String> bound = new HashSet<String>();
   for (Binding b : Binding.valueBindings(bindings)) {
     bound.add(b.getName());
   }
   for (Binding b : Binding.valueBindings(bindings)) {
     HashSet<String> free = new HashSet<String>();
     b.FV(free);
     free.removeAll(bound);
     vars.addAll(free);
   }
   HashSet<String> free = new HashSet<String>();
   for (BArm arm : arms) arm.FV(vars);
   init.FV(vars);
   name.FV(vars);
   free.removeAll(bound);
   vars.addAll(free);
 }