* @return PlIterator
   */
  public static PlIterator getChildModules(Module module) {
    { Cons directsubmodules = Stella.NIL;

      { Context child = null;
        Cons iter000 = module.childContexts.theConsList;
        Cons collect000 = null;

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
          child = ((Context)(iter000.value));
          if (Stella_Object.isaP(child, Logic.SGT_STELLA_MODULE)) {
            if (collect000 == null) {
              {
                collect000 = Cons.cons(child, Stella.NIL);
                if (directsubmodules == Stella.NIL) {
                  directsubmodules = collect000;
                }
                else {
                  Cons.addConsToEndOfConsList(directsubmodules, collect000);
                }
              }
            }
            else {
              {
                collect000.rest = Cons.cons(child, Stella.NIL);
                collect000 = collect000.rest;
              }
            }
          }
        }
      }
      return (PLI.consToPlIterator(directsubmodules));
    }
  }