 class DocsExtractor
 
   constructor: ( regexes ) ->
+    @regexBaseClassName = regexes.baseClassName
     @regexClassName = regexes.className
     @regexComments = regexes.comments
     @regexCommentText = regexes.commentText
+    @regexRequiresClasses = regexes.requiresClasses
 
   extract: ( source ) ->
+    baseClassName: @baseClassName source
     className: @controlClassName source
-    comments: @controlComments source
+    members: @memberComments source
+    requiresClasses: @requiresClasses source
+
+  # Return the name for the control class defined in the source text.
+  baseClassName: ( source ) ->
+    match = @regexBaseClassName.exec source
+    match?[1]
 
   # Return the name for the control class defined in the source text.
   controlClassName: ( source ) ->
     match = @regexClassName.exec source
-    if match?
-      match[1]
-    else
-      null
+    match?[1]
 
   # Return the comments found for members defined in the source text.
-  controlComments: ( source ) ->
+  memberComments: ( source ) ->
     comments = null
     match = @regexComments.exec source
     while match != null

    extractor = extractors[ extension ]
    if extractor?
      source = fs.readFileSync filePath, "utf8"
      { className: className, comments: comments } = extractor.extract source
      if className? and comments?
        docs[ className ] = comments
  docs



formatDocs = ( docs ) ->
  json =  JSON.stringify docs, null, "  "
  """
  /* Control documentation generated from QuickUI control source files. */
  var controlDocumentation = #{json};
  """

