function scanFiles(filePaths, provideMap, requireMap) {
  /**
   * @param {string} line
   * @param {string} pattern Pattern to look for, e.g. goog.module(...).
   * @param {string=} opt_antiPattern Pattern to ignore if it shared same prefix
   *     as pattern, e.g. goog.module.declareLegacyNamespace.
   * @return {?string} Extracted namespace or null.
   */
  var extractNamespace = function(line, pattern, opt_antiPattern) {
    var pos = line.indexOf(pattern);
    if (pos == 0) {
      if (opt_antiPattern && line.indexOf(opt_antiPattern) == 0) {
        return null;
      }
      return line.substring(
          pos + pattern.length + 2, line.indexOf(';', pos) - 2);
    }
    return null;
  };

  filePaths.forEach(function(path) {
    var realPath = pathMod.resolve(path);
    var contents = fsMod.readFileSync(realPath).toString().split('\n');
    contents.forEach(function(line) {
      var ns = extractNamespace(line, 'goog.requireType') ||
               extractNamespace(line, 'goog.require');
      if (ns) {
        requireMap.set(realPath, ns);
      }
      ns = extractNamespace(line, 'goog.provide');
      if (ns) {
        provideMap.set(ns, realPath);
      }
      ns = extractNamespace(line, 'goog.module',
          'goog.module.declareLegacyNamespace');
      if (ns) {
        provideMap.set(ns, realPath, true);
      }
    });
  });
}
/*.js');
}


/**
@param {!Array<string>} filePaths
@param {!ProvideMap_} provideMap
@param {!RequireMap_} requireMap