code: public static void addExistingImports (String asFile, ImportSet imports)
      {
          // Discover the location of the 'public class' declaration.
          // We won't search past there.
          Matcher m = AS_PUBLIC_CLASS_DECL.matcher(asFile);
          int searchTo = asFile.length();
          if (m.find()) {
              searchTo = m.start();
          }
  
          m = AS_IMPORT.matcher(asFile.substring(0, searchTo));
          while (m.find()) {
              imports.add(m.group(3));
          }
      }
docs: Adds an existing ActionScript file's imports to the given ImportSet.
  @param asFile a String containing the contents of an ActionScript file