Ejemplo n.º 1
0
 protected WyilFile.Method propagate(WyilFile.Method method) {
   this.method = method;
   ArrayList<WyilFile.Case> cases = new ArrayList<WyilFile.Case>();
   for (WyilFile.Case c : method.cases()) {
     cases.add(propagate(c));
   }
   return new WyilFile.Method(method.modifiers(), method.name(), method.type(), cases);
 }
Ejemplo n.º 2
0
  public void apply(WyilFile module) {
    filename = module.filename();

    for (WyilFile.ConstDef type : module.constants()) {
      module.add(propagate(type));
    }
    for (WyilFile.TypeDef type : module.types()) {
      module.add(propagate(type));
    }

    for (WyilFile.Method method : module.methods()) {
      if (!method.isNative()) {
        // native functions/methods don't have bodies
        module.add(propagate(method));
      }
    }
  }