diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/Makefile ../rdoc-f95-20090109-1/Makefile
--- ruby-1.8.7-p72/lib/rdoc/Makefile	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/Makefile	2007-02-27 15:49:10.000000000 +0900
@@ -0,0 +1,63 @@
+RUBY=ruby
+DOCTMP=doc-tmp
+
+all:
+
+doc: doc-stamp
+	test -d $(DOCTMP) || mkdir $(DOCTMP)
+	ln -s ../ $(DOCTMP)/rdoc
+	RUBYLIB=./$(DOCTMP) \
+	    $(RUBY) ./rdoc -U --op doc --title "RDoc-F95 Documentations" \
+	    --charset euc-jp --inline-source --line-numbers \
+	    --main README.ja \
+	    README README.ja README.org *.rb */*.rb */*/*.rb || eval "rm $< $(DOCTMP)/rdoc ; rmdir $(DOCTMP) ; false"
+	if [ -f doc/rdoc-style.css ] ; then \
+	    echo '' >> doc/rdoc-style.css ;\
+	    echo 'img{vertical-align: middle;}' >> doc/rdoc-style.css ;\
+	    echo '' >> doc/rdoc-style.css ;\
+	fi
+	rm $< $(DOCTMP)/rdoc
+	rmdir $(DOCTMP)
+
+doc-stamp:
+	touch $@
+
+clean:
+	test "`find . -name '*~'`" = "" || rm `find . -name '*~'`
+	test -f doc-stamp || rm doc-stamp
+
+clean-doc:
+	test ! -d doc || rm -rf -v doc
+
+patch:
+	if [ ! -d patch_dir ] ; then \
+	    mkdir patch_dir ;\
+	    cd patch_dir ;\
+	    cvs -d :pserver:anonymous@cvs.ruby-lang.org:/src login ;\
+	    cvs -z4 -d :pserver:anonymous@cvs.ruby-lang.org:/src co ruby ;\
+	fi
+	cd patch_dir/ruby ; cvs update
+	test -L patch_dir/ruby/lib/rdoc-f95 || \
+		eval "cd patch_dir/ruby/lib ; ln -s ../../../ rdoc-f95"
+	cd patch_dir/ruby ; \
+	diff \
+		--exclude=rdoc \
+		--exclude=parse_c.rb \
+		--exclude=parse_rb.rb \
+		--exclude=install.rb \
+		--exclude=README* \
+		--exclude=Makefile \
+		--exclude=*~ \
+		--exclude=CVS \
+		--exclude=patch_dir \
+		--exclude=rdoc-cvs.patch \
+		--exclude=rdoc-cvs.patch.tmp \
+		-Nur lib/rdoc/ lib/rdoc-f95/ > ../../rdoc-cvs.patch.tmp \
+		|| true
+	sed "s|^diff.*$$|diff -Nur lib/rdoc/ lib/rdoc-`date +%Y-%m-%d`/|" rdoc-cvs.patch.tmp > rdoc-cvs.patch
+	rm rdoc-cvs.patch.tmp
+
+clean-patch:
+	-rm -v rdoc-cvs.patch.tmp rdoc-cvs.patch
+	-rm -v -rf patch_dir/ruby
+	-rmdir patch_dir
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/README ../rdoc-f95-20090109-1/README
--- ruby-1.8.7-p72/lib/rdoc/README	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/README	2009-01-09 20:41:56.000000000 +0900
@@ -1,489 +1,439 @@
-= RDOC - Ruby Documentation System
+({Japanese}[link:files/README_ja.html] | English)
 
-This package contains Rdoc and SimpleMarkup. Rdoc is an application
-that produces documentation for one or more Ruby source files. We work
-similarly to JavaDoc, parsing the source, and extracting the
-definition for classes, modules, and methods (along with includes and
-requires).  We associate with these optional documentation contained
-in the immediately preceding comment block, and then render the result
-using a pluggable output formatter. (Currently, HTML is the only
-supported format. Markup is a library that converts plain text into
-various output formats. The Markup library is used to interpret the
-comment blocks that Rdoc uses to document methods, classes, and so on.
-
-This library contains two packages, rdoc itself and a text markup
-library, 'markup'. 
-
-== Roadmap
-
-* If you want to use Rdoc to create documentation for your Ruby source
-  files, read on.
-* If you want to include extensions written in C, see rdoc/parsers/parse_c.rb.
-* For information on the various markups available in comment
-  blocks, see markup/simple_markup.rb.
-* If you want to drive Rdoc programatically, see RDoc::RDoc.
-* If you want to use the library to format text blocks into HTML,
-  have a look at SM::SimpleMarkup.
-* If you want to try writing your own HTML output template, see
-  RDoc::Page.
-
-== Summary
-
-Once installed, you can create documentation using the 'rdoc' command
-(the command is 'rdoc.bat' under Windows)
-
-  % rdoc [options]  [names...]
-
-Type "rdoc --help" for an up-to-date option summary.
-
-A typical use might be to generate documentation for a package of Ruby
-source (such as rdoc itself). 
-
-  % rdoc
-
-This command generates documentation for all the Ruby and C source
-files in and below the current directory. These will be stored in a
-documentation tree starting in the subdirectory 'doc'.
-
-You can make this slightly more useful for your readers by having the
-index page contain the documentation for the primary file. In our
-case, we could type
-
-  % rdoc --main rdoc/rdoc.rb
-
-You'll find information on the various formatting tricks you can use
-in comment blocks in the documentation this generates.
-
-RDoc uses file extensions to determine how to process each file. File
-names ending <tt>.rb</tt> and <tt>.rbw</tt> are assumed to be Ruby
-source. Files ending <tt>.c</tt> are parsed as C files. All other
-files are assumed to contain just SimpleMarkup-style markup (with or
-without leading '#' comment markers). If directory names are passed to
-RDoc, they are scanned recursively for C and Ruby source files only.
-
-== Credits
-
-* The Ruby parser in rdoc/parse.rb is based heavily on the outstanding
-  work of Keiju ISHITSUKA of Nippon Rational Inc, who produced the Ruby
-  parser for irb and the rtags package.
-
-* Code to diagram classes and modules was written by Sergey A Yanovitsky
-  (Jah) of Enticla. 
-
-* Charset patch from MoonWolf.
-
-* Rich Kilmer wrote the kilmer.rb output template.
-
-* Dan Brickley led the design of the RDF format.
-
-== License
-
-RDoc is Copyright (c) 2001-2003 Dave Thomas, The Pragmatic Programmers.  It
-is free software, and may be redistributed under the terms specified
-in the README file of the Ruby distribution.
-
-= Usage
-
-RDoc is invoked from the command line using:
-
-   % rdoc <options> [name...]
-
-Files are parsed, and the information they contain collected, before
-any output is produced. This allows cross references between all files
-to be resolved. If a name is a directory, it is traversed. If no
-names are specified, all Ruby files in the current directory (and
-subdirectories) are processed.
-
-Options are:
-
-[<tt>--accessor</tt> <i>name[,name...]</i>]
-    specifies the name(s) of additional methods that should be treated
-    as if they were <tt>attr_</tt><i>xxx</i> methods. Specifying
-    "--accessor db_opt" means lines such as
-
-         db_opt :name, :age
-  
-    will get parsed and displayed in the documentation. Each name may have an
-    optional "=flagtext" appended, in which case the given flagtext will appear
-    where (for example) the 'rw' appears for attr_accessor.
-
-[<tt>--all</tt>]
-    include protected and private methods in the output (by default
-    only public methods are included)
-
-[<tt>--charset</tt> _charset_]
-    Set the character set for the generated HTML.
-
-[<tt>--diagram</tt>]
-    include diagrams showing modules and classes.  This is currently
-    an experimental feature, and may not be supported by all output
-    templates. You need dot V1.8.6 or later to use the --diagram
-    option correctly (http://www.research.att.com/sw/tools/graphviz/).
-
-[<tt>--exclude</tt> <i>pattern</i>]
-    exclude files and directories matching this pattern from processing
-
-[<tt>--extension</tt> <i>new=old</i>]
-    treat files ending <i>.new</i> as if they ended
-    <i>.old</i>. Saying '--extension cgi=rb' causes RDoc to treat .cgi
-    files as Ruby source.
-
-[<tt>fileboxes</tt>]
-    Classes are put in boxes which represents files, where these
-    classes reside. Classes shared between more than one file are
-    shown with list of files that sharing them.  Silently discarded if
-    --diagram is not given Experimental.
-
-[<tt>--fmt</tt> _fmt_]
-    generate output in a particular format.
-
-[<tt>--help</tt>]
-    generate a usage summary.
-
-[<tt>--help-output</tt>]
-    explain the various output options.
-
-[<tt>--image-format</tt> <i>gif/png/jpg/jpeg</i>]
-    sets output image format for diagrams. Can be png, gif, jpeg,
-    jpg. If this option is omitted, png is used. Requires --diagram.
-
-[<tt>--include</tt> <i>dir,...</i>]
-    specify one or more directories to be searched when satisfying
-    :+include+: directives. Multiple <tt>--include</tt> options may be
-    given. The directory containing the file currently being processed
-    is always searched.
-
-[<tt>--inline-source</tt>]
-    By default, the source code of methods is shown in a popup. With
-    this option, it's displayed inline.
-
-[<tt>line-numbers</tt>]
-    include line numbers in the source code
-
-[<tt>--main</tt> _name_]
-    the class of module _name_ will appear on the index page. If you
-    want to set a particular file as a main page (a README, for
-    example) simply specifiy its name as the first on the command
-    line.
-
-[<tt>--merge</tt>]
-    when generating _ri_ output, if classes being processed already
-    exist in the destination directory, merge in the current details
-    rather than overwrite them.
-
-[<tt>--one-file</tt>]
-    place all the output into a single file
-
-[<tt>--op</tt> _dir_]
-    set the output directory to _dir_ (the default is the directory
-    "doc")
-
-[<tt>--op-name</tt> _name_]
-    set the name of the output. Has no effect for HTML.
-    "doc")
-
-[<tt>--opname</tt> _name_]
-    set the output name (has no effect for HTML).
-
-[<tt>--promiscuous</tt>]
-    If a module or class is defined in more than one source file, and
-    you click on a particular file's name in the top navigation pane,
-    RDoc will normally only show you the inner classes and modules of
-    that class that are defined in the particular file. Using this
-    option makes it show all classes and modules defined in the class,
-    regardless of the file they were defined in.
-
-[<tt>--quiet</tt>]
-    do not display progress messages
-
-[<tt>--ri</tt>, <tt>--ri-site</tt>, _and_ <tt>--ri-system</tt>]
-    generate output than can be read by the _ri_ command-line tool.
-    By default --ri places its output in ~/.rdoc, --ri-site in
-    $datadir/ri/<ver>/site, and --ri-system in
-    $datadir/ri/<ver>/system. All can be overridden with a subsequent
-    --op option. All default directories are in ri's default search
-    path.
-
-[<tt>--show-hash</tt>]
-    A name of the form #name in a comment is a possible hyperlink to
-    an instance method name. When displayed, the '#' is removed unless
-    this option is specified
-
-[<tt>--style</tt> <i>stylesheet url</i>]
-    specifies the URL of an external stylesheet to use (rather than
-    generating one of our own)
-
-[<tt>tab-width</tt> _n_]
-    set the width of tab characters (default 8)
-
-[<tt>--template</tt> <i>name</i>]
-    specify an alternate template to use when generating output (the
-    default is 'standard'). This template should be in a directory
-    accessible via $: as rdoc/generators/xxxx_template, where 'xxxx'
-    depends on the output formatter.
-
-[<tt>--version</tt>]
-   display  RDoc's version
-
-[<tt>--webcvs</tt> _url_]
-    Specify a URL for linking to a web frontend to CVS. If the URL
-    contains a '\%s', the name of the current file will be
-    substituted; if the URL doesn't contain a '\%s', the filename will
-    be appended to it.
-
-= Example
-
-A typical small Ruby program commented using RDoc might be as follows. You
-can see the formatted result in EXAMPLE.rb and Anagram.
-
-      :include: EXAMPLE.rb
-
-= Markup
-
-Comment blocks can be written fairly naturally, either using '#' on
-successive lines of the comment, or by including the comment in 
-an =begin/=end block. If you use the latter form, the =begin line
-must be flagged with an RDoc tag:
-
-  =begin rdoc
-  Documentation to 
-  be processed by RDoc.
-  =end
-
-Paragraphs are lines that share the left margin. Text indented past
-this margin are formatted verbatim.
-
-1. Lists are typed as indented paragraphs with:
-   * a '*' or '-' (for bullet lists)
-   * a digit followed by a period for 
-     numbered lists
-   * an upper or lower case letter followed
-     by a period for alpha lists.
-
-   For example, the input that produced the above paragraph looked like
-       1. Lists are typed as indented 
-          paragraphs with:
-          * a '*' or '-' (for bullet lists)
-          * a digit followed by a period for 
-            numbered lists
-          * an upper or lower case letter followed
-            by a period for alpha lists.
-
-2. Labeled lists (sometimes called description
-   lists) are typed using square brackets for the label.
-      [cat]   small domestic animal
-      [+cat+] command to copy standard input
-
-3. Labeled lists may also be produced by putting a double colon
-   after the label. This sets the result in tabular form, so the
-   descriptions all line up. This was used to create the 'author'
-   block at the bottom of this description.
-      cat::   small domestic animal
-      +cat+:: command to copy standard input
-
-   For both kinds of labeled lists, if the body text starts on the same
-   line as the label, then the start of that text determines the block
-   indent for the rest of the body. The text may also start on the line
-   following the label, indented from the start of the label. This is
-   often preferable if the label is long. Both the following are
-   valid labeled list entries:
-
-      <tt>--output</tt> <i>name [, name]</i>::
-          specify the name of one or more output files. If multiple
-          files are present, the first is used as the index.
-
-      <tt>--quiet:</tt>:: do not output the names, sizes, byte counts,
-                          index areas, or bit ratios of units as
-                          they are processed.
-
-4. Headings are entered using equals signs
-
-      = Level One Heading
-      == Level Two Heading
-   and so on
-
-5. Rules (horizontal lines) are entered using three or
-   more hyphens.
-
-6. Non-verbatim text can be marked up:
-
-   _italic_::     \_word_ or \<em>text</em>
-   *bold*::       \*word* or \<b>text</b>
-   +typewriter+:: \+word+ or \<tt>text</tt>
-
-   The first form only works around 'words', where a word is a
-   sequence of upper and lower case letters and underscores. Putting a
-   backslash before inline markup stops it being interpreted, which is
-   how I created the table above:
-
-     _italic_::     \_word_ or \<em>text</em>
-     *bold*::       \*word* or \<b>text</b>
-     +typewriter+:: \+word+ or \<tt>text</tt>
-
-7. Names of classes, source files, and any method names
-   containing an underscore or preceded by a hash
-   character are automatically hyperlinked from
-   comment text to their description. 
-
-8. Hyperlinks to the web starting http:, mailto:, ftp:, or www. are
-   recognized. An HTTP url that references an external image file is
-   converted into an inline <IMG..>.  Hyperlinks starting 'link:' are
-   assumed to refer to local files whose path is relative to the --op
-   directory.
-
-   Hyperlinks can also be of the form <tt>label</tt>[url], in which
-   case the label is used in the displayed text, and <tt>url</tt> is
-   used as the target. If <tt>label</tt> contains multiple words,
-   put it in braces: <em>{multi word label}[</em>url<em>]</em>.
-       
-9. Method parameter lists are extracted and displayed with
-   the method description. If a method calls +yield+, then
-   the parameters passed to yield will also be displayed:
-
-      def fred
-        ...
-        yield line, address
-
-   This will get documented as
-
-      fred() { |line, address| ... }
-
-   You can override this using a comment containing 
-   ':yields: ...' immediately after the method definition
-
-      def fred      # :yields: index, position
-        ...
-        yield line, address
-
-   which will get documented as
-
-       fred() { |index, position| ... }
-
-
-10. ':yields:' is an example of a documentation modifier. These appear
-    immediately after the start of the document element they are modifying.
-    Other modifiers include
-
-    [<tt>:nodoc:</tt><i>[all]</i>]
-         don't include this element in the documentation.  For classes
-         and modules, the methods, aliases, constants, and attributes
-         directly within the affected class or module will also be
-         omitted.  By default, though, modules and classes within that
-         class of module _will_ be documented. This is turned off by
-         adding the +all+ modifier.
-
-              module SM  #:nodoc:
-                class Input
-                end
-              end
-              module Markup #:nodoc: all
-                class Output
-                end
-              end
-
-         In the above code, only class <tt>SM::Input</tt> will be
-         documented.
-
-    [<tt>:doc:</tt>]
-         force a method or attribute to be documented even if it
-         wouldn't otherwise be. Useful if, for example, you want to
-         include documentation of a particular private method.
-
-    [<tt>:notnew:</tt>]
-         only applicable to the +initialize+ instance method. Normally
-         RDoc assumes that the documentation and parameters for
-         #initialize are actually for the ::new method, and so fakes
-         out a ::new for the class. THe :notnew: modifier stops
-         this. Remember that #initialize is protected, so you won't
-         see the documentation unless you use the -a command line
-         option.
-
-
-11. RDoc stops processing comments if it finds a comment
-    line containing '<tt>#--</tt>'. This can be used to 
-    separate external from internal comments, or 
-    to stop a comment being associated with a method, 
-    class, or module. Commenting can be turned back on with
-    a line that starts '<tt>#++</tt>'.
-
-        # Extract the age and calculate the
-        # date-of-birth.
-        #--
-        # FIXME: fails if the birthday falls on
-        # February 29th
-        #++
-        # The DOB is returned as a Time object.
-
-        def get_dob(person)
-           ...
-
-12. Comment blocks can contain other directives:
-
-    [<tt>:section: title</tt>]
-        Starts a new section in the output. The title following
-	<tt>:section:</tt> is used as the section heading, and the
-	remainder of the comment containing the section is used as
-	introductory text. Subsequent methods, aliases, attributes,
-	and classes will be documented in this section. A :section:
-	comment block may have one or more lines before the :section:
-	directive. These will be removed, and any identical lines at
-	the end of the block are also removed. This allows you to add
-	visual cues such as
-
-           # ----------------------------------------
-	   # :section: My Section
-	   # This is the section that I wrote.
-	   # See it glisten in the noon-day sun.
-           # ----------------------------------------
-
-    [<tt>call-seq:</tt>]
-        lines up to the next blank line in the comment are treated as
-        the method's calling sequence, overriding the
-        default parsing of method parameters and yield arguments.
-
-    [<tt>:include:</tt><i>filename</i>] 
-         include the contents of the named file at this point. The
-         file will be searched for in the directories listed by
-         the <tt>--include</tt> option, or in the current
-         directory by default.  The contents of the file will be
-         shifted to have the same indentation as the ':' at the
-         start of the :include: directive.
-
-    [<tt>:title:</tt><i>text</i>]
-         Sets the title for the document. Equivalent to the --title command
-         line parameter. (The command line parameter overrides any :title:
-         directive in the source).
-
-    [<tt>:enddoc:</tt>]
-         Document nothing further at the current level.
-
-    [<tt>:main:</tt><i>name</i>]
-         Equivalent to the --main command line parameter.
-
-    [<tt>:stopdoc: / :startdoc:</tt>]
-         Stop and start adding new documentation elements to the
-         current container. For example, if a class has a number of
-         constants that you don't want to document, put a
-         <tt>:stopdoc:</tt> before the first, and a
-         <tt>:startdoc:</tt> after the last. If you don't specifiy a
-         <tt>:startdoc:</tt> by the end of the container, disables
-         documentation for the entire class or module.
-
-
----
-
-See also markup/simple_markup.rb.
-
-= Other stuff
-
-Author::   Dave Thomas <dave@pragmaticprogrammer.com>
-Requires:: Ruby 1.8.1 or later
-License::  Copyright (c) 2001-2003 Dave Thomas.
-           Released under the same license as Ruby.
-
-== Warranty
-
-This software is provided "as is" and without any express or
-implied warranties, including, without limitation, the implied
-warranties of merchantibility and fitness for a particular
-purpose.
+= Enhanced version of RDoc Fortran 90/95 parser
+
+Here is a patch file to improve
+the RDoc[http://www.ruby-doc.org/stdlib/libdoc/rdoc/rdoc/index.html]
+analysis feature 
+for Fortran 90/95 source codes.
+A patched package of RDoc source is also available. 
+
+== Operation verification 
+
+Operation of the package has been verified with Ruby 1.8.5 and 1.9.0.
+
+--
+== Tutorial
+
+A Japanese tutorial is prepared in 
+{Auto-generation of documents of numerical models by RDoc}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/tutorial/]. 
+English tutorial is not prepared ... (T-T)
+++
+
+== Download
+
+The latest version (Version $Name: rdoc-f95-20090109-1 $)
+
+* {Patch for Ruby 1.8.7-p72}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/rdoc-f95_ruby1.8.7-p72.patch]
+--
+* {Patch for Ruby 1.9.0}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/rdoc-f95_ruby1.9.0.patch]
+++
+
+* {TGZ file of patched RDoc resources}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/rdoc-f95.tgz]
+
+Archives of old versions
+
+* {Patch files, TGZ packages, source code trees (only JAPANESE)}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/arch/SIGEN.htm]
+
+* {Binary packages for Debian GNU/Linux}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/debian]
+
+
+== Installation
+
+You have the following three ways for installation.
+
+=== Installation by applying the patch to original Ruby package
+
+To use the patch file, follow the steps described below:
+
+* Download
+  ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz
+  from {Ruby Home Page}[http://www.ruby-lang.org/].
+
+* Unpack the archive file as
+
+    % tar -zxvf ruby-1.8.7-p72.tar.gz
+
+* Put the patch file (rdoc-f95_ruby1.8.7-p72.patch)
+  in the directory where you executed the tar command 
+  and apply the patch; 
+
+    % patch -p0 < rdoc-f95_ruby1.8.7-p72.patch
+
+* Install RDoc package as written in 
+  {Site of the Ruby}[http://www.ruby-lang.org/].
+
+
+=== Installation by using patched RDoc package
+
+To install the patched RDoc package, 
+follow the steps described below: 
+
+* Download archive file rdoc-f95.tgz
+
+* Unpack:
+
+    % tar -zxvf rdoc-f95.tgz
+
+* Go into the Ruby source directory:
+
+    % cd rdoc-f95-XXXXXXXX
+
+* Install the package:
+
+    % ruby install.rb
+
+<b>If rdoc is already installed, the original rdoc will be overritten</b>.
+
+Use --help option to show options and the directory to which
+rdoc is installed:
+
+  % ruby install.rb --help
+
+=== Installation by using binary packages for Debian GNU/Linux
+
+Add following URL to sources.list of APT (/etc/apt/sources.list).
+You can use "ftp" protocol instead of "http".
+
+  deb http://www.gfd-dennou.org/library/cc-env/Linux/debian-dennou etch/
+
+Install by APT commands.
+
+  % apt-get update
+  % apt-get install rdoc-f95
+
+This "rdoc-f95" package disables original "rdoc" package
+because "rdoc-f95" moves files of "rdoc" to diverted location.
+If you want to use original "rdoc" package, please remove "rdoc-f95".
+Then files of original "rdoc" package will be returned to proper location.
+
+Following suggested packages enable you to use "diagram" and
+"mathml" options (see below).
+
+  % apt-get install graphviz libmathml-ruby
+
+
+== Usage
+
+Set the environment variable *PATH* to include
+the directory where the execution program is installed, 
+and *RUBYLIB* to include the directory 
+where the libraries are installed.
+
+Move to a directory where your Fortran 90/95 files exist, 
+and execute the following command.  HTML documents will be generated in
+*doc* directory.
+
+  % rdoc -U --ignore-case --inline-source
+
+Files ending <tt>.f90</tt>, <tt>.F90</tt>, <tt>.f95</tt>, <tt>.F95</tt>
+are parsed as Fortran 90/95 programs.
+All Fortran 90/95 programs in subdirectories are parsed recursively.
+
+Just as in the original RDoc, files ending with <tt>.rb</tt> and <tt>.rbw</tt>
+are parsed as Ruby programs and files ending with <tt>.c</tt>, <tt>.cc</tt>,
+<tt>.cpp</tt>, <tt>.CC</tt>, <tt>.cxx</tt> are parsed as C programs.
+
+With the option <tt>--op</tt>,  
+the directory where HTML documents are generated can be changed.
+<tt>--title</tt> option sets title of HTML documents.
+When <tt>--all</tt> option is used, 
+private subroutines, functions etc. in
+Fortran 90/95 programs are shown in HTML documents (for developers).
+If files or directories are specified as arguments (for example,
+"<tt>src/*.f90</tt>" or "<tt>test/</tt>"), the particular files
+are parsed.
+In the following example, files with suffix "<tt>.f90</tt>" in a
+directory "<tt>src/</tt>" and files in a directory "<tt>test/</tt>"
+are parsed.
+
+  % rdoc -U --ignore-case --inline-source  \
+         --op rdoc --title "RDoc documentations" src/*.f90 test/
+
+Alternatively, you can parse only a part of files by creating a
+"<tt>.document</tt>" file and writing names of the files and the
+directories to the file.
+
+For more information, 
+see {README of original RDoc}[link:files/README_org.html].
+
+
+== Rules for RDoc Document
+
+Refer to <b>parsers/parse_f95.rb</b> which
+explains parsed information, way of looking at documents,
+the format of comment blocks in Fortran 90/95 source code.
+If you use "--mathml" option (see below),
+refer to <b>RDoc::Markup::ToXHtmlTexParser</b>, too.
+For general information, see
+{README of original RDoc}[link:files/README_org.html] .
+
+== Samples
+
+* {Code reference of gtool5 library that is a Fortran 90/95 library for numerical models for geophysical fluid (only JAPANESE)}[http://www.gfd-dennou.org/library/gtool/gtool5/gtool5_current/doc/develop_reference/]
+
+* {Code reference of planetary atmospheric general circulation model DCPAM}[http://www.gfd-dennou.org/library/dcpam/dcpam5/dcpam5_current/doc/code_reference/xml]
+
+== Differences from original RDoc
+
+This patch has been created for enhancing the Fortran 90/95 parser of RDoc .
+{The Fortran 90/95 parse script parse_f95.rb}[http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/rdoc/parser/f95.rb] 
+is mainly modified, and other programs are also improved.
+
+
+The original RDoc has been developed by Dave Thomas and is now
+maintained by Ryan Davis and Eric Hodel, etc. .
+The RDoc is available from the Ruby source code repository.
+See {Ruby Repository Guide}[http://www.ruby-lang.org/en/news/2006/12/22/cvs-repository-moved-to-svn/].
+For more information about RDoc, see
+{README of original RDoc}[link:files/README_org.html] or
+{RubyForge: rdoc Project}[http://rubyforge.org/projects/rdoc]
+
+Differences to the original one are given below.
+Note that some differences were lost because
+this patch (2005/12/17 version) has been already included into
+the original RDoc package.
+
+--
+#<b>Enhancement of an analytical performance of Fortran 90/95 source codes</b> ::
+#    See parsers/parse_f95.rb for details.
+
+#<b>Modification of format of comment blocks</b> ::
+#    See parsers/parse_f95.rb for details.
+++
+
+<b>Addition of <tt>--ignore-case</tt> option </b> ::
+    In the Fortran 90/95 Standard,  
+    upper case letters are not distinguished from lower case letters, 
+    although original RDoc produces case-dependently 
+    cross-references of Class and  Methods.
+    When this options is specified, 
+    upper cases are not distinguished from lower cases.
+
+<b>Cross-reference of file names</b> ::
+    Cross-reference of file names is available as well as
+    modules, subroutines, and so on.
+
+<b>Modification of <tt>--style</tt> option</b> ::
+    Original RDoc can not treat relative path stylesheet.
+    Application of this patch modifies this function.
+
+<b>Conversion of TeX formula into MathML</b>::
+    TeX formula can be converted into MathML format
+    with --mathml option, 
+    if <b>MathML library for Ruby version 0.6b -- 0.8</b> is installed.
+    This library is available from {Bottega of Hiraku (only JAPANESE)}[http://www.hinet.mydns.jp/~hiraku/].
+    See <b>RDoc::Markup::ToXHtmlTexParser</b> about format.
+
+    <b>*** Caution ***</b>
+    Documents generated with "--mathml" option are not displayed correctly
+    according to browser and/or its setting.
+    We have been confirmed that 
+    documents generated with "--mathml" option are displayed correctly
+    with {Mozilla Firefox}[http://www.mozilla.org/products/firefox/]
+    and Internet Explorer
+    (+ {MathPlayer}[http://www.dessci.com/en/products/mathplayer/]).
+    See {MathML Software - Browsers}[http://www.w3.org/Math/Software/mathml_software_cat_browsers.html]
+    for other browsers.
+
+Some formats of comments in HTML document are changed
+to improve the analysis features.
+See <b>parsers/parse_f95.rb</b> for details.
+
+
+== Remarks on usage
+
+The enhanced version of the RDoc Fortran 90/95 parser
+has been constructed on the premise of
+educational and academic usages only. 
+For these uses, usage and modification of the resources
+withiout notification to the authors is permitted.
+Licence of the enhanced version of RDoc Fortran 90/95 parser 
+conforms to that of original RDoc.
+See {README of original RDoc}[link:files/README_org.html] .
+
+When you publish your scientific/technological works
+using the enhanced version of RDoc Fortran 90/95 parser, 
+we will be very glad if you cite our resources 
+in the following way:
+
+  GFD Dennou Club dcmodel project, 2008:
+  http://www.gfd-dennou.org/library/dcmodel/, GFD Dennou Club.
+
+== Contact
+
+To contact us, please send an email to link:../rdoc-f95-mailto.png .
+
+== References
+
+* {Yasuhiro MORIKAWA, Masaki ISHIWATARI, Takeshi HORINOUCHI,
+  Masatsugu ODAKA, Yoshi-Yuki HAYASHI, 2007:
+  Document generation for numerical models by RDoc. 
+  Tenki, <b>54</b>, 185--190.}[http://s-ws.net/tenki/cont/54_02/co.html]
+  (only JAPANESE)
+
+--
+== Presentations
+++
+
+
+== History
+
+==== 2009/01/09
+
+* Ruby version of a patch file is updated to 1.8.7-p72.
+* "Samples" are updated. 
+
+==== 2008/03/16
+
+* Tutorial is created (only JAPANESE)
+
+==== 2008/03/08
+
+* Ruby version 1.9.0 is supported. 
+
+* MathML library for Ruby version 0.8 is supported.
+
+* References and presentations are added to README. 
+  An example of citation is changed. 
+
+==== 2007/03/09
+
+* A bug that RiWriter can not operate in Ruby 1.8 is fixed.
+
+==== 2007/02/27
+
+* README and README.ja are modified due to movement of Ruby source code
+  Repository from CVS to SVN.
+
+==== 2007/01/12
+
+* A bug that Fortran 90/95 source code like
+  "FUNCTION Get_Platform() RESULT(platform)" is converted to
+  "Get_Platform( platform ) result(platform)" is fixed.
+  (by the advice from Hani Andreas Ibrahim).
+
+==== 2007/01/09
+
+* <b>Generators::TexParser</b> is modified.
+
+==== 2007/01/05
+
+* Contact address is changed.
+* Ruby version of a patch file is updated to 1.8.5-p12.
+* Document "Usage of \newcommand and \newenvironment" is added in
+  <b>Generators::TexParser</b>.
+* Document "Cross-reference of defined operators and defined
+  assignments" is added in <b>parsers/parse_f95.rb</b>.
+* Document "The sequence of displayed entities" in
+  <b>parsers/parse_f95.rb</b> is modified.
+* A bug that '--ignore-case' option is invalid partly is fixed.
+
+==== 2006/12/15
+
+* Ruby version of a patch file is updated to 1.8.5-p2
+
+==== 2006/12/13
+
+* The sequence of displayed entities can be ordered manually by
+  the comment like "!:doc-priority 100:".
+
+==== 2006/11/20
+
+* Description about ".docuemnt" file is added.
+* Some subprograms which have different names in one interface block
+  are parsed correctly.
+* Import updates of RDoc in original Ruby CVS.
+
+==== 2006/11/16
+
+* Generators::TexParser is modified/
+  * A way to write equations across multiple lines is described in document.
+  * The format of CVS keywords, that is "$ID: ... $" or
+    "$LOG: ... $ etc. is ignored.
+* All methods added to "code_object.rb" for "parse_f95.rb" are moved
+  to "parse_f95.rb". Therefore "parse_f95.rb" works alone in Ruby
+  1.8.5 .
+
+==== 2006/11/14
+
+* Ruby version of a patch file is updated to 1.8.5
+* Patch filename is changed.
+* Debian GNU/Linux binary packages are modified.
+* XHTML version of documents is changed from "XHTML 1.0 Transitional"
+  to "XHTML 1.1 plus MathML 2.0".
+* Interpreter of continuous lines is modified.
+* Import updates of RDoc in original Ruby CVS.
+* English is corrected with comments of Dr. Geiger (Institute for
+  Plasma Physics)
+* File names beginning "../" are parsed correctly.
+* A version of MathML library for Ruby is changed from 0.5 to 0.6b.
+* Syntax error with MathML library for Ruby is avoided.
+
+==== 2006/08/15
+
+* Description about installation with binary packages for Debian GNU/Linux
+  is modified.
+* Bugs about parsing comments of NAMELIST is modified.
+
+==== 2006/08/14
+
+* Package name is changed as "rdoc-f95" from "rdoc-dennou".
+* Address is changed as
+  http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/
+* README and README.ja are modified.
+* Conversion of TeX formula into MathML is enable.
+* Modification of --style option.
+* Main programs are added to 'Methods' too.
+* The NAMELIST group names scattered in each file are collected on one page.
+* Names of modules provided by F90 files are added to documents of the files
+  automatically.
+
+
+==== 2006/02/24
+
+* English version of README is created.
+
+==== 2006/01/18
+* Comment formats for arguments of subroutines and functions 
+  are slightly modified.
+
+  * A space is inserted below the argument described in HTML document.
+
+* Patched package is rebulid with
+  updated Ruby resources in CVS repository.
+
+==== 2005/12/28
+* Patch file for ruby 1.8.4 is released.
+
+==== 2005/12/17
+
+* Some bugs are fixed.
+* Parsing external subroutines specified interface are improved.
+* Handling of Continuation lines are improved.
+
+==== 2005/12/13
+
+* Remarks and Todo are added in parsers/parse_f95.rb 
+* Sample is added in README
+* Parsing part of  public, private statements
+  are improved. 
+
+==== 2005/12/08
+
+* "Remarks in use" and "Contact" are added in README .
+* Address is changed as 
+  http://www.gfd-dennou.org/library/dcmodel/rdoc-dennou/
+
+==== 2005/11/28
+
+* ":nodoc:" tag are available.
+* Parsing "contains" in subroutines and functions are improved.
+* Title is changed.
+* Old version of the patches are placed in web page.
+
+==== 2005/11/17
+
+* Improvement of analysis features, checking HTML documents 
+  which are produced by RDoc.
+  release of preliminary version.
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/README.ja ../rdoc-f95-20090109-1/README.ja
--- ruby-1.8.7-p72/lib/rdoc/README.ja	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/README.ja	2009-01-09 20:41:56.000000000 +0900
@@ -0,0 +1,503 @@
+(Japanese | {English}[link:files/README.html])
+
+= RDoc Fortran 90/95 ¥½¡¼¥¹¥³¡¼¥É²òÀÏµ¡Ç½¶¯²½ÈÇ
+
+{RDoc - Ruby Documentation System}[http://www.ruby-doc.org/stdlib/libdoc/rdoc/rdoc/index.html]
+¤Î Fortran 90/95 ¥½¡¼¥¹¥³¡¼¥É²òÀÏµ¡Ç½¤ò¶¯²½¤¹¤ë¤¿¤á¤Î¥Ñ¥Ã¥Á¤ò
+ÇÛÉÛ¤·¤Æ¤¤¤Þ¤¹. ¥Ñ¥Ã¥Á¤òÅ¬ÍÑ¤·¤¿¥Ñ¥Ã¥±¡¼¥¸¤âÇÛÉÛ¤·¤Æ¤¤¤Þ¤¹.
+
+== Æ°ºî³ÎÇ§
+
+¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ï Ruby 1.8.5 ¤ª¤è¤Ó 1.9.0 ¤Ç¤ÎÆ°ºî¤ò³ÎÇ§¤·¤Æ¤¤¤Þ¤¹.
+
+== ¥Á¥å¡¼¥È¥ê¥¢¥ë
+
+¥¤¥ó¥¹¥È¡¼¥ë¤Ë»Ï¤Þ¤ê, 
+¼ÂºÝ¤Ë Fortran 90/95 ¥½¡¼¥¹¥³¡¼¥É¤òºîÀ®¤·¤Æ
+¥É¥­¥å¥á¥ó¥È²½¤¹¤ë¤Þ¤Ç¤Î¥¬¥¤¥À¥ó¥¹¤È¤·¤Æ,
+¥Á¥å¡¼¥È¥ê¥¢¥ë 
+<b>{RDoc ¤Ë¤è¤ë¿ôÃÍ¥â¥Ç¥ë¤Î¼«Æ°¥É¥­¥å¥á¥ó¥ÈÀ¸À®}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/tutorial/] </b>
+¤òÍÑ°Õ¤·¤Æ¤¤¤Þ¤¹. 
+
+== ¥À¥¦¥ó¥í¡¼¥É
+
+ºÇ¿·ÈÇ (¥Ð¡¼¥¸¥ç¥ó $Name: rdoc-f95-20090109-1 $)
+
+* {Ruby 1.8.7-p72 ÍÑ¤Î¥Ñ¥Ã¥Á}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/rdoc-f95_ruby1.8.7-p72.patch]
+--
+* {Ruby 1.9.0 ÍÑ¤Î¥Ñ¥Ã¥Á}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/rdoc-f95_ruby1.9.0.patch]
+++
+
+* {rdoc-f95 tar.gz ¥Ñ¥Ã¥±¡¼¥¸ (Ruby 1.8.7-p72 ¤Î rdoc ¤ÎÉôÊ¬¤ò¼è¤ê½Ð¤·, ¾åµ­¥Ñ¥Ã¥Á¤òÅ¬ÍÑ¤·¤Æ tar ¥Ü¡¼¥ë¤Ë¤·¤¿¤â¤Î)}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/rdoc-f95.tgz]
+
+²áµî¤Î¥¢¡¼¥«¥¤¥Ö
+
+* {¥Ñ¥Ã¥Á ¡¦ TGZ ¥Ñ¥Ã¥±¡¼¥¸ ¡¦ ¥½¡¼¥¹¥Ä¥ê¡¼¤Î¥ê¥¹¥È}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/arch/SIGEN.htm]
+
+* {Debian GNU/Linux ÍÑ¥Ð¥¤¥Ê¥ê¥Ñ¥Ã¥±¡¼¥¸}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/debian]
+
+== ¥¤¥ó¥¹¥È¡¼¥ë
+
+¥¤¥ó¥¹¥È¡¼¥ë¤Ë¤Ï°Ê²¼¤Î 3 ¤Ä¤ÎÊýË¡¤¬¤¢¤ê¤Þ¤¹.
+
+=== ¥Ñ¥Ã¥Á¥Õ¥¡¥¤¥ë¤òÍøÍÑ¤¹¤ëÊýË¡
+
+¥Ñ¥Ã¥Á¥Õ¥¡¥¤¥ë¤ò Ruby ¤Î¥ª¥ê¥¸¥Ê¥ë»ñ¸»¤ËÅ¬ÍÑ¤¹¤ë¼ê½ç¤Ï
+°Ê²¼¤ÎÄÌ¤ê¤Ç¤¹.
+
+* ¤Þ¤º, {Ruby ¤Î¥Û¡¼¥à¥Ú¡¼¥¸}[http://www.ruby-lang.org/] ¤«¤é
+  ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz
+  ¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤
+
+* ¾åµ­ TGZ ¥Õ¥¡¥¤¥ë¤òÅ¸³«¤·¤Æ¤¯¤À¤µ¤¤.
+
+    % tar -zxvf ruby-1.8.7-p72.tar.gz
+
+* ¤³¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ë¾åµ­¤Î¥Ñ¥Ã¥Á¥Õ¥¡¥¤¥ë
+  rdoc-f95_ruby1.8.7-p72.patch ¤òÃÖ¤­, °Ê²¼¤Î¥³¥Þ¥ó¥É¤Ç¥Ñ¥Ã¥Á¤ò
+  Å¬ÍÑ¤·¤Æ¤¯¤À¤µ¤¤.
+
+    % patch -p0 < rdoc-f95_ruby1.8.7-p72.patch
+
+* ¥Ñ¥Ã¥Á¤òÅ¬ÍÑ¤·¤¿¸å¤Ë, Ruby ¤Î¥¤¥ó¥¹¥È¡¼¥ëºî¶È¤ò¹Ô¤Ã¤Æ¤¯¤À¤µ¤¤.
+  Ruby ¤Î¥¤¥ó¥¹¥È¡¼¥ëÊýË¡¤Ï
+  {¥ª¥Ö¥¸¥§¥¯¥È»Ø¸þ¥¹¥¯¥ê¥×¥È¸À¸ì Ruby ¤Î¥Û¡¼¥à¥Ú¡¼¥¸}[http://www.ruby-lang.org/]
+  ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤.
+
+=== ¥Ñ¥Ã¥Á¤¬Å¬ÍÑ¤µ¤ì¤¿¥Ñ¥Ã¥±¡¼¥¸¤òÍøÍÑ¤¹¤ëÊýË¡
+
+¥Ñ¥Ã¥Á¤¬Å¬ÍÑ¤µ¤ì¤¿ rdoc-f95.tgz ¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍÑ¤¹¤ë¤Ë¤Ï
+°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹.
+
+¥¢¡¼¥«¥¤¥Ö¥Õ¥¡¥¤¥ë rdoc-f95.tgz ¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤¿¸å¤Ë, 
+°Ê²¼¤Î¤è¤¦¤Ë tar ¥³¥Þ¥ó¥É¤ÇÅ¸³«¸å,
+Å¸³«¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ë°ÜÆ°¤·, 
+install.rb ¤Ç¥¤¥ó¥¹¥È¡¼¥ë¤ò¹Ô¤Ã¤Æ¤¯¤À¤µ¤¤. 
+<b>´û¤Ë rdoc ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¾ì¹ç, ¾å½ñ¤­¤¹¤ë²ÄÇ½À­¤¬¤¢¤ê¤Þ¤¹</b>.
+
+  % tar -zxvf rdoc-f95.tgz
+  % cd rdoc-f95-XXXXXXXX
+  % ruby install.rb
+
+¥¤¥ó¥¹¥È¡¼¥ëÀè¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ä, ÊÑ¹¹¤Î¤¿¤á¤Î¥ª¥×¥·¥ç¥ó¤Ë´Ø¤·¤Æ¤Ï,
+°Ê²¼¤Î¥³¥Þ¥ó¥É¤ÇÃÎ¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹.
+
+  % ruby install.rb --help
+
+=== Debian GNU/Linux ÍÑ¥Ð¥¤¥Ê¥ê¥Ñ¥Ã¥±¡¼¥¸¤òÍøÍÑ¤¹¤ëÊýË¡
+
+°Ê²¼¤Î URL ¤ò APT ¤Î¥½¡¼¥¹¥ê¥¹¥È (/etc/apt/sources.list) ¤Ë²Ã¤¨¤Þ¤¹.
+¥×¥í¥È¥³¥ë¤È¤·¤Æ http ¤ÎÂå¤ï¤ê¤Ë ftp ¤òÍÑ¤¤¤ë¤³¤È¤â²ÄÇ½¤Ç¤¹.
+
+  deb http://www.gfd-dennou.org/library/cc-env/Linux/debian-dennou etch/
+
+APT ¤Î¥³¥Þ¥ó¥É¤Ç¥¤¥ó¥¹¥È¡¼¥ë¤ò¹Ô¤Ê¤¤¤Þ¤¹.
+
+  % apt-get update
+  % apt-get install rdoc-f95
+
+¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ï¥ª¥ê¥¸¥Ê¥ë¤Î rdoc ¥Ñ¥Ã¥±¡¼¥¸¤Î¥Õ¥¡¥¤¥ë·²¤òÂàÈò¤·¤¿¾ì½ê
+¤Ø°ÜÆ°¤µ¤»¤ë¤¿¤á, ¥ª¥ê¥¸¥Ê¥ë¤Î rdoc ¥Ñ¥Ã¥±¡¼¥¸¤¬»ÈÍÑ¤Ç¤­¤Ê¤¯¤Ê¤ê¤Þ¤¹.
+¥ª¥ê¥¸¥Ê¥ë¤Î rdoc ¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍÑ¤¹¤ë¾ì¹ç¤Ï rdoc-f95
+¥Ñ¥Ã¥±¡¼¥¸¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤. ÂàÈò¤µ¤ì¤¿¥ª¥ê¥¸¥Ê¥ë¤Î rdoc ¥Ñ¥Ã¥±¡¼¥¸¤Î
+¥Õ¥¡¥¤¥ë·²¤¬ËÜÍè¤Î¾ì½ê¤ËÉüµ¢¤·¤Þ¤¹.
+
+°Ê²¼¤ÎÄó°Æ¥Ñ¥Ã¥±¡¼¥¸¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤ª¤¯¤È,
+diagram ¥ª¥×¥·¥ç¥ó¤ä mathml ¥ª¥×¥·¥ç¥ó (²¼µ­»²¾È) ¤¬»ÈÍÑ²ÄÇ½¤Ë¤Ê¤ê¤Þ¤¹.
+
+  % apt-get install graphviz libmathml-ruby
+
+
+== RDoc ¤Î»ÈÍÑÊýË¡
+
+¼Â¹Ô¥×¥í¥°¥é¥à¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¾ì½ê¤ò´Ä¶­ÊÑ¿ô *PATH*
+¤ËÀßÄê¤·, ¥é¥¤¥Ö¥é¥ê¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¾ì½ê¤ò´Ä¶­ÊÑ¿ô *RUBYLIB*
+¤ËÀßÄê¤·¤Æ¤¯¤À¤µ¤¤.
+
+Fortran 90/95 ¥Õ¥¡¥¤¥ë¤¬ÃÖ¤¤¤Æ¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Þ¤Ç°ÜÆ°¤·, °Ê²¼¤Î¥³¥Þ¥ó¥É¤ò
+¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤. *doc* ¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Ë¥É¥­¥å¥á¥ó¥È¤¬ºîÀ®¤µ¤ì¤Þ¤¹.
+
+  % rdoc -U --ignore-case --charset euc-jp --inline-source
+
+³ÈÄ¥»Ò¤¬ <tt>.f90</tt>, <tt>.F90</tt>, <tt>.f95</tt>, <tt>.F95</tt>
+¤Ç¤¢¤ë¥Õ¥¡¥¤¥ë¤Ï Fortran 90/95 ¥×¥í¥°¥é¥à¤È¤·¤Æ²òÀÏ¤µ¤ì¤Þ¤¹.
+¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤ÎÁ´¤Æ¤Î Fortran 90/95 ¥×¥í¥°¥é¥à¤â²òÀÏ¤µ¤ì¤Þ¤¹.
+
+¤Ê¤ª, ¥ª¥ê¥¸¥Ê¥ë¤Î RDoc ¤ÈÆ±ÍÍ, ³ÈÄ¥»Ò¤¬ <tt>.rb</tt>,
+<tt>.rbw</tt> ¤Ç¤¢¤ë¥Õ¥¡¥¤¥ë¤Ï Ruby ¥×¥í¥°¥é¥à¤È¤·¤Æ, ³ÈÄ¥»Ò¤¬ 
+<tt>.c</tt>, <tt>.cc</tt>, <tt>.cpp</tt>, <tt>.CC</tt>, <tt>.cxx</tt> 
+¤Ç¤¢¤ë¥Õ¥¡¥¤¥ë¤Ï C ¥×¥í¥°¥é¥à¤È¤·¤Æ²òÀÏ¤µ¤ì¤Þ¤¹.
+
+*doc* ¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Ë½ÐÎÏ¤·¤¿¤¤¾ì¹ç¤Ï, 
+<tt>--op</tt> ¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤Æ¤¯¤À¤µ¤¤. 
+¥¿¥¤¥È¥ë¤Ï
+<tt>--title</tt> ¥ª¥×¥·¥ç¥ó¤ÇÊÑ¹¹¤Ç¤­¤Þ¤¹.
+¤Þ¤¿, ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï Fortran 90/95 ¤Î private Â°À­¤Î¥µ¥Ö¥ë¡¼¥Á¥ó¤ä´Ø¿ô
+¤Ê¤É¤Ï¥É¥­¥å¥á¥ó¥È¤Ë½ÐÎÏ¤µ¤ì¤Þ¤»¤ó¤¬, <tt>--all</tt> ¥ª¥×¥·¥ç¥ó¤ò
+¤Ä¤±¤ë¤³¤È¤Ç, Á´¤Æ¤¬¥É¥­¥å¥á¥ó¥È¤Ë½ÐÎÏ¤µ¤ì¤Þ¤¹.
+<tt>--charset</tt>¥ª¥×¥·¥ç¥ó¤Ï, ¥É¥­¥å¥á¥ó¥È¤ËÈ¿±Ç¤µ¤ì¤ë¥³¥á¥ó¥È¤Ë
+ÆüËÜ¸ì¤Ê¤É 2 ¥Ð¥¤¥ÈÊ¸»ú¤¬´Þ¤Þ¤ì¤ë¾ì¹ç¤ËÍÑ¤¤¤Þ¤¹.
+¥³¥á¥ó¥È¤ÎÊ¸»ú¥³¡¼¥É¤Ë¹ç¤ï¤», <tt>euc-jp</tt>, <tt>Shift_JIS</tt>,
+<tt>iso-2022-jp</tt> ¤Ê¤É¤ò»ØÄê¤·¤Æ¤¯¤À¤µ¤¤.
+
+°ìÉô¤Î¥Õ¥¡¥¤¥ë¤Î¤ß¤ò
+¥É¥­¥å¥á¥ó¥È²½¤·¤¿¤¤¾ì¹ç¤Ï, °ú¿ô¤Ë <tt>src/*.f90</tt> ¤Ê¤É¤È
+¥Õ¥¡¥¤¥ëÌ¾¤ä¥Ç¥£¥ì¥¯¥È¥êÌ¾¤òÌÀ¼¨Åª¤Ë»ØÄê¤·¤Æ¤¯¤À¤µ¤¤.
+°Ê²¼¤ÎÎã¤Ç¤Ï, "<tt>src/</tt>" °Ê²¼¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÂ¸ºß¤¹¤ë
+³ÈÄ¥»Ò "<tt>.f90</tt>" ¤Î¥Õ¥¡¥¤¥ë¤È,
+"<tt>test</tt>" ¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤¬¥É¥­¥å¥á¥ó¥È²½¤µ¤ì¤Þ¤¹.
+
+  % rdoc -U --ignore-case --charset euc-jp --inline-source  \
+         --op rdoc --title "RDoc documentations" src/*.f90 test/
+
+¤³¤ÎÊýË¡°Ê³°¤Ë¤â, "<tt>.document</tt>" ¥Õ¥¡¥¤¥ë¤òºîÀ®¤·, ¤½¤ÎÃæ¤Ë
+¥Õ¥¡¥¤¥ëÌ¾¤ä¥Ç¥£¥ì¥¯¥È¥êÌ¾¤òµ­½Ò¤·¤Æ¤ª¤¯¤³¤È¤Ç¥É¥­¥å¥á¥ó¥È²½¤¹¤ë
+¥Õ¥¡¥¤¥ë¤ò¸ÂÄê¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹.
+
+¾Ü¤·¤¤¤³¤È¤Ï
+{RDoc ¥ª¥ê¥¸¥Ê¥ë¤Î README}[link:files/README_org.html] 
+¤ò»²¾È¤¯¤À¤µ¤¤.
+
+
+== ½ñË¡
+
+²òÀÏ¤µ¤ì¤ë¾ðÊó¤ä¥É¥­¥å¥á¥ó¥È¤Î¸«Êý, ¥³¥á¥ó¥ÈÉô¤Î½ñ¤­Êý¤Ë´Ø¤·¤Æ¤Ï,
+<b>parsers/parse_f95.rb</b> ¤ò»²¾È¤¯¤À¤µ¤¤. --mathml ¥ª¥×¥·¥ç¥ó (²¼µ­»²¾È)
+¤ò»ÈÍÑ¤¹¤ë¾ì¹ç¤Ë¤Ï, <b>RDoc::Markup::ToXHtmlTexParser</b> ¤â»²¾È¤¯¤À¤µ¤¤.
+¤¿¤À¤·, ¤³¤ì¤é¤Ëµ­½Ò¤µ¤ì¤ë¤Î¤Ï Fortran 90/95 ¤Ê¤É¤ËÆÃÍ­¤ÊÉôÊ¬¤Ê¤Î¤Ç,
+°ìÈÌÅª¤ÊÉôÊ¬¤Ë´Ø¤·¤Æ¤Ï
+{RDoc ¥ª¥ê¥¸¥Ê¥ë¤Î README}[link:files/README_org.html] 
+¤ò»²¾È¤¯¤À¤µ¤¤.
+ÂçÎÓ¤µ¤ó¤Ë¤è¤ëÆüËÜ¸ìÌõ¤¬ http://www.kmc.gr.jp/~ohai/rdoc.ja.html ¤Ë¤¢¤ê¤Þ¤¹.
+
+== ¥µ¥ó¥×¥ë
+
+* {ÃÏµåÎ®ÂÎ¿ôÃÍ¥â¥Ç¥ë¤Î¤¿¤á¤Î Fortran 90/95 ¥é¥¤¥Ö¥é¥ê gtool5 ¤Î¥³¡¼¥É¥ê¥Õ¥¡¥ì¥ó¥¹}[http://www.gfd-dennou.org/library/gtool/gtool5/gtool5_current/doc/develop_reference/]
+
+* {ÏÇÀ±Âçµ¤Âç½Û´Ä¥â¥Ç¥ë dcpam5 ¤Î¥³¡¼¥É¥ê¥Õ¥¡¥ì¥ó¥¹}[http://www.gfd-dennou.org/library/dcpam/dcpam5/dcpam5_current/doc/code_reference/xml]
+
+
+== ¥ª¥ê¥¸¥Ê¥ë¤Î RDoc ¤È¤Î°ã¤¤
+
+¤³¤³¤ÇÇÛÉÛ¤¹¤ë¥Ñ¥Ã¥Á¤Ï, RDoc ¤Î Fortran 90/95 ¥½¡¼¥¹¥³¡¼¥É¤Î
+²òÀÏÇ½ÎÏ¤òÂçÉý¤Ë¸þ¾å¤µ¤», Fortran 90/95 ¥×¥í¥°¥é¥à¤«¤é
+¼«Æ°À¸À®¤µ¤ì¤ë¥É¥­¥å¥á¥ó¥È¤Î¾ðÊóÎÌ¤ò½¼¼Â¤µ¤»¤Þ¤¹.
+¼ç¤Ë²þÎÉ¤µ¤ì¤Æ¤¤¤ë¤Î¤Ï, ¸µ¡¹¤Î RDoc ¤ËÉÕÂ°¤µ¤ì¤ë
+{Fortran 90/95 ²òÀÏ¥×¥í¥°¥é¥à parse_f95.rb}[http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/rdoc/parser/f95.rb]
+¤Ç¤¹¤¬, Â¾¤Î¤¤¤¯¤Ä¤«¤Î¥×¥í¥°¥é¥à¤Ë¤â²þÎÉ¤ò»Ü¤·¤Æ¤¤¤Þ¤¹.
+
+¥ª¥ê¥¸¥Ê¥ë¤Î RDoc ¤Ï Dave Thomas »á¤Ë¤è¤Ã¤Æ³«È¯¤µ¤ì, 
+¸½ºß¤Ç¤Ï Ryan Davis »á, Eric Hodel »á¤é¤Ë¤è¤Ã¤Æ¥á¥ó¥Æ¥Ê¥ó¥¹¤µ¤ì¤Æ¤¤¤Þ¤¹.
+¥ª¥ê¥¸¥Ê¥ë¤Î RDoc ¤Ï Ruby ¤Î¥½¡¼¥¹¥³¡¼¥É¥ì¥Ý¥¸¥È¥ê
+¤è¤ê¼èÆÀ¤Ç¤­¤Þ¤¹.
+{Ruby ¥ì¥Ý¥¸¥È¥ê¥¬¥¤¥É}[http://www.ruby-lang.org/ja/documentation/repository-guide] ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤.
+¥ª¥ê¥¸¥Ê¥ë¤Î RDoc ¤Ë´Ø¤·¤Æ¤Ï
+{RDoc ¥ª¥ê¥¸¥Ê¥ë¤Î README}[link:files/README_org.html]
+¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤.
+
+
+¥ª¥ê¥¸¥Ê¥ë¤«¤é¤ÎÊÑ¹¹ÅÀ¤Î¼ç¤Ê¤â¤Î¤Ï°Ê²¼¤ÎÄÌ¤ê¤Ç¤¹.
+¤Ê¤ª, ´û¤Ë¤³¤Î¥Ñ¥Ã¥Á (2005/12/17 ¥Ð¡¼¥¸¥ç¥ó) ¤Ï
+Ruby ËÜ²È¤Î¥½¡¼¥¹¥³¡¼¥É¥ì¥Ý¥¸¥È¥ê¤Ø¤È¥Õ¥£¡¼¥É¥Ð¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¤Î¤Ç,
+°ìÉô¤Ï´û¤Ë¡Ö¥ª¥ê¥¸¥Ê¥ë¤È¤ÎÊÑ¹¹ÅÀ¡×
+¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤.
+
+<b><tt>--ignore-case</tt> ¥ª¥×¥·¥ç¥ó¤ÎÄÉ²Ã</b> ::
+    Fortran 90/95 µ¬³Ê¤Ç¤ÏÂçÊ¸»ú¾®Ê¸»ú¤Î¶èÊÌ¤Ï¤¢¤ê¤Þ¤»¤ó.
+    ¤³¤ì¤ËÂÐ¤·¤Æ, ¥ª¥ê¥¸¥Ê¥ë¤Î RDoc ¤Ï¥¯¥é¥¹Ì¾¤ä¥á¥½¥Ã¥ÉÌ¾¤Î
+    ¥¯¥í¥¹¥ê¥Õ¥¡¥ì¥ó¥¹¤ÎºÝ¤ËÂçÊ¸»ú¾®Ê¸»ú¤ò¶èÊÌ¤·¤Þ¤¹. 
+    ¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍ¿¤¨¤ë¤³¤È¤Ë¤è¤ê,
+    ¤½¤Î¶èÊÌ¤ò¹Ô¤ï¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤¹.
+
+<b>¥Õ¥¡¥¤¥ë¤Î¥¯¥í¥¹¥ê¥Õ¥¡¥ì¥ó¥¹</b> ::
+    ¥¯¥é¥¹¤ä¥â¥¸¥å¡¼¥ë, ¥á¥½¥Ã¥É¤ÈÆ±ÍÍ¤Ë, ¥Õ¥¡¥¤¥ëÌ¾¤Ë´Ø¤·¤Æ¤â
+    ¥¯¥í¥¹¥ê¥Õ¥¡¥ì¥ó¥¹¤ò²ÄÇ½¤Ë¤·¤Þ¤·¤¿.
+
+<b><tt>--style</tt> ¥ª¥×¥·¥ç¥ó¤Î²þÎÉ</b> ::
+    ¥ª¥ê¥¸¥Ê¥ë¤Î RDoc ¤Ç¤Ï, ÁêÂÐ¥Ñ¥¹¤Ç¥¹¥¿¥¤¥ë¥·¡¼¥È¤ò»ØÄê¤·¤¿¾ì¹ç,
+    ³Æ¥É¥­¥å¥á¥ó¥È¤Î¥¹¥¿¥¤¥ë¥·¡¼¥È¤Ø¤Î¥Ñ¥¹¤¬Àµ¤·¤¯ÀßÄê¤µ¤ì¤Þ¤»¤ó.
+    ¤³¤Î¥Ñ¥Ã¥Á¤òÅ¬ÍÑ¤¹¤ë¤³¤È¤Ç, Àµ¤·¤¯ÀßÄê¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹.
+
+<b>TeX ¤Ç½ñ¤«¤ì¤¿¿ô¼°¤Î MathML ¤Ø¤ÎÊÑ´¹</b> ::
+    {¤Ò¤é¤¯¤Î¹©Ë¼}[http://www.hinet.mydns.jp/~hiraku/]
+    ¤Ë¤Æ¸ø³«¤µ¤ì¤Æ¤¤¤ë
+    <b>Ruby ÍÑ MathML ¥é¥¤¥Ö¥é¥ê¤Î¥Ð¡¼¥¸¥ç¥ó 0.6b ¡Á 0.8</b> ¤ò
+    ¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤Ç, TeX ¤Ç½ñ¤«¤ì¤¿¿ô¼°¤ò
+    MathML ¤Î·Á¼°¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬²ÄÇ½¤Ç¤¹. ¤³¤Îµ¡Ç½¤òÍ­¸ú
+    ¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï rdoc ¥³¥Þ¥ó¥É¤Ë --mathml ¥ª¥×¥·¥ç¥ó¤ò
+    »ØÄê¤·¤Æ¤¯¤À¤µ¤¤.
+    TeX ¤Ç¿ô¼°¤ò½ñ¤¯ºÝ¤Î½ñ¼°¤Ë´Ø¤·¤Æ¤Ï
+    <b>RDoc::Markup::ToXHtmlTexParser</b> ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤.
+
+    <b>¢¨ Ãí°Õ ¢¨</b> --mathml ¥ª¥×¥·¥ç¥ó¤ò»ÈÍÑ¤·¤¿ºÝ¤ËºîÀ®¤µ¤ì¤ë
+    ¥É¥­¥å¥á¥ó¥È¤Ï¥Ö¥é¥¦¥¶¤Ë¤è¤Ã¤Æ¤ÏÀµ¤·¤¯É½¼¨¤µ¤ì¤Ê¤¤¤³¤È¤â
+    ¤¢¤ê¤Þ¤¹.
+    {Mozilla Firefox}[http://www.mozilla.org/products/firefox/]
+    ¤ª¤è¤Ó Internet Explorer
+    (+ {MathPlayer}[http://www.dessci.com/en/products/mathplayer/])
+    ¤Ç¤ÏÀµ¤·¤¯É½¼¨¤µ¤ì¤ë¤³¤È¤ò³ÎÇ§¤·¤Æ¤¤¤Þ¤¹.
+    ¤½¤ÎÂ¾¤Î¥Ö¥é¥¦¥¶¤Î MathML ÂÐ±þ¤Ë´Ø¤·¤Æ¤Ï,
+    {MathML ÆüËÜ¸ì¾ðÊó}[http://washitake.com/MathML/] 
+    ¤ä {MathML Software - Browsers}[http://www.w3.org/Math/Software/mathml_software_cat_browsers.html]
+    ¤Ê¤É¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤.
+
+--
+# °Ê¹ß¤Ï Fortran ¤È¤Ï´Ø·¸¤ÎÌµ¤¤²þÊÑ
+#
+#<b>Ruby ¥é¥¤¥Ö¥é¥ê IRB::SLex ¤ÎÆÉ¤ß¹þ¤ß¤Ë¤Ä¤¤¤Æ</b> ::
+#    Ruby 1.8.2 ¤Ç¤âÆ°ºî¤¹¤ë¤è¤¦, ºÇ¿·¤Î parse_rb.rb ¤ò£±¤Ä°ÊÁ°¤Î
+#    ¥Ð¡¼¥¸¥ç¥ó¤ËÌá¤·¤Æ¤¤¤Þ¤¹.
+#
+#
+#<b>³ÈÄ¥»Ò<tt>cxx</tt>¤â C ¥Ñ¡¼¥µ¤Ç²ò¼á</b> ::
+#    ¤³¤ì¤ÏÁ´¤¯ Fortran 90/95 ¤È¤Ï´Ø·¸¤¢¤ê¤Þ¤»¤ó.
+#    ¤³¤Î³ÈÄ¥»Ò <tt>cxx</tt> ¤Ï <tt>c++</tt> ¥Õ¥¡¥¤¥ë¤«¤é
+#    SWIG[http://swig.shibu.jp/] ¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Î³ÈÄ¥»Ò¤Ç¤¹.
+++
+
+²òÀÏÇ½ÎÏ¤¬¸þ¾å¤µ¤ì¤¿¤Î¤ËÈ¼¤¤, ¥É¥­¥å¥á¥ó¥È¤ËÈ¿±Ç¤µ¤ì¤ë¥³¥á¥ó¥È¤Î½ñË¡¤Î
+Â¿¾¯ÊÑ¹¹¤µ¤ì¤Æ¤¤¤Þ¤¹. 
+<b>parsers/parse_f95.rb</b> ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤.
+
+
+== »ÈÍÑ¾å¤ÎÃí°Õ
+
+RDoc Fortran 90/95 ¥½¡¼¥¹¥³¡¼¥É²òÀÏµ¡Ç½¶¯²½ÈÇ¤Î¥Ñ¥Ã¥Á¤â¤·¤¯¤Ï¥Ñ¥Ã¥±¡¼¥¸
+(°Ê²¼, ËÜ¥Ñ¥Ã¥Á¤â¤·¤¯¤Ï¥Ñ¥Ã¥±¡¼¥¸)¤Ï, 
+¸¦µæ¡¦¶µ°é¤Î¾ì¤ÇÍÑ¤¤¤é¤ì¤ë¤³¤È¤òÁ°Äó¤È¤·¤Æ¤ª¤ê¤Þ¤¹. ¶µ°é¸½¾ì¤Ë¤ª¤¤¤Æ¤Ï¼«Í³¤Ë»ÈÍÑ¡¦²þÊÑ¤·¤Æ¤¤¤¿¤À¤¤¤Æ·ë¹½¤Ç¤¹. 
+¥é¥¤¥»¥ó¥¹µ¬Äê¤ÏËÜ²È RDoc ¤Ë½àµò¤·¤Þ¤¹.
+{RDoc ¥ª¥ê¥¸¥Ê¥ë¤Î README}[link:files/README_org.html] 
+¤ò»²¾È¤¯¤À¤µ¤¤.
+
+ËÜ¥Ñ¥Ã¥Á¤â¤·¤¯¤Ï¥Ñ¥Ã¥±¡¼¥¸¤òÍøÍÑ¤·¤ÆÆÀ¤é¤ì¤¿²Ê³Øµ»½ÑÅªÀ®²Ì¤ò
+ÏÀÊ¸¤ä Web Åù¤Ë¤ÆÈ¯É½¤¹¤ëºÝ¤Ë¤Ï, ¤½¤Î»Ý¤òµ­¤·, ¥ê¥Õ¥¡¥ì¥ó¥¹¤Ëµó¤²¤Æ
+Äº¤­¤Þ¤¹¤è¤¦¤ª´ê¤¤¤·¤Þ¤¹.
+
+* °úÍÑÎã (ÏÂÊ¸)
+
+    ÃÏµåÎ®ÂÎÅÅÇ¾¶æ³ÚÉô dcmodel ¥×¥í¥¸¥§¥¯¥È, 2008:
+    http://www.gfd-dennou.org/library/dcmodel/, ÃÏµåÎ®ÂÎÅÅÇ¾¶æ³ÚÉô.
+
+* °úÍÑÎã (±ÑÊ¸)
+
+    GFD Dennou Club dcmodel project, 2008:
+    http://www.gfd-dennou.org/library/dcmodel/, GFD Dennou Club.
+
+
+== Ï¢ÍíÀè
+
+¥³¥á¥ó¥È¤ä°Õ¸«, ¼ÁÌä¤Ê¤É¤Ï link:../rdoc-f95-mailto.png ¤Þ¤Ç¤ª´ó¤»¤¯¤À¤µ¤¤.
+
+
+== »²¹ÍÊ¸¸¥
+
+* {¿¹ÀîÌ÷Âç, ÀÐÅÏÀµ¼ù, ËÙÇ·ÆâÉð, ¾®¹âÀµ»Ì, ÎÓ¾Í²ð, 2007:
+  RDoc ¤òÍÑ¤¤¤¿¿ôÃÍ¥â¥Ç¥ë¤Î¥É¥­¥å¥á¥ó¥ÈÀ¸À®. Å·µ¤, <b>54</b>, 185--190.}[http://s-ws.net/tenki/cont/54_02/co.html]
+
+== È¯É½»ñÎÁ
+
+* ¿¹ÀîÌ÷Âç, ÀÐÅÏÀµ¼ù, ËÙÇ·ÆâÉð, ¾®¹âÀµ»Ì, ÎÓ¾Í²ð,
+  ¡ÖRDoc ¤òÍÑ¤¤¤¿¿ôÃÍ¥â¥Ç¥ë¤Î¥É¥­¥å¥á¥ó¥ÈÀ¸À®¡×,
+  ÆüËÜµ¤¾Ý³Ø²ñ 2006 Ç¯ÅÙ½Õµ¨Âç²ñ,
+  ¤Ä¤¯¤Ð¹ñºÝ²ñµÄ¾ì, 2006 Ç¯ 5 ·î 24 Æü (¹Ö±éÈÖ¹æ D401).
+  {¹Ö±éÍ½¹Æ}[http://www.gfd-dennou.org/arch/prepri/2006/metsoc.spr/rdoc-dennou/yokou/pub/rdoc-dennou_2006_metsoc-spr_ver0.8.pdf], 
+  {È¯É½»ñÎÁ (HTML)}[http://www.gfd-dennou.org/arch/prepri/2006/metsoc.spr/rdoc-dennou/presen/pub/]
+  {È¯É½»ñÎÁ (PDF)}[http://www.gfd-dennou.org/arch/prepri/2006/metsoc.spr/rdoc-dennou/presen/pub/metsoc-spr2006_rdoc-dennou_ver1.4.pdf]. 
+
+* ¿¹ÀîÌ÷Âç, ÀÐÅÏÀµ¼ù, ËÙÇ·ÆâÉð, ¾®¹âÀµ»Ì, ÎÓ¾Í²ð,
+  ¡ÖRDoc ¤òÍÑ¤¤¤¿ Fortran90/95 ¥×¥í¥°¥é¥à¤Î¥É¥­¥å¥á¥ó¥ÈÀ¸À®¡×,
+  ÃÏµåÏÇÀ±²Ê³ØÏ¢¹ç 2006 Ç¯Âç²ñ,
+  ËëÄ¥¥á¥Ã¥»¹ñºÝ²ñµÄ¾ì, 2006 Ç¯ 5 ·î 14 Æü (¹Ö±éÈÖ¹æ J157-016).
+  {¹Ö±éÍ½¹Æ}[http://www.gfd-dennou.org/arch/prepri/2006/goudou/rdoc-dennou/yokou/pub/J157-016.pdf], 
+  {È¯É½»ñÎÁ (HTML)}[http://www.gfd-dennou.org/arch/prepri/2006/goudou/rdoc-dennou/presen/pub/],
+  {È¯É½»ñÎÁ (PDF)}[http://www.gfd-dennou.org/arch/prepri/2006/goudou/rdoc-dennou/presen/pub/jpgu_rdoc-dennou_ver1.4.pdf]. 
+
+* ¿¹ÀîÌ÷Âç, ÀÐÅÏÀµ¼ù, ËÙÇ·ÆâÉð, ¾®¹âÀµ»Ì, ÎÓ¾Í²ð,
+  ¡ÖRDoc ¤òÍÑ¤¤¤¿ Fortran90/95 ¥×¥í¥°¥é¥à¤Î¥É¥­¥å¥á¥ó¥ÈÀ¸À®¡×,
+  2005 Ç¯ STEL ¸¦µæ¾®½¸²ñ,
+  ±§ÃèÃÏµå·Ï¾ðÊó²Ê³Ø¸¦µæ²ñ, °¦É²Âç³ØÁí¹ç¾ðÊó¥á¥Ç¥£¥¢¥»¥ó¥¿¡¼,
+  2005 Ç¯ 12 ·î 15 Æü.
+  {È¯É½»ñÎÁ}[http://www.gfd-dennou.org/arch/prepri/2005/stel-gi/rdoc-dennou/pub/]
+
+== ÍúÎò
+
+==== 2009/01/09
+
+* ¥Ñ¥Ã¥Á¥Õ¥¡¥¤¥ë¤ò Ruby ¥Ð¡¼¥¸¥ç¥ó 1.8.7-p72 ¤ËÂÐ±þ.
+* ¥µ¥ó¥×¥ë¤Î¥ê¥ó¥¯Àè¤ò¹¹¿·. 
+
+==== 2008/03/16
+
+* ¥Á¥å¡¼¥È¥ê¥¢¥ë
+  <b>{RDoc ¤Ë¤è¤ë¿ôÃÍ¥â¥Ç¥ë¤Î¼«Æ°¥É¥­¥å¥á¥ó¥ÈÀ¸À®}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/tutorial/] </b>
+  ¤òºîÀ®. 
+
+==== 2008/03/08
+
+* Ruby ¥Ð¡¼¥¸¥ç¥ó 1.9.0 ¤ËÂÐ±þ. 
+
+* Ruby ÍÑ MathML ¥é¥¤¥Ö¥é¥ê ¥Ð¡¼¥¸¥ç¥ó 0.8 ¤ËÂÐ±þ. 
+
+* README ¤Ë»²¹ÍÊ¸¸¥¤ÈÈ¯É½»ñÎÁ¤òÄÉ²Ã. 
+  °úÍÑÎã¤ÎÊÑ¹¹. 
+
+==== 2007/03/09
+
+* RiWriter ¤¬ Ruby 1.8 ¤ÇÆ°ºî¤·¤Ê¤¤¥Ð¥°¤ò½¤Àµ.
+
+==== 2007/02/27
+
+* Ruby ¥½¡¼¥¹¥³¡¼¥É¥ì¥Ý¥¸¥È¥ê¤¬ CVS ¤«¤é SVN ¤ËÊÑ¹¹¤µ¤ì¤¿¤³¤È¤ËÈ¼¤¤
+  README, README.ja ¤ò½¤Àµ.
+
+==== 2007/01/12
+
+* "FUNCTION Get_Platform() RESULT(platform)" ¤Î¤è¤¦¤Ê
+  Fortran 90/95 ¥½¡¼¥¹¥³¡¼¥É¤¬
+  "Get_Platform( platform ) result(platform)" ¤Î¤è¤¦¤ËÉ½¼¨¤µ¤ì¤Æ¤·¤Þ¤¦
+  ¥Ð¥°¤Î½¤Àµ (Hani Andreas Ibrahim »á¤Ë¤è¤ëÊó¹ð¤è¤ê).
+
+==== 2007/01/09
+
+* <b>Generators::TexParser</b> ¤Î½¤Àµ.
+
+==== 2007/01/05
+
+* Ï¢ÍíÀè¥¢¥É¥ì¥¹¤òÊÑ¹¹.
+* ¥Ñ¥Ã¥Á¥Õ¥¡¥¤¥ë¤ò Ruby ¥Ð¡¼¥¸¥ç¥ó 1.8.5-p12 ¤ËÂÐ±þ.
+* <b>Generators::TexParser</b> ¤Ë
+  ²òÀâ¡Ö\newcommand, \newenvironment ¤Î»ÈÍÑÊýË¡¡×¤òÄÉ²Ã.
+* <b>parsers/parse_f95.rb</b> ¤Ë
+  ²òÀâ¡ÖÍøÍÑ¼ÔÄêµÁ±é»»»Ò, ÍøÍÑ¼ÔÄêµÁÂåÆþ¤Î¥¯¥í¥¹¥ê¥Õ¥¡¥ì¥ó¥¹¡×¤òÄÉ²Ã.
+* <b>parsers/parse_f95.rb</b> ¤Î
+  ²òÀâ¡Ö¸À¸ìÍ×ÁÇ¤ÎÉ½¼¨½ç½ø¡×¤ò½¤Àµ
+* ¥¯¥í¥¹¥ê¥Õ¥¡¥ì¥ó¥¹»þ¤Ë°ìÉô '--ignore-case' ¥ª¥×¥·¥ç¥ó¤¬¸ú¤«¤Ê¤¤
+  ÌäÂê¤ò½¤Àµ.
+
+==== 2006/12/15
+
+* ¥Ñ¥Ã¥Á¥Õ¥¡¥¤¥ë¤ò Ruby ¥Ð¡¼¥¸¥ç¥ó 1.8.5-p2 ¤ËÂÐ±þ.
+
+
+==== 2006/12/13
+
+* "!:doc-priority 100:" ¤È¤¤¤Ã¤¿¥³¥á¥ó¥È¤Îµ­½Ò¤Ë¤è¤ê,
+  É½¼¨¤µ¤ì¤ë¸À¸ìÍ×ÁÇ¤Î½çÈÖ¤òÌÀ¼¨Åª¤ËÊÑ¹¹²ÄÇ½¤Ë¤¹¤ë.
+
+==== 2006/11/20
+
+* ".document" ¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤ÆÄÉµ­.
+* °ì¤Ä¤Î interface ¥Ö¥í¥Ã¥¯Æâ¤Ëµ­½Ò¤µ¤ì¤ë°Û¤Ê¤ëÌ¾Á°¤ÎÊ£¿ô¤Î
+  Éû¥×¥í¥°¥é¥à¤òÀµ¤·¤¯²òÀÏ¤Ç¤­¤ë¤è¤¦½¤Àµ.
+* Ruby ËÜ²È¤Î CVS ¤Î¹¹¿·ÆâÍÆ¤ò°Ü¿¢.
+
+==== 2006/11/16
+
+* Generators::TexParser ¤Î²þÎÉ.
+  * ²òÀâÊ¸½ñ¤Ë, ¿ô¼°¤òÊ£¿ô¹Ô¤ÇÉ½¼¨¤¹¤ë¾ì¹ç¤ÎÎã¤òÄÉµ­.
+  * "$ID: ... $" ¤ä "$LOG: ... $ ¤È¤¤¤Ã¤¿,
+    CVS ¤Î¥­¡¼¥ï¡¼¥É¤È¤·¤ÆÍÑ¤¤¤é¤ì¤Æ¤¤¤ë½ñ¤­Êý¤Ï¿ô¼°¤È¤·¤Æ°·¤ï¤Ê¤¤.
+* parse_f95.rb ¤Î¤¿¤á¤Ë code_object.rb ¤ËÄÉ²Ã¤·¤¿
+  Á´¤Æ¤Î¥á¥½¥Ã¥É¤ò parse_f95.rb ¤Ø°ÜÆ°¤·¤¿. ¤³¤ì¤Ë¤è¤ê,
+  parse_f95.rb Ã±ÂÎ¤ò Ruby 1.8.5 ¤ËÁÈ¤ß¹þ¤ó¤Ç»ÈÍÑ¤¹¤ë¤³¤È¤¬²ÄÇ½¤È¤Ê¤Ã¤¿.
+
+==== 2006/11/14
+
+* ¥Ñ¥Ã¥Á¥Õ¥¡¥¤¥ë¤ò Ruby ¥Ð¡¼¥¸¥ç¥ó 1.8.5 ¤ËÂÐ±þ.
+* ¥Ñ¥Ã¥Á¤Î¥Õ¥¡¥¤¥ëÌ¾¤òÊÑ¹¹.
+* Debian GNU/Linux ¤Î¥Ð¥¤¥Ê¥ê¥Ñ¥Ã¥±¡¼¥¸¤ÎºîÀ®ÊýË¡¤ò½¤Àµ.
+* À¸À®¤µ¤ì¤ë¥É¥­¥å¥á¥ó¥È¤Î XHTML ¤Î¥Ð¡¼¥¸¥ç¥ó ¤ò XHTML 1.0
+  Transitional ¤«¤é XHTML 1.1 plus MathML 2.0 ¤ØÊÑ¹¹.
+* Fortran 90/95 ¥Ñ¡¼¥µ¤Ë¤ª¤¤¤Æ, ·ÑÂ³¹Ô¤Î½èÍýÊýË¡¤ò½¤Àµ.
+* Ruby ËÜ²È¤Î CVS ¤Î¹¹¿·ÆâÍÆ¤ò°Ü¿¢.
+* Institute for Plasma Physics ¤Î Giger »á¤Î¥³¥á¥ó¥È¤ò¼õ¤±¤Æ±Ñ¸ì¤ò½¤Àµ
+* "../" ¤Ç»Ï¤Þ¤ë¥Õ¥¡¥¤¥ëÌ¾¤ò¥Ñ¡¼¥¹¤Ç¤­¤Ê¤¤¥Ð¥°¤ò½¤Àµ.
+* »ÈÍÑ¤¹¤ë Ruby ÍÑ MathML ¥é¥¤¥Ö¥é¥ê¤Î¥Ð¡¼¥¸¥ç¥ó¤ò 0.5 ¤«¤é 0.6a ¤Ø.
+* Ruby ÍÑ MathML ¥é¥¤¥Ö¥é¥ê¤ò»ÈÍÑ¤¹¤ëºÝ, ¥¨¥é¡¼¤¬À¸¤¸¤Æ¤â·Ù¹ð¤òÈ¯¤·¤Æ
+  Æ°ºî¤ò·ÑÂ³¤¹¤ë¤è¤¦½¤Àµ.
+
+==== 2006/08/15
+
+* Debian GNU/Linux ÍÑ¥Ð¥¤¥Ê¥ê¥Ñ¥Ã¥±¡¼¥¸¤Î¥¤¥ó¥¹¥È¡¼¥ëÊýË¡¤ò²þÄê.
+* NAMELIST ¤Î¥³¥á¥ó¥È¤ò¼èÆÀ¤¹¤ë¥×¥í¥°¥é¥à¤Î¥Ð¥°¤ò½¤Àµ.
+
+==== 2006/08/14
+
+* ¥Ñ¥Ã¥±¡¼¥¸Ì¾¤ò rdoc-dennou ¤«¤é rdoc-f95 ¤ËÊÑ¹¹.
+* ¸ø³«¥¢¥É¥ì¥¹¤ò
+  http://www.gfd-dennou.org/library/dcmodel/rdoc-dennou/ ¤«¤é
+  http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/ ¤ØÊÑ¹¹.
+  (²áµî¤Î URL ¤â¤·¤Ð¤é¤¯»Ä¤·¤Æ¤ª¤­¤Þ¤¹).
+* README, README.ja ¤Î½¤Àµ.
+* TeX ¤Ç½ñ¤«¤ì¤¿¿ô¼°¤ò MathML ¤Ø¤ÎÊÑ´¹¤¹¤ëµ¡Ç½¤òÄÉ²Ã.
+* style ¥ª¥×¥·¥ç¥ó¤Î²þÎÉ.
+* ¼ç¥×¥í¥°¥é¥à¤â 'Methods' ¤ÎÍó¤ËÄÉ²Ã.
+* ³Æ¥Õ¥¡¥¤¥ë¤ËÅÀºß¤·¤Æ¤¤¤ë NAMELIST ÊÑ¿ô·²¤ò¼«Æ°Åª¤Ë°ì²Õ½ê¤Ë
+  ½¸Ìó¤·¤ÆÉ½¼¨¤¹¤ë¤è¤¦²þÎÉ.
+* F90 ¥Õ¥¡¥¤¥ë¤¬Äó¶¡¤¹¤ë¥â¥¸¥å¡¼¥ë·²¤ÎÌ¾Á°¤ò,
+  ¼«Æ°Åª¤Ë¥Õ¥¡¥¤¥ë¤Î¥É¥­¥å¥á¥ó¥È¤ËÄÉµ­¤¹¤ë¤è¤¦²þÎÉ.
+
+
+==== 2006/02/24
+
+* ±Ñ¸ìÈÇ README ¤ÎºîÀ®
+
+* README.ja ¤Î½¤Àµ.
+
+
+==== 2006/01/18
+* ¥µ¥Ö¥ë¡¼¥Á¥ó, ´Ø¿ô¤Î°ú¿ô¤Î¾ðÊó¤ò¥³¥á¥ó¥È¤È¤·¤Æ½ÐÎÏ¤¹¤ëºÝ¤Î½ñ¼°¤ò
+  ¾¯¤·¤À¤±½¤Àµ.
+
+  * °ú¿ô¾ðÊó¤ò¥³¥á¥ó¥È¤Ë½ÐÎÏ¤¹¤ëºÝ, °ú¿ô¤Î¸å¤í¤Ë¶õÇò¤òÁÞÆþ¤·¤¿.
+    ¤³¤ì¤Ë¤è¤ê, ¥á¥½¥Ã¥É¤ÎÊÂ¤ÓÂØ¤¨¤ò¹Ô¤¦ºÝ (¥á¥½¥Ã¥É¤Ï¥á¥½¥Ã¥ÉÌ¾,
+    °ú¿ô, ¥³¥á¥ó¥È¤Î½ç¤ËÂç¤­¤µ¤òÈæ³Ó¤·, ÊÂ¤Ù¤ë½ç½ø¤ò·è¤á¤ë),
+    "args" ¤¬ "args(:)" ¤è¤ê¤âÁ°¤ËÍè¤ë¤è¤¦¤Ë¤Ê¤ë.
+
+* ËÜ²È Ruby ¤Î CVS ¥ì¥Ý¥¸¥È¥êÆâ¤Î¹¹¿·¤ò¼õ¤±, ºÇ¿·ÈÇ¤ò¤³¤Á¤é¤Î
+  ¥Ñ¥Ã¥±¡¼¥¸ÈÇ¤Ë¤â°Ü¿¢.
+
+==== 2005/12/28
+* ruby 1.8.4 ¤Î¥ê¥ê¡¼¥¹¤ËÈ¼¤¤, ¥Ñ¥Ã¥Á¤ò 1.8.4 ÍÑ¤ËÊÑ¹¹.
+
+==== 2005/12/17
+
+* Æ±Ì¾¤Î¼êÂ³¤­Æ±»Î¤Ç¸ø³«¡¦Èó¸ø³«Â°À­¤ò¸í¤Ã¤ÆÀßÄê¤·¤Æ¤·¤Þ¤¦¥Ð¥°¤ò½¤Àµ.
+* °Ê²¼¤Î¥Ð¥°¤ò½¤Àµ
+  * program, module, subroutine, function ¤Î end Ê¸¤ÏÉ¬¤º
+    end program, end module, end subroutine, end function ¤Î¤è¤¦¤Ë
+    µ­½Ò¤·¤Ê¤¤¤È, ½ñË¡¤òÀµ¤·¤¯²òÀÏ½ÐÍè¤Ê¤¤.
+  * program ¡Á end program Ê¸¤Î, ºÇ½é¤ÈºÇ¸å¤Î program ¤È¤¤¤¦Ê¸»ú¤ò
+    ¾ÊÎ¬¤·¤¿¾ì¹ç, program Ê¸¤ÎÆâÉô¤ÇÄêµÁ¤µ¤ì¤ë¤â¤Î¤ÏÁ´¤Æ public ¤À¤È
+    Ç§¼±¤µ¤ì¤ë.
+  * ";" ¤ÎÊ¸»ú¤ò¥³¥á¥ó¥ÈÆâ¤Ç¤â²þ¹Ô¤ËÊÑ´¹¤·¤Æ¤·¤Þ¤¦
+* !-- ¡Á !++ ¤Ë¤è¤ë¥³¥á¥ó¥Èºï½ü¤Î»ØÄê¤ÎºÝ¤Ë, "!" ¤è¤ê¤âÁ°¤Ë¶õÇò¤ò
+  ´Þ¤ó¤Ç¤è¤¤¤è¤¦¤Ë½¤Àµ.
+* interface Ê¸¤Ç»ØÄê¤µ¤ì¤ë³°Éô¼êÂ³¤­¤Î²òÀÏ¤ò½¤Àµ.
+* ·ÑÂ³¹Ô¤Î°·¤¤¤ò½¤Àµ.
+
+==== 2005/12/13
+
+* parsers/parse_f95.rb ¤ËÃí°Õ»ö¹à¤È Todo ¤òÄÉ²Ã.
+* ¡Ö¥µ¥ó¥×¥ë¡×¤òÄÉ²Ã.
+* public, private Ê¸¤ò²òÀÏ¤¹¤ëÉôÊ¬¤Î¥Ð¥°¤ò½¤Àµ.
+
+==== 2005/12/08
+
+* ¡Ö»ÈÍÑ¾å¤ÎÃí°Õ¡×, ¡ÖÏ¢ÍíÀè¡×¤òÄÉ²Ã.
+* ¸ø³«¥¢¥É¥ì¥¹¤ò
+  http://www.gfd-dennou.org/library/dcmodel/doc/rdoc-dennou/ ¤«¤é
+  http://www.gfd-dennou.org/library/dcmodel/rdoc-dennou/ ¤ØÊÑ¹¹.
+  (²áµî¤Î URL ¤â¤·¤Ð¤é¤¯»Ä¤·¤Æ¤ª¤­¤Þ¤¹).
+
+==== 2005/11/28
+
+* ":nodoc:" ¤Î»ØÄê¤ò²ÄÇ½¤Ë¤¹¤ë.
+* ¥µ¥Ö¥ë¡¼¥Á¥ó¤ä´Ø¿ôÆâ¤Î "contains" Ê¸¤Î½èÍýÊýË¡¤ò½¤Àµ¤¹¤ë.
+* É½Âê¤òÊÑ¹¹¤¹¤ë.
+* ²áµî¤Î¥Ð¡¼¥¸¥ç¥ó¤ò¸ø³«¤¹¤ë.
+
+==== 2005/11/17
+
+* °ìÄÌ¤êÍß¤·¤¤µ¡Ç½¤¬Â·¤¤, ¥É¥­¥å¥á¥ó¥È¤Î¥Á¥§¥Ã¥¯¤â¹Ô¤Ã¤¿¤Î¤Ç,
+  ¥¿¥°¤ò¤Ä¤±¤Æ¸ø³«¤¹¤ë.
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/README.org ../rdoc-f95-20090109-1/README.org
--- ruby-1.8.7-p72/lib/rdoc/README.org	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/README.org	2006-07-08 14:56:44.000000000 +0900
@@ -0,0 +1,502 @@
+= RDOC - Ruby Documentation System
+
+== Annotation
+
+This is a copy from 
+{RDoc original README}[http://www.ruby-doc.org/stdlib/libdoc/rdoc/rdoc/index.html]
+
+See README or README.ja .
+
+== Overview
+
+This package contains Rdoc and SimpleMarkup. Rdoc is an application
+that produces documentation for one or more Ruby source files. We work
+similarly to JavaDoc, parsing the source, and extracting the
+definition for classes, modules, and methods (along with includes and
+requires).  We associate with these optional documentation contained
+in the immediately preceding comment block, and then render the result
+using a pluggable output formatter. (Currently, HTML is the only
+supported format. Markup is a library that converts plain text into
+various output formats. The Markup library is used to interpret the
+comment blocks that Rdoc uses to document methods, classes, and so on.
+
+This library contains two packages, rdoc itself and a text markup
+library, 'markup'. 
+
+== Roadmap
+
+* If you want to use Rdoc to create documentation for your Ruby source
+  files, read on.
+* If you want to include extensions written in C, see rdoc/parsers/parse_c.rb.
+* For information on the various markups available in comment
+  blocks, see markup/simple_markup.rb.
+* If you want to drive Rdoc programatically, see RDoc::RDoc.
+* If you want to use the library to format text blocks into HTML,
+  have a look at SM::SimpleMarkup.
+* If you want to try writing your own HTML output template, see
+  RDoc::Page.
+
+== Summary
+
+Once installed, you can create documentation using the 'rdoc' command
+(the command is 'rdoc.bat' under Windows)
+
+  % rdoc [options]  [names...]
+
+Type "rdoc --help" for an up-to-date option summary.
+
+A typical use might be to generate documentation for a package of Ruby
+source (such as rdoc itself). 
+
+  % rdoc
+
+This command generates documentation for all the Ruby and C source
+files in and below the current directory. These will be stored in a
+documentation tree starting in the subdirectory 'doc'.
+
+You can make this slightly more useful for your readers by having the
+index page contain the documentation for the primary file. In our
+case, we could type
+
+  % rdoc --main rdoc/rdoc.rb
+
+You'll find information on the various formatting tricks you can use
+in comment blocks in the documentation this generates.
+
+RDoc uses file extensions to determine how to process each file. File
+names ending <tt>.rb</tt> and <tt>.rbw</tt> are assumed to be Ruby
+source. Files ending <tt>.c</tt> are parsed as C files. All other
+files are assumed to contain just SimpleMarkup-style markup (with or
+without leading '#' comment markers). If directory names are passed to
+RDoc, they are scanned recursively for C and Ruby source files only.
+
+== Credits
+
+* The Ruby parser in rdoc/parse.rb is based heavily on the outstanding
+  work of Keiju ISHITSUKA of Nippon Rational Inc, who produced the Ruby
+  parser for irb and the rtags package.
+
+* Code to diagram classes and modules was written by Sergey A Yanovitsky
+  (Jah) of Enticla. 
+
+* Charset patch from MoonWolf.
+
+* Rich Kilmer wrote the kilmer.rb output template.
+
+* Dan Brickley led the design of the RDF format.
+
+== License
+
+RDoc is Copyright (c) 2001-2003 Dave Thomas, The Pragmatic Programmers.  It
+is free software, and may be redistributed under the terms specified
+in the README file of the Ruby distribution.
+
+
+= Usage
+
+RDoc is invoked from the command line using:
+
+   % rdoc <options> [name...]
+
+Files are parsed, and the information they contain collected, before
+any output is produced. This allows cross references between all files
+to be resolved. If a name is a directory, it is traversed. If no
+names are specified, all Ruby files in the current directory (and
+subdirectories) are processed.
+
+Options are:
+
+[<tt>--accessor</tt> <i>name[,name...]</i>]
+    specifies the name(s) of additional methods that should be treated
+    as if they were <tt>attr_</tt><i>xxx</i> methods. Specifying
+    "--accessor db_opt" means lines such as
+
+         db_opt :name, :age
+  
+    will get parsed and displayed in the documentation. Each name may have an
+    optional "=flagtext" appended, in which case the given flagtext will appear
+    where (for example) the 'rw' appears for attr_accessor.
+
+[<tt>--all</tt>]
+    include protected and private methods in the output (by default
+    only public methods are included)
+
+[<tt>--charset</tt> _charset_]
+    Set the character set for the generated HTML.
+
+[<tt>--diagram</tt>]
+    include diagrams showing modules and classes.  This is currently
+    an experimental feature, and may not be supported by all output
+    templates. You need dot V1.8.6 or later to use the --diagram
+    option correctly (http://www.research.att.com/sw/tools/graphviz/).
+
+[<tt>--exclude</tt> <i>pattern</i>]
+    exclude files and directories matching this pattern from processing
+
+[<tt>--extension</tt> <i>new=old</i>]
+    treat files ending <i>.new</i> as if they ended
+    <i>.old</i>. Saying '--extension cgi=rb' causes RDoc to treat .cgi
+    files as Ruby source.
+
+[<tt>fileboxes</tt>]
+    Classes are put in boxes which represents files, where these
+    classes reside. Classes shared between more than one file are
+    shown with list of files that sharing them.  Silently discarded if
+    --diagram is not given Experimental.
+
+[<tt>--fmt</tt> _fmt_]
+    generate output in a particular format.
+
+[<tt>--help</tt>]
+    generate a usage summary.
+
+[<tt>--help-output</tt>]
+    explain the various output options.
+
+[<tt>--ignore-case</tt>]
+    The case of names of classes or modules or methods are ignored.
+
+[<tt>--image-format</tt> <i>gif/png/jpg/jpeg</i>]
+    sets output image format for diagrams. Can be png, gif, jpeg,
+    jpg. If this option is omitted, png is used. Requires --diagram.
+
+[<tt>--include</tt> <i>dir,...</i>]
+    specify one or more directories to be searched when satisfying
+    :+include+: directives. Multiple <tt>--include</tt> options may be
+    given. The directory containing the file currently being processed
+    is always searched.
+
+[<tt>--inline-source</tt>]
+    By default, the source code of methods is shown in a popup. With
+    this option, it's displayed inline.
+
+[<tt>line-numbers</tt>]
+    include line numbers in the source code
+
+[<tt>--main</tt> _name_]
+    the class of module _name_ will appear on the index page. If you
+    want to set a particular file as a main page (a README, for
+    example) simply specifiy its name as the first on the command
+    line.
+
+[<tt>--merge</tt>]
+    when generating _ri_ output, if classes being processed already
+    exist in the destination directory, merge in the current details
+    rather than overwrite them.
+
+[<tt>--one-file</tt>]
+    place all the output into a single file
+
+[<tt>--op</tt> _dir_]
+    set the output directory to _dir_ (the default is the directory
+    "doc")
+
+[<tt>--op-name</tt> _name_]
+    set the name of the output. Has no effect for HTML.
+    "doc")
+
+[<tt>--opname</tt> _name_]
+    set the output name (has no effect for HTML).
+
+[<tt>--promiscuous</tt>]
+    If a module or class is defined in more than one source file, and
+    you click on a particular file's name in the top navigation pane,
+    RDoc will normally only show you the inner classes and modules of
+    that class that are defined in the particular file. Using this
+    option makes it show all classes and modules defined in the class,
+    regardless of the file they were defined in.
+
+[<tt>--quiet</tt>]
+    do not display progress messages
+
+[<tt>--ri</tt>, <tt>--ri-site</tt>, _and_ <tt>--ri-system</tt>]
+    generate output than can be read by the _ri_ command-line tool.
+    By default --ri places its output in ~/.rdoc, --ri-site in
+    $datadir/ri/<ver>/site, and --ri-system in
+    $datadir/ri/<ver>/system. All can be overridden with a subsequent
+    --op option. All default directories are in ri's default search
+    path.
+
+[<tt>--show-hash</tt>]
+    A name of the form #name in a comment is a possible hyperlink to
+    an instance method name. When displayed, the '#' is removed unless
+    this option is specified
+
+[<tt>--style</tt> <i>stylesheet url</i>]
+    specifies the URL of an external stylesheet to use (rather than
+    generating one of our own)
+
+[<tt>tab-width</tt> _n_]
+    set the width of tab characters (default 8)
+
+[<tt>--template</tt> <i>name</i>]
+    specify an alternate template to use when generating output (the
+    default is 'standard'). This template should be in a directory
+    accessible via $: as rdoc/generators/xxxx_template, where 'xxxx'
+    depends on the output formatter.
+
+[<tt>--version</tt>]
+   display  RDoc's version
+
+[<tt>--webcvs</tt> _url_]
+    Specify a URL for linking to a web frontend to CVS. If the URL
+    contains a '\%s', the name of the current file will be
+    substituted; if the URL doesn't contain a '\%s', the filename will
+    be appended to it.
+
+= Example
+
+A typical small Ruby program commented using RDoc might be as follows. You
+can see the formatted result in EXAMPLE.rb and Anagram.
+
+      :include: EXAMPLE.rb
+
+= Markup
+
+Comment blocks can be written fairly naturally, either using '#' on
+successive lines of the comment, or by including the comment in 
+an =begin/=end block. If you use the latter form, the =begin line
+must be flagged with an RDoc tag:
+
+  =begin rdoc
+  Documentation to 
+  be processed by RDoc.
+  =end
+
+Paragraphs are lines that share the left margin. Text indented past
+this margin are formatted verbatim.
+
+1. Lists are typed as indented paragraphs with:
+   * a '*' or '-' (for bullet lists)
+   * a digit followed by a period for 
+     numbered lists
+   * an upper or lower case letter followed
+     by a period for alpha lists.
+
+   For example, the input that produced the above paragraph looked like
+       1. Lists are typed as indented 
+          paragraphs with:
+          * a '*' or '-' (for bullet lists)
+          * a digit followed by a period for 
+            numbered lists
+          * an upper or lower case letter followed
+            by a period for alpha lists.
+
+2. Labeled lists (sometimes called description
+   lists) are typed using square brackets for the label.
+      [cat]   small domestic animal
+      [+cat+] command to copy standard input
+
+3. Labeled lists may also be produced by putting a double colon
+   after the label. This sets the result in tabular form, so the
+   descriptions all line up. This was used to create the 'author'
+   block at the bottom of this description.
+      cat::   small domestic animal
+      +cat+:: command to copy standard input
+
+   For both kinds of labeled lists, if the body text starts on the same
+   line as the label, then the start of that text determines the block
+   indent for the rest of the body. The text may also start on the line
+   following the label, indented from the start of the label. This is
+   often preferable if the label is long. Both the following are
+   valid labeled list entries:
+
+      <tt>--output</tt> <i>name [, name]</i>::
+          specify the name of one or more output files. If multiple
+          files are present, the first is used as the index.
+
+      <tt>--quiet:</tt>:: do not output the names, sizes, byte counts,
+                          index areas, or bit ratios of units as
+                          they are processed.
+
+4. Headings are entered using equals signs
+
+      = Level One Heading
+      == Level Two Heading
+   and so on
+
+5. Rules (horizontal lines) are entered using three or
+   more hyphens.
+
+6. Non-verbatim text can be marked up:
+
+   _italic_::     \_word_ or \<em>text</em>
+   *bold*::       \*word* or \<b>text</b>
+   +typewriter+:: \+word+ or \<tt>text</tt>
+
+   The first form only works around 'words', where a word is a
+   sequence of upper and lower case letters and underscores. Putting a
+   backslash before inline markup stops it being interpreted, which is
+   how I created the table above:
+
+     _italic_::     \_word_ or \<em>text</em>
+     *bold*::       \*word* or \<b>text</b>
+     +typewriter+:: \+word+ or \<tt>text</tt>
+
+7. Names of classes, source files, and any method names
+   containing an underscore or preceded by a hash
+   character are automatically hyperlinked from
+   comment text to their description. 
+
+8. Hyperlinks to the web starting http:, mailto:, ftp:, or www. are
+   recognized. An HTTP url that references an external image file is
+   converted into an inline <IMG..>.  Hyperlinks starting 'link:' are
+   assumed to refer to local files whose path is relative to the --op
+   directory.
+
+   Hyperlinks can also be of the form <tt>label</tt>[url], in which
+   case the label is used in the displayed text, and <tt>url</tt> is
+   used as the target. If <tt>label</tt> contains multiple words,
+   put it in braces: <em>{multi word label}[</em>url<em>]</em>.
+       
+9. Method parameter lists are extracted and displayed with
+   the method description. If a method calls +yield+, then
+   the parameters passed to yield will also be displayed:
+
+      def fred
+        ...
+        yield line, address
+
+   This will get documented as
+
+      fred() { |line, address| ... }
+
+   You can override this using a comment containing 
+   ':yields: ...' immediately after the method definition
+
+      def fred      # :yields: index, position
+        ...
+        yield line, address
+
+   which will get documented as
+
+       fred() { |index, position| ... }
+
+
+10. ':yields:' is an example of a documentation modifier. These appear
+    immediately after the start of the document element they are modifying.
+    Other modifiers include
+
+    [<tt>:nodoc:</tt><i>[all]</i>]
+         don't include this element in the documentation.  For classes
+         and modules, the methods, aliases, constants, and attributes
+         directly within the affected class or module will also be
+         omitted.  By default, though, modules and classes within that
+         class of module _will_ be documented. This is turned off by
+         adding the +all+ modifier.
+
+              module SM  #:nodoc:
+                class Input
+                end
+              end
+              module Markup #:nodoc: all
+                class Output
+                end
+              end
+
+         In the above code, only class <tt>SM::Input</tt> will be
+         documented.
+
+    [<tt>:doc:</tt>]
+         force a method or attribute to be documented even if it
+         wouldn't otherwise be. Useful if, for example, you want to
+         include documentation of a particular private method.
+
+    [<tt>:notnew:</tt>]
+         only applicable to the +initialize+ instance method. Normally
+         RDoc assumes that the documentation and parameters for
+         #initialize are actually for the ::new method, and so fakes
+         out a ::new for the class. THe :notnew: modifier stops
+         this. Remember that #initialize is protected, so you won't
+         see the documentation unless you use the -a command line
+         option.
+
+
+11. RDoc stops processing comments if it finds a comment
+    line containing '<tt>#--</tt>'. This can be used to 
+    separate external from internal comments, or 
+    to stop a comment being associated with a method, 
+    class, or module. Commenting can be turned back on with
+    a line that starts '<tt>#++</tt>'.
+
+        # Extract the age and calculate the
+        # date-of-birth.
+        #--
+        # FIXME: fails if the birthday falls on
+        # February 29th
+        #++
+        # The DOB is returned as a Time object.
+
+        def get_dob(person)
+           ...
+
+12. Comment blocks can contain other directives:
+
+    [<tt>:section: title</tt>]
+        Starts a new section in the output. The title following
+	<tt>:section:</tt> is used as the section heading, and the
+	remainder of the comment containing the section is used as
+	introductory text. Subsequent methods, aliases, attributes,
+	and classes will be documented in this section. A :section:
+	comment block may have one or more lines before the :section:
+	directive. These will be removed, and any identical lines at
+	the end of the block are also removed. This allows you to add
+	visual cues such as
+
+           # ----------------------------------------
+	   # :section: My Section
+	   # This is the section that I wrote.
+	   # See it glisten in the noon-day sun.
+           # ----------------------------------------
+
+    [<tt>call-seq:</tt>]
+        lines up to the next blank line in the comment are treated as
+        the method's calling sequence, overriding the
+        default parsing of method parameters and yield arguments.
+
+    [<tt>:include:</tt><i>filename</i>] 
+         include the contents of the named file at this point. The
+         file will be searched for in the directories listed by
+         the <tt>--include</tt> option, or in the current
+         directory by default.  The contents of the file will be
+         shifted to have the same indentation as the ':' at the
+         start of the :include: directive.
+
+    [<tt>:title:</tt><i>text</i>]
+         Sets the title for the document. Equivalent to the --title command
+         line parameter. (The command line parameter overrides any :title:
+         directive in the source).
+
+    [<tt>:enddoc:</tt>]
+         Document nothing further at the current level.
+
+    [<tt>:main:</tt><i>name</i>]
+         Equivalent to the --main command line parameter.
+
+    [<tt>:stopdoc: / :startdoc:</tt>]
+         Stop and start adding new documentation elements to the
+         current container. For example, if a class has a number of
+         constants that you don't want to document, put a
+         <tt>:stopdoc:</tt> before the first, and a
+         <tt>:startdoc:</tt> after the last. If you don't specifiy a
+         <tt>:startdoc:</tt> by the end of the container, disables
+         documentation for the entire class or module.
+
+
+---
+
+See also markup/simple_markup.rb.
+
+= Other stuff
+
+Author::   Dave Thomas <dave@pragmaticprogrammer.com>
+Requires:: Ruby 1.8.1 or later
+License::  Copyright (c) 2001-2003 Dave Thomas.
+           Released under the same license as Ruby.
+
+== Warranty
+
+This software is provided "as is" and without any express or
+implied warranties, including, without limitation, the implied
+warranties of merchantibility and fitness for a particular
+purpose.
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/code_objects.rb ../rdoc-f95-20090109-1/code_objects.rb
--- ruby-1.8.7-p72/lib/rdoc/code_objects.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/code_objects.rb	2008-03-08 16:02:07.000000000 +0900
@@ -5,10 +5,10 @@
 
 module RDoc
 
-
+  ##
   # We contain the common stuff for contexts (which are containers)
   # and other elements (methods, attributes and so on)
-  #
+
   class CodeObject
 
     attr_accessor :parent
@@ -82,8 +82,7 @@
     # Access the code object's comment
     attr_reader :comment
 
-    # Update the comment, but don't overwrite a real comment
-    # with an empty one
+    # Update the comment, but don't overwrite a real comment with an empty one
     def comment=(comment)
       @comment = comment unless comment.empty?
     end
@@ -94,7 +93,7 @@
     # those directives. Wehn a comment is assigned, we then extract
     # out any matching directives and update our object
 
-    def CodeObject.attr_overridable(name, *aliases)
+    def self.attr_overridable(name, *aliases)
       @overridables ||= {}
 
       attr_accessor name
@@ -126,6 +125,7 @@
         @title = title
         @@sequence.succ!
         @sequence = @@sequence.dup
+        @comment = nil
         set_comment(comment)
       end
 
@@ -235,7 +235,7 @@
     end
 
     def add_method(a_method)
-      puts "Adding #@visibility method #{a_method.name} to #@name" if $DEBUG
+      puts "Adding #@visibility method #{a_method.name} to #@name" if $DEBUG_RDOC
       a_method.visibility = @visibility
       add_to(@method_list, a_method)
     end
@@ -279,10 +279,10 @@
     def add_class_or_module(collection, class_type, name, superclass=nil)
       cls = collection[name]
       if cls
-        puts "Reusing class/module #{name}" if $DEBUG
+        puts "Reusing class/module #{name}" if $DEBUG_RDOC
       else
         cls = class_type.new(name, superclass)
-        puts "Adding class/module #{name} to #@name" if $DEBUG
+        puts "Adding class/module #{name} to #@name" if $DEBUG_RDOC
 #        collection[name] = cls if @document_self  && !@done_documenting
         collection[name] = cls if !@done_documenting
         cls.parent = self
@@ -385,8 +385,8 @@
           module_name = modules.shift
           result = find_module_named(module_name)
           if result
-            modules.each do |module_name|
-              result = result.find_module_named(module_name)
+            modules.each do |name|
+              result = result.find_module_named(name)
               break unless result
             end
           end
@@ -457,7 +457,7 @@
     
   end
 
-
+  ##
   # A TopLevel context is a source file
 
   class TopLevel < Context
@@ -469,7 +469,7 @@
     @@all_classes = {}
     @@all_modules = {}
 
-    def TopLevel::reset
+    def self.reset
       @@all_classes = {}
       @@all_modules = {}
     end
@@ -487,39 +487,46 @@
       nil
     end
 
-    # Adding a class or module to a TopLevel is special, as we only
-    # want one copy of a particular top-level class. For example,
-    # if both file A and file B implement class C, we only want one
-    # ClassModule object for C. This code arranges to share
-    # classes and modules between files.
+    ##
+    # Adding a class or module to a TopLevel is special, as we only want one
+    # copy of a particular top-level class. For example, if both file A and
+    # file B implement class C, we only want one ClassModule object for C.
+    # This code arranges to share classes and modules between files.
 
     def add_class_or_module(collection, class_type, name, superclass)
       cls = collection[name]
+
       if cls
-        puts "Reusing class/module #{name}" if $DEBUG
+        puts "Reusing class/module #{name}" if $DEBUG_RDOC
       else
         if class_type == NormalModule
           all = @@all_modules
         else
           all = @@all_classes
         end
+
         cls = all[name]
+
         if !cls
           cls = class_type.new(name, superclass)
-          all[name] = cls  unless @done_documenting
+          all[name] = cls unless @done_documenting
         end
-        puts "Adding class/module #{name} to #@name" if $DEBUG
+
+        puts "Adding class/module #{name} to #{@name}" if $DEBUG_RDOC
+
         collection[name] = cls unless @done_documenting
+
         cls.parent = self
       end
+
       cls
     end
 
-    def TopLevel.all_classes_and_modules
+    def self.all_classes_and_modules
       @@all_classes.values + @@all_modules.values
     end
 
-    def TopLevel.find_class_named(name)
+    def self.find_class_named(name)
      @@all_classes.each_value do |c|
         res = c.find_class_named(name) 
         return res if res
@@ -537,12 +544,13 @@
       nil
     end
 
+    ##
     # Find a named module
+
     def find_module_named(name)
       find_class_or_module_named(name) || find_enclosing_module_named(name)
     end
 
-
   end
 
   # ClassModule is the base class for objects representing either a
@@ -614,7 +622,7 @@
     end
   end
 
-
+  ##
   # AnyMethod is the base class for objects representing methods
 
   class AnyMethod < CodeObject
@@ -623,14 +631,18 @@
     attr_accessor :block_params
     attr_accessor :dont_rename_initialize
     attr_accessor :singleton
-    attr_reader   :aliases           # list of other names for this method
-    attr_accessor :is_alias_for      # or a method we're aliasing
+    attr_reader :text
+
+    # list of other names for this method
+    attr_reader   :aliases
+
+    # method we're aliasing
+    attr_accessor :is_alias_for
 
     attr_overridable :params, :param, :parameters, :parameter
 
     attr_accessor :call_seq
 
-
     include TokenStream
 
     def initialize(text, name)
@@ -684,7 +696,6 @@
     end
   end
 
-
   # Represent an alias, which is an old_name/ new_name pair associated
   # with a particular context
   class Alias < CodeObject
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/diagram.rb ../rdoc-f95-20090109-1/diagram.rb
--- ruby-1.8.7-p72/lib/rdoc/diagram.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/diagram.rb	2008-03-08 16:01:09.000000000 +0900
@@ -4,11 +4,11 @@
 # You must have the V1.7 or later in your path
 # http://www.research.att.com/sw/tools/graphviz/
 
-require "rdoc/dot/dot"
-require 'rdoc/options'
+require 'rdoc/dot'
 
 module RDoc
 
+  ##
   # Draw a set of diagrams representing the modules and classes in the
   # system. We draw one diagram for each file, and one for each toplevel
   # class or module. This means there will be overlap. However, it also
@@ -30,20 +30,26 @@
 
     DOT_PATH = "dot"
 
-    # Pass in the set of top level objects. The method also creates
-    # the subdirectory to hold the images
+    ##
+    # Pass in the set of top level objects. The method also creates the
+    # subdirectory to hold the images
 
     def initialize(info, options)
       @info = info
       @options = options
       @counter = 0
-      File.makedirs(DOT_PATH)
+      FileUtils.mkdir_p(DOT_PATH)
       @diagram_cache = {}
+      @html_suffix = ".html"
+      if @options.mathml
+        @html_suffix = ".xhtml"
+      end
     end
 
-    # Draw the diagrams. We traverse the files, drawing a diagram for
-    # each. We also traverse each top-level class and module in that
-    # file drawing a diagram for these too. 
+    ##
+    # Draw the diagrams. We traverse the files, drawing a diagram for each. We
+    # also traverse each top-level class and module in that file drawing a
+    # diagram for these too.
 
     def draw
       unless @options.quiet
@@ -55,26 +61,26 @@
         @done_modules = {}
         @local_names = find_names(i)
         @global_names = []
-        @global_graph = graph = DOT::DOTDigraph.new('name' => 'TopLevel',
-                                    'fontname' => FONT,
-                                    'fontsize' => '8',
-                                    'bgcolor'  => 'lightcyan1',
-                                    'compound' => 'true')
-        
+        @global_graph = graph = DOT::Digraph.new('name' => 'TopLevel',
+                                                 'fontname' => FONT,
+                                                 'fontsize' => '8',
+                                                 'bgcolor'  => 'lightcyan1',
+                                                 'compound' => 'true')
+
         # it's a little hack %) i'm too lazy to create a separate class
         # for default node
-        graph << DOT::DOTNode.new('name' => 'node',
-                                  'fontname' => FONT,
-                                  'color' => 'black',
-                                  'fontsize' => 8)
-        
+        graph << DOT::Node.new('name' => 'node',
+                               'fontname' => FONT,
+                               'color' => 'black',
+                               'fontsize' => 8)
+
         i.modules.each do |mod|
           draw_module(mod, graph, true, i.file_relative_name)
         end
         add_classes(i, graph, i.file_relative_name)
 
         i.diagram = convert_to_png("f_#{file_count}", graph)
-        
+
         # now go through and document each top level class and
         # module independently
         i.modules.each_with_index do |mod, count|
@@ -82,27 +88,25 @@
           @local_names = find_names(mod)
           @global_names = []
 
-          @global_graph = graph = DOT::DOTDigraph.new('name' => 'TopLevel',
-                                      'fontname' => FONT,
-                                      'fontsize' => '8',
-                                      'bgcolor'  => 'lightcyan1',
-                                      'compound' => 'true')
-
-          graph << DOT::DOTNode.new('name' => 'node',
-                                    'fontname' => FONT,
-                                    'color' => 'black',
-                                    'fontsize' => 8)
+          @global_graph = graph = DOT::Digraph.new('name' => 'TopLevel',
+                                                   'fontname' => FONT,
+                                                   'fontsize' => '8',
+                                                   'bgcolor'  => 'lightcyan1',
+                                                   'compound' => 'true')
+
+          graph << DOT::Node.new('name' => 'node',
+                                 'fontname' => FONT,
+                                 'color' => 'black',
+                                 'fontsize' => 8)
           draw_module(mod, graph, true)
-          mod.diagram = convert_to_png("m_#{file_count}_#{count}", 
-                                       graph) 
+          mod.diagram = convert_to_png("m_#{file_count}_#{count}",
+                                       graph)
         end
       end
       $stderr.puts unless @options.quiet
     end
 
-    #######
     private
-    #######
 
     def find_names(mod)
       return [mod.full_name] + mod.classes.collect{|cl| cl.full_name} +
@@ -126,40 +130,40 @@
       return if  @done_modules[mod.full_name] and not toplevel
 
       @counter += 1
-      url = mod.http_url("classes")
-      m = DOT::DOTSubgraph.new('name' => "cluster_#{mod.full_name.gsub( /:/,'_' )}",
-                               'label' => mod.name,
-                               'fontname' => FONT,
-                               'color' => 'blue', 
-                               'style' => 'filled', 
-                               'URL'   => %{"#{url}"},
-                               'fillcolor' => toplevel ? 'palegreen1' : 'palegreen3')
-      
+      url = mod.http_url("classes").sub(/\.html$/, @html_suffix)
+      m = DOT::Subgraph.new('name' => "cluster_#{mod.full_name.gsub( /:/,'_' )}",
+                            'label' => mod.name,
+                            'fontname' => FONT,
+                            'color' => 'blue',
+                            'style' => 'filled',
+                            'URL'   => %{"#{url}"},
+                            'fillcolor' => toplevel ? 'palegreen1' : 'palegreen3')
+
       @done_modules[mod.full_name] = m
       add_classes(mod, m, file)
       graph << m
 
       unless mod.includes.empty?
-        mod.includes.each do |m|
-          m_full_name = find_full_name(m.name, mod)
+        mod.includes.each do |inc|
+          m_full_name = find_full_name(inc.name, mod)
           if @local_names.include?(m_full_name)
-            @global_graph << DOT::DOTEdge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
-                                      'to' => "#{mod.full_name.gsub( /:/,'_' )}",
-                                      'ltail' => "cluster_#{m_full_name.gsub( /:/,'_' )}",
-                                      'lhead' => "cluster_#{mod.full_name.gsub( /:/,'_' )}")
+            @global_graph << DOT::Edge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
+                                           'to' => "#{mod.full_name.gsub( /:/,'_' )}",
+                                           'ltail' => "cluster_#{m_full_name.gsub( /:/,'_' )}",
+                                           'lhead' => "cluster_#{mod.full_name.gsub( /:/,'_' )}")
           else
             unless @global_names.include?(m_full_name)
               path = m_full_name.split("::")
-              url = File.join('classes', *path) + ".html"
-              @global_graph << DOT::DOTNode.new('name' => "#{m_full_name.gsub( /:/,'_' )}",
-                                        'shape' => 'box',
-                                        'label' => "#{m_full_name}",
-                                        'URL'   => %{"#{url}"})
+              url = File.join('classes', *path) + @html_suffix
+              @global_graph << DOT::Node.new('name' => "#{m_full_name.gsub( /:/,'_' )}",
+                                             'shape' => 'box',
+                                             'label' => "#{m_full_name}",
+                                             'URL'   => %{"#{url}"})
               @global_names << m_full_name
             end
-            @global_graph << DOT::DOTEdge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
-                                      'to' => "#{mod.full_name.gsub( /:/,'_' )}",
-                                      'lhead' => "cluster_#{mod.full_name.gsub( /:/,'_' )}")
+            @global_graph << DOT::Edge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
+                                           'to' => "#{mod.full_name.gsub( /:/,'_' )}",
+                                           'lhead' => "cluster_#{mod.full_name.gsub( /:/,'_' )}")
           end
         end
       end
@@ -167,27 +171,28 @@
 
     def add_classes(container, graph, file = nil )
 
-      use_fileboxes = Options.instance.fileboxes
+      use_fileboxes = @options.fileboxes
 
       files = {}
 
       # create dummy node (needed if empty and for module includes)
       if container.full_name
-        graph << DOT::DOTNode.new('name'     => "#{container.full_name.gsub( /:/,'_' )}",
-                                  'label'    => "",
-                                  'width'  => (container.classes.empty? and 
-                                               container.modules.empty?) ? 
-                                  '0.75' : '0.01',
-                                  'height' => '0.01',
-                                  'shape' => 'plaintext')
+        graph << DOT::Node.new('name'     => "#{container.full_name.gsub( /:/,'_' )}",
+                               'label'    => "",
+                               'width'  => (container.classes.empty? and
+                                            container.modules.empty?) ?
+                               '0.75' : '0.01',
+                               'height' => '0.01',
+                               'shape' => 'plaintext')
       end
+
       container.classes.each_with_index do |cl, cl_index|
         last_file = cl.in_files[-1].file_relative_name
 
         if use_fileboxes && !files.include?(last_file)
           @counter += 1
           files[last_file] =
-            DOT::DOTSubgraph.new('name'     => "cluster_#{@counter}",
+            DOT::Subgraph.new('name'     => "cluster_#{@counter}",
                                  'label'    => "#{last_file}",
                                  'fontname' => FONT,
                                  'color'=>
@@ -196,17 +201,17 @@
 
         next if cl.name == 'Object' || cl.name[0,2] == "<<"
 
-        url = cl.http_url("classes")
-        
+        url = cl.http_url("classes").sub(/\.html$/, @html_suffix)
+
         label = cl.name.dup
         if use_fileboxes && cl.in_files.length > 1
-          label <<  '\n[' + 
+          label <<  '\n[' +
                         cl.in_files.collect {|i|
-                             i.file_relative_name 
+                             i.file_relative_name
                         }.sort.join( '\n' ) +
                     ']'
-        end 
-                
+        end
+
         attrs = {
           'name' => "#{cl.full_name.gsub( /:/, '_' )}",
           'fontcolor' => 'black',
@@ -217,41 +222,41 @@
           'URL'   => %{"#{url}"}
         }
 
-        c = DOT::DOTNode.new(attrs)
-        
+        c = DOT::Node.new(attrs)
+
         if use_fileboxes
-          files[last_file].push c 
+          files[last_file].push c
         else
           graph << c
         end
       end
-      
+
       if use_fileboxes
         files.each_value do |val|
           graph << val
         end
       end
-      
+
       unless container.classes.empty?
         container.classes.each_with_index do |cl, cl_index|
           cl.includes.each do |m|
             m_full_name = find_full_name(m.name, cl)
             if @local_names.include?(m_full_name)
-              @global_graph << DOT::DOTEdge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
-                                      'to' => "#{cl.full_name.gsub( /:/,'_' )}",
-                                      'ltail' => "cluster_#{m_full_name.gsub( /:/,'_' )}")
+              @global_graph << DOT::Edge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
+                                             'to' => "#{cl.full_name.gsub( /:/,'_' )}",
+                                             'ltail' => "cluster_#{m_full_name.gsub( /:/,'_' )}")
             else
               unless @global_names.include?(m_full_name)
                 path = m_full_name.split("::")
-                url = File.join('classes', *path) + ".html"
-                @global_graph << DOT::DOTNode.new('name' => "#{m_full_name.gsub( /:/,'_' )}",
-                                          'shape' => 'box',
-                                          'label' => "#{m_full_name}",
-                                          'URL'   => %{"#{url}"})
+                url = File.join('classes', *path) + @html_suffix
+                @global_graph << DOT::Node.new('name' => "#{m_full_name.gsub( /:/,'_' )}",
+                                               'shape' => 'box',
+                                               'label' => "#{m_full_name}",
+                                               'URL'   => %{"#{url}"})
                 @global_names << m_full_name
               end
-              @global_graph << DOT::DOTEdge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
-                                      'to' => "#{cl.full_name.gsub( /:/, '_')}")
+              @global_graph << DOT::Edge.new('from' => "#{m_full_name.gsub( /:/,'_' )}",
+                                             'to' => "#{cl.full_name.gsub( /:/, '_')}")
             end
           end
 
@@ -260,28 +265,27 @@
           sclass_full_name = find_full_name(sclass,cl)
           unless @local_names.include?(sclass_full_name) or @global_names.include?(sclass_full_name)
             path = sclass_full_name.split("::")
-            url = File.join('classes', *path) + ".html"
-            @global_graph << DOT::DOTNode.new(
-                       'name' => "#{sclass_full_name.gsub( /:/, '_' )}",
-                       'label' => sclass_full_name,
-                       'URL'   => %{"#{url}"})
+            url = File.join('classes', *path) + @html_suffix
+            @global_graph << DOT::Node.new('name' => "#{sclass_full_name.gsub( /:/, '_' )}",
+                                           'label' => sclass_full_name,
+                                           'URL'   => %{"#{url}"})
             @global_names << sclass_full_name
           end
-          @global_graph << DOT::DOTEdge.new('from' => "#{sclass_full_name.gsub( /:/,'_' )}",
-                                    'to' => "#{cl.full_name.gsub( /:/, '_')}")
+          @global_graph << DOT::Edge.new('from' => "#{sclass_full_name.gsub( /:/,'_' )}",
+                                         'to' => "#{cl.full_name.gsub( /:/, '_')}")
         end
       end
 
       container.modules.each do |submod|
         draw_module(submod, graph)
       end
-      
+
     end
 
     def convert_to_png(file_base, graph)
       str = graph.to_s
       return @diagram_cache[str] if @diagram_cache[str]
-      op_type = Options.instance.image_format
+      op_type = @options.image_format
       dotfile = File.join(DOT_PATH, file_base)
       src = dotfile + ".dot"
       dot = dotfile + "." + op_type
@@ -294,7 +298,7 @@
       File.open(src, 'w+' ) do |f|
         f << str << "\n"
       end
-      
+
       system "dot", "-T#{op_type}", src, "-o", dot
 
       # Now construct the imagemap wrapper around
@@ -305,20 +309,20 @@
       return ret
     end
 
-    # Extract the client-side image map from dot, and use it
-    # to generate the imagemap proper. Return the whole
-    # <map>..<img> combination, suitable for inclusion on
-    # the page
+    ##
+    # Extract the client-side image map from dot, and use it to generate the
+    # imagemap proper. Return the whole <map>..<img> combination, suitable for
+    # inclusion on the page
 
     def wrap_in_image_map(src, dot)
       res = %{<map id="map" name="map">\n}
       dot_map = `dot -Tismap #{src}`
-      dot_map.each do |area|
+      dot_map.split($/).each do |area|
         unless area =~ /^rectangle \((\d+),(\d+)\) \((\d+),(\d+)\) ([\/\w.]+)\s*(.*)/
           $stderr.puts "Unexpected output from dot:\n#{area}"
           return nil
         end
-        
+
         xs, ys = [$1.to_i, $3.to_i], [$2.to_i, $4.to_i]
         url, area_name = $5, $6
 
@@ -331,5 +335,8 @@
       res << %{<img src="#{dot}" usemap="#map" border="0" alt="#{dot}">}
       return res
     end
+
   end
+
 end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/dot/dot.rb ../rdoc-f95-20090109-1/dot/dot.rb
--- ruby-1.8.7-p72/lib/rdoc/dot/dot.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/dot/dot.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,255 +0,0 @@
-module DOT
-
-    # these glogal vars are used to make nice graph source
-    $tab = '    '
-    $tab2 = $tab * 2
-
-    # if we don't like 4 spaces, we can change it any time
-    def change_tab( t )
-        $tab = t
-        $tab2 = t * 2
-    end
-
-    # options for node declaration
-    NODE_OPTS = [
-        'bgcolor',
-        'color',
-        'fontcolor',
-        'fontname',
-        'fontsize',
-        'height',
-        'width',
-        'label',
-        'layer',
-        'rank',
-        'shape',
-        'shapefile',
-        'style',
-        'URL',
-    ]
-
-    # options for edge declaration
-    EDGE_OPTS = [
-        'color',
-        'decorate',
-        'dir',
-        'fontcolor',
-        'fontname',
-        'fontsize',
-        'id',
-        'label',
-        'layer',
-        'lhead',
-        'ltail',
-        'minlen',
-        'style',
-        'weight'
-    ]
-
-    # options for graph declaration
-    GRAPH_OPTS = [
-        'bgcolor',
-        'center',
-        'clusterrank',
-        'color',
-        'compound',
-        'concentrate',
-        'fillcolor',
-        'fontcolor',
-        'fontname',
-        'fontsize',
-        'label',
-        'layerseq',
-        'margin',
-        'mclimit',
-        'nodesep',
-        'nslimit',
-        'ordering',
-        'orientation',
-        'page',
-        'rank',
-        'rankdir',
-        'ranksep',
-        'ratio',
-        'size',
-        'style',
-        'URL'
-    ]
-
-    # a root class for any element in dot notation
-    class DOTSimpleElement
-        attr_accessor :name
-
-        def initialize( params = {} )
-            @label = params['name'] ? params['name'] : ''
-        end
-
-        def to_s
-            @name
-        end
-    end
-
-    # an element that has options ( node, edge or graph )
-    class DOTElement < DOTSimpleElement
-        #attr_reader :parent
-        attr_accessor :name, :options
-
-        def initialize( params = {}, option_list = [] )
-            super( params )
-            @name = params['name'] ? params['name'] : nil
-            @parent = params['parent'] ? params['parent'] : nil
-            @options = {}
-            option_list.each{ |i|
-                @options[i] = params[i] if params[i]
-            }
-            @options['label'] ||= @name if @name != 'node'
-        end
-
-        def each_option
-            @options.each{ |i| yield i }
-        end
-
-        def each_option_pair
-            @options.each_pair{ |key, val| yield key, val }
-        end
-
-        #def parent=( thing )
-        #    @parent.delete( self ) if defined?( @parent ) and @parent
-        #    @parent = thing
-        #end
-    end
-
-
-    # this is used when we build nodes that have shape=record
-    # ports don't have options :)
-    class DOTPort < DOTSimpleElement
-        attr_accessor :label
-
-        def initialize( params = {} )
-            super( params )
-            @name = params['label'] ? params['label'] : ''
-        end
-        def to_s
-            ( @name && @name != "" ? "<#{@name}>" : "" ) + "#{@label}"
-        end
-    end
-
-    # node element
-    class DOTNode < DOTElement
-
-        def initialize( params = {}, option_list = NODE_OPTS )
-            super( params, option_list )
-            @ports = params['ports'] ? params['ports'] : []
-        end
-
-        def each_port
-            @ports.each{ |i| yield i }
-        end
-
-        def << ( thing )
-            @ports << thing
-        end
-
-        def push ( thing )
-            @ports.push( thing )
-        end
-
-        def pop
-            @ports.pop
-        end
-
-        def to_s( t = '' )
-
-            label = @options['shape'] != 'record' && @ports.length == 0 ?
-                @options['label'] ?
-                    t + $tab + "label = \"#{@options['label']}\"\n" :
-                    '' :
-                t + $tab + 'label = "' + " \\\n" +
-                t + $tab2 + "#{@options['label']}| \\\n" +
-                @ports.collect{ |i|
-                    t + $tab2 + i.to_s
-                }.join( "| \\\n" ) + " \\\n" +
-                t + $tab + '"' + "\n"
-
-            t + "#{@name} [\n" +
-            @options.to_a.collect{ |i|
-                i[1] && i[0] != 'label' ?
-                    t + $tab + "#{i[0]} = #{i[1]}" : nil
-            }.compact.join( ",\n" ) + ( label != '' ? ",\n" : "\n" ) +
-            label +
-            t + "]\n"
-        end
-    end
-
-    # subgraph element is the same to graph, but has another header in dot
-    # notation
-    class DOTSubgraph < DOTElement
-
-        def initialize( params = {}, option_list = GRAPH_OPTS )
-            super( params, option_list )
-            @nodes = params['nodes'] ? params['nodes'] : []
-            @dot_string = 'subgraph'
-        end
-
-        def each_node
-            @nodes.each{ |i| yield i }
-        end
-
-        def << ( thing )
-            @nodes << thing
-        end
-
-        def push( thing )
-            @nodes.push( thing )
-        end
-
-        def pop
-            @nodes.pop
-        end
-
-        def to_s( t = '' )
-          hdr = t + "#{@dot_string} #{@name} {\n"
-
-          options = @options.to_a.collect{ |name, val|
-            val && name != 'label' ?
-            t + $tab + "#{name} = #{val}" :
-              name ? t + $tab + "#{name} = \"#{val}\"" : nil
-          }.compact.join( "\n" ) + "\n"
-
-          nodes = @nodes.collect{ |i|
-            i.to_s( t + $tab )
-          }.join( "\n" ) + "\n"
-          hdr + options + nodes + t + "}\n"
-        end
-    end
-
-    # this is graph
-    class DOTDigraph < DOTSubgraph
-        def initialize( params = {}, option_list = GRAPH_OPTS )
-            super( params, option_list )
-            @dot_string = 'digraph'
-        end
-    end
-
-    # this is edge
-    class DOTEdge < DOTElement
-        attr_accessor :from, :to
-        def initialize( params = {}, option_list = EDGE_OPTS )
-            super( params, option_list )
-            @from = params['from'] ? params['from'] : nil
-            @to = params['to'] ? params['to'] : nil
-        end
-
-        def to_s( t = '' )
-            t + "#{@from} -> #{to} [\n" +
-            @options.to_a.collect{ |i|
-                i[1] && i[0] != 'label' ?
-                    t + $tab + "#{i[0]} = #{i[1]}" :
-                    i[1] ? t + $tab + "#{i[0]} = \"#{i[1]}\"" : nil
-            }.compact.join( "\n" ) + "\n" + t + "]\n"
-        end
-    end
-end
-
-
-
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/dot.rb ../rdoc-f95-20090109-1/dot.rb
--- ruby-1.8.7-p72/lib/rdoc/dot.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/dot.rb	2008-03-08 15:52:50.000000000 +0900
@@ -0,0 +1,249 @@
+module RDoc; end
+
+module RDoc::DOT
+
+  TAB = '  '
+  TAB2 = TAB * 2
+
+  # options for node declaration
+  NODE_OPTS = [
+    'bgcolor',
+    'color',
+    'fontcolor',
+    'fontname',
+    'fontsize',
+    'height',
+    'width',
+    'label',
+    'layer',
+    'rank',
+    'shape',
+    'shapefile',
+    'style',
+    'URL',
+  ]
+
+  # options for edge declaration
+  EDGE_OPTS = [
+    'color',
+    'decorate',
+    'dir',
+    'fontcolor',
+    'fontname',
+    'fontsize',
+    'id',
+    'label',
+    'layer',
+    'lhead',
+    'ltail',
+    'minlen',
+    'style',
+    'weight'
+  ]
+
+  # options for graph declaration
+  GRAPH_OPTS = [
+    'bgcolor',
+    'center',
+    'clusterrank',
+    'color',
+    'compound',
+    'concentrate',
+    'fillcolor',
+    'fontcolor',
+    'fontname',
+    'fontsize',
+    'label',
+    'layerseq',
+    'margin',
+    'mclimit',
+    'nodesep',
+    'nslimit',
+    'ordering',
+    'orientation',
+    'page',
+    'rank',
+    'rankdir',
+    'ranksep',
+    'ratio',
+    'size',
+    'style',
+    'URL'
+  ]
+
+  # a root class for any element in dot notation
+  class SimpleElement
+    attr_accessor :name
+
+    def initialize( params = {} )
+      @label = params['name'] ? params['name'] : ''
+    end
+
+    def to_s
+      @name
+    end
+  end
+
+  # an element that has options ( node, edge or graph )
+  class Element < SimpleElement
+    #attr_reader :parent
+    attr_accessor :name, :options
+
+    def initialize( params = {}, option_list = [] )
+      super( params )
+      @name = params['name'] ? params['name'] : nil
+      @parent = params['parent'] ? params['parent'] : nil
+      @options = {}
+      option_list.each{ |i|
+        @options[i] = params[i] if params[i]
+      }
+      @options['label'] ||= @name if @name != 'node'
+    end
+
+    def each_option
+      @options.each{ |i| yield i }
+    end
+
+    def each_option_pair
+      @options.each_pair{ |key, val| yield key, val }
+    end
+
+    #def parent=( thing )
+    #    @parent.delete( self ) if defined?( @parent ) and @parent
+    #    @parent = thing
+    #end
+  end
+
+
+  # this is used when we build nodes that have shape=record
+  # ports don't have options :)
+  class Port < SimpleElement
+    attr_accessor :label
+
+    def initialize( params = {} )
+      super( params )
+      @name = params['label'] ? params['label'] : ''
+    end
+    def to_s
+      ( @name && @name != "" ? "<#{@name}>" : "" ) + "#{@label}"
+    end
+  end
+
+  # node element
+  class Node < Element
+
+    def initialize( params = {}, option_list = NODE_OPTS )
+      super( params, option_list )
+      @ports = params['ports'] ? params['ports'] : []
+    end
+
+    def each_port
+      @ports.each{ |i| yield i }
+    end
+
+    def << ( thing )
+      @ports << thing
+    end
+
+    def push ( thing )
+      @ports.push( thing )
+    end
+
+    def pop
+      @ports.pop
+    end
+
+    def to_s( t = '' )
+
+      label = @options['shape'] != 'record' && @ports.length == 0 ?
+        @options['label'] ?
+        t + TAB + "label = \"#{@options['label']}\"\n" :
+                    '' :
+                    t + TAB + 'label = "' + " \\\n" +
+                    t + TAB2 + "#{@options['label']}| \\\n" +
+                    @ports.collect{ |i|
+        t + TAB2 + i.to_s
+      }.join( "| \\\n" ) + " \\\n" +
+        t + TAB + '"' + "\n"
+
+        t + "#{@name} [\n" +
+        @options.to_a.collect{ |i|
+        i[1] && i[0] != 'label' ?
+          t + TAB + "#{i[0]} = #{i[1]}" : nil
+      }.compact.join( ",\n" ) + ( label != '' ? ",\n" : "\n" ) +
+        label +
+        t + "]\n"
+    end
+  end
+
+  # subgraph element is the same to graph, but has another header in dot
+  # notation
+  class Subgraph < Element
+
+    def initialize( params = {}, option_list = GRAPH_OPTS )
+      super( params, option_list )
+      @nodes = params['nodes'] ? params['nodes'] : []
+      @dot_string = 'subgraph'
+    end
+
+    def each_node
+      @nodes.each{ |i| yield i }
+    end
+
+    def << ( thing )
+      @nodes << thing
+    end
+
+    def push( thing )
+      @nodes.push( thing )
+    end
+
+    def pop
+      @nodes.pop
+    end
+
+    def to_s( t = '' )
+      hdr = t + "#{@dot_string} #{@name} {\n"
+
+      options = @options.to_a.collect{ |name, val|
+        val && name != 'label' ?
+          t + TAB + "#{name} = #{val}" :
+        name ? t + TAB + "#{name} = \"#{val}\"" : nil
+      }.compact.join( "\n" ) + "\n"
+
+      nodes = @nodes.collect{ |i|
+        i.to_s( t + TAB )
+      }.join( "\n" ) + "\n"
+      hdr + options + nodes + t + "}\n"
+    end
+  end
+
+  # this is graph
+  class Digraph < Subgraph
+    def initialize( params = {}, option_list = GRAPH_OPTS )
+      super( params, option_list )
+      @dot_string = 'digraph'
+    end
+  end
+
+  # this is edge
+  class Edge < Element
+    attr_accessor :from, :to
+    def initialize( params = {}, option_list = EDGE_OPTS )
+      super( params, option_list )
+      @from = params['from'] ? params['from'] : nil
+      @to = params['to'] ? params['to'] : nil
+    end
+
+    def to_s( t = '' )
+      t + "#{@from} -> #{to} [\n" +
+        @options.to_a.collect{ |i|
+        i[1] && i[0] != 'label' ?
+          t + TAB + "#{i[0]} = #{i[1]}" :
+        i[1] ? t + TAB + "#{i[0]} = \"#{i[1]}\"" : nil
+      }.compact.join( "\n" ) + "\n" + t + "]\n"
+    end
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generator/chm/chm.rb ../rdoc-f95-20090109-1/generator/chm/chm.rb
--- ruby-1.8.7-p72/lib/rdoc/generator/chm/chm.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/generator/chm/chm.rb	2008-03-08 21:22:36.000000000 +0900
@@ -0,0 +1,98 @@
+require 'rdoc/generator/chm'
+require 'rdoc/generator/html/html'
+
+module RDoc::Generator::CHM::CHM
+
+  HTML = RDoc::Generator::HTML::HTML
+
+  INDEX = HTML::INDEX
+
+  CLASS_INDEX = HTML::CLASS_INDEX
+  CLASS_PAGE = HTML::CLASS_PAGE
+  FILE_INDEX = HTML::FILE_INDEX
+  FILE_PAGE = HTML::FILE_PAGE
+  METHOD_INDEX = HTML::METHOD_INDEX
+  METHOD_LIST = HTML::METHOD_LIST
+
+  FR_INDEX_BODY = HTML::FR_INDEX_BODY
+
+  # This is a nasty little hack, but hhc doesn't support the <?xml tag, so...
+  BODY = HTML::BODY.sub!(/<\?xml.*\?>/, '')
+  SRC_PAGE = HTML::SRC_PAGE.sub!(/<\?xml.*\?>/, '')
+
+  HPP_FILE = <<-EOF
+[OPTIONS]
+Auto Index = Yes
+Compatibility=1.1 or later
+Compiled file=<%= values["opname"] %>.chm
+Contents file=contents.hhc
+Full-text search=Yes
+Index file=index.hhk
+Language=0x409 English(United States)
+Title=<%= values["title"] %>
+
+[FILES]
+<% values["all_html_files"].each do |all_html_files| %>
+<%= all_html_files["html_file_name"] %>
+<% end # values["all_html_files"] %>
+  EOF
+
+  CONTENTS = <<-EOF
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<HTML>
+<HEAD>
+<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
+<!-- Sitemap 1.0 -->
+</HEAD><BODY>
+<OBJECT type="text/site properties">
+	<param name="Foreground" value="0x80">
+	<param name="Window Styles" value="0x800025">
+	<param name="ImageType" value="Folder">
+</OBJECT>
+<UL>
+<% values["contents"].each do |contents| %>
+	<LI> <OBJECT type="text/sitemap">
+		<param name="Name" value="<%= contents["c_name"] %>">
+		<param name="Local" value="<%= contents["ref"] %>">
+		</OBJECT>
+<% if contents["methods"] then %>
+<ul>
+<% contents["methods"].each do |methods| %>
+	<LI> <OBJECT type="text/sitemap">
+		<param name="Name" value="<%= methods["name"] %>">
+		<param name="Local" value="<%= methods["aref"] %>">
+		</OBJECT>
+<% end # contents["methods"] %>
+</ul>
+<% end %>
+        </LI>
+<% end # values["contents"] %>
+</UL>
+</BODY></HTML>
+  EOF
+
+  CHM_INDEX = <<-EOF
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<HTML>
+<HEAD>
+<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
+<!-- Sitemap 1.0 -->
+</HEAD><BODY>
+<OBJECT type="text/site properties">
+	<param name="Foreground" value="0x80">
+	<param name="Window Styles" value="0x800025">
+	<param name="ImageType" value="Folder">
+</OBJECT>
+<UL>
+<% values["index"].each do |index| %>
+	<LI> <OBJECT type="text/sitemap">
+		<param name="Name" value="<%= index["name"] %>">
+		<param name="Local" value="<%= index["aref"] %>">
+		</OBJECT>
+<% end # values["index"] %>
+</UL>
+</BODY></HTML>
+  EOF
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generator/chm.rb ../rdoc-f95-20090109-1/generator/chm.rb
--- ruby-1.8.7-p72/lib/rdoc/generator/chm.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/generator/chm.rb	2008-03-08 21:21:34.000000000 +0900
@@ -0,0 +1,113 @@
+require 'rdoc/generator/html'
+
+class RDoc::Generator::CHM < RDoc::Generator::HTML
+
+  HHC_PATH = "c:/Program Files/HTML Help Workshop/hhc.exe"
+
+  ##
+  # Standard generator factory
+
+  def self.for(options)
+    new(options)
+  end
+
+  def initialize(*args)
+    super
+    @op_name = @options.op_name || "rdoc"
+    check_for_html_help_workshop
+  end
+
+  def check_for_html_help_workshop
+    stat = File.stat(HHC_PATH)
+  rescue
+    $stderr <<
+      "\n.chm output generation requires that Microsoft's Html Help\n" <<
+      "Workshop is installed. RDoc looks for it in:\n\n    " <<
+      HHC_PATH <<
+      "\n\nYou can download a copy for free from:\n\n" <<
+      "    http://msdn.microsoft.com/library/default.asp?" <<
+      "url=/library/en-us/htmlhelp/html/hwMicrosoftHTMLHelpDownloads.asp\n\n"
+  end
+
+  ##
+  # Generate the html as normal, then wrap it in a help project
+
+  def generate(info)
+    super
+    @project_name = @op_name + ".hhp"
+    create_help_project
+  end
+
+  ##
+  # The project contains the project file, a table of contents and an index
+
+  def create_help_project
+    create_project_file
+    create_contents_and_index
+    compile_project
+  end
+
+  ##
+  # The project file links together all the various
+  # files that go to make up the help.
+
+  def create_project_file
+    template = RDoc::TemplatePage.new @template::HPP_FILE
+    values = { "title" => @options.title, "opname" => @op_name }
+    files = []
+    @files.each do |f|
+      files << { "html_file_name" => f.path }
+    end
+
+    values['all_html_files'] = files
+
+    File.open(@project_name, "w") do |f|
+      template.write_html_on(f, values)
+    end
+  end
+
+  ##
+  # The contents is a list of all files and modules.
+  # For each we include  as sub-entries the list
+  # of methods they contain. As we build the contents
+  # we also build an index file
+
+  def create_contents_and_index
+    contents = []
+    index    = []
+
+    (@files+@classes).sort.each do |entry|
+      content_entry = { "c_name" => entry.name, "ref" => entry.path }
+      index << { "name" => entry.name, "aref" => entry.path }
+
+      internals = []
+
+      methods = entry.build_method_summary_list(entry.path)
+
+      content_entry["methods"] = methods unless methods.empty?
+      contents << content_entry
+      index.concat methods
+    end
+
+    values = { "contents" => contents }
+    template = RDoc::TemplatePage.new @template::CONTENTS
+    File.open("contents.hhc", "w") do |f|
+      template.write_html_on(f, values)
+    end
+
+    values = { "index" => index }
+    template = RDoc::TemplatePage.new @template::CHM_INDEX
+    File.open("index.hhk", "w") do |f|
+      template.write_html_on(f, values)
+    end
+  end
+
+  ##
+  # Invoke the windows help compiler to compiler the project
+
+  def compile_project
+    system(HHC_PATH, @project_name)
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generator/html/hefss.rb ../rdoc-f95-20090109-1/generator/html/hefss.rb
--- ruby-1.8.7-p72/lib/rdoc/generator/html/hefss.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/generator/html/hefss.rb	2008-03-08 21:27:15.000000000 +0900
@@ -0,0 +1,414 @@
+require 'rdoc/generator/html'
+require 'rdoc/generator/html/html'
+
+module RDoc::Generator::HTML::HEFSS
+
+  FONTS = "Verdana, Arial, Helvetica, sans-serif"
+
+STYLE = <<-EOF
+body,p { font-family: Verdana, Arial, Helvetica, sans-serif;
+       color: #000040; background: #BBBBBB;
+}
+
+td { font-family: Verdana, Arial, Helvetica, sans-serif;
+       color: #000040;
+}
+
+.attr-rw { font-size: small; color: #444488 }
+
+.title-row {color:      #eeeeff;
+	    background: #BBBBDD;
+}
+
+.big-title-font { color: white;
+                  font-family: Verdana, Arial, Helvetica, sans-serif;
+                  font-size: large;
+                  height: 50px}
+
+.small-title-font { color: purple;
+                    font-family: Verdana, Arial, Helvetica, sans-serif;
+                    font-size: small; }
+
+.aqua { color: purple }
+
+.method-name, attr-name {
+      font-family: monospace; font-weight: bold;
+}
+
+.tablesubtitle {
+   width: 100%;
+   margin-top: 1ex;
+   margin-bottom: .5ex;
+   padding: 5px 0px 5px 20px;
+   font-size: large;
+   color: purple;
+   background: #BBBBCC;
+}
+
+.tablesubsubtitle {
+   width: 100%;
+   margin-top: 1ex;
+   margin-bottom: .5ex;
+   padding: 5px 0px 5px 20px;
+   font-size: medium;
+   color: white;
+   background: #BBBBCC;
+}
+
+.name-list {
+  font-family: monospace;
+  margin-left: 40px;
+  margin-bottom: 2ex;
+  line-height: 140%;
+}
+
+.description {
+  margin-left: 40px;
+  margin-bottom: 2ex;
+  line-height: 140%;
+}
+
+.methodtitle {
+  font-size: medium;
+  text_decoration: none;
+  padding: 3px 3px 3px 20px;
+  color: #0000AA;
+}
+
+.column-title {
+  font-size: medium;
+  font-weight: bold;
+  text_decoration: none;
+  padding: 3px 3px 3px 20px;
+  color: #3333CC;
+  }
+
+.variable-name {
+  font-family: monospace;
+  font-size: medium;
+  text_decoration: none;
+  padding: 3px 3px 3px 20px;
+  color: #0000AA;
+}
+
+.row-name {
+  font-size: medium;
+  font-weight: medium;
+  font-family: monospace;
+  text_decoration: none;
+  padding: 3px 3px 3px 20px;
+}
+
+.paramsig {
+   font-size: small;
+}
+
+.srcbut { float: right }
+
+  EOF
+
+  BODY = <<-EOF
+<html><head>
+  <title><%= values["title"] %></title>
+  <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>">
+  <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" media="screen" />
+  <script type="text/javascript" language="JavaScript">
+  <!--
+  function popCode(url) {
+    parent.frames.source.location = url
+  }
+  //-->
+  </script>
+</head>
+<body bgcolor="#BBBBBB">
+
+<%= template_include %>  <!-- banner header -->
+
+<% if values["diagram"] then %>
+<table width="100%"><tr><td align="center">
+<%= values["diagram"] %>
+</td></tr></table>
+<% end %>
+
+<% if values["description"] then %>
+<div class="description"><%= values["description"] %></div>
+<% end %>
+
+<% if values["requires"] then %>
+<table cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Required files</td></tr>
+</table><br />
+<div class="name-list">
+<% values["requires"].each do |requires| %>
+<%= href requires["aref"], requires["name"] %>
+<% end # values["requires"] %>
+<% end %>
+</div>
+
+<% if values["sections"] then %>
+<% values["sections"].each do |sections| %>
+<% if sections["method_list"] then %>
+<% sections["method_list"].each do |method_list| %>
+<% if method_list["methods"] then %>
+<table cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Subroutines and Functions</td></tr>
+</table><br />
+<div class="name-list">
+<% method_list["methods"].each do |methods| %>
+<a href="<%= methods["codeurl"] %>" target="source"><%= methods["name"] %></a>
+<% end # values["methods"] %>
+</div>
+<% end %>
+<% end # values["method_list"] %>
+<% end %>
+
+<% if sections["attributes"] then %>
+<table cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Arguments</td></tr>
+</table><br />
+<table cellspacing="5">
+<% sections["attributes"].each do |attributes| %>
+     <tr valign="top">
+<% if attributes["rw"] then %>
+       <td align="center" class="attr-rw">&nbsp;[<%= attributes["rw"] %>]&nbsp;</td>
+<% end %>
+<% unless attributes["rw"] then %>
+       <td></td>
+<% end %>
+       <td class="attr-name"><%= attributes["name"] %></td>
+       <td><%= attributes["a_desc"] %></td>
+     </tr>
+<% end # values["attributes"] %>
+</table>
+<% end %>
+<% end # values["sections"] %>
+<% end %>
+
+<% if values["classlist"] then %>
+<table cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Modules</td></tr>
+</table><br />
+<%= values["classlist"] %><br />
+<% end %>
+
+  <%= template_include %>  <!-- method descriptions -->
+
+</body>
+</html>
+  EOF
+
+  FILE_PAGE = <<-EOF
+<table width="100%">
+ <tr class="title-row">
+ <td><table width="100%"><tr>
+   <td class="big-title-font" colspan="2"><font size="-3"><b>File</b><br /></font><%= values["short_name"] %></td>
+   <td align="right"><table cellspacing="0" cellpadding="2">
+         <tr>
+           <td  class="small-title-font">Path:</td>
+           <td class="small-title-font"><%= values["full_path"] %>
+<% if values["cvsurl"] then %>
+				&nbsp;(<a href="<%= values["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
+<% end %>
+           </td>
+         </tr>
+         <tr>
+           <td class="small-title-font">Modified:</td>
+           <td class="small-title-font"><%= values["dtm_modified"] %></td>
+         </tr>
+        </table>
+    </td></tr></table></td>
+  </tr>
+</table><br />
+  EOF
+
+  CLASS_PAGE = <<-EOF
+<table width="100%" border="0" cellspacing="0">
+ <tr class="title-row">
+ <td class="big-title-font">
+   <font size="-3"><b><%= values["classmod"] %></b><br /></font><%= values["full_name"] %>
+ </td>
+ <td align="right">
+   <table cellspacing="0" cellpadding="2">
+     <tr valign="top">
+      <td class="small-title-font">In:</td>
+      <td class="small-title-font">
+<% values["infiles"].each do |infiles| %>
+<%= href infiles["full_path_url"], infiles["full_path"] %>
+<% if infiles["cvsurl"] then %>
+&nbsp;(<a href="<%= infiles["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
+<% end %>
+<% end # values["infiles"] %>
+      </td>
+     </tr>
+<% if values["parent"] then %>
+     <tr>
+      <td class="small-title-font">Parent:</td>
+      <td class="small-title-font">
+<% if values["par_url"] then %>
+        <a href="<%= values["par_url"] %>" class="cyan">
+<% end %>
+<%= values["parent"] %>
+<% if values["par_url"] then %>
+         </a>
+<% end %>
+      </td>
+     </tr>
+<% end %>
+   </table>
+  </td>
+  </tr>
+</table><br />
+  EOF
+
+  METHOD_LIST = <<-EOF
+<% if values["includes"] then %>
+<div class="tablesubsubtitle">Uses</div><br />
+<div class="name-list">
+<% values["includes"].each do |includes| %>
+    <span class="method-name"><%= href includes["aref"], includes["name"] %></span>
+<% end # values["includes"] %>
+</div>
+<% end %>
+
+<% if values["sections"] then %>
+<% values["sections"].each do |sections| %>
+<% if sections["method_list"] then %>
+<% sections["method_list"].each do |method_list| %>
+<% if method_list["methods"] then %>
+<table cellpadding="5" width="100%">
+<tr><td class="tablesubtitle"><%= method_list["type"] %> <%= method_list["category"] %> methods</td></tr>
+</table>
+<% method_list["methods"].each do |methods| %>
+<table width="100%" cellspacing="0" cellpadding="5" border="0">
+<tr><td class="methodtitle">
+<a name="<%= methods["aref"] %>">
+<b><%= methods["name"] %></b><%= methods["params"] %>
+<% if methods["codeurl"] then %>
+<a href="<%= methods["codeurl"] %>" target="source" class="srclink">src</a>
+<% end %>
+</a></td></tr>
+</table>
+<% if method_list["m_desc"] then %>
+<div class="description">
+<%= method_list["m_desc"] %>
+</div>
+<% end %>
+<% end # method_list["methods"] %>
+<% end %>
+<% end # sections["method_list"] %>
+<% end %>
+<% end # values["sections"] %>
+<% end %>
+  EOF
+
+  SRC_PAGE = <<-EOF
+<html>
+<head><title><%= values["title"] %></title>
+<meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>">
+<style type="text/css">
+  .kw { color: #3333FF; font-weight: bold }
+  .cmt { color: green; font-style: italic }
+  .str { color: #662222; font-style: italic }
+  .re  { color: #662222; }
+.ruby-comment    { color: green; font-style: italic }
+.ruby-constant   { color: #4433aa; font-weight: bold; }
+.ruby-identifier { color: #222222;  }
+.ruby-ivar       { color: #2233dd; }
+.ruby-keyword    { color: #3333FF; font-weight: bold }
+.ruby-node       { color: #777777; }
+.ruby-operator   { color: #111111;  }
+.ruby-regexp     { color: #662222; }
+.ruby-value      { color: #662222; font-style: italic }
+</style>
+</head>
+<body bgcolor="#BBBBBB">
+<pre><%= values["code"] %></pre>
+</body>
+</html>
+  EOF
+
+  FR_INDEX_BODY = %{
+<%= template_include %>
+}
+
+  FILE_INDEX = <<-EOF
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>">
+<style type="text/css">
+<!--
+  body {
+background-color: #bbbbbb;
+     font-family: #{FONTS};
+       font-size: 11px;
+      font-style: normal;
+     line-height: 14px;
+           color: #000040;
+  }
+div.banner {
+  background: #bbbbcc;
+  color:      white;
+  padding: 1;
+  margin: 0;
+  font-size: 90%;
+  font-weight: bold;
+  line-height: 1.1;
+  text-align: center;
+  width: 100%;
+}
+
+-->
+</style>
+<base target="docwin">
+</head>
+<body>
+<div class="banner"><%= values["list_title"] %></div>
+<% values["entries"].each do |entries| %>
+<a href="<%= entries["href"] %>"><%= entries["name"] %></a><br />
+<% end # values["entries"] %>
+</body></html>
+  EOF
+
+  CLASS_INDEX = FILE_INDEX
+  METHOD_INDEX = FILE_INDEX
+
+  INDEX = <<-EOF
+<html>
+<head>
+  <title><%= values["title"] %></title>
+  <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>">
+</head>
+
+<frameset cols="20%,*">
+    <frameset rows="15%,35%,50%">
+        <frame src="fr_file_index.html"   title="Files" name="Files">
+        <frame src="fr_class_index.html"  name="Modules">
+        <frame src="fr_method_index.html" name="Subroutines and Functions">
+    </frameset>
+    <frameset rows="80%,20%">
+      <frame  src="<%= values["initial_page"] %>" name="docwin">
+      <frame  src="blank.html" name="source">
+    </frameset>
+    <noframes>
+          <body bgcolor="#BBBBBB">
+            Click <a href="html/index.html">here</a> for a non-frames
+            version of this page.
+          </body>
+    </noframes>
+</frameset>
+
+</html>
+  EOF
+
+  # Blank page to use as a target
+  BLANK = %{
+<html><body bgcolor="#BBBBBB"></body></html>
+}
+
+  def write_extra_pages
+    template = TemplatePage.new(BLANK)
+    File.open("blank.html", "w") { |f| template.write_html_on(f, {}) }
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generator/html/html.rb ../rdoc-f95-20090109-1/generator/html/html.rb
--- ruby-1.8.7-p72/lib/rdoc/generator/html/html.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/generator/html/html.rb	2008-03-08 21:30:06.000000000 +0900
@@ -0,0 +1,708 @@
+require 'rdoc/generator/html'
+require 'rdoc/generator/html/one_page_html'
+
+##
+# = CSS2 RDoc HTML template
+#
+# This is a template for RDoc that uses XHTML 1.0 Transitional and dictates a
+# bit more of the appearance of the output to cascading stylesheets than the
+# default. It was designed for clean inline code display, and uses DHTMl to
+# toggle the visbility of each method's source with each click on the '[source]'
+# link.
+#
+# == Authors
+#
+# * Michael Granger <ged@FaerieMUD.org>
+#
+# Copyright (c) 2002, 2003 The FaerieMUD Consortium. Some rights reserved.
+#
+# This work is licensed under the Creative Commons Attribution License. To view
+# a copy of this license, visit http://creativecommons.org/licenses/by/1.0/ or
+# send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
+# 94305, USA.
+
+module RDoc::Generator::HTML::HTML
+
+  FONTS = "Verdana,Arial,Helvetica,sans-serif"
+
+  STYLE = <<-EOF
+body {
+    font-family: Verdana,Arial,Helvetica,sans-serif;
+    font-size:   90%;
+    margin: 0;
+    margin-left: 40px;
+    padding: 0;
+    background: white;
+}
+
+h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
+h1 { font-size: 150%; }
+h2,h3,h4 { margin-top: 1em; }
+
+a { background: #eef; color: #039; text-decoration: none; }
+a:hover { background: #039; color: #eef; }
+
+/* Override the base stylesheet's Anchor inside a table cell */
+td > a {
+  background: transparent;
+  color: #039;
+  text-decoration: none;
+}
+
+/* and inside a section title */
+.section-title > a {
+  background: transparent;
+  color: #eee;
+  text-decoration: none;
+}
+
+/* === Structural elements =================================== */
+
+div#index {
+    margin: 0;
+    margin-left: -40px;
+    padding: 0;
+    font-size: 90%;
+}
+
+
+div#index a {
+    margin-left: 0.7em;
+}
+
+div#index .section-bar {
+   margin-left: 0px;
+   padding-left: 0.7em;
+   background: #ccc;
+   font-size: small;
+}
+
+
+div#classHeader, div#fileHeader {
+    width: auto;
+    color: white;
+    padding: 0.5em 1.5em 0.5em 1.5em;
+    margin: 0;
+    margin-left: -40px;
+    border-bottom: 3px solid #006;
+}
+
+div#classHeader a, div#fileHeader a {
+    background: inherit;
+    color: white;
+}
+
+div#classHeader td, div#fileHeader td {
+    background: inherit;
+    color: white;
+}
+
+
+div#fileHeader {
+    background: #057;
+}
+
+div#classHeader {
+    background: #048;
+}
+
+
+.class-name-in-header {
+  font-size:  180%;
+  font-weight: bold;
+}
+
+
+div#bodyContent {
+    padding: 0 1.5em 0 1.5em;
+}
+
+div#description {
+    padding: 0.5em 1.5em;
+    background: #efefef;
+    border: 1px dotted #999;
+}
+
+div#description h1,h2,h3,h4,h5,h6 {
+    color: #125;;
+    background: transparent;
+}
+
+div#validator-badges {
+    text-align: center;
+}
+div#validator-badges img { border: 0; }
+
+div#copyright {
+    color: #333;
+    background: #efefef;
+    font: 0.75em sans-serif;
+    margin-top: 5em;
+    margin-bottom: 0;
+    padding: 0.5em 2em;
+}
+
+
+/* === Classes =================================== */
+
+table.header-table {
+    color: white;
+    font-size: small;
+}
+
+.type-note {
+    font-size: small;
+    color: #DEDEDE;
+}
+
+.xxsection-bar {
+    background: #eee;
+    color: #333;
+    padding: 3px;
+}
+
+.section-bar {
+   color: #333;
+   border-bottom: 1px solid #999;
+    margin-left: -20px;
+}
+
+
+.section-title {
+    background: #79a;
+    color: #eee;
+    padding: 3px;
+    margin-top: 2em;
+    margin-left: -30px;
+    border: 1px solid #999;
+}
+
+.top-aligned-row {  vertical-align: top }
+.bottom-aligned-row { vertical-align: bottom }
+
+/* --- Context section classes ----------------------- */
+
+.context-row { }
+.context-item-name { font-family: monospace; font-weight: bold; color: black; }
+.context-item-value { font-size: small; color: #448; }
+.context-item-desc { color: #333; padding-left: 2em; }
+
+/* --- Method classes -------------------------- */
+.method-detail {
+    background: #efefef;
+    padding: 0;
+    margin-top: 0.5em;
+    margin-bottom: 1em;
+    border: 1px dotted #ccc;
+}
+.method-heading {
+  color: black;
+  background: #ccc;
+  border-bottom: 1px solid #666;
+  padding: 0.2em 0.5em 0 0.5em;
+}
+.method-signature { color: black; background: inherit; }
+.method-name { font-weight: bold; }
+.method-args { font-style: italic; }
+.method-description { padding: 0 0.5em 0 0.5em; }
+
+/* --- Source code sections -------------------- */
+
+a.source-toggle { font-size: 90%; }
+div.method-source-code {
+    background: #262626;
+    color: #ffdead;
+    margin: 1em;
+    padding: 0.5em;
+    border: 1px dashed #999;
+    overflow: scroll;
+}
+
+div.method-source-code pre {
+    color: #ffdead;
+    overflow: visible;
+}
+
+
+/* --- Ruby keyword styles --------------------- */
+
+.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
+
+.ruby-constant  { color: #7fffd4; background: transparent; }
+.ruby-keyword { color: #00ffff; background: transparent; }
+.ruby-ivar    { color: #eedd82; background: transparent; }
+.ruby-operator  { color: #00ffee; background: transparent; }
+.ruby-identifier { color: #ffdead; background: transparent; }
+.ruby-node    { color: #ffa07a; background: transparent; }
+.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
+.ruby-regexp  { color: #ffa07a; background: transparent; }
+.ruby-value   { color: #7fffd4; background: transparent; }
+EOF
+
+
+#####################################################################
+### H E A D E R   T E M P L A T E
+#####################################################################
+
+  XHTML_PREAMBLE = <<-EOF
+<?xml version="1.0" encoding="<%= values["charset"] %>"?>
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+  EOF
+
+  HEADER = XHTML_PREAMBLE + <<-EOF
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title><%= values["title"] %></title>
+  <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\\"text/css\\">div.method-source-code { display: none }</style>" )
+
+  // ]]>
+  </script>
+
+</head>
+<body>
+EOF
+
+#####################################################################
+### C O N T E X T   C O N T E N T   T E M P L A T E
+#####################################################################
+
+  CONTEXT_CONTENT = %{
+}
+
+#####################################################################
+### F O O T E R   T E M P L A T E
+#####################################################################
+
+  FOOTER = <<-EOF
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
+  EOF
+
+
+#####################################################################
+### F I L E   P A G E   H E A D E R   T E M P L A T E
+#####################################################################
+
+  FILE_PAGE = <<-EOF
+  <div id="fileHeader">
+    <h1><%= values["short_name"] %></h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td><%= values["full_path"] %>
+<% if values["cvsurl"] then %>
+        &nbsp;(<a href="<%= values["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
+<% end %>
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td><%= values["dtm_modified"] %></td>
+    </tr>
+    </table>
+  </div>
+  EOF
+
+#####################################################################
+### C L A S S   P A G E   H E A D E R   T E M P L A T E
+#####################################################################
+
+  CLASS_PAGE = <<-EOF
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong><%= values["classmod"] %></strong></td>
+          <td class="class-name-in-header"><%= values["full_name"] %></td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+<% values["infiles"].each do |infiles| %>
+<% if infiles["full_path_url"] then %>
+                <a href="<%= infiles["full_path_url"] %>">
+<% end %>
+                <%= infiles["full_path"] %>
+<% if infiles["full_path_url"] then %>
+                </a>
+<% end %>
+<% if infiles["cvsurl"] then %>
+        &nbsp;(<a href="<%= infiles["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
+<% end %>
+        <br />
+<% end # values["infiles"] %>
+            </td>
+        </tr>
+
+<% if values["parent"] then %>
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+<% if values["par_url"] then %>
+                <a href="<%= values["par_url"] %>">
+<% end %>
+                <%= values["parent"] %>
+<% if values["par_url"] then %>
+               </a>
+<% end %>
+            </td>
+        </tr>
+<% end %>
+        </table>
+    </div>
+  EOF
+
+#####################################################################
+### M E T H O D   L I S T   T E M P L A T E
+#####################################################################
+
+  METHOD_LIST = <<-EOF
+
+  <div id="contextContent">
+<% if values["diagram"] then %>
+    <div id="diagram">
+      <%= values["diagram"] %>
+    </div>
+<% end %>
+
+<% if values["description"] then %>
+    <div id="description">
+      <%= values["description"] %>
+    </div>
+<% end %>
+
+<% if values["requires"] then %>
+    <div id="requires-list">
+      <h3 class="section-bar">Required files</h3>
+
+      <div class="name-list">
+<% values["requires"].each do |requires| %>
+        <%= href requires["aref"], requires["name"] %>&nbsp;&nbsp;
+<% end # values["requires"] %>
+      </div>
+    </div>
+<% end %>
+
+<% if values["toc"] then %>
+    <div id="contents-list">
+      <h3 class="section-bar">Contents</h3>
+      <ul>
+<% values["toc"].each do |toc| %>
+      <li><a href="#<%= values["href"] %>"><%= values["secname"] %></a></li>
+<% end # values["toc"] %>
+     </ul>
+<% end %>
+   </div>
+
+<% if values["methods"] then %>
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+<% values["methods"].each do |methods| %>
+        <%= href methods["aref"], methods["name"] %>&nbsp;&nbsp;
+<% end # values["methods"] %>
+      </div>
+    </div>
+<% end %>
+
+  </div>
+
+
+    <!-- if includes -->
+<% if values["includes"] then %>
+    <div id="includes">
+      <h3 class="section-bar">Included Modules</h3>
+
+      <div id="includes-list">
+<% values["includes"].each do |includes| %>
+        <span class="include-name"><%= href includes["aref"], includes["name"] %></span>
+<% end # values["includes"] %>
+      </div>
+    </div>
+<% end %>
+
+<% values["sections"].each do |sections| %>
+    <div id="section">
+<% if sections["sectitle"] then %>
+      <h2 class="section-title"><a name="<%= sections["secsequence"] %>"><%= sections["sectitle"] %></a></h2>
+<% if sections["seccomment"] then %>
+      <div class="section-comment">
+        <%= sections["seccomment"] %>
+      </div>
+<% end %>
+<% end %>
+
+<% if values["classlist"] then %>
+    <div id="class-list">
+      <h3 class="section-bar">Classes and Modules</h3>
+
+      <%= values["classlist"] %>
+    </div>
+<% end %>
+
+<% if values["constants"] then %>
+    <div id="constants-list">
+      <h3 class="section-bar">Constants</h3>
+
+      <div class="name-list">
+        <table summary="Constants">
+<% values["constants"].each do |constants| %>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name"><%= constants["name"] %></td>
+          <td>=</td>
+          <td class="context-item-value"><%= constants["value"] %></td>
+<% if values["desc"] then %>
+          <td width="3em">&nbsp;</td>
+          <td class="context-item-desc"><%= constants["desc"] %></td>
+<% end %>
+        </tr>
+<% end # values["constants"] %>
+        </table>
+      </div>
+    </div>
+<% end %>
+
+<% if values["aliases"] then %>
+    <div id="aliases-list">
+      <h3 class="section-bar">External Aliases</h3>
+
+      <div class="name-list">
+                        <table summary="aliases">
+<% values["aliases"].each do |aliases| $stderr.puts({ :aliases => aliases }.inspect) %>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name"><%= values["old_name"] %></td>
+          <td>-&gt;</td>
+          <td class="context-item-value"><%= values["new_name"] %></td>
+        </tr>
+<% if values["desc"] then %>
+      <tr class="top-aligned-row context-row">
+        <td>&nbsp;</td>
+        <td colspan="2" class="context-item-desc"><%= values["desc"] %></td>
+      </tr>
+<% end %>
+<% end # values["aliases"] %>
+        </table>
+      </div>
+    </div>
+<% end %>
+
+
+<% if values["attributes"] then %>
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+<% values["attributes"].each do |attributes| $stderr.puts({ :attributes => attributes }.inspect) %>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name"><%= values["name"] %></td>
+<% if values["rw"] then %>
+          <td class="context-item-value">&nbsp;[<%= values["rw"] %>]&nbsp;</td>
+<% end %>
+<% unless values["rw"] then %>
+          <td class="context-item-value">&nbsp;&nbsp;</td>
+<% end %>
+          <td class="context-item-desc"><%= values["a_desc"] %></td>
+        </tr>
+<% end # values["attributes"] %>
+        </table>
+      </div>
+    </div>
+<% end %>
+      
+
+
+    <!-- if method_list -->
+<% if sections["method_list"] then %>
+    <div id="methods">
+<% sections["method_list"].each do |method_list| %>
+<% if method_list["methods"] then %>
+      <h3 class="section-bar"><%= method_list["type"] %> <%= method_list["category"] %> methods</h3>
+
+<% method_list["methods"].each do |methods| %>
+      <div id="method-<%= methods["aref"] %>" class="method-detail">
+        <a name="<%= methods["aref"] %>"></a>
+
+        <div class="method-heading">
+<% if methods["codeurl"] then %>
+          <a href="<%= methods["codeurl"] %>" target="Code" class="method-signature"
+            onclick="popupCode('<%= methods["codeurl"] %>');return false;">
+<% end %>
+<% if methods["sourcecode"] then %>
+          <a href="#<%= methods["aref"] %>" class="method-signature">
+<% end %>
+<% if methods["callseq"] then %>
+          <span class="method-name"><%= methods["callseq"] %></span>
+<% end %>
+<% unless methods["callseq"] then %>
+          <span class="method-name"><%= methods["name"] %></span><span class="method-args"><%= methods["params"] %></span>
+<% end %>
+<% if methods["codeurl"] then %>
+          </a>
+<% end %>
+<% if methods["sourcecode"] then %>
+          </a>
+<% end %>
+        </div>
+
+        <div class="method-description">
+<% if methods["m_desc"] then %>
+          <%= methods["m_desc"] %>
+<% end %>
+<% if methods["sourcecode"] then %>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('<%= methods["aref"] %>-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="<%= methods["aref"] %>-source">
+<pre>
+<%= methods["sourcecode"] %>
+</pre>
+          </div>
+<% end %>
+        </div>
+      </div>
+
+<% end # method_list["methods"] %>
+<% end %>
+<% end # sections["method_list"] %>
+
+    </div>
+<% end %>
+<% end # values["sections"] %>
+  EOF
+
+#####################################################################
+### B O D Y   T E M P L A T E
+#####################################################################
+
+  BODY = HEADER + %{
+
+<%= template_include %>  <!-- banner header -->
+
+  <div id="bodyContent">
+
+} +  METHOD_LIST + %{
+
+  </div>
+
+} + FOOTER
+
+#####################################################################
+### S O U R C E   C O D E   T E M P L A T E
+#####################################################################
+
+  SRC_PAGE = XHTML_PREAMBLE + <<-EOF
+<html>
+<head>
+  <title><%= values["title"] %></title>
+  <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
+  <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" media="screen" />
+</head>
+<body class="standalone-code">
+  <pre><%= values["code"] %></pre>
+</body>
+</html>
+  EOF
+
+
+#####################################################################
+### I N D E X   F I L E   T E M P L A T E S
+#####################################################################
+
+  FR_INDEX_BODY = %{
+<%= template_include %>
+}
+
+  FILE_INDEX = XHTML_PREAMBLE + <<-EOF
+<!--
+
+    <%= values["list_title"] %>
+
+  -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title><%= values["list_title"] %></title>
+  <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
+  <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" />
+  <base target="docwin" />
+</head>
+<body>
+<div id="index">
+  <h1 class="section-bar"><%= values["list_title"] %></h1>
+  <div id="index-entries">
+<% values["entries"].each do |entries| %>
+    <a href="<%= entries["href"] %>"><%= entries["name"] %></a><br />
+<% end # values["entries"] %>
+  </div>
+</div>
+</body>
+</html>
+  EOF
+
+  CLASS_INDEX = FILE_INDEX
+  METHOD_INDEX = FILE_INDEX
+
+  INDEX = <<-EOF
+<?xml version="1.0" encoding="<%= values["charset"] %>"?>
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+
+<!--
+
+    <%= values["title"] %>
+
+  -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title><%= values["title"] %></title>
+  <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
+</head>
+<frameset rows="20%, 80%">
+    <frameset cols="25%,35%,45%">
+        <frame src="fr_file_index.html"   title="Files" name="Files" />
+        <frame src="fr_class_index.html"  name="Classes" />
+        <frame src="fr_method_index.html" name="Methods" />
+    </frameset>
+    <frame src="<%= values["initial_page"] %>" name="docwin" />
+</frameset>
+</html>
+  EOF
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generator/html/kilmer.rb ../rdoc-f95-20090109-1/generator/html/kilmer.rb
--- ruby-1.8.7-p72/lib/rdoc/generator/html/kilmer.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/generator/html/kilmer.rb	2008-03-08 21:27:15.000000000 +0900
@@ -0,0 +1,418 @@
+require 'rdoc/generator/html'
+
+module RDoc::Generator::HTML::KILMER
+
+  FONTS = "Verdana, Arial, Helvetica, sans-serif"
+
+  STYLE = <<-EOF
+body,td,p { font-family: <%= values["fonts"] %>;
+       color: #000040;
+}
+
+.attr-rw { font-size: xx-small; color: #444488 }
+
+.title-row { background-color: #CCCCFF;
+             color:      #000010;
+}
+
+.big-title-font {
+  color: black;
+  font-weight: bold;
+  font-family: <%= values["fonts"] %>;
+  font-size: large;
+  height: 60px;
+  padding: 10px 3px 10px 3px;
+}
+
+.small-title-font { color: black;
+                    font-family: <%= values["fonts"] %>;
+                    font-size:10; }
+
+.aqua { color: black }
+
+.method-name, .attr-name {
+      font-family: font-family: <%= values["fonts"] %>;
+      font-weight: bold;
+      font-size: small;
+      margin-left: 20px;
+      color: #000033;
+}
+
+.tablesubtitle, .tablesubsubtitle {
+   width: 100%;
+   margin-top: 1ex;
+   margin-bottom: .5ex;
+   padding: 5px 0px 5px 3px;
+   font-size: large;
+   color: black;
+   background-color: #CCCCFF;
+   border: thin;
+}
+
+.name-list {
+  margin-left: 5px;
+  margin-bottom: 2ex;
+  line-height: 105%;
+}
+
+.description {
+  margin-left: 5px;
+  margin-bottom: 2ex;
+  line-height: 105%;
+  font-size: small;
+}
+
+.methodtitle {
+  font-size: small;
+  font-weight: bold;
+  text-decoration: none;
+  color: #000033;
+  background-color: white;
+}
+
+.srclink {
+  font-size: small;
+  font-weight: bold;
+  text-decoration: none;
+  color: #0000DD;
+  background-color: white;
+}
+
+.paramsig {
+   font-size: small;
+}
+
+.srcbut { float: right }
+  EOF
+
+  BODY = <<-EOF
+<html><head>
+  <title><%= values["title"] %></title>
+  <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>">
+  <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" media="screen" />
+  <script type="text/javascript" language="JavaScript">
+  <!--
+  function popCode(url) {
+    parent.frames.source.location = url
+  }
+  //-->
+  </script>
+</head>
+<body bgcolor="white">
+
+<%= template_include %>  <!-- banner header -->
+
+<% if values["diagram"] then %>
+<table width="100%"><tr><td align="center">
+<%= values["diagram"] %>
+</td></tr></table>
+<% end %>
+
+<% if values["description"] then %>
+<div class="description"><%= values["description"] %></div>
+<% end %>
+
+<% if values["requires"] then %>
+<table cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Required files</td></tr>
+</table><br />
+<div class="name-list">
+<% values["requires"].each do |requires| %>
+<%= href requires["aref"], requires["name"] %>
+<% end # values["requires"] %>
+<% end %>
+</div>
+
+<% if values["methods"] then %>
+<table cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Methods</td></tr>
+</table><br />
+<div class="name-list">
+<% values["methods"].each do |methods| %>
+<%= href methods["aref"], methods["name"] %>,
+<% end # values["methods"] %>
+</div>
+<% end %>
+
+
+<% values["sections"].each do |sections| %>
+    <div id="section">
+<% if sections["sectitle"] then %>
+      <h2 class="section-title"><a name="<%= sections["secsequence"] %>"><%= sections["sectitle"] %></a></h2>
+<% if sections["seccomment"] then %>
+      <div class="section-comment">
+        <%= sections["seccomment"] %>
+      </div>
+<% end %>
+<% end %>
+
+<% if sections["attributes"] then %>
+<table cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Attributes</td></tr>
+</table><br />
+<table cellspacing="5">
+<% sections["attributes"].each do |attributes| %>
+     <tr valign="top">
+<% if attributes["rw"] then %>
+       <td align="center" class="attr-rw">&nbsp;[<%= attributes["rw"] %>]&nbsp;</td>
+<% end %>
+<% unless attributes["rw"] then %>
+       <td></td>
+<% end %>
+       <td class="attr-name"><%= attributes["name"] %></td>
+       <td><%= attributes["a_desc"] %></td>
+     </tr>
+<% end # sections["attributes"] %>
+</table>
+<% end %>
+
+<% if sections["classlist"] then %>
+<table cellpadding="5" width="100%">
+<tr><td class="tablesubtitle">Classes and Modules</td></tr>
+</table><br />
+<%= sections["classlist"] %><br />
+<% end %>
+
+  <%= template_include %>  <!-- method descriptions -->
+
+<% end # values["sections"] %>
+
+</body>
+</html>
+  EOF
+
+  FILE_PAGE = <<-EOF
+<table width="100%">
+ <tr class="title-row">
+ <td><table width="100%"><tr>
+   <td class="big-title-font" colspan="2"><font size="-3"><b>File</b><br /></font><%= values["short_name"] %></td>
+   <td align="right"><table cellspacing="0" cellpadding="2">
+         <tr>
+           <td  class="small-title-font">Path:</td>
+           <td class="small-title-font"><%= values["full_path"] %>
+<% if values["cvsurl"] then %>
+				&nbsp;(<a href="<%= values["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
+<% end %>
+           </td>
+         </tr>
+         <tr>
+           <td class="small-title-font">Modified:</td>
+           <td class="small-title-font"><%= values["dtm_modified"] %></td>
+         </tr>
+        </table>
+    </td></tr></table></td>
+  </tr>
+</table><br />
+  EOF
+
+  CLASS_PAGE = <<-EOF
+<table width="100%" border="0" cellspacing="0">
+ <tr class="title-row">
+ <td class="big-title-font">
+   <font size="-3"><b><%= values["classmod"] %></b><br /></font><%= values["full_name"] %>
+ </td>
+ <td align="right">
+   <table cellspacing="0" cellpadding="2">
+     <tr valign="top">
+      <td class="small-title-font">In:</td>
+      <td class="small-title-font">
+<% values["infiles"].each do |infiles| %>
+<%= href infiles["full_path_url"], infiles["full_path"] %>
+<% if infiles["cvsurl"] then %>
+&nbsp;(<a href="<%= infiles["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
+<% end %>
+<% end # values["infiles"] %>
+      </td>
+     </tr>
+<% if values["parent"] then %>
+     <tr>
+      <td class="small-title-font">Parent:</td>
+      <td class="small-title-font">
+<% if values["par_url"] then %>
+        <a href="<%= values["par_url"] %>" class="cyan">
+<% end %>
+<%= values["parent"] %>
+<% if values["par_url"] then %>
+         </a>
+<% end %>
+      </td>
+     </tr>
+<% end %>
+   </table>
+  </td>
+  </tr>
+</table><br />
+  EOF
+
+  METHOD_LIST = <<-EOF
+<% if values["includes"] then %>
+<div class="tablesubsubtitle">Included modules</div><br />
+<div class="name-list">
+<% values["includes"].each do |includes| %>
+    <span class="method-name"><%= href includes["aref"], includes["name"] %></span>
+<% end # values["includes"] %>
+</div>
+<% end %>
+
+<% if values["method_list"] then %>
+<% values["method_list"].each do |method_list| $stderr.puts({ :method_list => method_list }.inspect) %>
+<% if values["methods"] then %>
+<table cellpadding=5 width="100%">
+<tr><td class="tablesubtitle"><%= values["type"] %> <%= values["category"] %> methods</td></tr>
+</table>
+<% values["methods"].each do |methods| $stderr.puts({ :methods => methods }.inspect) %>
+<table width="100%" cellspacing="0" cellpadding="5" border="0">
+<tr><td class="methodtitle">
+<a name="<%= values["aref"] %>">
+<% if values["callseq"] then %>
+<b><%= values["callseq"] %></b>
+<% end %>
+<% unless values["callseq"] then %>
+ <b><%= values["name"] %></b><%= values["params"] %>
+<% end %>
+<% if values["codeurl"] then %>
+<a href="<%= values["codeurl"] %>" target="source" class="srclink">src</a>
+<% end %>
+</a></td></tr>
+</table>
+<% if values["m_desc"] then %>
+<div class="description">
+<%= values["m_desc"] %>
+</div>
+<% end %>
+<% if values["aka"] then %>
+<div class="aka">
+This method is also aliased as
+<% values["aka"].each do |aka| $stderr.puts({ :aka => aka }.inspect) %>
+<a href="<%= values["aref"] %>"><%= values["name"] %></a>
+<% end # values["aka"] %>
+</div>
+<% end %>
+<% if values["sourcecode"] then %>
+<pre class="source">
+<%= values["sourcecode"] %>
+</pre>
+<% end %>
+<% end # values["methods"] %>
+<% end %>
+<% end # values["method_list"] %>
+<% end %>
+  EOF
+
+  SRC_PAGE = <<-EOF
+<html>
+<head><title><%= values["title"] %></title>
+<meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>">
+<style type="text/css">
+.ruby-comment    { color: green; font-style: italic }
+.ruby-constant   { color: #4433aa; font-weight: bold; }
+.ruby-identifier { color: #222222;  }
+.ruby-ivar       { color: #2233dd; }
+.ruby-keyword    { color: #3333FF; font-weight: bold }
+.ruby-node       { color: #777777; }
+.ruby-operator   { color: #111111;  }
+.ruby-regexp     { color: #662222; }
+.ruby-value      { color: #662222; font-style: italic }
+  .kw { color: #3333FF; font-weight: bold }
+  .cmt { color: green; font-style: italic }
+  .str { color: #662222; font-style: italic }
+  .re  { color: #662222; }
+</style>
+</head>
+<body bgcolor="white">
+<pre><%= values["code"] %></pre>
+</body>
+</html>
+  EOF
+
+  FR_INDEX_BODY = %{
+<%= template_include %>
+}
+
+  FILE_INDEX = <<-EOF
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>">
+<style>
+<!--
+body {
+  background-color: #ddddff;
+  font-family: #{FONTS};
+  font-size: 11px;
+  font-style: normal;
+  line-height: 14px;
+  color: #000040;
+}
+
+div.banner {
+  background: #0000aa;
+  color: white;
+  padding: 1;
+  margin: 0;
+  font-size: 90%;
+  font-weight: bold;
+  line-height: 1.1;
+  text-align: center;
+  width: 100%;
+}
+
+-->
+</style>
+<base target="docwin">
+</head>
+<body>
+<div class="banner"><%= values["list_title"] %></div>
+<% values["entries"].each do |entries| %>
+<a href="<%= entries["href"] %>"><%= entries["name"] %></a><br />
+<% end # values["entries"] %>
+</body></html>
+  EOF
+
+  CLASS_INDEX = FILE_INDEX
+  METHOD_INDEX = FILE_INDEX
+
+  INDEX = <<-EOF
+<html>
+<head>
+  <title><%= values["title"] %></title>
+  <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>">
+</head>
+
+<frameset cols="20%,*">
+    <frameset rows="15%,35%,50%">
+        <frame src="fr_file_index.html"   title="Files" name="Files">
+        <frame src="fr_class_index.html"  name="Classes">
+        <frame src="fr_method_index.html" name="Methods">
+    </frameset>
+<% if values["inline_source"] then %>
+      <frame  src="<%= values["initial_page"] %>" name="docwin">
+<% end %>
+<% unless values["inline_source"] then %>
+    <frameset rows="80%,20%">
+      <frame  src="<%= values["initial_page"] %>" name="docwin">
+      <frame  src="blank.html" name="source">
+    </frameset>
+<% end %>
+    <noframes>
+          <body bgcolor="white">
+            Click <a href="html/index.html">here</a> for a non-frames
+            version of this page.
+          </body>
+    </noframes>
+</frameset>
+
+</html>
+  EOF
+
+  # A blank page to use as a target
+  BLANK = %{
+<html><body bgcolor="white"></body></html>
+}
+
+  def write_extra_pages
+    template = TemplatePage.new(BLANK)
+    File.open("blank.html", "w") { |f| template.write_html_on(f, {}) }
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generator/html/one_page_html.rb ../rdoc-f95-20090109-1/generator/html/one_page_html.rb
--- ruby-1.8.7-p72/lib/rdoc/generator/html/one_page_html.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/generator/html/one_page_html.rb	2008-03-08 21:27:15.000000000 +0900
@@ -0,0 +1,121 @@
+require 'rdoc/generator/html'
+
+module RDoc::Generator::HTML::ONE_PAGE_HTML
+
+  CONTENTS_XML = <<-EOF
+<% if defined? classes and classes["description"] then %>
+<%= classes["description"] %>
+<% end %>
+
+<% if defined? files and files["requires"] then %>
+<h4>Requires:</h4>
+<ul>
+<% files["requires"].each do |requires| %>
+<% if requires["aref"] then %>
+<li><a href="<%= requires["aref"] %>"><%= requires["name"] %></a></li>
+<% end %>
+<% unless requires["aref"] then %>
+<li><%= requires["name"] %></li>
+<% end %>
+<% end # files["requires"] %>
+</ul>
+<% end %>
+
+<% if defined? classes and classes["includes"] then %>
+<h4>Includes</h4>
+<ul>
+<% classes["includes"].each do |includes| %>
+<% if includes["aref"] then %>
+<li><a href="<%= includes["aref"] %>"><%= includes["name"] %></a></li>
+<% end %>
+<% unless includes["aref"] then %>
+<li><%= includes["name"] %></li>
+<% end %>
+<% end # classes["includes"] %>
+</ul>
+<% end %>
+
+<% if defined? classes and classes["sections"] then %>
+<% classes["sections"].each do |sections| %>
+<% if sections["attributes"] then %>
+<h4>Attributes</h4>
+<table>
+<% sections["attributes"].each do |attributes| %>
+<tr><td><%= attributes["name"] %></td><td><%= attributes["rw"] %></td><td><%= attributes["a_desc"] %></td></tr>
+<% end # sections["attributes"] %>
+</table>
+<% end %>
+
+<% if sections["method_list"] then %>
+<h3>Methods</h3>
+<% sections["method_list"].each do |method_list| %>
+<% if method_list["methods"] then %>
+<% method_list["methods"].each do |methods| %>
+<h4><%= methods["type"] %> <%= methods["category"] %> method: 
+<% if methods["callseq"] then %>
+<a name="<%= methods["aref"] %>"><%= methods["callseq"] %></a>
+<% end %>
+<% unless methods["callseq"] then %>
+<a name="<%= methods["aref"] %>"><%= methods["name"] %><%= methods["params"] %></a></h4>
+<% end %>
+
+<% if methods["m_desc"] then %>
+<%= methods["m_desc"] %>
+<% end %>
+
+<% if methods["sourcecode"] then %>
+<blockquote><pre>
+<%= methods["sourcecode"] %>
+</pre></blockquote>
+<% end %>
+<% end # method_list["methods"] %>
+<% end %>
+<% end # sections["method_list"] %>
+<% end %>
+<% end # classes["sections"] %>
+<% end %>
+  EOF
+
+  ONE_PAGE = %{
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <title><%= values["title"] %></title>
+  <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
+</head>
+<body>
+<% values["files"].each do |files| %>
+<h2>File: <%= files["short_name"] %></h2>
+<table>
+  <tr><td>Path:</td><td><%= files["full_path"] %></td></tr>
+  <tr><td>Modified:</td><td><%= files["dtm_modified"] %></td></tr>
+</table>
+} + CONTENTS_XML + %{
+<% end # values["files"] %>
+
+<% if values["classes"] then %>
+<h2>Classes</h2>
+<% values["classes"].each do |classes| %>
+<% if classes["parent"] then %>
+<h3><%= classes["classmod"] %> <%= classes["full_name"] %> &lt; <%= href classes["par_url"], classes["parent"] %></h3>
+<% end %>
+<% unless classes["parent"] then %>
+<h3><%= classes["classmod"] %> <%= classes["full_name"] %></h3>
+<% end %>
+
+<% if classes["infiles"] then %>
+(in files
+<% classes["infiles"].each do |infiles| %>
+<%= href infiles["full_path_url"], infiles["full_path"] %>
+<% end # classes["infiles"] %>
+)
+<% end %>
+} + CONTENTS_XML + %{
+<% end # values["classes"] %>
+<% end %>
+</body>
+</html>
+}
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generator/html.rb ../rdoc-f95-20090109-1/generator/html.rb
--- ruby-1.8.7-p72/lib/rdoc/generator/html.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/generator/html.rb	2008-03-09 12:19:45.000000000 +0900
@@ -0,0 +1,370 @@
+require 'fileutils'
+
+require 'rdoc/generator'
+require 'rdoc/markup/to_html'
+
+##
+# We're responsible for generating all the HTML files from the object tree
+# defined in code_objects.rb. We generate:
+#
+# [files]   an html file for each input file given. These
+#           input files appear as objects of class
+#           TopLevel
+#
+# [classes] an html file for each class or module encountered.
+#           These classes are not grouped by file: if a file
+#           contains four classes, we'll generate an html
+#           file for the file itself, and four html files
+#           for the individual classes.
+#
+# [indices] we generate three indices for files, classes,
+#           and methods. These are displayed in a browser
+#           like window with three index panes across the
+#           top and the selected description below
+#
+# Method descriptions appear in whatever entity (file, class, or module) that
+# contains them.
+#
+# We generate files in a structure below a specified subdirectory, normally
+# +doc+.
+#
+#  opdir
+#     |
+#     |___ files
+#     |       |__  per file summaries
+#     |
+#     |___ classes
+#             |__ per class/module descriptions
+#
+# HTML is generated using the Template class.
+
+class RDoc::Generator::HTML
+
+  include RDoc::Generator
+  include RDoc::Generator::MarkUp
+
+  ##
+  # Generator may need to return specific subclasses depending on the
+  # options they are passed. Because of this we create them using a factory
+
+  def self.for(options)
+    RDoc::Generator::AllReferences.reset
+    RDoc::Generator::Method.reset
+
+    if options.all_one_file
+      RDoc::Generator::HTMLInOne.new options
+    else
+      new options
+    end
+  end
+
+  class << self
+    protected :new
+  end
+
+  ##
+  # Set up a new HTML generator. Basically all we do here is load up the
+  # correct output temlate
+
+  def initialize(options) #:not-new:
+    @options = options
+    load_html_template
+  end
+
+  ##
+  # Build the initial indices and output objects
+  # based on an array of TopLevel objects containing
+  # the extracted information.
+
+  def generate(toplevels)
+    @toplevels  = toplevels
+    @files      = []
+    @classes    = []
+
+    write_style_sheet
+    gen_sub_directories()
+    build_indices
+    generate_html
+  end
+
+  private
+
+  ##
+  # Load up the HTML template specified in the options.
+  # If the template name contains a slash, use it literally
+
+  def load_html_template
+    template = @options.template
+
+    unless template =~ %r{/|\\} then
+      template = ::File.join('rdoc', 'generator', @options.generator.key,
+                             template)
+    end
+
+    require template
+
+    @template = self.class.const_get @options.template.upcase
+    @options.template_class = @template
+
+  rescue LoadError
+    $stderr.puts "Could not find HTML template '#{template}'"
+    exit 99
+  end
+
+  ##
+  # Write out the style sheet used by the main frames
+
+  def write_style_sheet
+    return unless @template.constants.include? :STYLE or
+                  @template.constants.include? 'STYLE'
+
+    template = RDoc::TemplatePage.new @template::STYLE
+
+    unless @options.css then
+      open RDoc::Generator::CSS_NAME, 'w' do |f|
+        values = {}
+
+        if @template.constants.include? :FONTS or
+           @template.constants.include? 'FONTS' then
+          values["fonts"] = @template::FONTS
+        end
+
+        template.write_html_on(f, values)
+      end
+    end
+  end
+
+  ##
+  # See the comments at the top for a description of the directory structure
+
+  def gen_sub_directories
+    FileUtils.mkdir_p RDoc::Generator::FILE_DIR
+    FileUtils.mkdir_p RDoc::Generator::CLASS_DIR
+  rescue
+    $stderr.puts $!.message
+    exit 1
+  end
+
+  def build_indices
+    @files, @classes = RDoc::Generator::Context.build_indicies(@toplevels,
+                                                               @options)
+  end
+
+  ##
+  # Generate all the HTML
+
+  def generate_html
+    # the individual descriptions for files and classes
+    gen_into(@files)
+    gen_into(@classes)
+    # and the index files
+    gen_file_index
+    gen_class_index
+    gen_method_index
+    gen_main_index
+
+    # this method is defined in the template file
+    write_extra_pages if defined? write_extra_pages
+  end
+
+  def gen_into(list)
+    list.each do |item|
+      if item.document_self
+        op_file = item.path
+        FileUtils.mkdir_p(::File.dirname(op_file))
+        open(op_file, "w") { |file| item.write_on(file) }
+      end
+    end
+
+  end
+
+  def gen_file_index
+    gen_an_index @files, 'Files', @template::FILE_INDEX, "fr_file_index.html"
+  end
+
+  def gen_class_index
+    gen_an_index(@classes, 'Classes', @template::CLASS_INDEX,
+                 "fr_class_index.html")
+  end
+
+  def gen_method_index
+    gen_an_index(RDoc::Generator::Method.all_methods, 'Methods',
+                 @template::METHOD_INDEX, "fr_method_index.html")
+  end
+
+  def gen_an_index(collection, title, template, filename)
+    template = RDoc::TemplatePage.new @template::FR_INDEX_BODY, template
+    res = []
+    collection.sort.each do |f|
+      if f.document_self
+        res << { "href" => f.path, "name" => f.index_name }
+      end
+    end
+
+    values = {
+      "entries"    => res,
+      'list_title' => CGI.escapeHTML(title),
+      'index_url'  => main_url,
+      'charset'    => @options.charset,
+      'style_url'  => style_url('', @options.css),
+    }
+
+    open filename, 'w' do |f|
+      template.write_html_on(f, values)
+    end
+  end
+
+  ##
+  # The main index page is mostly a template frameset, but includes the
+  # initial page. If the <tt>--main</tt> option was given, we use this as
+  # our main page, otherwise we use the first file specified on the command
+  # line.
+
+  def gen_main_index
+    template = RDoc::TemplatePage.new @template::INDEX
+
+    open 'index.html', 'w'  do |f|
+      classes = @classes.sort.map { |klass| klass.value_hash }
+
+      values = {
+        'main_page'     => @main_page,
+        'initial_page'  => main_url,
+        'style_url'     => style_url('', @options.css),
+        'title'         => CGI.escapeHTML(@options.title),
+        'charset'       => @options.charset,
+        'classes'       => classes,
+      }
+
+      values['inline_source'] = @options.inline_source
+
+      template.write_html_on f, values
+    end
+  end
+
+  ##
+  # Returns the url of the main page
+
+  def main_url
+    @main_page = @options.main_page
+    @main_page_ref = nil
+    if @main_page
+      @main_page_ref = AllReferences[@main_page]
+      if @main_page_ref then
+        @main_page_path = @main_page_ref.path
+      else
+        $stderr.puts "Could not find main page #{@main_page}"
+      end
+    end
+
+    unless @main_page_path then
+      file = @files.find { |file| file.document_self }
+      @main_page_path = file.path if file
+    end
+
+    unless @main_page_path then
+      $stderr.puts "Couldn't find anything to document"
+      $stderr.puts "Perhaps you've used :stopdoc: in all classes"
+      exit 1
+    end
+
+    @main_page_path
+  end
+
+end
+
+class RDoc::Generator::HTMLInOne < RDoc::Generator::HTML
+
+  def initialize(*args)
+    super
+  end
+
+  ##
+  # Build the initial indices and output objects
+  # based on an array of TopLevel objects containing
+  # the extracted information.
+
+  def generate(info)
+    @toplevels  = info
+    @hyperlinks = {}
+
+    build_indices
+    generate_xml
+  end
+
+  ##
+  # Generate:
+  #
+  # * a list of RDoc::Generator::File objects for each TopLevel object.
+  # * a list of RDoc::Generator::Class objects for each first level
+  #   class or module in the TopLevel objects
+  # * a complete list of all hyperlinkable terms (file,
+  #   class, module, and method names)
+
+  def build_indices
+    @files, @classes = RDoc::Generator::Context.build_indices(@toplevels,
+                                                              @options)
+  end
+
+  ##
+  # Generate all the HTML. For the one-file case, we generate
+  # all the information in to one big hash
+
+  def generate_xml
+    values = {
+      'charset' => @options.charset,
+      'files'   => gen_into(@files),
+      'classes' => gen_into(@classes),
+      'title'        => CGI.escapeHTML(@options.title),
+    }
+
+    # this method is defined in the template file
+    write_extra_pages if defined? write_extra_pages
+
+    template = RDoc::TemplatePage.new @template::ONE_PAGE
+
+    if @options.op_name
+      opfile = open @options.op_name, 'w'
+    else
+      opfile = $stdout
+    end
+    template.write_html_on(opfile, values)
+  end
+
+  def gen_into(list)
+    res = []
+    list.each do |item|
+      res << item.value_hash
+    end
+    res
+  end
+
+  def gen_file_index
+    gen_an_index(@files, 'Files')
+  end
+
+  def gen_class_index
+    gen_an_index(@classes, 'Classes')
+  end
+
+  def gen_method_index
+    gen_an_index(RDoc::Generator::Method.all_methods, 'Methods')
+  end
+
+  def gen_an_index(collection, title)
+    res = []
+    collection.sort.each do |f|
+      if f.document_self
+        res << { "href" => f.path, "name" => f.index_name }
+      end
+    end
+
+    return {
+      "entries" => res,
+      'list_title' => title,
+      'index_url'  => main_url,
+    }
+  end
+
+end
+
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generator/ri.rb ../rdoc-f95-20090109-1/generator/ri.rb
--- ruby-1.8.7-p72/lib/rdoc/generator/ri.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/generator/ri.rb	2008-03-08 21:21:34.000000000 +0900
@@ -0,0 +1,229 @@
+require 'rdoc/generator'
+require 'rdoc/markup/to_flow'
+
+require 'rdoc/ri/cache'
+require 'rdoc/ri/reader'
+require 'rdoc/ri/writer'
+require 'rdoc/ri/descriptions'
+
+class RDoc::Generator::RI
+
+  ##
+  # Generator may need to return specific subclasses depending on the
+  # options they are passed. Because of this we create them using a factory
+
+  def self.for(options)
+    new(options)
+  end
+
+  class << self
+    protected :new
+  end
+
+  ##
+  # Set up a new RDoc::Generator::RI.
+
+  def initialize(options) #:not-new:
+    @options   = options
+    @ri_writer = RDoc::RI::Writer.new "."
+    @markup    = RDoc::Markup.new
+    @to_flow   = RDoc::Markup::ToFlow.new
+
+    @generated = {}
+  end
+
+  ##
+  # Build the initial indices and output objects based on an array of
+  # TopLevel objects containing the extracted information.
+
+  def generate(toplevels)
+    RDoc::TopLevel.all_classes_and_modules.each do |cls|
+      process_class cls
+    end
+  end
+
+  def process_class(from_class)
+    generate_class_info(from_class)
+
+    # now recure into this classes constituent classess
+    from_class.each_classmodule do |mod|
+      process_class(mod)
+    end
+  end
+
+  def generate_class_info(cls)
+    if cls === RDoc::NormalModule
+      cls_desc = RDoc::RI::ModuleDescription.new
+    else
+      cls_desc = RDoc::RI::ClassDescription.new
+      cls_desc.superclass  = cls.superclass
+    end
+
+    cls_desc.name        = cls.name
+    cls_desc.full_name   = cls.full_name
+    cls_desc.comment     = markup(cls.comment)
+
+    cls_desc.attributes = cls.attributes.sort.map do |a|
+      RDoc::RI::Attribute.new(a.name, a.rw, markup(a.comment))
+    end
+
+    cls_desc.constants = cls.constants.map do |c|
+      RDoc::RI::Constant.new(c.name, c.value, markup(c.comment))
+    end
+
+    cls_desc.includes = cls.includes.map do |i|
+      RDoc::RI::IncludedModule.new(i.name)
+    end
+
+    class_methods, instance_methods = method_list(cls)
+
+    cls_desc.class_methods = class_methods.map do |m|
+      RDoc::RI::MethodSummary.new(m.name)
+    end
+
+    cls_desc.instance_methods = instance_methods.map do |m|
+      RDoc::RI::MethodSummary.new(m.name)
+    end
+
+    update_or_replace(cls_desc)
+
+    class_methods.each do |m|
+      generate_method_info(cls_desc, m)
+    end
+
+    instance_methods.each do |m|
+      generate_method_info(cls_desc, m)
+    end
+  end
+
+  def generate_method_info(cls_desc, method)
+    meth_desc = RDoc::RI::MethodDescription.new
+    meth_desc.name = method.name
+    meth_desc.full_name = cls_desc.full_name
+    if method.singleton
+      meth_desc.full_name += "::"
+    else
+      meth_desc.full_name += "#"
+    end
+    meth_desc.full_name << method.name
+
+    meth_desc.comment = markup(method.comment)
+    meth_desc.params = params_of(method)
+    meth_desc.visibility = method.visibility.to_s
+    meth_desc.is_singleton = method.singleton
+    meth_desc.block_params = method.block_params
+
+    meth_desc.aliases = method.aliases.map do |a|
+      RDoc::RI::AliasName.new(a.name)
+    end
+
+    @ri_writer.add_method(cls_desc, meth_desc)
+  end
+
+  private
+
+  ##
+  # Returns a list of class and instance methods that we'll be documenting
+
+  def method_list(cls)
+    list = cls.method_list
+    unless @options.show_all
+      list = list.find_all do |m|
+        m.visibility == :public || m.visibility == :protected || m.force_documentation
+      end
+    end
+
+    c = []
+    i = []
+    list.sort.each do |m|
+      if m.singleton
+        c << m
+      else
+        i << m
+      end
+    end
+    return c,i
+  end
+
+  def params_of(method)
+    if method.call_seq
+      method.call_seq
+    else
+      params = method.params || ""
+
+      p = params.gsub(/\s*\#.*/, '')
+      p = p.tr("\n", " ").squeeze(" ")
+      p = "(" + p + ")" unless p[0] == ?(
+
+      if (block = method.block_params)
+        block.gsub!(/\s*\#.*/, '')
+        block = block.tr("\n", " ").squeeze(" ")
+        if block[0] == ?(
+          block.sub!(/^\(/, '').sub!(/\)/, '')
+        end
+        p << " {|#{block.strip}| ...}"
+      end
+      p
+    end
+  end
+
+  def markup(comment)
+    return nil if !comment || comment.empty?
+
+    # Convert leading comment markers to spaces, but only
+    # if all non-blank lines have them
+
+    if comment =~ /^(?>\s*)[^\#]/
+      content = comment
+    else
+      content = comment.gsub(/^\s*(#+)/)  { $1.tr('#',' ') }
+    end
+    @markup.convert(content, @to_flow)
+  end
+
+  ##
+  # By default we replace existing classes with the same name. If the
+  # --merge option was given, we instead merge this definition into an
+  # existing class. We add our methods, aliases, etc to that class, but do
+  # not change the class's description.
+
+  def update_or_replace(cls_desc)
+    old_cls = nil
+
+    if @options.merge
+      rdr = RDoc::RI::Reader.new RDoc::RI::Cache.new(@options.op_dir)
+
+      namespace = rdr.top_level_namespace
+      namespace = rdr.lookup_namespace_in(cls_desc.name, namespace)
+      if namespace.empty?
+        $stderr.puts "You asked me to merge this source into existing "
+        $stderr.puts "documentation. This file references a class or "
+        $stderr.puts "module called #{cls_desc.name} which I don't"
+        $stderr.puts "have existing documentation for."
+        $stderr.puts
+        $stderr.puts "Perhaps you need to generate its documentation first"
+        exit 1
+      else
+        old_cls = namespace[0]
+      end
+    end
+
+    prev_cls = @generated[cls_desc.full_name]
+
+    if old_cls and not prev_cls then
+      old_desc = rdr.get_class old_cls
+      cls_desc.merge_in old_desc
+    end
+
+    if prev_cls then
+      cls_desc.merge_in prev_cls
+    end
+
+    @generated[cls_desc.full_name] = cls_desc
+
+    @ri_writer.remove_class cls_desc
+    @ri_writer.add_class cls_desc
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generator/xhtml/ctop.xsl ../rdoc-f95-20090109-1/generator/xhtml/ctop.xsl
--- ruby-1.8.7-p72/lib/rdoc/generator/xhtml/ctop.xsl	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/generator/xhtml/ctop.xsl	2008-03-09 01:14:54.000000000 +0900
@@ -0,0 +1,1318 @@
+<xsl:stylesheet
+  version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:mml="http://www.w3.org/1998/Math/MathML"
+>
+
+<!--
+$Id: ctop.xsl,v 1.1 2008-03-08 16:14:54 morikawa Exp $
+
+Copyright David Carlisle 2001, 2002.
+
+Use and distribution of this code are permitted under the terms of the <a
+href="http://www.w3.org/Consortium/Legal/copyright-software-19980720"
+>W3C Software Notice and License</a>.
+-->
+
+<xsl:output method="xml" />
+
+<xsl:template mode="c2p" match="*">
+<xsl:copy>
+  <xsl:copy-of select="@*"/>
+  <xsl:apply-templates mode="c2p"/>
+</xsl:copy>
+</xsl:template>
+
+
+<!-- 4.4.1.1 cn -->
+
+<xsl:template mode="c2p" match="mml:cn">
+ <mml:mn><xsl:apply-templates mode="c2p"/></mml:mn>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:cn[@type='complex-cartesian']">
+  <mml:mrow>
+    <mml:mn><xsl:apply-templates mode="c2p" select="text()[1]"/></mml:mn>
+    <mml:mo>+</mml:mo>
+    <mml:mn><xsl:apply-templates mode="c2p" select="text()[2]"/></mml:mn>
+    <mml:mo><!--&#8290;--><!--invisible times--></mml:mo>
+    <mml:mi>i<!-- imaginary i --></mml:mi>
+  </mml:mrow>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:cn[@type='rational']">
+  <mml:mrow>
+    <mml:mn><xsl:apply-templates mode="c2p" select="text()[1]"/></mml:mn>
+    <mml:mo>/</mml:mo>
+    <mml:mn><xsl:apply-templates mode="c2p" select="text()[2]"/></mml:mn>
+  </mml:mrow>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:cn[@type='integer']">
+  <xsl:choose>
+  <xsl:when test="not(@base) or @base=10">
+       <mml:mn><xsl:apply-templates mode="c2p"/></mml:mn>
+  </xsl:when>
+  <xsl:otherwise>
+  <mml:msub>
+    <mml:mn><xsl:apply-templates mode="c2p"/></mml:mn>
+    <mml:mn><xsl:value-of select="@base"/></mml:mn>
+  </mml:msub>
+  </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:cn[@type='complex-polar']">
+  <mml:mrow>
+    <mml:mn><xsl:apply-templates mode="c2p" select="text()[1]"/></mml:mn>
+    <mml:mo><!--&#8290;--><!--invisible times--></mml:mo>
+    <mml:msup>
+    <mml:mi>e<!-- exponential e--></mml:mi>
+    <mml:mrow>
+     <mml:mi>i<!-- imaginary i--></mml:mi>
+     <mml:mo><!--&#8290;--><!--invisible times--></mml:mo>
+     <mml:mn><xsl:apply-templates mode="c2p" select="text()[2]"/></mml:mn>
+    </mml:mrow>
+    </mml:msup>
+  </mml:mrow>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:cn[@type='e-notation']">
+    <mml:mn><xsl:apply-templates mode="c2p" select="text()[1]"/>E<xsl:apply-templates mode="c2p" select="text()[2]"/></mml:mn>
+</xsl:template>
+
+<!-- 4.4.1.1 ci  -->
+
+<xsl:template mode="c2p" match="mml:ci/text()">
+ <mml:mi><xsl:value-of select="."/></mml:mi>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:ci">
+ <mml:mrow><xsl:apply-templates mode="c2p"/></mml:mrow>
+</xsl:template>
+
+<!-- 4.4.1.2 csymbol -->
+
+<xsl:template mode="c2p" match="mml:csymbol/text()">
+ <mml:mo><xsl:apply-templates mode="c2p"/></mml:mo>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:csymbol">
+ <mml:mrow><xsl:apply-templates mode="c2p"/></mml:mrow>
+</xsl:template>
+
+<!-- 4.4.2.1 apply 4.4.2.2 reln -->
+
+<xsl:template mode="c2p" match="mml:apply|mml:reln">
+ <mml:mrow>
+ <xsl:apply-templates mode="c2p" select="*[1]">
+  <xsl:with-param name="p" select="10"/>
+ </xsl:apply-templates>
+ <mml:mo><!--&#8290;--><!--invisible times--></mml:mo>
+ <mml:mfenced open="(" close=")" separators=",">
+ <xsl:apply-templates mode="c2p" select="*[position()>1]"/>
+ </mml:mfenced>
+ </mml:mrow>
+</xsl:template>
+
+<!-- 4.4.2.3 fn -->
+<xsl:template mode="c2p" match="mml:fn">
+ <mml:mrow><xsl:apply-templates mode="c2p"/></mml:mrow>
+</xsl:template>
+
+<!-- 4.4.2.4 interval -->
+<xsl:template mode="c2p" match="mml:interval[*[2]]">
+ <mml:mfenced open="[" close="]"><xsl:apply-templates mode="c2p"/></mml:mfenced>
+</xsl:template>
+<xsl:template mode="c2p" match="mml:interval[*[2]][@closure='open']">
+ <mml:mfenced open="(" close=")"><xsl:apply-templates mode="c2p"/></mml:mfenced>
+</xsl:template>
+<xsl:template mode="c2p" match="mml:interval[*[2]][@closure='open-closed']">
+ <mml:mfenced open="(" close="]"><xsl:apply-templates mode="c2p"/></mml:mfenced>
+</xsl:template>
+<xsl:template mode="c2p" match="mml:interval[*[2]][@closure='closed-open']">
+ <mml:mfenced open="[" close=")"><xsl:apply-templates mode="c2p"/></mml:mfenced>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:interval">
+ <mml:mfenced open="{{" close="}}"><xsl:apply-templates mode="c2p"/></mml:mfenced>
+</xsl:template>
+
+<!-- 4.4.2.5 inverse -->
+
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:inverse]]">
+ <mml:msup>
+  <xsl:apply-templates mode="c2p" select="*[2]"/>
+  <mml:mrow><mml:mo>(</mml:mo><mml:mn>-1</mml:mn><mml:mo>)</mml:mo></mml:mrow>
+ </mml:msup>
+</xsl:template>
+
+<!-- 4.4.2.6 sep -->
+
+<!-- 4.4.2.7 condition -->
+<xsl:template mode="c2p" match="mml:condition">
+ <mml:mrow><xsl:apply-templates mode="c2p"/></mml:mrow>
+</xsl:template>
+
+<!-- 4.4.2.8 declare -->
+<xsl:template mode="c2p" match="mml:declare"/>
+
+<!-- 4.4.2.9 lambda -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:lambda]]">
+ <mml:mrow>
+  <mml:mi>&#955;<!--lambda--></mml:mi>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:bvar/*"/></mml:mrow>
+ <mml:mo>.</mml:mo>
+ <mml:mfenced>
+  <xsl:apply-templates mode="c2p" select="*[last()]"/>
+ </mml:mfenced>
+</mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.2.10 compose -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:compose]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="1"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8728;<!-- o --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+
+<!-- 4.4.2.11` ident -->
+<xsl:template mode="c2p" match="mml:ident">
+<mml:mo>id</mml:mo>
+</xsl:template>
+
+<!-- 4.4.2.12` domain -->
+<xsl:template mode="c2p" match="mml:domain">
+<mml:mo>domain</mml:mo>
+</xsl:template>
+
+<!-- 4.4.2.13` codomain -->
+<xsl:template mode="c2p" match="mml:codomain">
+<mml:mo>codomain</mml:mo>
+</xsl:template>
+
+<!-- 4.4.2.14` image -->
+<xsl:template mode="c2p" match="mml:image">
+<mml:mo>image</mml:mo>
+</xsl:template>
+
+<!-- 4.4.2.15` domainofapplication -->
+<xsl:template mode="c2p" match="mml:domainofapplication">
+ <mml:error/>
+</xsl:template>
+
+<!-- 4.4.2.16` piecewise -->
+<xsl:template mode="c2p" match="mml:piecewise">
+<mml:mrow>
+<mml:mo>{</mml:mo>
+<mml:mtable>
+ <xsl:for-each select="mml:piece|mml:otherwise">
+ <mml:mtr>
+ <mml:mtd><xsl:apply-templates mode="c2p" select="*[1]"/></mml:mtd>
+ <mml:mtd><mml:mtext>&#160; if &#160;</mml:mtext></mml:mtd>
+ <mml:mtd><xsl:apply-templates mode="c2p" select="*[2]"/></mml:mtd>
+ </mml:mtr>
+ </xsl:for-each>
+</mml:mtable>
+</mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.3.1 quotient -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:quotient]]">
+<mml:mrow>
+<mml:mo>&#8970;<!-- lfloor--></mml:mo>
+<xsl:apply-templates mode="c2p" select="*[2]"/>
+<mml:mo>/</mml:mo>
+<xsl:apply-templates mode="c2p" select="*[3]"/>
+<mml:mo>&#8971;<!-- rfloor--></mml:mo>
+</mml:mrow>
+</xsl:template>
+
+
+
+<!-- 4.4.3.2 factorial -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:factorial]]">
+<mml:mrow>
+<xsl:apply-templates mode="c2p" select="*[2]">
+  <xsl:with-param name="p" select="7"/>
+</xsl:apply-templates>
+<mml:mo>!</mml:mo>
+</mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.3.3 divide -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:divide]]">
+  <xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+  <xsl:with-param name="mo"><mml:mo>/</mml:mo></xsl:with-param>
+  <xsl:with-param name="p" select="$p"/>
+  <xsl:with-param name="this-p" select="3"/>
+</xsl:call-template>
+</xsl:template>
+
+
+<!-- 4.4.3.4 max  min-->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:max]]">
+<mml:mrow>
+  <mml:mo>max</mml:mo>
+  <xsl:call-template name="set"/>
+</mml:mrow>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:min]]">
+<mml:mrow>
+  <mml:mo>max</mml:mo>
+  <xsl:call-template name="set"/>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.3.5  minus-->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:minus] and count(*)=2]">
+<mml:mrow>
+  <mml:mo>&#8722;<!--minus--></mml:mo>
+  <xsl:apply-templates mode="c2p" select="*[2]">
+      <xsl:with-param name="p" select="5"/>
+  </xsl:apply-templates>
+</mml:mrow>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:minus] and count(*)&gt;2]">
+  <xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+  <xsl:with-param name="mo"><mml:mo>&#8722;<!--minus--></mml:mo></xsl:with-param>
+  <xsl:with-param name="p" select="$p"/>
+  <xsl:with-param name="this-p" select="2"/>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.3.6  plus-->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:plus]]">
+  <xsl:param name="p" select="0"/>
+  <mml:mrow>
+  <xsl:if test="$p &gt; 2"><mml:mo>(</mml:mo></xsl:if>
+  <xsl:for-each select="*[position()&gt;1]">
+   <xsl:if test="position() &gt; 1">
+    <mml:mo>
+    <xsl:choose>
+      <xsl:when test="self::mml:apply[*[1][self::mml:times] and
+      *[2][self::mml:apply/*[1][self::mml:minus] or self::mml:cn[not(mml:sep) and
+      (number(.) &lt; 0)]]]">&#8722;<!--minus--></xsl:when>
+      <xsl:otherwise>+</xsl:otherwise>
+    </xsl:choose>
+    </mml:mo>
+   </xsl:if>   
+    <xsl:choose>
+      <xsl:when test="self::mml:apply[*[1][self::mml:times] and
+      *[2][self::mml:cn[not(mml:sep) and (number(.) &lt;0)]]]">
+     <mml:mrow>
+     <mml:mn><xsl:value-of select="-(*[2])"/></mml:mn>
+      <mml:mo><!--&#8290;--><!--invisible times--></mml:mo>
+     <xsl:apply-templates mode="c2p" select=".">
+     <xsl:with-param name="first" select="2"/>
+     <xsl:with-param name="p" select="2"/>
+   </xsl:apply-templates>
+     </mml:mrow>
+      </xsl:when>
+      <xsl:when test="self::mml:apply[*[1][self::mml:times] and
+      *[2][self::mml:apply/*[1][self::mml:minus]]]">
+     <mml:mrow>
+     <xsl:apply-templates mode="c2p" select="./*[2]/*[2]"/>
+     <xsl:apply-templates mode="c2p" select=".">
+     <xsl:with-param name="first" select="2"/>
+     <xsl:with-param name="p" select="2"/>
+   </xsl:apply-templates>
+     </mml:mrow>
+      </xsl:when>
+      <xsl:otherwise>
+     <xsl:apply-templates mode="c2p" select=".">
+     <xsl:with-param name="p" select="2"/>
+   </xsl:apply-templates>
+   </xsl:otherwise>
+    </xsl:choose>
+  </xsl:for-each>
+  <xsl:if test="$p &gt; 2"><mml:mo>)</mml:mo></xsl:if>
+  </mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.3.7 power -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:power]]">
+<mml:msup>
+<xsl:apply-templates mode="c2p" select="*[2]">
+  <xsl:with-param name="p" select="5"/>
+</xsl:apply-templates>
+<xsl:apply-templates mode="c2p" select="*[3]">
+  <xsl:with-param name="p" select="5"/>
+</xsl:apply-templates>
+</mml:msup>
+</xsl:template>
+
+<!-- 4.4.3.8 remainder -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:rem]]">
+  <xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+  <xsl:with-param name="mo"><mml:mo>mod</mml:mo></xsl:with-param>
+  <xsl:with-param name="p" select="$p"/>
+  <xsl:with-param name="this-p" select="3"/>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.3.9  times-->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:times]]" name="times">
+  <xsl:param name="p" select="0"/>
+  <xsl:param name="first" select="1"/>
+  <mml:mrow>
+  <xsl:if test="$p &gt; 3"><mml:mo>(</mml:mo></xsl:if>
+  <xsl:for-each select="*[position()&gt;1]">
+   <xsl:if test="position() &gt; 1">
+    <mml:mo>
+    <xsl:choose>
+      <xsl:when test="self::mml:cn">&#215;<!-- times --></xsl:when>
+      <xsl:otherwise><!--&#8290;--><!--invisible times--></xsl:otherwise>
+    </xsl:choose>
+    </mml:mo>
+   </xsl:if> 
+   <xsl:if test="position()&gt;= $first">
+   <xsl:apply-templates mode="c2p" select=".">
+     <xsl:with-param name="p" select="3"/>
+   </xsl:apply-templates>
+   </xsl:if>
+  </xsl:for-each>
+  <xsl:if test="$p &gt; 3"><mml:mo>)</mml:mo></xsl:if>
+  </mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.3.10 root -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:root] and not(mml:degree) or mml:degree=2]" priority="4">
+<mml:msqrt>
+<xsl:apply-templates mode="c2p" select="*[position()&gt;1]"/>
+</mml:msqrt>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:root]]">
+<mml:mroot>
+<xsl:apply-templates mode="c2p" select="*[position()&gt;1 and not(self::mml:degree)]"/>
+<mml:mrow><xsl:apply-templates mode="c2p" select="mml:degree/*"/></mml:mrow>
+</mml:mroot>
+</xsl:template>
+
+<!-- 4.4.3.11 gcd -->
+<xsl:template mode="c2p" match="mml:gcd">
+<mml:mo>gcd</mml:mo>
+</xsl:template>
+
+<!-- 4.4.3.12 and -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:and]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8743;<!-- and --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+
+<!-- 4.4.3.13 or -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:or]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="3"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8744;<!-- or --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.3.14 xor -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:xor]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="3"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>xor</mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+
+<!-- 4.4.3.15 not -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:not]]">
+<mml:mrow>
+<mml:mo>&#172;<!-- not --></mml:mo>
+<xsl:apply-templates mode="c2p" select="*[2]">
+  <xsl:with-param name="p" select="7"/>
+</xsl:apply-templates>
+</mml:mrow>
+</xsl:template>
+
+
+
+
+<!-- 4.4.3.16 implies -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:implies]]">
+  <xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+  <xsl:with-param name="mo"><mml:mo>&#8658;<!-- Rightarrow --></mml:mo></xsl:with-param>
+  <xsl:with-param name="p" select="$p"/>
+  <xsl:with-param name="this-p" select="3"/>
+</xsl:call-template>
+</xsl:template>
+
+
+<!-- 4.4.3.17 forall -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:forall]]">
+ <mml:mrow>
+  <mml:mi>&#8704;<!--forall--></mml:mi>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:bvar[not(current()/mml:condition)]/*|mml:condition/*"/></mml:mrow>
+ <mml:mo>.</mml:mo>
+ <mml:mfenced>
+  <xsl:apply-templates mode="c2p" select="*[last()]"/>
+ </mml:mfenced>
+</mml:mrow>
+</xsl:template>
+
+
+
+<!-- 4.4.3.18 exists -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:exists]]">
+ <mml:mrow>
+  <mml:mi>&#8707;<!--exists--></mml:mi>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:bvar[not(current()/mml:condition)]/*|mml:condition/*"/></mml:mrow>
+ <mml:mo>.</mml:mo>
+ <mml:mfenced>
+  <xsl:apply-templates mode="c2p" select="*[last()]"/>
+ </mml:mfenced>
+</mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.3.19 abs -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:abs]]">
+<mml:mrow>
+<mml:mo>|</mml:mo>
+<xsl:apply-templates mode="c2p" select="*[2]"/>
+<mml:mo>|</mml:mo>
+</mml:mrow>
+</xsl:template>
+
+
+
+<!-- 4.4.3.20 conjugate -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:conjugate]]">
+<mml:mover>
+<xsl:apply-templates mode="c2p" select="*[2]"/>
+<mml:mo>&#175;<!-- overline --></mml:mo>
+</mml:mover>
+</xsl:template>
+
+<!-- 4.4.3.21 arg -->
+<xsl:template mode="c2p" match="mml:arg">
+ <mml:mo>arg</mml:mo>
+</xsl:template>
+
+
+<!-- 4.4.3.22 real -->
+<xsl:template mode="c2p" match="mml:real">
+ <mml:mo>&#8475;<!-- real --></mml:mo>
+</xsl:template>
+
+<!-- 4.4.3.23 imaginary -->
+<xsl:template mode="c2p" match="mml:imaginary">
+ <mml:mo>&#8465;<!-- imaginary --></mml:mo>
+</xsl:template>
+
+<!-- 4.4.3.24 lcm -->
+<xsl:template mode="c2p" match="mml:lcm">
+ <mml:mo>lcm</mml:mo>
+</xsl:template>
+
+
+<!-- 4.4.3.25 floor -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:floor]]">
+<mml:mrow>
+<mml:mo>&#8970;<!-- lfloor--></mml:mo>
+<xsl:apply-templates mode="c2p" select="*[2]"/>
+<mml:mo>&#8971;<!-- rfloor--></mml:mo>
+</mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.3.25 ceiling -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:ceiling]]">
+<mml:mrow>
+<mml:mo>&#8968;<!-- lceil--></mml:mo>
+<xsl:apply-templates mode="c2p" select="*[2]"/>
+<mml:mo>&#8969;<!-- rceil--></mml:mo>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.4.1 eq -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:eq]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="1"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>=</mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.4.2 neq -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:neq]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="1"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8800;<!-- neq --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.4.3 eq -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:gt]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="1"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&gt;</mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.4.4 lt -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:lt]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="1"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&lt;</mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.4.5 geq -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:geq]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="1"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8805;</mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.4.6 geq -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:leq]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="1"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8804;</mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.4.7 equivalent -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:equivalent]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="1"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8801;</mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.4.8 approx -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:approx]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="1"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8771;</mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+
+<!-- 4.4.4.9 factorof -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:factorof]]">
+  <xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+  <xsl:with-param name="mo"><mml:mo>|</mml:mo></xsl:with-param>
+  <xsl:with-param name="p" select="$p"/>
+  <xsl:with-param name="this-p" select="3"/>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.5.1 int -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:int]]">
+ <mml:mrow>
+ <mml:msubsup>
+  <mml:mi>&#8747;<!--int--></mml:mi>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:lowlimit/*|mml:interval/*[1]|mml:condition/*"/></mml:mrow>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:uplimit/*|mml:interval/*[2]"/></mml:mrow>
+ </mml:msubsup>
+ <xsl:apply-templates mode="c2p" select="*[last()]"/>
+ <mml:mo>d</mml:mo><xsl:apply-templates mode="c2p" select="mml:bvar"/>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.5.2 diff -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:diff] and mml:ci and count(*)=2]" priority="2">
+ <mml:msup>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="*[2]"/></mml:mrow>
+ <mml:mo>&#8242;<!--prime--></mml:mo>
+ </mml:msup>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:diff]]" priority="1">
+ <mml:mfrac>
+ <xsl:choose>
+ <xsl:when test="mml:bvar/mml:degree">
+ <mml:mrow><mml:msup><mml:mo>d</mml:mo><xsl:apply-templates mode="c2p" select="mml:bvar/mml:degree/node()"/></mml:msup>
+     <xsl:apply-templates mode="c2p"  select="*[last()]"/></mml:mrow>
+ <mml:mrow><mml:mo>d</mml:mo><mml:msup><xsl:apply-templates mode="c2p"
+ select="mml:bvar/node()"/><xsl:apply-templates mode="c2p"
+ select="mml:bvar/mml:degree/node()"/></mml:msup>
+</mml:mrow>
+</xsl:when>
+<xsl:otherwise>
+ <mml:mrow><mml:mo>d</mml:mo><xsl:apply-templates mode="c2p" select="*[last()]"/></mml:mrow>
+ <mml:mrow><mml:mo>d</mml:mo><xsl:apply-templates mode="c2p" select="mml:bvar"/></mml:mrow>
+</xsl:otherwise>
+ </xsl:choose>
+ </mml:mfrac>
+</xsl:template>
+
+
+<!-- 4.4.5.3 partialdiff -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:partialdiff] and mml:list and mml:ci and count(*)=3]" priority="2">
+<mml:mrow>
+ <mml:msub><mml:mo>D</mml:mo><mml:mrow>
+<xsl:for-each select="mml:list[1]/*">
+<xsl:apply-templates mode="c2p" select="."/>
+<xsl:if test="position()&lt;last()"><mml:mo>,</mml:mo></xsl:if>
+</xsl:for-each>
+</mml:mrow></mml:msub>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="*[3]"/></mml:mrow>
+</mml:mrow>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:partialdiff]]" priority="1">
+ <mml:mfrac>
+ <mml:mrow><mml:msup><mml:mo>&#8706;<!-- partial --></mml:mo>
+<mml:mrow>
+ <xsl:choose>
+ <xsl:when test="mml:degree">
+<xsl:apply-templates mode="c2p" select="mml:degree/node()"/>
+</xsl:when>
+<xsl:when test="mml:bvar/mml:degree[string(number(.))='NaN']">
+<xsl:for-each select="mml:bvar/mml:degree">
+<xsl:apply-templates mode="c2p" select="node()"/>
+<xsl:if test="position()&lt;last()"><mml:mo>+</mml:mo></xsl:if>
+</xsl:for-each>
+<xsl:if test="count(mml:bvar[not(mml:degree)])&gt;0">
+<mml:mo>+</mml:mo><mml:mn><xsl:value-of select="count(mml:bvar[not(mml:degree)])"/></mml:mn>
+</xsl:if>
+</xsl:when>
+<xsl:otherwise>
+<mml:mn><xsl:value-of select="sum(mml:bvar/mml:degree)+count(mml:bvar[not(mml:degree)])"/></mml:mn>
+</xsl:otherwise>
+ </xsl:choose>
+</mml:mrow>
+</mml:msup>
+     <xsl:apply-templates mode="c2p"  select="*[last()]"/></mml:mrow>
+<mml:mrow>
+<xsl:for-each select="mml:bvar">
+<mml:mrow>
+<mml:mo>&#8706;<!-- partial --></mml:mo><mml:msup><xsl:apply-templates mode="c2p" select="node()"/>
+                     <mml:mrow><xsl:apply-templates mode="c2p" select="mml:degree/node()"/></mml:mrow>
+</mml:msup>
+</mml:mrow>
+</xsl:for-each>
+</mml:mrow>
+ </mml:mfrac>
+</xsl:template>
+
+<!-- 4.4.5.4  lowlimit-->
+<xsl:template mode="c2p" match="mml:lowlimit"/>
+
+<!-- 4.4.5.5 uplimit-->
+<xsl:template mode="c2p" match="mml:uplimit"/>
+
+<!-- 4.4.5.6  bvar-->
+<xsl:template mode="c2p" match="mml:bvar">
+ <mml:mi><xsl:apply-templates mode="c2p"/></mml:mi>
+ <xsl:if test="following-sibling::mml:bvar"><mml:mo>,</mml:mo></xsl:if>
+</xsl:template>
+
+<!-- 4.4.5.7 degree-->
+<xsl:template mode="c2p" match="mml:degree"/>
+
+<!-- 4.4.5.8 divergence-->
+<xsl:template mode="c2p" match="mml:divergence">
+<mml:mo>div</mml:mo>
+</xsl:template>
+
+<!-- 4.4.5.9 grad-->
+<xsl:template mode="c2p" match="mml:grad">
+<mml:mo>grad</mml:mo>
+</xsl:template>
+
+<!-- 4.4.5.10 curl -->
+<xsl:template mode="c2p" match="mml:curl">
+<mml:mo>curl</mml:mo>
+</xsl:template>
+
+
+<!-- 4.4.5.11 laplacian-->
+<xsl:template mode="c2p" match="mml:laplacian">
+<mml:msup><mml:mo>&#8711;<!-- nabla --></mml:mo><mml:mn>2</mml:mn></mml:msup>
+</xsl:template>
+
+<!-- 4.4.6.1 set -->
+
+<xsl:template mode="c2p" match="mml:set">
+  <xsl:call-template name="set"/>
+</xsl:template>
+
+<!-- 4.4.6.2 list -->
+
+<xsl:template mode="c2p" match="mml:list">
+  <xsl:call-template name="set">
+   <xsl:with-param name="o" select="'('"/>
+   <xsl:with-param name="c" select="')'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.3 union -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:union]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8746;<!-- union --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.4 intersect -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:intersect]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="3"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8745;<!-- intersect --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.5 in -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:in]]">
+  <xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+  <xsl:with-param name="mo"><mml:mo>&#8712;<!-- in --></mml:mo></xsl:with-param>
+  <xsl:with-param name="p" select="$p"/>
+  <xsl:with-param name="this-p" select="3"/>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.5 notin -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:notin]]">
+  <xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+  <xsl:with-param name="mo"><mml:mo>&#8713;<!-- not in --></mml:mo></xsl:with-param>
+  <xsl:with-param name="p" select="$p"/>
+  <xsl:with-param name="this-p" select="3"/>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.7 subset -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:subset]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8838;<!-- subseteq --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.8 prsubset -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:prsubset]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8834;<!-- prsubset --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.9 notsubset -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:notsubset]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8840;<!-- notsubseteq --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.10 notprsubset -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:notprsubset]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8836;<!-- prsubset --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.11 setdiff -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:setdiff]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8726;<!-- setminus --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.12 card -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:card]]">
+<mml:mrow>
+<mml:mo>|</mml:mo>
+<xsl:apply-templates mode="c2p" select="*[2]"/>
+<mml:mo>|</mml:mo>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.6.13 cartesianproduct -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:cartesianproduct or self::mml:vectorproduct]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#215;<!-- times --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<xsl:template
+match="mml:apply[*[1][self::mml:cartesianproduct][count(following-sibling::mml:reals)=count(following-sibling::*)]]"
+priority="2">
+<mml:msup>
+<xsl:apply-templates mode="c2p" select="*[2]">
+  <xsl:with-param name="p" select="5"/>
+</xsl:apply-templates>
+<mml:mn><xsl:value-of select="count(*)-1"/></mml:mn>
+</mml:msup>
+</xsl:template>
+
+
+<!-- 4.4.7.1 sum -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:sum]]">
+ <mml:mrow>
+ <mml:msubsup>
+  <mml:mo>&#8721;<!--sum--></mml:mo>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:lowlimit/*|mml:interval/*[1]|mml:condition/*"/></mml:mrow>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:uplimit/*|mml:interval/*[2]"/></mml:mrow>
+ </mml:msubsup>
+ <xsl:apply-templates mode="c2p" select="*[last()]"/>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.7.2 product -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:product]]">
+ <mml:mrow>
+ <mml:msubsup>
+  <mml:mo>&#8719;<!--product--></mml:mo>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:lowlimit/*|mml:interval/*[1]|mml:condition/*"/></mml:mrow>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:uplimit/*|mml:interval/*[2]"/></mml:mrow>
+ </mml:msubsup>
+ <xsl:apply-templates mode="c2p" select="*[last()]"/>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.7.3 limit -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:limit]]">
+ <mml:mrow>
+ <mml:munder>
+  <mml:mi>limit</mml:mi>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:lowlimit|mml:condition/*"/></mml:mrow>
+ </mml:munder>
+ <xsl:apply-templates mode="c2p" select="*[last()]"/>
+</mml:mrow>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:apply[mml:limit]/mml:lowlimit" priority="3">
+<mml:mrow>
+<xsl:apply-templates mode="c2p" select="../mml:bvar/node()"/>
+<mml:mo>&#8594;<!--rightarrow--></mml:mo>
+<xsl:apply-templates mode="c2p"/>
+</mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.7.4 tendsto -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:tendsto]]">
+ <xsl:param name="p"/>
+<xsl:call-template name="binary">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>
+  <xsl:choose>
+   <xsl:when test="@type='above'">&#8600;<!--searrow--></xsl:when>
+   <xsl:when test="@type='below'">&#8599;<!--nearrow--></xsl:when>
+   <xsl:when test="@type='two-sided'">&#8594;<!--rightarrow--></xsl:when>
+   <xsl:otherwise>&#8594;<!--rightarrow--></xsl:otherwise>
+  </xsl:choose>
+  </mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.8.1 trig -->
+<xsl:template mode="c2p" match="mml:apply[*[1][
+ self::mml:sin or self::mml:cos or self::mml:tan or self::mml:sec or
+ self::mml:csc or self::mml:cot or self::mml:sinh or self::mml:cosh or
+ self::mml:tanh or self::mml:sech or self::mml:csch or self::mml:coth or
+ self::mml:arcsin or self::mml:arccos or self::mml:arctan or self::mml:arccosh
+ or self::mml:arccot or self::mml:arccoth or self::mml:arccsc or
+ self::mml:arccsch or self::mml:arcsec or self::mml:arcsech or
+ self::mml:arcsinh or self::mml:arctanh or self::mml:ln]]">
+<mml:mrow>
+<mml:mi><xsl:value-of select="local-name(*[1])"/></mml:mi>
+<xsl:apply-templates mode="c2p" select="*[2]">
+  <xsl:with-param name="p" select="7"/>
+</xsl:apply-templates>
+</mml:mrow>
+</xsl:template>
+
+
+
+
+<!-- 4.4.8.2 exp -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:exp]]">
+<mml:msup>
+<mml:mi>e<!-- exponential e--></mml:mi>
+<mml:mrow><xsl:apply-templates mode="c2p" select="*[2]"/></mml:mrow>
+</mml:msup>
+</xsl:template>
+
+<!-- 4.4.8.3 ln -->
+<!-- with trig -->
+
+<!-- 4.4.8.4 log -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:log]]">
+<mml:mrow>
+<xsl:choose>
+<xsl:when test="not(mml:logbase) or mml:logbase=10">
+<mml:mi>log</mml:mi>
+</xsl:when>
+<xsl:otherwise>
+<mml:msub>
+<mml:mi>log</mml:mi>
+<mml:mrow><xsl:apply-templates mode="c2p" select="mml:logbase/node()"/></mml:mrow>
+</mml:msub>
+</xsl:otherwise>
+</xsl:choose>
+<xsl:apply-templates mode="c2p" select="*[last()]">
+  <xsl:with-param name="p" select="7"/>
+</xsl:apply-templates>
+</mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.9.1 mean -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:mean]]">
+<mml:mrow>
+ <mml:mo>&#9001;<!--langle--></mml:mo>
+    <xsl:for-each select="*[position()&gt;1]">
+      <xsl:apply-templates mode="c2p" select="."/>
+      <xsl:if test="position() !=last()"><mml:mo>,</mml:mo></xsl:if>
+    </xsl:for-each>
+<mml:mo>&#9002;<!--rangle--></mml:mo>
+</mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.9.2 sdef -->
+<xsl:template mode="c2p" match="mml:sdev">
+<mml:mo>&#963;<!--sigma--></mml:mo>
+</xsl:template>
+
+<!-- 4.4.9.3 variance -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:variance]]">
+<mml:msup>
+<mml:mrow>
+<mml:mo>&#963;<!--sigma--></mml:mo>
+<mml:mo>(</mml:mo>
+<xsl:apply-templates mode="c2p" select="*[2]"/>
+<mml:mo>)</mml:mo>
+</mml:mrow>
+<mml:mn>2</mml:mn>
+</mml:msup>
+</xsl:template>
+
+
+<!-- 4.4.9.4 median -->
+<xsl:template mode="c2p" match="mml:median">
+<mml:mo>median</mml:mo>
+</xsl:template>
+
+
+<!-- 4.4.9.5 mode -->
+<xsl:template mode="c2p" match="mml:mode">
+<mml:mo>mode</mml:mo>
+</xsl:template>
+
+<!-- 4.4.9.5 moment -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:moment]]">
+<mml:mrow>
+ <mml:mo>&#9001;<!--langle--></mml:mo>
+       <mml:msup>
+      <xsl:apply-templates mode="c2p" select="*[last()]"/>
+      <mml:mrow><xsl:apply-templates mode="c2p" select="mml:degree/node()"/></mml:mrow>
+       </mml:msup>
+<mml:mo>&#9002;<!--rangle--></mml:mo>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.9.5 momentabout -->
+<xsl:template mode="c2p" match="mml:momentabout"/>
+
+<!-- 4.4.10.1 vector  -->
+<xsl:template mode="c2p" match="mml:vector">
+<mml:mrow>
+<mml:mo>(</mml:mo>
+<mml:mtable>
+<xsl:for-each select="*">
+<mml:mtr><mml:mtd><xsl:apply-templates mode="c2p" select="."/></mml:mtd></mml:mtr>
+</xsl:for-each>
+</mml:mtable>
+<mml:mo>)</mml:mo>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.10.2 matrix  -->
+<xsl:template mode="c2p" match="mml:matrix">
+<mml:mrow>
+<mml:mo>(</mml:mo>
+<mml:mtable>
+<xsl:apply-templates mode="c2p"/>
+</mml:mtable>
+<mml:mo>)</mml:mo>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.10.3 matrixrow  -->
+<xsl:template mode="c2p" match="mml:matrixrow">
+<mml:mtr>
+<xsl:for-each select="*">
+<mml:mtd><xsl:apply-templates mode="c2p" select="."/></mml:mtd>
+</xsl:for-each>
+</mml:mtr>
+</xsl:template>
+
+<!-- 4.4.10.4 determinant  -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:determinant]]">
+<mml:mrow>
+<mml:mi>det</mml:mi>
+<xsl:apply-templates mode="c2p" select="*[2]">
+  <xsl:with-param name="p" select="7"/>
+</xsl:apply-templates>
+</mml:mrow>
+</xsl:template>
+
+<xsl:template
+match="mml:apply[*[1][self::mml:determinant]][*[2][self::mml:matrix]]" priority="2">
+<mml:mrow>
+<mml:mo>|</mml:mo>
+<mml:mtable>
+<xsl:apply-templates mode="c2p" select="mml:matrix/*"/>
+</mml:mtable>
+<mml:mo>|</mml:mo>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.10.5 transpose -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:transpose]]">
+<mml:msup>
+<xsl:apply-templates mode="c2p" select="*[2]">
+  <xsl:with-param name="p" select="7"/>
+</xsl:apply-templates>
+<mml:mi>T</mml:mi>
+</mml:msup>
+</xsl:template>
+
+<!-- 4.4.10.5 selector -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:selector]]">
+<mml:msub>
+<xsl:apply-templates mode="c2p" select="*[2]">
+  <xsl:with-param name="p" select="7"/>
+</xsl:apply-templates>
+<mml:mrow>
+    <xsl:for-each select="*[position()&gt;2]">
+      <xsl:apply-templates mode="c2p" select="."/>
+      <xsl:if test="position() !=last()"><mml:mo>,</mml:mo></xsl:if>
+    </xsl:for-each>
+</mml:mrow>
+</mml:msub>
+</xsl:template>
+
+<!-- *** -->
+<!-- 4.4.10.6 vectorproduct see cartesianproduct -->
+
+
+<!-- 4.4.10.7 scalarproduct-->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:scalarproduct or self::mml:outerproduct]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>.</mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.10.8 outerproduct-->
+
+<!-- 4.4.11.2 semantics -->
+<xsl:template mode="c2p" match="mml:semantics">
+ <xsl:apply-templates mode="c2p" select="*[1]"/>
+</xsl:template>
+<xsl:template mode="c2p" match="mml:semantics[mml:annotation-xml/@encoding='MathML-Presentation']">
+ <xsl:apply-templates mode="c2p" select="mml:annotation-xml[@encoding='MathML-Presentation']/node()"/>
+</xsl:template>
+
+<!-- 4.4.12.1 integers -->
+<xsl:template mode="c2p" match="mml:integers">
+<mml:mi mathvariant="double-struck">Z</mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.2 reals -->
+<xsl:template mode="c2p" match="mml:reals">
+<mml:mi mathvariant="double-struck">R</mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.3 rationals -->
+<xsl:template mode="c2p" match="mml:rationals">
+<mml:mi mathvariant="double-struck">Q</mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.4 naturalnumbers -->
+<xsl:template mode="c2p" match="mml:naturalnumbers">
+<mml:mi mathvariant="double-struck">N</mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.5 complexes -->
+<xsl:template mode="c2p" match="mml:complexes">
+<mml:mi mathvariant="double-struck">C</mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.6 primes -->
+<xsl:template mode="c2p" match="mml:primes">
+<mml:mi mathvariant="double-struck">P</mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.7 exponentiale -->
+<xsl:template mode="c2p" match="mml:exponentiale">
+  <mml:mi>e<!-- exponential e--></mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.8 imaginaryi -->
+<xsl:template mode="c2p" match="mml:imaginaryi">
+  <mml:mi>i<!-- imaginary i--></mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.9 notanumber -->
+<xsl:template mode="c2p" match="mml:notanumber">
+  <mml:mi>NaN</mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.10 true -->
+<xsl:template mode="c2p" match="mml:true">
+  <mml:mi>true</mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.11 false -->
+<xsl:template mode="c2p" match="mml:false">
+  <mml:mi>false</mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.12 emptyset -->
+<xsl:template mode="c2p" match="mml:emptyset">
+  <mml:mi>&#8709;<!-- emptyset --></mml:mi>
+</xsl:template>
+
+
+<!-- 4.4.12.13 pi -->
+<xsl:template mode="c2p" match="mml:pi">
+  <mml:mi>&#960;<!-- pi --></mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.14 eulergamma -->
+<xsl:template mode="c2p" match="mml:eulergamma">
+  <mml:mi>&#947;<!-- gamma --></mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.15 infinity -->
+<xsl:template mode="c2p" match="mml:infinity">
+  <mml:mi>&#8734;<!-- infinity --></mml:mi>
+</xsl:template>
+
+
+<!-- ****************************** -->
+<xsl:template name="infix" >
+  <xsl:param name="mo"/>
+  <xsl:param name="p" select="0"/>
+  <xsl:param name="this-p" select="0"/>
+  <mml:mrow>
+  <xsl:if test="$this-p &lt; $p"><mml:mo>(</mml:mo></xsl:if>
+  <xsl:for-each select="*[position()&gt;1]">
+   <xsl:if test="position() &gt; 1">
+    <xsl:copy-of select="$mo"/>
+   </xsl:if>   
+   <xsl:apply-templates mode="c2p" select=".">
+     <xsl:with-param name="p" select="$this-p"/>
+   </xsl:apply-templates>
+  </xsl:for-each>
+  <xsl:if test="$this-p &lt; $p"><mml:mo>)</mml:mo></xsl:if>
+  </mml:mrow>
+</xsl:template>
+
+<xsl:template name="binary" >
+  <xsl:param name="mo"/>
+  <xsl:param name="p" select="0"/>
+  <xsl:param name="this-p" select="0"/>
+  <mml:mrow>
+  <xsl:if test="$this-p &lt; $p"><mml:mo>(</mml:mo></xsl:if>
+   <xsl:apply-templates mode="c2p" select="*[2]">
+     <xsl:with-param name="p" select="$this-p"/>
+   </xsl:apply-templates>
+   <xsl:copy-of select="$mo"/>
+   <xsl:apply-templates mode="c2p" select="*[3]">
+     <xsl:with-param name="p" select="$this-p"/>
+   </xsl:apply-templates>
+  <xsl:if test="$this-p &lt; $p"><mml:mo>)</mml:mo></xsl:if>
+  </mml:mrow>
+</xsl:template>
+
+<xsl:template name="set" >
+  <xsl:param name="o" select="'{'"/>
+  <xsl:param name="c" select="'}'"/>
+  <mml:mrow>
+   <mml:mo><xsl:value-of select="$o"/></mml:mo>
+   <xsl:choose>
+   <xsl:when test="mml:condition">
+   <mml:mrow><xsl:apply-templates mode="c2p" select="mml:bvar/*[not(self::bvar or self::condition)]"/></mml:mrow>
+   <mml:mo>|</mml:mo>
+   <mml:mrow><xsl:apply-templates mode="c2p" select="mml:condition/node()"/></mml:mrow>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:for-each select="*">
+      <xsl:apply-templates mode="c2p" select="."/>
+      <xsl:if test="position() !=last()"><mml:mo>,</mml:mo></xsl:if>
+    </xsl:for-each>
+   </xsl:otherwise>
+   </xsl:choose>
+   <mml:mo><xsl:value-of select="$c"/></mml:mo>
+  </mml:mrow>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generator/xhtml/mathml.xsl ../rdoc-f95-20090109-1/generator/xhtml/mathml.xsl
--- ruby-1.8.7-p72/lib/rdoc/generator/xhtml/mathml.xsl	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/generator/xhtml/mathml.xsl	2008-03-09 01:14:54.000000000 +0900
@@ -0,0 +1,42 @@
+
+<xsl:stylesheet
+  version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:msxsl="urn:schemas-microsoft-com:xslt"
+  xmlns:fns="http://www.w3.org/2002/Math/preference"
+  xmlns:mml="http://www.w3.org/1998/Math/MathML"
+  extension-element-prefixes="msxsl fns"
+>
+
+<!--
+Copyright David Carlisle 2001, 2002.
+
+Use and distribution of this code are permitted under the terms of the <a
+href="http://www.w3.org/Consortium/Legal/copyright-software-19980720"
+>W3C Software Notice and License</a>.
+-->
+
+<xsl:include href="ctop.xsl"/>
+<xsl:include href="pmathml.xsl"/>
+
+<xsl:output/>
+
+<xsl:template match="/">
+<xsl:choose>
+<xsl:when test="system-property('xsl:vendor')='Transformiix'">
+<xsl:apply-templates mode="c2p"/>
+</xsl:when>
+<!-- not working, currently
+<xsl:when test="system-property('xsl:vendor')='Microsoft' and /*/@fns:renderer='css'">
+<xsl:variable name="pmml">
+<xsl:apply-templates mode="c2p"/>
+</xsl:variable>
+<xsl:apply-templates select="msxsl:node-set($pmml)/node()"/>
+</xsl:when>
+-->
+<xsl:otherwise>
+<xsl:apply-templates/>
+</xsl:otherwise>
+</xsl:choose>
+</xsl:template> 
+</xsl:stylesheet>
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generator/xhtml/pmathml.xsl ../rdoc-f95-20090109-1/generator/xhtml/pmathml.xsl
--- ruby-1.8.7-p72/lib/rdoc/generator/xhtml/pmathml.xsl	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/generator/xhtml/pmathml.xsl	2008-03-09 01:14:54.000000000 +0900
@@ -0,0 +1,612 @@
+<xsl:stylesheet
+  version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:mml="http://www.w3.org/1998/Math/MathML"
+  xmlns:h="http://www.w3.org/1999/xhtml"
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:msxsl="urn:schemas-microsoft-com:xslt"
+  xmlns:fns="http://www.w3.org/2002/Math/preference"
+  xmlns:doc="http://www.dcarlisle.demon.co.uk/xsldoc"
+  xmlns:ie5="http://www.w3.org/TR/WD-xsl"
+  exclude-result-prefixes="h ie5 fns msxsl fns doc"
+  extension-element-prefixes="msxsl fns doc"
+>
+
+<!--
+$Id: pmathml.xsl,v 1.1 2008-03-08 16:14:54 morikawa Exp $
+
+Copyright David Carlisle 2001, 2002.
+
+Use and distribution of this code are permitted under the terms of the <a
+href="http://www.w3.org/Consortium/Legal/copyright-software-19980720"
+>W3C Software Notice and License</a>.
+-->
+
+<!-- MathPlayer mpdialog code for contributed by
+     Jack Dignan and Robert Miner, both of Design Science.
+-->
+
+<xsl:output method="xml" omit-xml-declaration="yes"  />
+
+<ie5:if doc:id="iehack" test=".">
+    <ie5:eval no-entities="t">'&lt;!--'</ie5:eval>
+</ie5:if>
+
+
+<fns:x name="mathplayer" o="MathPlayer.Factory.1">
+<object id="mmlFactory" 
+        classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987">
+</object>
+<?import namespace="mml" implementation="#mmlFactory"?>
+</fns:x>
+
+<fns:x name="techexplorer" o="techexplorer.AxTchExpCtrl.1">
+<object id="mmlFactory" classid="clsid:0E76D59A-C088-11D4-9920-002035EFB1A4">
+</object>
+<?import namespace="mml" implementation="#mmlFactory"?>
+</fns:x>
+
+
+<!-- SCRIPT not script due to weird mozilla bug
+http://bugzilla.mozilla.org/show_bug.cgi?id=158457
+-->
+
+<fns:x name="css" o="Microsoft.FreeThreadedXMLDOM">
+<SCRIPT for="window" event="onload">
+var xsl = new ActiveXObject("Microsoft.FreeThreadedXMLDOM");
+xsl.async = false;
+xsl.validateOnParse = false;
+xsl.load("pmathmlcss.xsl");
+var xslTemplate = new ActiveXObject("MSXML2.XSLTemplate.3.0");
+xslTemplate.stylesheet=xsl.documentElement;
+var xslProc = xslTemplate.createProcessor();
+xslProc.input = document.XMLDocument;
+xslProc.transform();
+var str = xslProc.output;
+<!-- work around bug in IE6 under Win XP, RM 6/5/2002 -->
+var repl = "replace";
+if (window.navigator.appVersion.match(/Windows NT 5.1/)) { repl = ""; }
+var newDoc = document.open("text/html", repl);
+newDoc.write(str);
+</SCRIPT>
+</fns:x>
+
+
+<h:p>
+in mpdialog mode, we just write out some JavaScript to display 
+dialog to the reader asking whether they want to install MathPlayer 
+Depending on the response we get, we then instantiate an XSL processor
+and reprocess the doc, passing $secondpass according to the
+reader response.
+</h:p>
+<h:p>Using d-o-e is fairly horrible, but this code is only for IE
+anyway, and we need to force HTML semantics in this case.</h:p>
+
+<xsl:variable name="mpdialog">
+var cookieName = "MathPlayerInstall=";
+function MPInstall(){
+ var showDialog=true;
+ var c = document.cookie;
+ var i = c.indexOf(cookieName);
+ if (i >= 0) {
+  if ( c.substr(i + cookieName.length, 1) >= 2) { showDialog=false; }
+ }
+ if (showDialog) {
+  MPDialog();
+  c = document.cookie;
+  i = c.indexOf(cookieName);
+ }
+ if (i >= 0) return c.substr(i + cookieName.length, 1);
+ else return null;
+}
+
+function MPDialog() {
+ var vArgs="";
+ var sFeatures="dialogWidth:410px;dialogHeight:190px;help:off;status:no";
+ var text = "";
+ text += "javascript:document.write('"
+ text += '&lt;script>'
+ text += 'function fnClose(v) { '
+ text += 'var exp = new Date();'
+ text += 'var thirtyDays = exp.getTime() + (30 * 24 * 60 * 60 * 1000);'
+ text += 'exp.setTime(thirtyDays);'
+ text += 'var cookieProps = ";expires=" + exp.toGMTString();'
+ text += 'if (document.forms[0].dontask.checked) v+=2;'
+ text += 'document.cookie="' + cookieName + '"+v+cookieProps;'
+ text += 'window.close();'
+ text += '}'
+ text += '&lt;/' + 'script>'
+ text += '&lt;head>&lt;title>Install MathPlayer?&lt;/title>&lt;/head>'
+ text += '&lt;body bgcolor="#D4D0C8">&lt;form>'
+ text += '&lt;table cellpadding=10 style="font-family:Arial;font-size:10pt" border=0 width=100%>'
+ text += '&lt;tr>&lt;td align=left>This page requires Design Science\\\'s MathPlayer&amp;trade;.&lt;br>'
+ text += 'Do you want to download and install MathPlayer?&lt;/td>&lt;/tr>';
+ text += '&lt;tr>&lt;td align=center>&lt;input type="checkbox" name="dontask">'
+ text += 'Don\\\'t ask me again&lt;/td>&lt;/tr>'
+ text += '&lt;tr>&lt;td align=center>&lt;input id=yes type="button" value=" Yes "'
+ text += ' onClick="fnClose(1)">&amp;nbsp;&amp;nbsp;&amp;nbsp;'
+ text += '&lt;input type="button" value="  No  " onClick="fnClose(0)">&lt;/td>&lt;/tr>'
+ text += '&lt;/table>&lt;/form>';
+ text += '&lt;/body>'
+ text += "')"
+ window.showModalDialog( text , vArgs, sFeatures );
+}
+
+function WaitDialog() {
+ var vArgs="";
+ var sFeatures="dialogWidth:510px;dialogHeight:150px;help:off;status:no";
+ var text = "";
+ text += "javascript:document.write('"
+ text += '&lt;script>'
+ text += 'window.onload=fnLoad;'
+ text += 'function fnLoad() {document.forms[0].yes.focus();}'
+ text += 'function fnClose(v) { '
+ text += 'window.returnValue=v;'
+ text += 'window.close();'
+ text += '}'
+ text += '&lt;/' + 'script>'
+ text += '&lt;head>&lt;title>Wait for Installation?&lt;/title>&lt;/head>'
+ text += '&lt;body bgcolor="#D4D0C8" onload="fnLoad()">&lt;form>&lt;'
+ text += 'table cellpadding=10 style="font-family:Arial;font-size:10pt" border=0 width=100%>'
+ text += '&lt;tr>&lt;td align=left>Click OK once MathPlayer is installed '
+ text += 'to refresh the page.&lt;br>'
+ text += 'Click Cancel to view the page immediately without MathPlayer.&lt;/td>&lt;/tr>';
+ text += '&lt;tr>&lt;td align=center>&lt;input id=yes type="button" '
+ text += 'value="   OK   " onClick="fnClose(1)">&amp;nbsp;&amp;nbsp;&amp;nbsp;'
+ text += '&lt;input type="button" value="Cancel" onClick="fnClose(0)">&lt;/td>&lt;/tr>'
+ text += '&lt;/table>&lt;/form>';
+ text += '&lt;/body>'
+ text += "')"
+ return window.showModalDialog( text , vArgs, sFeatures );
+}
+
+var result = MPInstall();
+
+var action = "fallthrough";
+if (result == 1 || result == 3) {
+ window.open("http://www.dessci.com/webmath/mathplayer");
+ var wait = WaitDialog();
+ if ( wait == 1) {
+  action =  "install";
+  document.location.reload();
+
+ }
+}
+if (action == "fallthrough") {
+var xsl = new ActiveXObject("Microsoft.FreeThreadedXMLDOM");
+xsl.async = false;
+xsl.validateOnParse = false;
+xsl.load("pmathmlcss.xsl");
+var xslTemplate = new ActiveXObject("MSXML2.XSLTemplate.3.0");
+xslTemplate.stylesheet=xsl.documentElement;
+var xslProc = xslTemplate.createProcessor();
+xslProc.input = document.XMLDocument;
+
+xslProc.transform();
+var str = xslProc.output;
+<!-- work around bug in IE6 under Win XP, RM 6/5/2002 -->
+var repl = "replace";
+if (window.navigator.appVersion.match(/Windows NT 5.1/)) { repl = ""; }
+var newDoc = document.open("text/html", repl);
+newDoc.write(str);
+document.close();
+}
+</xsl:variable>
+
+<fns:x name="mathplayer-dl" >mathplayer-dl</fns:x>
+
+<fns:x name="techexplorer-plugin" >techexplorer-plugin</fns:x>
+
+<xsl:variable name="root" select="/"/>
+
+
+
+<xsl:param name="activex">
+   <xsl:choose>
+     <xsl:when test="/*/@fns:renderer='techexplorer-plugin'">techexplorer-plugin</xsl:when>
+     <xsl:when test="system-property('xsl:vendor')!='Microsoft'"/>
+     <xsl:otherwise>
+<xsl:variable name="docpref" select="document('')/*/fns:x[@name=$root/*/@fns:renderer][1]"/>
+     <xsl:choose>
+     <xsl:when test="$docpref='mathplayer-dl'">mathplayer-dl</xsl:when>
+     <xsl:when test="$docpref and fns:isinstalled(string($docpref/@o))='true'">
+           <xsl:copy-of select="$docpref/node()"/>
+     </xsl:when>
+     <xsl:otherwise>
+       <xsl:copy-of select="(document('')/*/fns:x[fns:isinstalled(string(@o))='true'])[1]/node()"/>
+     </xsl:otherwise>
+  </xsl:choose>
+     </xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+
+<h:div doc:ref="iehack">
+<h:h3>IE5 hacks</h:h3>
+<h:p>This code will be ignored by an XSLT engine as a top level
+element in a foreign namespace. It will be executed by an IE5XSL
+engine and insert &lt;!-- into the output stream, ie the start of a
+comment. This will comment out all the XSLT code which will be copied
+to the output. A similar clause below will close this comment, it is
+then followed by the IE5XSL templates to be executed.</h:p>
+<h:p>This trick is due to Jonathan Marsh of Microsoft, and used in
+<h:a href="http://www.w3.org/TR/2001/WD-query-datamodel-20010607/xmlspec-ie-dm.xsl">the stylesheet for
+the XPath 2 data model draft</h:a>.</h:p>
+</h:div>
+
+<h:h2>XSLT stylesheet</h:h2>
+<h:h3>MSXSL script block</h:h3>
+
+<h:p>The following script block implements an extension function that
+tests whether a specified ActiveX component is known to the client.
+This is used below to test for the existence of MathML rendering
+components.</h:p>
+<msxsl:script language="JScript" implements-prefix="fns">
+    function isinstalled(ax) 
+    {
+    try {
+        var ActiveX = new ActiveXObject(ax);
+        return "true";
+    } catch (e) {
+        return "false";
+    }
+}
+</msxsl:script>
+
+<h:p>The main bulk of this stylesheet is an identity transformation so...</h:p>
+<xsl:template match="*|comment()">
+<xsl:copy>
+<xsl:copy-of select="@*"/>
+<xsl:apply-templates/>
+</xsl:copy>
+</xsl:template>
+
+
+
+<h:p>XHTML elements are copied sans prefix (XHTML is default namespace
+here, so these elements will still be in XHTML namespace</h:p>
+<xsl:template match="h:*">
+<xsl:element name="{local-name(.)}">
+ <xsl:copy-of select="@*"/>
+<xsl:apply-templates/>
+</xsl:element>
+</xsl:template>
+
+<h:p>IE's treatment of XHTML as HTML needs a little help here...</h:p>
+<xsl:template match="h:br|h:hr">
+<xsl:choose>
+<xsl:when test="system-property('xsl:vendor')='Microsoft'">
+  <xsl:value-of disable-output-escaping="yes" select="concat('&lt;',local-name(.))"/>
+  <xsl:apply-templates mode="verb" select="@*"/>
+  <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
+</xsl:when>
+<xsl:otherwise>
+<xsl:element name="{local-name(.)}">
+ <xsl:copy-of select="@*"/>
+<xsl:apply-templates/>
+</xsl:element>
+</xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+<h:p>This just ensures the mathml prefix declaration isn't copied from
+the source at this stage, so that the system will use the mml prefix
+coming from this stylesheet</h:p>
+<xsl:template match="h:html|html">
+<html>
+<xsl:copy-of select="@*[not(namespace-uri(.)='http://www.w3.org/2002/Math/preference')]"/>
+<xsl:apply-templates/>
+</html>
+</xsl:template>
+
+<h:p>We modify the head element to add code to specify a Microsoft
+"Behaviour" if the behaviour component is known to the system.</h:p>
+<h:span doc:ref="mp">Test for MathPlayer (Design Science)</h:span>
+<h:span doc:ref="te">Test for Techexplorer (IBM)</h:span>
+<h:span doc:ref="ms"><h:div>Test for Microsoft. In this case we just
+output a small HTML file that executes a script that will re-process
+the source docuument with a different stylesheet. Doing things this
+way avoids the need to xsl:import the second stylesheet, which would
+very much increase the processing overhead of running this
+stylesheet.</h:div></h:span>
+<h:span doc:ref="other">Further tests (eg for netscape/mozilla) could
+be added here if necessary</h:span>
+<xsl:template match="h:head|head">
+<head>
+
+<!-- new if for IE frames bug -->
+<xsl:if test="system-property('xsl:vendor')='Microsoft'">
+<xsl:if test="name(msxsl:node-set($activex)/*)=''">
+<object id="mmlFactory" 
+        classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987">
+</object>
+<xsl:processing-instruction name="import">
+ namespace="mml" implementation="#mmlFactory"
+</xsl:processing-instruction>
+</xsl:if>
+</xsl:if>
+
+<xsl:choose>
+<xsl:when doc:id="mp" test="$activex='mathplayer-dl'">
+    <xsl:if test="fns:isinstalled('MathPlayer.Factory.1')='false'">
+     <SCRIPT for="window" event="onload">
+       <xsl:value-of select="$mpdialog" disable-output-escaping="yes"/>
+     </SCRIPT>
+    </xsl:if>
+   <xsl:copy-of select="document('')/*/fns:x[@name='mathplayer']"/>
+</xsl:when>
+<xsl:when doc:id="mp" test="not($activex='techexplorer-plugin') and system-property('xsl:vendor')='Microsoft'">
+  <xsl:copy-of select="$activex"/>
+</xsl:when>
+<xsl:otherwise doc:id="other">
+</xsl:otherwise>
+</xsl:choose>
+  <xsl:apply-templates/>
+</head>
+</xsl:template>
+
+
+<xsl:template match="mml:math" priority="22">
+<xsl:choose>
+<xsl:when test="$activex='techexplorer-plugin'">
+<embed  type="text/mathml" height="75" width="300">
+<xsl:attribute name="mmldata">
+<xsl:apply-templates mode="verb" select="."/>
+</xsl:attribute>
+</embed>
+</xsl:when>
+<xsl:otherwise>
+<xsl:element name="mml:{local-name(.)}">
+ <xsl:copy-of select="@*"/>
+<xsl:apply-templates/>
+</xsl:element>
+</xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+
+<!-- squash annotation elements -->
+
+
+
+<h:p>Somewhat bizarrely in an otherwise namespace aware system,
+Microsoft behaviours are defined to trigger off the
+<h:em>prefix</h:em> not the <h:em>Namespace</h:em>. In the code above
+we associated a MathML rendering behaviour (if one was found) with the
+prefix <h:code>mml:</h:code> so here we ensure that this is the prefix
+that actually gets used in the output.</h:p>
+<xsl:template match="mml:*">
+<xsl:element name="mml:{local-name(.)}">
+ <xsl:copy-of select="@*"/>
+<xsl:apply-templates/>
+</xsl:element>
+</xsl:template>
+
+<h:p>Copy semantics element through in IE (so mathplayer gets to see
+mathplayer annotations, otherwise use first child or a presentation annotation.</h:p>
+<xsl:template match="mml:semantics">
+<xsl:choose>
+ <xsl:when test="system-property('xsl:vendor')='Microsoft'">
+   <xsl:element name="mml:{local-name(.)}">
+    <xsl:copy-of select="@*"/>
+    <xsl:apply-templates/>
+   </xsl:element>
+ </xsl:when>
+ <xsl:when test="mml:annotation-xml[@encoding='MathML-Presentation']">
+   <xsl:apply-templates select="mml:annotation-xml[@encoding='MathML-Presentation']/node()"/>  
+ </xsl:when>
+ <xsl:otherwise>
+   <xsl:apply-templates select="*[1]"/>  
+ </xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+<!-- a version of my old verb.xsl -->
+
+<!-- non empty elements and other nodes. -->
+<xsl:template mode="verb" match="*[*]|*[text()]|*[comment()]|*[processing-instruction()]">
+  <xsl:value-of select="concat('&lt;',local-name(.))"/>
+  <xsl:apply-templates mode="verb" select="@*"/>
+  <xsl:text>&gt;</xsl:text>
+  <xsl:apply-templates mode="verb"/>
+  <xsl:value-of select="concat('&lt;/',local-name(.),'&gt;')"/>
+</xsl:template>
+
+<!-- empty elements -->
+<xsl:template mode="verb" match="*">
+  <xsl:value-of select="concat('&lt;',local-name(.))"/>
+  <xsl:apply-templates mode="verb" select="@*"/>
+  <xsl:text>/&gt;</xsl:text>
+</xsl:template>
+
+<!-- attributes
+     Output always surrounds attribute value by "
+     so we need to make sure no literal " appear in the value  -->
+<xsl:template mode="verb" match="@*">
+  <xsl:value-of select="concat(' ',local-name(.),'=')"/>
+  <xsl:text>"</xsl:text>
+  <xsl:call-template name="string-replace">
+    <xsl:with-param name="from" select="'&quot;'"/>
+    <xsl:with-param name="to" select="'&amp;quot;'"/> 
+    <xsl:with-param name="string" select="."/>
+  </xsl:call-template>
+  <xsl:text>"</xsl:text>
+</xsl:template>
+
+<!-- pis -->
+<xsl:template mode="verb" match="processing-instruction()"/>
+
+<!-- only works if parser passes on comment nodes -->
+<xsl:template mode="verb" match="comment()"/>
+
+
+<!-- text elements
+     need to replace & and < by entity references-->
+<xsl:template mode="verb" match="text()">
+  <a name="{generate-id(.)}"/>
+  <xsl:call-template name="string-replace">
+    <xsl:with-param name="to" select="'&amp;gt;'"/>
+    <xsl:with-param name="from" select="'&gt;'"/> 
+    <xsl:with-param name="string">
+      <xsl:call-template name="string-replace">
+        <xsl:with-param name="to" select="'&amp;lt;'"/>
+        <xsl:with-param name="from" select="'&lt;'"/> 
+        <xsl:with-param name="string">
+          <xsl:call-template name="string-replace">
+            <xsl:with-param name="to" select="'&amp;amp;'"/>
+            <xsl:with-param name="from" select="'&amp;'"/> 
+            <xsl:with-param name="string" select="."/>
+          </xsl:call-template>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+
+<!-- end  verb mode -->
+
+<!-- replace all occurences of the character(s) `from'
+     by the string `to' in the string `string'.-->
+<xsl:template name="string-replace" >
+  <xsl:param name="string"/>
+  <xsl:param name="from"/>
+  <xsl:param name="to"/>
+  <xsl:choose>
+    <xsl:when test="contains($string,$from)">
+      <xsl:value-of select="substring-before($string,$from)"/>
+      <xsl:value-of select="$to"/>
+      <xsl:call-template name="string-replace">
+      <xsl:with-param name="string" select="substring-after($string,$from)"/>
+      <xsl:with-param name="from" select="$from"/>
+      <xsl:with-param name="to" select="$to"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$string"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+
+<!-- end of verb.xsl -->
+
+
+
+<h:h2>IE5XSL stylesheet</h:h2>
+<h:p>In a rare fit of sympathy for users of
+<h:em>the-language-known-as-XSL-in-IE5</h:em> this file incorporates a
+version of the above code designed to work in the Microsoft dialect.
+This is needed otherwise users of a MathML rendering behaviour would
+have to make a choice whether they wanted to use this stylesheet
+(keeping their source documents conforming XHTML+MathML) or to use
+the explicit Microsoft Object code, which is less portable, but would
+work in at least IE5.5.</h:p>
+
+<h:p>This entire section of code, down to the end of the stylesheet is
+contained within this ie5:if. Thus XSLT sees it as a top level element
+from a foreign namespace and silently ignores it. IE5XSL sees it as
+"if true" and so executes the code.</h:p>
+
+
+<h:p doc:ref="closecomment">First close the comment started at the beginning. This ensures
+that the bulk of the XSLT code, while being copied to the result tree
+by the IE5XSL engine, will not be rendered in the browser.</h:p>
+
+<h:span doc:ref="eval">Lacking attribute value templates in
+xsl:element, and the local-name() function, we resort to constructing
+the start and end tags in strings in javascript, then using
+no-entities attribute which is the IE5XSL equivalent of disable-output-encoding</h:span>
+<ie5:if test=".">
+
+<ie5:eval doc:id="closecomment" no-entities="t">'--&gt;'</ie5:eval>
+
+<ie5:apply-templates select=".">
+
+
+<ie5:script>
+    function mpisinstalled() 
+    {
+    try {
+        var ActiveX = new ActiveXObject("MathPlayer.Factory.1");
+        return "true";
+    } catch (e) {
+        return "false";
+    }
+}
+</ie5:script>
+
+<ie5:template match="/">
+<ie5:apply-templates/>
+</ie5:template>
+
+<ie5:template match="head|h:head"/>
+
+<ie5:template match="text()">
+<ie5:value-of select="."/>
+</ie5:template>
+
+<ie5:template match="*|@*">
+<ie5:copy>
+<ie5:apply-templates select="*|text()|@*"/>
+</ie5:copy>
+</ie5:template>
+
+
+<ie5:template match="mml:*">
+<ie5:eval  no-entities="t" doc:id="eval">'&lt;mml:' + this.nodeName.substring(this.nodeName.indexOf(":")+1)</ie5:eval>
+<ie5:for-each select="@*">
+<ie5:eval no-entities="t">' ' + this.nodeName</ie5:eval>="<ie5:value-of select="."/>"
+</ie5:for-each>
+<ie5:eval no-entities="t">'&gt;'</ie5:eval>
+<ie5:apply-templates select="*|text()"/>
+<ie5:eval no-entities="t">'&lt;/mml:' +  this.nodeName.substring(this.nodeName.indexOf(":")+1) + '&gt;'</ie5:eval>
+</ie5:template>
+
+
+<ie5:template match="mml:math">
+<ie5:if expr="mpisinstalled()=='false'">
+<embed  type="text/mathml" height="75" width="300">
+<ie5:attribute name="mmldata">
+<ie5:eval  doc:id="eval"  no-entities="t">'&lt;math&gt;'</ie5:eval>
+<ie5:apply-templates/>
+<ie5:eval  doc:id="eval"  no-entities="t">'&lt;/math&gt;'</ie5:eval>
+</ie5:attribute>
+</embed>
+</ie5:if>
+<ie5:if expr="mpisinstalled()=='true'">
+<ie5:eval  doc:id="eval"  no-entities="t">'&lt;mml:' + this.nodeName.substring(this.nodeName.indexOf(":")+1)</ie5:eval>
+<ie5:for-each select="@*">
+<ie5:eval no-entities="t">' ' + this.nodeName</ie5:eval>="<ie5:value-of select="."/>"
+</ie5:for-each>
+<ie5:eval no-entities="t">'&gt;'</ie5:eval>
+<ie5:apply-templates select="*|text()"/>
+<ie5:eval no-entities="t">'&lt;/mml:' +  this.nodeName.substring(this.nodeName.indexOf(":")+1) + '&gt;'</ie5:eval>
+</ie5:if>
+</ie5:template>
+
+<ie5:template match="html|h:html">
+<html   xmlns:mml="http://www.w3.org/1998/Math/MathML">
+<head>
+<ie5:if expr="mpisinstalled()=='true'">
+<object id="mmlFactory"
+        classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987">
+</object>
+<ie5:pi name="IMPORT">
+ namespace="mml" implementation="#mmlFactory"
+</ie5:pi>
+</ie5:if>
+<ie5:apply-templates select="h:head/*|head/*"/>
+</head>
+<body>
+<ie5:apply-templates select="body|h:body"/>
+</body>
+</html>
+</ie5:template>
+
+</ie5:apply-templates>
+
+
+</ie5:if>
+
+
+</xsl:stylesheet>
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generator/xhtml/pmathmlcss.xsl ../rdoc-f95-20090109-1/generator/xhtml/pmathmlcss.xsl
--- ruby-1.8.7-p72/lib/rdoc/generator/xhtml/pmathmlcss.xsl	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/generator/xhtml/pmathmlcss.xsl	2008-03-09 01:14:54.000000000 +0900
@@ -0,0 +1,872 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+Presentation MathML Stylesheet
+-->
+
+<!--
+$Id: pmathmlcss.xsl,v 1.1 2008-03-08 16:14:54 morikawa Exp $
+
+Copyright David Carlisle 2001, 2002.
+
+Use and distribution of this code are permitted under the terms of the <a
+href="http://www.w3.org/Consortium/Legal/copyright-software-19980720"
+>W3C Software Notice and License</a>.
+-->
+
+<xsl:stylesheet
+   version="1.0"
+   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+   xmlns:h="http://www.w3.org/1999/xhtml"
+  xmlns:m="http://www.w3.org/1998/Math/MathML"
+  xmlns:doc="http://www.dcarlisle.demon.co.uk/xsldoc"
+  xmlns:x="data:,x"
+  exclude-result-prefixes="x h doc"
+>
+
+<h:h2>Dictionary</h:h2>
+
+<h:p> The following elements in the x: namespace form an
+implementation of an "Operator Dictionary" for this MathML
+Implementation. In the case of stretch operators, the element
+specifies the symbol parts via the latin-1 equivalent character based
+on the encoding in the symbol font.  It is a clear "failure to comply
+to the spec" that using latin 1 characters (or numeric character
+references) in the latin 1 range access glyphs in teh symbol font via
+font position, however most of these character parts are not in
+Unicode (until 3.2), so there is no standard way to access these characters.</h:p>
+
+<x:x x="{" m="0em"  stretch="true" top="ì" middle="í" extend="ï" bottom="î">{</x:x>
+<x:x x="}" m="0em"  stretch="true" top="ü" middle="ý" extend="ú" bottom="þ">{</x:x>
+
+<x:x x="(" m="0em"  stretch="true" top="æ" middle="ç" extend="ç" bottom="è">(</x:x>
+<x:x x=")" m="0em"  stretch="true" top="ö" middle="÷" extend="÷" bottom="ø">)</x:x>
+
+<x:x x="[" m="0em"  stretch="true" top="é" middle="ê" extend="ê" bottom="ë">[</x:x>
+<x:x x="]" m="0em"  stretch="true" top="ù" middle="ú" extend="ú" bottom="û">]</x:x>
+
+<x:x x="&#x301A;" m="0em"  stretch="true" top="éé" middle="êê" extend="êê" bottom="ëë">[[</x:x>
+<x:x x="&#x301B;" m="0em"  stretch="true" top="ùù" middle="úú" extend="úú" bottom="ûû">]]</x:x>
+
+<x:x x="|" m="0em"  stretch="true" top="ç" middle="ç" extend="ç" bottom="ç">|</x:x>
+<x:x x="||" m="0em"  stretch="true" top="çç" middle="çç" extend="çç" bottom="çç">||</x:x>
+
+<x:x x="&#x2061;" m="0em">&#xFEFF;</x:x><!--  applyfunction -->
+<x:x x="&#x2062;" m="0em">&#xFEFF;</x:x><!--  invisibletimes -->
+<x:x x="-">&#x2212;</x:x>
+<x:x x="&#x2243;"><span style="position:
+relative;  top: +.1em;">&#x2212;</span>&#xFEFF;<span style="position:
+relative; left: -.55em; top: -.2em; margin: 0em;">~</span></x:x>
+<x:x x="&#xFE38;" m="0em">_v_</x:x>
+
+
+<h:p>Remove these for now, as XML parser in IE6 is broken and doesn't
+accept plane 1 characters.</h:p>
+<!--
+<x:x x="&#x1D538;" v="doublestruck">A</x:x>
+<x:x x="&#x1D539;" v="doublestruck">B</x:x>
+<x:x x="&#x2102;" v="doublestruck">C</x:x>
+<x:x x="&#x1D53B;" v="doublestruck">D</x:x>
+
+<x:x x="&#x1D552;" v="doublestruck">a</x:x>
+<x:x x="&#x1D553;" v="doublestruck">b</x:x>
+<x:x x="&#x1D554;" v="doublestruck">c</x:x>
+<x:x x="&#x1D555;" v="doublestruck">d</x:x>
+
+<x:x x="&#x1D504;" v="fraktur">A</x:x>
+<x:x x="&#x1D505;" v="fraktur">B</x:x>
+<x:x x="&#x212D;" v="fraktur">C</x:x>
+<x:x x="&#x1D507;" v="fraktur">D</x:x>
+
+<x:x x="&#x1D51E;" v="fraktur">a</x:x>
+<x:x x="&#x1D51F;" v="fraktur">b</x:x>
+<x:x x="&#x1D520;" v="fraktur">c</x:x>
+<x:x x="&#x1D521;" v="fraktur">d</x:x>
+-->
+
+<h:p>Grab all of the above into a variable.</h:p>
+<xsl:variable name="opdict" select="document('')/*/x:x"/>
+
+<h:h2>HTML elements</h:h2>
+
+<h:p>
+XHTML elements get passed straight through, sans namespace prefix.
+</h:p>
+<xsl:template match="h:*">
+<xsl:element name="{local-name(.)}">
+<xsl:copy-of select="@*"/>
+<xsl:apply-templates/>
+</xsl:element>
+</xsl:template>
+
+
+
+
+<h:p>
+Template for the head element copies the original content, aand in
+addition adds a script element and CSS style element that implement
+the core of the MathML renderer.
+</h:p>
+
+<h:p doc:ref="malign">
+The malign function first finds the left most item in the aligngroup, and
+then modifies the left margin of each item to make them
+align. (Currently only left alignment is supported.)
+</h:p>
+
+<h:p doc:ref="mrowStretch">
+The mrowStretch function implements stretchy brackets. It is called
+repeatedly, once for each mo child,after a span corresponding to an
+mrow. The arguments are the id of teh span and the characters to use
+for the parts of the stretch operator.
+constructed fence. The 
+</h:p>
+
+<h:p doc:ref="css">
+Inline CSS style block handles all font and size specification for the
+various MathML operators.
+</h:p>
+
+<xsl:template match="h:head">
+
+<xsl:element name="{local-name(.)}">
+<xsl:copy-of select="@*"/>
+<xsl:apply-templates/>
+
+<script>
+
+<xsl:text doc:id="malign">
+function malign (l)
+{
+var m = 0;
+for ( i = 0; i &lt; l.length ; i++)
+{
+ m = Math.max(m,l[i].offsetLeft);
+}
+for ( i = 0; i &lt; l.length ; i++)
+{
+ l[i].style.marginLeft=m - l[i].offsetLeft;
+}
+}
+</xsl:text>
+
+<xsl:text doc:id="mrowStretch">
+function mrowStretch (opid,opt,ope,opm,opb){
+opH = opid.offsetHeight;
+var opH;
+var i;
+var es;
+if (mrowH &gt; opH * 2) {
+m= "&lt;font size='+1' face='symbol'>" + opm + "&lt;/font>&lt;br/>" ;
+if ((mrowH &lt; opH * 3) &amp;&amp;(opm == ope) ) m="";
+es="";
+for ( i = 3; i &lt;= mrowH / (2*opH) ; i += 1) es += "&lt;font size='+1' face='symbol'>" + ope + "&lt;/font>&lt;br/>" ;
+opid.innerHTML="&lt;table class='lr'>&lt;tr>&lt;td>&lt;font size='+1' face='symbol'>" +
+          opt + "&lt;/font>&lt;br/>" +
+       es +
+       m +
+       es +
+ "&lt;font size='+1' face='symbol'>" + opb + "&lt;/font>&lt;/td>&lt;/tr>&lt;/table>";
+}
+}
+</xsl:text>
+
+<xsl:text doc:id="msubsup">
+function msubsup (bs,bbs,x,b,p){
+<!--
+p.style.setExpression("top",bs +" .offsetTop - " + (p.offsetHeight/2 +(bbs.offsetHeight - Math.max(bbs.offsetHeight, b.offsetHeight + p.offsetHeight)*.5)));
+-->
+p.style.setExpression("top",bs +" .offsetTop -"  + (p.offsetHeight/2));
+b.style.setExpression("top",bs + ".offsetTop + " + (bbs.offsetHeight - b.offsetHeight*.5));
+x.style.setExpression("marginLeft",Math.max(p.offsetWidth,b.offsetWidth));
+	document.recalc(true);
+}
+</xsl:text>
+
+<!--
+function msubsupzz (bs,x,b,p){
+p.style.setExpression("top",bs +" .offsetTop - " + bs +
+"p.offsetHeight/2 +(" + bs + ".offsetHeight - Math.max(" + bs + ".offsetHeight, (" + bs + "b.offsetHeight + " + bs + "p.offsetHeight)*.5))");
+b.style.setExpression("top",bs + ".offsetTop + " + bs + ".offsetHeight -  " + bs + "b.offsetHeight/2");
+x.style.setExpression("marginLeft","Math.max(" + bs +"p.offsetWidth,"
++ bs +"b.offsetWidth)");
+}
+-->
+
+<xsl:text doc:id="msup">
+function msup (bs,x,p){
+p.style.setExpression("top",bs +" .offsetTop -"  + (p.offsetHeight/2));
+x.style.setExpression("marginLeft", bs +"p.offsetWidth");
+x.style.setExpression("height", bs + ".offsetHeight + " + p.offsetHeight);
+document.recalc(true);
+}
+</xsl:text>
+
+<xsl:text doc:id="msub">
+function msub (bs,x,p){
+p.style.setExpression("top",bs +" .offsetTop +"  + (p.offsetHeight/2));
+x.style.setExpression("marginLeft", bs +"p.offsetWidth");
+x.style.setExpression("height", bs + ".offsetHeight + " + p.offsetHeight);
+document.recalc(true);
+}
+</xsl:text>
+
+<xsl:text doc:id="toggle">
+function toggle (x) {
+for ( i = 0 ; i &lt; x.childNodes.length ; i++) {
+if (x.childNodes.item(i).style.display=='inline') {
+ x.childNodes.item(i).style.display='none';
+if ( i+1 == x.childNodes.length) {
+x.childNodes.item(0).style.display='inline';
+} else {
+x.childNodes.item(i+1).style.display='inline';
+};
+break;
+}
+}
+}
+</xsl:text>
+</script>
+
+
+<style>
+<xsl:text doc:id="css">
+
+.msubsup {
+<!--background-color: red;-->
+font-size: 80%;
+position: absolute;
+}
+
+.munderover {
+display: inline;
+vertical-align: middle;
+}
+	
+.lr {
+display: inline;
+vertical-align: middle;
+}
+
+.mi {
+font-style: serif;
+}
+
+
+.mspace{
+display: inline;
+}
+.mtext {
+font-style: serif;
+}
+.ms {
+font-style: monospace;
+}
+
+.mi1 {
+font-style: italic;
+}
+
+.doublestruck {
+font-family:  castellar, algerian,niagara engraved;
+}
+.mo {
+padding-right: .3em;
+padding-left: .3em;
+}
+
+.mn {
+}
+
+.msqrt {
+border-style: solid;
+border-color: black;
+border-width: .1em 0pt 0pt .1em;
+padding-left: .2em;
+margin-left: 0em;
+margin-top: .2em;
+display: inline;
+}
+
+.actuarial {
+border-style: solid;
+border-color: black;
+border-width: .1em .1em 0pt 0pt ;
+padding-right: .2em;
+margin-right: 0em;
+margin-top: .2em;
+display: inline;
+}
+
+.ssa {
+ position:relative; top:+0.5ex;  
+width: 0pt;
+color: red;
+}
+
+
+.mover {
+margin: 0pt;
+padding: 0pt;
+display: inline;
+vertical-align: middle;
+text-align: center;
+}
+
+.mtable {
+display: inline;
+vertical-align: middle;
+}
+
+
+.mfrac {
+text-align: center;
+display:inline;
+vertical-align: middle;
+}
+
+.mfraca {
+vertical-align: bottom;
+}
+
+.mfracaa {
+border-width: 0em 0em .2ex 0em ; border-style: solid;
+   border-color: black;
+}
+
+
+.mfracb {
+vertical-align: top;
+}
+
+.merror{
+background-color: white  ;
+border-style: solid;
+border-color: #FF0000;
+color: #FF0000;
+}
+.mphantom{
+visibility: hidden;
+}
+</xsl:text>
+</style>
+</xsl:element>
+</xsl:template>
+
+<h:p>
+Unimplemented MathML elements get copied literally, in red, mainly as
+a debugging aid.
+</h:p>
+<xsl:template match="m:*">
+<span style="color: red;">&lt;<xsl:value-of select="local-name(.)"/>&gt;</span>
+<xsl:apply-templates/>
+<span style="color: red;">&lt;/<xsl:value-of select="local-name(.)"/>&gt;</span>
+</xsl:template>
+
+<h:p>
+mi: set default font based on string length, otherwise behaviour based
+on entries in the operator dictionary if one exists, or content is
+copied through to the output unchanged.
+</h:p>
+<xsl:template match="m:mi">
+<span class="mi">
+<xsl:if test="1=string-length(normalize-space(.))">
+<xsl:attribute name="class">mi1</xsl:attribute>
+</xsl:if>
+<xsl:apply-templates select="@mathvariant"/>
+ <xsl:variable name="x"  select="normalize-space(.)"/>
+ <xsl:choose>
+  <xsl:when test="$opdict[@x=$x and @v]">
+   <xsl:attribute name="class"><xsl:value-of select="$opdict[@x=$x]/@v"/></xsl:attribute>
+    <xsl:value-of select="$opdict[@x=$x and @v]"/>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:value-of select="$x"/>
+   </xsl:otherwise>
+  </xsl:choose>
+</span>
+</xsl:template>
+
+<h:p>
+Handling of mathvariant attribute.
+The choice of font families here (currently) avoids math-specific
+fonts but does use several fionts coming with windows 9.x and/or
+office 2000.
+</h:p>
+<xsl:template match="@mathvariant[.='bold']">
+<xsl:attribute name="style">font-weight: bold; font-style: upright</xsl:attribute>
+</xsl:template>
+<xsl:template match="@mathvariant[.='bold-italic']">
+<xsl:attribute name="style">font-style: upright; font-weight: bold; font-style: italic;</xsl:attribute>
+</xsl:template>
+<xsl:template match="@mathvariant[.='italic']">
+<xsl:attribute name="style">font-style: italic; </xsl:attribute>
+</xsl:template>
+<xsl:template match="@mathvariant[.='monospace']">
+<xsl:attribute name="style">font-family: monospace; </xsl:attribute>
+</xsl:template>
+
+<xsl:template match="@mathvariant[.='sans-serif']">
+<xsl:attribute name="style">font-family: sans-serif; </xsl:attribute>
+</xsl:template>
+<xsl:template match="@mathvariant[.='bold-sans-serif']">
+<xsl:attribute name="style">font-family: sans-serif; font-weight: bold; </xsl:attribute>
+</xsl:template>
+
+<xsl:template match="@mathvariant[.='fraktur']">
+<xsl:attribute name="style">font-family: old english text mt</xsl:attribute>
+<xsl:attribute name="class"></xsl:attribute>
+</xsl:template>
+
+<xsl:template match="@mathvariant[.='double-struck']">
+<xsl:attribute name="class">doublestruck</xsl:attribute>
+</xsl:template>
+
+
+<xsl:template match="@mathvariant[.='script']">
+<xsl:attribute name="style">font-family: brush script mt italic</xsl:attribute>
+<xsl:attribute name="class"></xsl:attribute>
+</xsl:template>
+
+
+<h:p>mo: Generate a unique ID so that a script at the end of any
+surrounding mrow may replace the conent by a suitably stretched
+operator if need be.</h:p>
+<xsl:template match="m:mo">
+<span id="{generate-id()}" class="mo">
+ <xsl:apply-templates/>
+</span>
+</xsl:template>
+
+<h:p>mn: a simple span</h:p>
+<xsl:template match="m:mn">
+<span class="mn">
+ <xsl:apply-templates/>
+</span>
+</xsl:template>
+
+<h:p>munder: currently only supports underline, with a bottom border</h:p>
+<xsl:template match="m:munder">
+<span class="munder">
+<xsl:if test="normalize-space(*[2])='&#x332;'">
+  <xsl:attribute
+  name="style">border-width: 0pt 0pt .1em 0pt; border-style: solid;"</xsl:attribute>
+</xsl:if>
+ <span><xsl:apply-templates select="*[1]"/></span>
+</span>
+</xsl:template>
+
+<h:p>mover: currently only supports overline, with a top border</h:p>
+<xsl:template match="m:mover">
+<span class="munder">
+<xsl:if test="normalize-space(*[2])='&#xAF;'">
+  <xsl:attribute
+  name="style">border-width: .1em 0pt 0pt 0pt; border-style: solid;"</xsl:attribute>
+</xsl:if>
+ <span><xsl:apply-templates select="*[1]"/></span>
+</span>
+</xsl:template>
+
+<h:p>munderover: </h:p>
+<xsl:template match="m:munderover">
+<table class="munderover">
+<tr><td><xsl:apply-templates select="*[3]"/></td></tr>
+<tr><td><xsl:apply-templates select="*[1]"/></td></tr>
+<tr><td><xsl:apply-templates select="*[2]"/></td></tr>
+</table>
+</xsl:template>
+
+<h:p>mtext: a simple span</h:p>
+<xsl:template match="m:mtext">
+<span class="mtext">
+ <xsl:value-of select="normalize-space(.)"/>
+</span>
+</xsl:template>
+
+<h:p>mstyle: not many attributes currently supported</h:p>
+<xsl:template match="m:mstyle">
+<span>
+<xsl:attribute name="style">
+ <xsl:if test="@color">color: <xsl:value-of select="@color"/>; </xsl:if>
+ <xsl:if test="@background">background-color: <xsl:value-of select="@background"/>; </xsl:if>
+</xsl:attribute>
+ <xsl:apply-templates/>
+</span>
+</xsl:template>
+
+
+<h:p>mglyph: Uses disable output escaping to construct a numeric
+character reference. Uses IE's non conforming behaviour of using this
+number to access the font encoding rather than unicode.</h:p>
+<xsl:template match="m:mglyph">
+<font face="{@fontfamily}"><xsl:value-of
+disable-output-escaping="yes" select="'&amp;#'"/>
+<xsl:value-of select="@index"/>;<xsl:text/>
+</font>
+</xsl:template>
+
+<h:p>ms: a simple span with left and right character added to the content.</h:p>
+<xsl:template match="m:ms">
+<span class="ms">
+  <xsl:value-of select="@lquote"/><xsl:if test="not(@lquote)">"</xsl:if>
+    <xsl:value-of select="normalize-space(.)"/>
+  <xsl:value-of select="@rquote"/><xsl:if test="not(@rquote)">"</xsl:if>
+</span>
+</xsl:template>
+
+
+<xsl:template match="m:math">
+    <xsl:call-template name="mrow"/>
+</xsl:template>
+
+
+
+<xsl:template match="m:mfenced">
+<xsl:variable name="l">
+ <xsl:choose>
+  <xsl:when test="@open"><xsl:value-of select="@open"/></xsl:when>
+  <xsl:otherwise>(</xsl:otherwise>
+ </xsl:choose>
+</xsl:variable>
+<xsl:variable name="r">
+ <xsl:choose>
+  <xsl:when test="@close"><xsl:value-of select="@close"/></xsl:when>
+  <xsl:otherwise>)</xsl:otherwise>
+ </xsl:choose>
+</xsl:variable>
+<xsl:variable name="s">
+ <xsl:choose>
+  <xsl:when test="@sep">
+    <xsl:call-template name="text">
+       <xsl:with-param name="x" select="@sep"/>
+    </xsl:call-template>
+  </xsl:when>
+  <xsl:otherwise>,</xsl:otherwise>
+ </xsl:choose>
+</xsl:variable>
+<span id="{generate-id()}L"><xsl:value-of select="$l"/></span>
+<span id="{generate-id()}M">
+<xsl:for-each select="*">
+<xsl:apply-templates select="."/>
+<xsl:if test="position() != last()"><span id="{generate-id()}X{position()}"><xsl:value-of select="$s"/></span></xsl:if>
+</xsl:for-each>
+</span>
+<span id="{generate-id()}R"><xsl:value-of select="$r"/></span>
+<script>
+
+<xsl:if test="$s=$opdict[@stretch='true']/@x">
+<xsl:for-each select="*[position()&lt;last()]">
+<xsl:variable name="opdictentry" select="$opdict[@x=$s]"/>
+mrowStretch(<xsl:value-of select="concat(generate-id(),'X',position())"/>,"<xsl:value-of
+select="$opdictentry/@top"/>","<xsl:value-of
+select="$opdictentry/@extend"/>","<xsl:value-of
+select="$opdictentry/@middle"/>","<xsl:value-of
+select="$opdictentry/@bottom"/>");</xsl:for-each>
+</xsl:if>
+
+<xsl:variable name="opdictentry" select="$opdict[@x=$l]"/>
+var mrowH = <xsl:value-of select="generate-id()"/>M.offsetHeight;
+mrowStretch(<xsl:value-of select="generate-id()"/>L,"<xsl:value-of
+select="$opdictentry/@top"/>","<xsl:value-of
+select="$opdictentry/@extend"/>","<xsl:value-of
+select="$opdictentry/@middle"/>","<xsl:value-of
+select="$opdictentry/@bottom"/>");<xsl:text/>
+
+<xsl:variable name="opdictentry2" select="$opdict[@x=$r]"/>
+mrowStretch(<xsl:value-of select="generate-id()"/>R,"<xsl:value-of
+select="$opdictentry2/@top"/>","<xsl:value-of
+select="$opdictentry2/@extend"/>","<xsl:value-of
+select="$opdictentry2/@middle"/>","<xsl:value-of
+select="$opdictentry2/@bottom"/>");<xsl:text/>
+</script>
+</xsl:template>
+
+
+
+<xsl:template match="m:mmultiscripts">
+<table style="display:inline; vertical-align: middle;">
+<tr>
+<xsl:for-each select="*[preceding-sibling::m:mprescripts and position() mod 2 = 0]">
+<td><xsl:apply-templates select="."/></td>
+</xsl:for-each>
+<td rowspan="2"><xsl:apply-templates select="*[1]"/></td>
+<xsl:for-each select="*[not(preceding-sibling::m:mprescripts) and position() !=1 and position() mod 2 = 1]">
+<td><xsl:apply-templates select="."/></td>
+</xsl:for-each>
+</tr>
+<tr>
+<xsl:for-each select="*[preceding-sibling::m:mprescripts and position() mod 2 = 1]">
+<td><xsl:apply-templates select="."/></td>
+</xsl:for-each>
+<xsl:for-each select="*[not(preceding-sibling::m:mprescripts) and
+not(self::m:mprescripts) and position() mod 2 = 0]">
+<td><xsl:apply-templates select="."/></td>
+</xsl:for-each>
+</tr>
+</table>
+</xsl:template>
+
+
+<xsl:template match="m:none">&#xFEFF;</xsl:template>
+
+<xsl:template match="m:merror">
+<span class="merror"><xsl:call-template name="mrow"/></span>
+</xsl:template>
+
+<xsl:template match="m:mphantom">
+<span class="mphantom"><xsl:apply-templates/></span>
+</xsl:template>
+
+<xsl:template match="m:maction[@type='tooltip']">
+<span title="{*[2]}"><xsl:apply-templates select="*[1]"/></span>
+</xsl:template>
+
+<xsl:template match="m:maction[@type='toggle']">
+<span  id="{generate-id()}" onclick="toggle({generate-id()})">
+<span style="display:inline;"><xsl:apply-templates select="*[1]"/></span>
+<xsl:for-each select="*[position() &gt; 1]">
+<span style="display:none;"><xsl:apply-templates select="."/></span>
+</xsl:for-each>
+</span>
+</xsl:template>
+
+
+<xsl:template match="m:maction[@type='statusline']">
+<span  id="{generate-id()}"
+onmouseover="window.status='{*[2]}';"
+onmouseout="window.status='';"
+>
+<xsl:apply-templates select="*[1]"/></span>
+</xsl:template>
+
+
+<xsl:template match="m:maction[@type='highlight']">
+<span  id="{generate-id()}"
+onmouseover="{generate-id()}.style.backgroundColor='yellow';"
+onmouseout="{generate-id()}.style.backgroundColor='white';"><xsl:apply-templates/></span>
+</xsl:template>
+
+
+
+<xsl:template match="m:mrow" name="mrow">
+<span id="{generate-id()}" class="mrow">
+ <xsl:apply-templates select="*"/>
+</span>
+<xsl:if test="m:mo[@stretch='true' or normalize-space(.)=$opdict[@stretch='true']/@x]">
+<script>
+var mrowH = <xsl:value-of select="generate-id()"/>.offsetHeight;
+<xsl:for-each select="m:mo[@stretch='true' or
+                  normalize-space(.)=$opdict[@stretch='true']/@x]">
+
+<xsl:variable name="o" select="normalize-space(.)"/>
+<xsl:variable name="opdictentry" select="$opdict[@x=$o]"/>
+mrowStretch(<xsl:value-of select="generate-id()"/>,"<xsl:value-of
+select="$opdictentry/@top"/>","<xsl:value-of
+select="$opdictentry/@extend"/>","<xsl:value-of
+select="$opdictentry/@middle"/>","<xsl:value-of
+select="$opdictentry/@bottom"/>");</xsl:for-each>
+</script>
+</xsl:if>
+</xsl:template>
+
+
+<xsl:template match="m:msubsup">
+<span id="{generate-id()}" >
+<xsl:apply-templates select="*[1]"/></span
+><span id="{generate-id()}b" class="msubsup"><xsl:apply-templates
+select="*[2]"/></span
+><span id="{generate-id()}p" class="msubsup"><xsl:apply-templates
+select="*[3]"/></span
+><span id="{generate-id()}x">&#xFEFF;</span>
+<script>
+msubsup("<xsl:value-of select="concat(generate-id(),'&quot;,',generate-id(),',',generate-id(),'x,',generate-id(),'b,',generate-id())"/>p);
+</script>
+</xsl:template>
+
+<xsl:template match="h:table//m:msubsup|m:mtable//m:msubsup|m:msubsup"
+priority="2">
+<span>
+<xsl:apply-templates select="*[1]"/>
+</span
+><sub><xsl:apply-templates
+select="*[2]"/></sub>
+<sup><xsl:apply-templates
+select="*[3]"/></sup>
+</xsl:template>
+
+<xsl:template match="m:msup
+">
+<span id="{generate-id()}">
+<xsl:apply-templates select="*[1]"/>
+</span
+><span id="{generate-id()}p" class="msubsup"><xsl:apply-templates
+select="*[2]"/></span
+><span id="{generate-id()}x">&#xFEFF;</span>
+<script>
+msup("<xsl:value-of select="concat(generate-id(),'&quot;,',generate-id(),'x,',generate-id())"/>p);
+</script>
+</xsl:template>
+
+<xsl:template match="h:table//m:msup|m:mtable//m:msup|m:msup"
+priority="2">
+<span>
+<xsl:apply-templates select="*[1]"/>
+</span
+><sup><xsl:apply-templates
+select="*[2]"/></sup>
+</xsl:template>
+
+<xsl:template match="m:msub
+">
+<span id="{generate-id()}">
+<xsl:apply-templates select="*[1]"/>
+</span
+><span id="{generate-id()}p" class="msubsup"><xsl:apply-templates
+select="*[2]"/></span
+><span id="{generate-id()}x">&#xFEFF;</span>
+<script>
+msub("<xsl:value-of select="concat(generate-id(),'&quot;,',generate-id(),'x,',generate-id())"/>p);
+</script>
+</xsl:template>
+
+<xsl:template match="h:table//m:msub|m:mtable//m:msub|m:msub"
+priority="2">
+<span>
+<xsl:apply-templates select="*[1]"/>
+</span
+><sub><xsl:apply-templates
+select="*[2]"/></sub>
+</xsl:template>
+
+
+<xsl:template match="m:*/text()" name="text">
+<xsl:param name="x" select="normalize-space(.)"/>
+<xsl:variable name="mo"  select="document('')/*/x:x[@x=$x]"/>
+<xsl:choose>
+  <xsl:when test="$mo"><xsl:copy-of select="$mo/node()"/></xsl:when>
+  <xsl:otherwise><xsl:copy-of select="$x"/></xsl:otherwise>
+</xsl:choose>
+</xsl:template>
+
+
+<xsl:template match="m:msqrt">
+<span class="msqrtx">\&#xFEFF;</span><span class="msqrt">
+<xsl:apply-templates/>
+</span>
+</xsl:template>
+
+<xsl:template match="m:menclose[@notation='radical']">
+<span class="msqrtx">\&#xFEFF;</span><span class="msqrt">
+<xsl:apply-templates/>
+</span>
+</xsl:template>
+
+<xsl:template match="m:menclose[@notation='actuarial']">
+<span class="actuarial">
+<xsl:apply-templates/>
+</span>
+</xsl:template>
+
+<xsl:template match="m:menclose">
+<span class="msqrt">
+<xsl:apply-templates/>
+</span>
+</xsl:template>
+
+<xsl:template match="m:mroot">
+<span class="msqrtx"><sup><xsl:apply-templates select="*[2]"/></sup>\&#xFEFF;</span><span class="msqrt">
+<xsl:apply-templates select="*[1]"/>
+</span>
+</xsl:template>
+
+
+<xsl:template match="m:mfrac">
+<xsl:param name="full" select="not(ancestor::m:mfrac)"/>
+<table  class="mfrac">
+<xsl:if test="$full">
+  <xsl:attribute name="style">font-size: 75% ;</xsl:attribute>
+</xsl:if>
+<xsl:if test="not($full)">
+  <xsl:attribute name="style">font-size: 100% ;</xsl:attribute>
+</xsl:if>
+<tr id="a{generate-id()}" class="mfraca"><td class="mfracaa">
+<xsl:apply-templates select="*[1]"/>
+</td></tr>
+<tr id="b{generate-id()}" class="mfracb"><td>
+<xsl:apply-templates select="*[2]"/>
+</td></tr>
+</table><xsl:if test="$full"><script>
+if ( a<xsl:value-of select="generate-id()"
+       />.offsetHeight >  b<xsl:value-of select="generate-id()"
+         />.offsetHeight ) b<xsl:value-of select="generate-id()
+            "/>.style.setExpression("height",a<xsl:value-of select="generate-id()"/>.offsetHeight );
+else a<xsl:value-of
+select="generate-id()"/>.style.setExpression("height",b<xsl:value-of
+       select="generate-id()"/>.offsetHeight );
+</script></xsl:if>
+</xsl:template>
+
+<xsl:template match="m:padded">
+<span>
+<xsl:attribute name="display">
+</xsl:attribute>
+<xsl:apply-templates/>
+</span>
+</xsl:template>
+
+
+<xsl:template match="m:mspace">
+<span style="padding-left: {@width};"></span>
+</xsl:template>
+
+<xsl:template match="m:mtable">
+<table class="mtable">
+<xsl:apply-templates/>
+</table>
+<script>
+<xsl:variable name="t" select="."/>
+<xsl:for-each select="m:mtr[1]/m:mtd">
+<xsl:variable name="c" select="position()"/>
+<xsl:for-each select="descendant::m:maligngroup">
+<xsl:variable name="g" select="position()"/>
+malign([<xsl:for-each
+select="$t/m:mtr/m:mtd[$c]/descendant::m:maligngroup[$g]">
+ <xsl:value-of select="generate-id()"/>
+ <xsl:if test="position()&lt;last()">,</xsl:if>
+</xsl:for-each>]);</xsl:for-each>
+</xsl:for-each>
+</script>
+</xsl:template>
+
+<xsl:template match="m:mtr">
+<tr>
+<xsl:apply-templates/>
+</tr>
+</xsl:template>
+
+
+<xsl:template match="m:mtd">
+<td>
+<xsl:apply-templates/>
+</td>
+</xsl:template>
+
+<xsl:template match="m:maligngroup">
+<xsl:variable name="g">
+<xsl:choose>
+<xsl:when test="@groupalign">
+</xsl:when>
+<xsl:when test="ancestor::td/@groupalign">
+</xsl:when>
+<xsl:when test="ancestor::tr/@groupalign">
+</xsl:when>
+<xsl:when test="ancestor::table/@groupalign">
+</xsl:when>
+
+<xsl:otherwise>left</xsl:otherwise>
+</xsl:choose>
+</xsl:variable>
+<span id="{generate-id()}">&#xFEFF;</span>
+</xsl:template>
+
+
+</xsl:stylesheet>
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generator/xhtml/xhtml.rb ../rdoc-f95-20090109-1/generator/xhtml/xhtml.rb
--- ruby-1.8.7-p72/lib/rdoc/generator/xhtml/xhtml.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/generator/xhtml/xhtml.rb	2008-03-09 07:53:39.000000000 +0900
@@ -0,0 +1,732 @@
+require 'rdoc/generator/xhtml'
+require 'rdoc/generator/html/one_page_html'
+
+##
+# = CSS2 RDoc XHTML template (for MathML)
+#
+# This is a template for RDoc that uses XHTML 1.0 Transitional and dictates a
+# bit more of the appearance of the output to cascading stylesheets than the
+# default. It was designed for clean inline code display, and uses DHTMl to
+# toggle the visbility of each method's source with each click on the '[source]'
+# link.
+#
+# This is a copy of html.rb. Then some headers that needed to
+# represent MathML are added.
+#
+# == Authors
+#
+# * Yasuhiro MORIKAWA <morikawa@gfd-dennou.org>
+#
+# Copyright (c) 2008 GFD Dennou Club some rights reserved.
+
+module RDoc::Generator::XHTML::XHTML
+
+  FONTS = "Verdana,Arial,Helvetica,sans-serif"
+
+  STYLE = <<-EOF
+body {
+    font-family: Verdana,Arial,Helvetica,sans-serif;
+    font-size:   90%;
+    margin: 0;
+    margin-left: 40px;
+    padding: 0;
+    background: white;
+}
+
+h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
+/* h1 { font-size: 150%; } */
+h2,h3,h4 { margin-top: 1em; }
+
+a { background: #eef; color: #039; text-decoration: none; }
+a:hover { background: #039; color: #eef; }
+
+/* Override the base stylesheet's Anchor inside a table cell */
+td > a {
+  background: transparent;
+  color: #039;
+  text-decoration: none;
+}
+
+/* and inside a section title */
+.section-title > a {
+  background: transparent;
+  color: #eee;
+  text-decoration: none;
+}
+
+/* === Structural elements =================================== */
+
+div#index {
+    margin: 0;
+    margin-left: -40px;
+    padding: 0;
+    font-size: 90%;
+}
+
+
+div#index a {
+    margin-left: 0.7em;
+}
+
+div#index .section-bar {
+   margin-left: 0px;
+   padding-left: 0.7em;
+   background: #ccc;
+   font-size: small;
+}
+
+
+div#classHeader, div#fileHeader {
+    width: auto;
+    color: white;
+    padding: 0.5em 1.5em 0.5em 1.5em;
+    margin: 0;
+    margin-left: -40px;
+    border-bottom: 3px solid #006;
+}
+
+div#classHeader a, div#fileHeader a {
+    background: inherit;
+    color: white;
+}
+
+div#classHeader td, div#fileHeader td {
+    background: inherit;
+    color: white;
+}
+
+
+div#fileHeader {
+    background: #057;
+}
+
+div#classHeader {
+    background: #048;
+}
+
+
+.class-name-in-header {
+  font-size:  180%;
+  font-weight: bold;
+}
+
+
+div#bodyContent {
+    padding: 0 1.5em 0 1.5em;
+}
+
+div#description {
+    padding: 0.5em 1.5em;
+    background: #efefef;
+    border: 1px dotted #999;
+}
+
+div#description h1,h2,h3,h4,h5,h6 {
+    color: #125;;
+    background: transparent;
+}
+
+div#validator-badges {
+    text-align: center;
+}
+div#validator-badges img { border: 0; }
+
+div#copyright {
+    color: #333;
+    background: #efefef;
+    font: 0.75em sans-serif;
+    margin-top: 5em;
+    margin-bottom: 0;
+    padding: 0.5em 2em;
+}
+
+
+/* === Classes =================================== */
+
+table.header-table {
+    color: white;
+    font-size: small;
+}
+
+.type-note {
+    font-size: small;
+    color: #DEDEDE;
+}
+
+.xxsection-bar {
+    background: #eee;
+    color: #333;
+    padding: 3px;
+}
+
+.section-bar {
+   color: #333;
+   border-bottom: 1px solid #999;
+    margin-left: -20px;
+}
+
+
+.section-title {
+    background: #79a;
+    color: #eee;
+    padding: 3px;
+    margin-top: 2em;
+    margin-left: -30px;
+    border: 1px solid #999;
+}
+
+.top-aligned-row {  vertical-align: top }
+.bottom-aligned-row { vertical-align: bottom }
+
+/* --- Context section classes ----------------------- */
+
+.context-row { }
+.context-item-name { font-family: monospace; font-weight: bold; color: black; }
+.context-item-value { font-size: small; color: #448; }
+.context-item-desc { color: #333; padding-left: 2em; }
+
+/* --- Method classes -------------------------- */
+.method-detail {
+    background: #efefef;
+    padding: 0;
+    margin-top: 0.5em;
+    margin-bottom: 1em;
+    border: 1px dotted #ccc;
+}
+.method-heading {
+  color: black;
+  background: #ccc;
+  border-bottom: 1px solid #666;
+  padding: 0.2em 0.5em 0 0.5em;
+}
+.method-signature { color: black; background: inherit; }
+.method-name { font-weight: bold; }
+.method-args { font-style: italic; }
+.method-description { padding: 0 0.5em 0 0.5em; }
+
+/* --- Source code sections -------------------- */
+
+a.source-toggle { font-size: 90%; }
+div.method-source-code {
+    background: #262626;
+    color: #ffdead;
+    margin: 1em;
+    padding: 0.5em;
+    border: 1px dashed #999;
+    overflow: scroll;
+}
+
+div.method-source-code pre {
+    color: #ffdead;
+    overflow: visible;
+}
+
+
+/* --- Ruby keyword styles --------------------- */
+
+.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
+
+.ruby-constant  { color: #7fffd4; background: transparent; }
+.ruby-keyword { color: #00ffff; background: transparent; }
+.ruby-ivar    { color: #eedd82; background: transparent; }
+.ruby-operator  { color: #00ffee; background: transparent; }
+.ruby-identifier { color: #ffdead; background: transparent; }
+.ruby-node    { color: #ffa07a; background: transparent; }
+.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
+.ruby-regexp  { color: #ffa07a; background: transparent; }
+.ruby-value   { color: #7fffd4; background: transparent; }
+
+/* --- MathML styles --------------------- */
+
+math {
+    font-size:   150%;
+}
+EOF
+
+
+#####################################################################
+### H E A D E R   T E M P L A T E
+#####################################################################
+
+#
+#== Notation
+#
+# Following "<?xml-stylesheet ... ?>" line is a special setting for
+# Internet Explorer.
+# If you use Mozilla or Firefox, this line is needless.
+# (Anyway, this line doesn't harm these browsers).
+# Due to this line, if you use Safari (Mac OS X, standard browser),
+# XHTML is not displayed correctly. (I think Safari can not handle
+# xml-stylesheet correctly). If you use Safari, do not use --mathml
+# option.
+#
+# Following URLs are references
+#
+# * http://www.kanzaki.com/docs/html/xhtml1.html#compatibility
+# * http://past.openvista.jp/blog/documents/W3C/XHTML_FAQ/
+#
+
+  XHTML_PREAMBLE = <<-EOF
+<?xml version="1.0" encoding="<%= values["charset"] %>"?>
+<?xml-stylesheet type="text/xsl" href="<%= values["mathml_xsl_url"] %>"?>
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" 
+     "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
+  EOF
+
+  HEADER = XHTML_PREAMBLE + <<-EOF
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title><%= values["title"] %></title>
+  <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" media="screen" />
+  <style type="text/css">
+    <!-- Make codeblocks hidden by default -->
+    div.method-source-code { display: none }
+  </style>
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+
+  // ]]>
+  </script>
+
+</head>
+<body>
+EOF
+
+#####################################################################
+### C O N T E X T   C O N T E N T   T E M P L A T E
+#####################################################################
+
+  CONTEXT_CONTENT = %{
+}
+
+#####################################################################
+### F O O T E R   T E M P L A T E
+#####################################################################
+
+  FOOTER = <<-EOF
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
+  EOF
+
+
+#####################################################################
+### F I L E   P A G E   H E A D E R   T E M P L A T E
+#####################################################################
+
+  FILE_PAGE = <<-EOF
+  <div id="fileHeader">
+    <h1><%= values["short_name"] %></h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td><%= values["full_path"] %>
+<% if values["cvsurl"] then %>
+        &nbsp;(<a href="<%= values["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
+<% end %>
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td><%= values["dtm_modified"] %></td>
+    </tr>
+    </table>
+  </div>
+  EOF
+
+#####################################################################
+### C L A S S   P A G E   H E A D E R   T E M P L A T E
+#####################################################################
+
+  CLASS_PAGE = <<-EOF
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong><%= values["classmod"] %></strong></td>
+          <td class="class-name-in-header"><%= values["full_name"] %></td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+<% values["infiles"].each do |infiles| %>
+<% if infiles["full_path_url"] then %>
+                <a href="<%= infiles["full_path_url"] %>">
+<% end %>
+                <%= infiles["full_path"] %>
+<% if infiles["full_path_url"] then %>
+                </a>
+<% end %>
+<% if infiles["cvsurl"] then %>
+        &nbsp;(<a href="<%= infiles["cvsurl"] %>"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
+<% end %>
+        <br />
+<% end # values["infiles"] %>
+            </td>
+        </tr>
+
+<% if values["parent"] then %>
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+<% if values["par_url"] then %>
+                <a href="<%= values["par_url"] %>">
+<% end %>
+                <%= values["parent"] %>
+<% if values["par_url"] then %>
+               </a>
+<% end %>
+            </td>
+        </tr>
+<% end %>
+        </table>
+    </div>
+  EOF
+
+#####################################################################
+### M E T H O D   L I S T   T E M P L A T E
+#####################################################################
+
+  METHOD_LIST = <<-EOF
+
+  <div id="contextContent">
+<% if values["diagram"] then %>
+    <div id="diagram">
+      <%= values["diagram"] %>
+    </div>
+<% end %>
+
+<% if values["description"] then %>
+    <div id="description">
+      <%= values["description"] %>
+    </div>
+<% end %>
+
+<% if values["requires"] then %>
+    <div id="requires-list">
+      <h3 class="section-bar">Required files</h3>
+
+      <div class="name-list">
+<% values["requires"].each do |requires| %>
+        <%= href requires["aref"], requires["name"] %>&nbsp;&nbsp;
+<% end # values["requires"] %>
+      </div>
+    </div>
+<% end %>
+
+<% if values["toc"] then %>
+    <div id="contents-list">
+      <h3 class="section-bar">Contents</h3>
+      <ul>
+<% values["toc"].each do |toc| %>
+      <li><a href="#<%= values["href"] %>"><%= values["secname"] %></a></li>
+<% end # values["toc"] %>
+     </ul>
+<% end %>
+   </div>
+
+<% if values["methods"] then %>
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+<% values["methods"].each do |methods| %>
+        <%= href methods["aref"], methods["name"] %>&nbsp;&nbsp;
+<% end # values["methods"] %>
+      </div>
+    </div>
+<% end %>
+
+  </div>
+
+
+    <!-- if includes -->
+<% if values["includes"] then %>
+    <div id="includes">
+      <h3 class="section-bar">Included Modules</h3>
+
+      <div id="includes-list">
+<% values["includes"].each do |includes| %>
+        <span class="include-name"><%= href includes["aref"], includes["name"] %></span>
+<% end # values["includes"] %>
+      </div>
+    </div>
+<% end %>
+
+<% values["sections"].each do |sections| %>
+    <div id="section">
+<% if sections["sectitle"] then %>
+      <h2 class="section-title"><a name="<%= sections["secsequence"] %>"><%= sections["sectitle"] %></a></h2>
+<% if sections["seccomment"] then %>
+      <div class="section-comment">
+        <%= sections["seccomment"] %>
+      </div>
+<% end %>
+<% end %>
+
+<% if values["classlist"] then %>
+    <div id="class-list">
+      <h3 class="section-bar">Classes and Modules</h3>
+
+      <%= values["classlist"] %>
+    </div>
+<% end %>
+
+<% if values["constants"] then %>
+    <div id="constants-list">
+      <h3 class="section-bar">Constants</h3>
+
+      <div class="name-list">
+        <table summary="Constants">
+<% values["constants"].each do |constants| %>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name"><%= constants["name"] %></td>
+          <td>=</td>
+          <td class="context-item-value"><%= constants["value"] %></td>
+<% if values["desc"] then %>
+          <td width="3em">&nbsp;</td>
+          <td class="context-item-desc"><%= constants["desc"] %></td>
+<% end %>
+        </tr>
+<% end # values["constants"] %>
+        </table>
+      </div>
+    </div>
+<% end %>
+
+<% if values["aliases"] then %>
+    <div id="aliases-list">
+      <h3 class="section-bar">External Aliases</h3>
+
+      <div class="name-list">
+                        <table summary="aliases">
+<% values["aliases"].each do |aliases| $stderr.puts({ :aliases => aliases }.inspect) %>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name"><%= values["old_name"] %></td>
+          <td>-&gt;</td>
+          <td class="context-item-value"><%= values["new_name"] %></td>
+        </tr>
+<% if values["desc"] then %>
+      <tr class="top-aligned-row context-row">
+        <td>&nbsp;</td>
+        <td colspan="2" class="context-item-desc"><%= values["desc"] %></td>
+      </tr>
+<% end %>
+<% end # values["aliases"] %>
+        </table>
+      </div>
+    </div>
+<% end %>
+
+
+<% if values["attributes"] then %>
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+<% values["attributes"].each do |attributes| $stderr.puts({ :attributes => attributes }.inspect) %>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name"><%= values["name"] %></td>
+<% if values["rw"] then %>
+          <td class="context-item-value">&nbsp;[<%= values["rw"] %>]&nbsp;</td>
+<% end %>
+<% unless values["rw"] then %>
+          <td class="context-item-value">&nbsp;&nbsp;</td>
+<% end %>
+          <td class="context-item-desc"><%= values["a_desc"] %></td>
+        </tr>
+<% end # values["attributes"] %>
+        </table>
+      </div>
+    </div>
+<% end %>
+      
+
+
+    <!-- if method_list -->
+<% if sections["method_list"] then %>
+    <div id="methods">
+<% sections["method_list"].each do |method_list| %>
+<% if method_list["methods"] then %>
+      <h3 class="section-bar"><%= method_list["type"] %> <%= method_list["category"] %> methods</h3>
+
+<% method_list["methods"].each do |methods| %>
+      <div id="method-<%= methods["aref"] %>" class="method-detail">
+        <a name="<%= methods["aref"] %>"></a>
+
+        <div class="method-heading">
+<% if methods["codeurl"] then %>
+          <a href="<%= methods["codeurl"] %>" target="Code" class="method-signature"
+            onclick="popupCode('<%= methods["codeurl"] %>');return false;">
+<% end %>
+<% if methods["sourcecode"] then %>
+          <a href="#<%= methods["aref"] %>" class="method-signature">
+<% end %>
+<% if methods["callseq"] then %>
+          <span class="method-name"><%= methods["callseq"] %></span>
+<% end %>
+<% unless methods["callseq"] then %>
+          <span class="method-name"><%= methods["name"] %></span><span class="method-args"><%= methods["params"] %></span>
+<% end %>
+<% if methods["codeurl"] then %>
+          </a>
+<% end %>
+<% if methods["sourcecode"] then %>
+          </a>
+<% end %>
+        </div>
+
+        <div class="method-description">
+<% if methods["m_desc"] then %>
+          <%= methods["m_desc"] %>
+<% end %>
+<% if methods["sourcecode"] then %>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('<%= methods["aref"] %>-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="<%= methods["aref"] %>-source">
+<pre>
+<%= methods["sourcecode"] %>
+</pre>
+          </div>
+<% end %>
+        </div>
+      </div>
+
+<% end # method_list["methods"] %>
+<% end %>
+<% end # sections["method_list"] %>
+
+    </div>
+<% end %>
+<% end # values["sections"] %>
+  EOF
+
+#####################################################################
+### B O D Y   T E M P L A T E
+#####################################################################
+
+  BODY = HEADER + %{
+
+<%= template_include %>  <!-- banner header -->
+
+  <div id="bodyContent">
+
+} +  METHOD_LIST + %{
+
+  </div>
+
+} + FOOTER
+
+#####################################################################
+### S O U R C E   C O D E   T E M P L A T E
+#####################################################################
+
+  SRC_PAGE = XHTML_PREAMBLE + <<-EOF
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title><%= values["title"] %></title>
+  <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
+  <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" media="screen" />
+</head>
+<body class="standalone-code">
+  <pre><%= values["code"] %></pre>
+</body>
+</html>
+  EOF
+
+
+#####################################################################
+### I N D E X   F I L E   T E M P L A T E S
+#####################################################################
+
+  FR_INDEX_BODY = %{
+<%= template_include %>
+}
+
+  FILE_INDEX = XHTML_PREAMBLE + <<-EOF
+<!--
+
+    <%= values["list_title"] %>
+
+  -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title><%= values["list_title"] %></title>
+  <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
+  <link rel="stylesheet" href="<%= values["style_url"] %>" type="text/css" />
+  <base target="docwin" />
+</head>
+<body>
+<div id="index">
+  <h1 class="section-bar"><%= values["list_title"] %></h1>
+  <div id="index-entries">
+<% values["entries"].each do |entries| %>
+    <a href="<%= entries["href"] %>"><%= entries["name"] %></a><br />
+<% end # values["entries"] %>
+  </div>
+</div>
+</body>
+</html>
+  EOF
+
+  CLASS_INDEX = FILE_INDEX
+  METHOD_INDEX = FILE_INDEX
+
+  INDEX = <<-EOF
+<?xml version="1.0" encoding="<%= values["charset"] %>"?>
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+
+<!--
+
+    <%= values["title"] %>
+
+  -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title><%= values["title"] %></title>
+  <meta http-equiv="Content-Type" content="text/html; charset=<%= values["charset"] %>" />
+</head>
+<frameset rows="20%, 80%">
+    <frameset cols="25%,35%,45%">
+        <frame src="fr_file_index.html"   title="Files" name="Files" />
+        <frame src="fr_class_index.html"  name="Classes" />
+        <frame src="fr_method_index.html" name="Methods" />
+    </frameset>
+    <frame src="<%= values["initial_page"] %>" name="docwin" />
+</frameset>
+</html>
+  EOF
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generator/xhtml.rb ../rdoc-f95-20090109-1/generator/xhtml.rb
--- ruby-1.8.7-p72/lib/rdoc/generator/xhtml.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/generator/xhtml.rb	2008-03-09 03:43:57.000000000 +0900
@@ -0,0 +1,106 @@
+require 'fileutils'
+
+require 'rdoc/generator'
+require 'rdoc/generator/html'
+require 'rdoc/markup/to_html'
+
+##
+# We're responsible for generating all the HTML files from the object tree
+# defined in code_objects.rb. We generate:
+#
+# [files]   an html file for each input file given. These
+#           input files appear as objects of class
+#           TopLevel
+#
+# [classes] an html file for each class or module encountered.
+#           These classes are not grouped by file: if a file
+#           contains four classes, we'll generate an html
+#           file for the file itself, and four html files
+#           for the individual classes.
+#
+# [indices] we generate three indices for files, classes,
+#           and methods. These are displayed in a browser
+#           like window with three index panes across the
+#           top and the selected description below
+#
+# Method descriptions appear in whatever entity (file, class, or module) that
+# contains them.
+#
+# We generate files in a structure below a specified subdirectory, normally
+# +doc+.
+#
+#  opdir
+#     |
+#     |___ files
+#     |       |__  per file summaries
+#     |
+#     |___ classes
+#             |__ per class/module descriptions
+#
+# HTML is generated using the Template class.
+
+class RDoc::Generator::XHTML < RDoc::Generator::HTML
+
+  def gen_an_index(collection, title, template, filename)
+    template = RDoc::TemplatePage.new @template::FR_INDEX_BODY, template
+    res = []
+    collection.sort.each do |f|
+      if f.document_self
+        res << { "href" => f.path, "name" => f.index_name }
+      end
+    end
+
+    values = {
+      "entries"    => res,
+      'list_title' => CGI.escapeHTML(title),
+      'index_url'  => main_url,
+      'charset'    => @options.charset,
+      'style_url'  => style_url('', @options.css),
+      'mathml_xsl_url' => style_url('', "mathml.xsl"),
+    }
+
+    open filename, 'w' do |f|
+      template.write_html_on(f, values)
+    end
+  end
+
+  ##
+  # Build the initial indices and output objects
+  # based on an array of TopLevel objects containing
+  # the extracted information.
+
+  def generate(*args)
+    super(*args)
+
+    copy_xsls
+  end
+
+  def copy_xsls
+    xsl_files = ["mathml.xsl", "pmathmlcss.xsl", "ctop.xsl", "pmathml.xsl"]
+    xsl_dir = "rdoc/generator/xhtml"
+    hit = 0
+    $LOAD_PATH.each{ |path|
+      hit = 0
+      xsl_files.each{ |file|
+        hit += 1 if ::File.exist?(::File.join(path, xsl_dir, file))
+      }
+      if hit >= 4
+        xsl_files.each{ |file|
+          ::FileUtils.copy(::File.join(path, xsl_dir, file), "./")
+        }
+        break
+      else
+        hit = 0
+      end
+    }
+    if hit < 4
+      $stderr.puts "Couldn't find xsl files (#{xsl_files.join(', ')})\n"
+      exit
+    end
+  end
+
+end
+
+class RDoc::Generator::XHTMLInOne < RDoc::Generator::HTMLInOne
+
+end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generator/xml/rdf.rb ../rdoc-f95-20090109-1/generator/xml/rdf.rb
--- ruby-1.8.7-p72/lib/rdoc/generator/xml/rdf.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/generator/xml/rdf.rb	2008-03-08 21:23:18.000000000 +0900
@@ -0,0 +1,113 @@
+require 'rdoc/generator/xml'
+
+module RDoc::Generator::XML::RDF
+
+  CONTENTS_RDF = <<-EOF
+<% if defined? classes and classes["description"] then %>
+    <description rd:parseType="Literal">
+<%= classes["description"] %>
+    </description>
+<% end %>
+
+<% if defined? files and files["requires"] then %>
+<% files["requires"].each do |requires| %>
+         <rd:required-file rd:name="<%= requires["name"] %>" />
+<% end # files["requires"] %>
+<% end %>
+
+<% if defined? classes and classes["includes"] then %>
+      <IncludedModuleList>
+<% classes["includes"].each do |includes| %>
+        <included-module rd:name="<%= includes["name"] %>"  />
+<% end # includes["includes"] %>
+      </IncludedModuleList>
+<% end %>
+
+<% if defined? classes and classes["sections"] then %>
+<% classes["sections"].each do |sections| %>
+<% if sections["attributes"] then %>
+<% sections["attributes"].each do |attributes| %>
+        <contents>
+        <Attribute rd:name="<%= attributes["name"] %>">
+<% if attributes["rw"] then %>
+          <attribute-rw><%= attributes["rw"] %></attribute-rw>
+<% end %>
+          <description rdf:parseType="Literal"><%= attributes["a_desc"] %></description>
+        </Attribute>
+        </contents>
+<% end # sections["attributes"] %>
+<% end %>
+
+<% if sections["method_list"] then %>
+<% sections["method_list"].each do |method_list| %>
+<% if method_list["methods"] then %>
+<% method_list["methods"].each do |methods| %>
+	<contents>
+        <Method rd:name="<%= methods["name"] %>" rd:visibility="<%= methods["type"] %>"
+                rd:category="<%= methods["category"] %>" rd:id="<%= methods["aref"] %>">
+          <parameters><%= methods["params"] %></parameters>
+<% if methods["m_desc"] then %>
+          <description rdf:parseType="Literal">
+<%= methods["m_desc"] %>
+          </description>
+<% end %>
+<% if methods["sourcecode"] then %>
+          <source-code-listing rdf:parseType="Literal">
+<%= methods["sourcecode"] %>
+          </source-code-listing>
+<% end %>
+        </Method>
+       </contents>
+<% end # method_list["methods"] %>
+<% end %>
+<% end # sections["method_list"] %>
+<% end %>
+     <!-- end method list -->
+<% end # classes["sections"] %>
+<% end %>
+  EOF
+
+########################################################################
+
+  ONE_PAGE = %{<?xml version="1.0" encoding="utf-8"?>
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+        xmlns="http://pragprog.com/rdoc/rdoc.rdf#"
+        xmlns:rd="http://pragprog.com/rdoc/rdoc.rdf#">
+
+<!-- RDoc -->
+<% values["files"].each do |files| %>
+  <rd:File rd:name="<%= files["short_name"] %>" rd:id="<%= files["href"] %>">
+      <path><%= files["full_path"] %></path>
+      <dtm-modified><%= files["dtm_modified"] %></dtm-modified>
+} + CONTENTS_RDF + %{
+  </rd:File>
+<% end # values["files"] %>
+<% values["classes"].each do |classes| %>
+  <<%= values["classmod"] %> rd:name="<%= classes["full_name"] %>" rd:id="<%= classes["full_name"] %>">
+    <classmod-info>
+<% if classes["infiles"] then %>
+      <InFiles>
+<% classes["infiles"].each do |infiles| %>
+        <infile>
+          <File rd:name="<%= infiles["full_path"] %>"
+<% if infiles["full_path_url"] then %>
+                rdf:about="<%= infiles["full_path_url"] %>"
+<% end %>
+           />
+         </infile>
+<% end # classes["infiles"] %>
+      </InFiles>
+<% end %>
+<% if classes["parent"] then %>
+     <superclass><%= href classes["par_url"], classes["parent"] %></superclass>
+<% end %>
+    </classmod-info>
+} + CONTENTS_RDF + %{
+  </<%= classes["classmod"] %>>
+<% end # values["classes"] %>
+<!-- /RDoc -->
+</rdf:RDF>
+}
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generator/xml/xml.rb ../rdoc-f95-20090109-1/generator/xml/xml.rb
--- ruby-1.8.7-p72/lib/rdoc/generator/xml/xml.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/generator/xml/xml.rb	2008-03-08 21:23:18.000000000 +0900
@@ -0,0 +1,111 @@
+require 'rdoc/generator/xml'
+
+module RDoc::Generator::XML::XML
+
+  CONTENTS_XML = <<-EOF
+<% if defined? classes and classes["description"] then %>
+    <description>
+<%= classes["description"] %>
+    </description>
+<% end %>
+    <contents>
+<% if defined? files and files["requires"] then %>
+      <required-file-list>
+<% files["requires"].each do |requires| %>
+         <required-file name="<%= requires["name"] %>"
+<% if requires["aref"] then %>
+                        href="<%= requires["aref"] %>"
+<% end %>
+         />
+<% end # files["requires"] %>
+      </required-file-list>
+<% end %>
+<% if defined? classes and classes["sections"] then %>
+<% classes["sections"].each do |sections| %>
+<% if sections["attributes"] then %>
+      <attribute-list>
+<% sections["attributes"].each do |attributes| %>
+        <attribute name="<%= attributes["name"] %>">
+<% if attributes["rw"] then %>
+          <attribute-rw><%= attributes["rw"] %></attribute-rw>
+<% end %>
+          <description><%= attributes["a_desc"] %></description>
+        </attribute>
+<% end # sections["attributes"] %>
+      </attribute-list>
+<% end %>
+<% if sections["method_list"] then %>
+      <method-list>
+<% sections["method_list"].each do |method_list| %>
+<% if method_list["methods"] then %>
+<% method_list["methods"].each do |methods| %>
+        <method name="<%= methods["name"] %>" type="<%= methods["type"] %>" category="<%= methods["category"] %>" id="<%= methods["aref"] %>">
+          <parameters><%= methods["params"] %></parameters>
+<% if methods["m_desc"] then %>
+          <description>
+<%= methods["m_desc"] %>
+          </description>
+<% end %>
+<% if methods["sourcecode"] then %>
+          <source-code-listing>
+<%= methods["sourcecode"] %>
+          </source-code-listing>
+<% end %>
+        </method>
+<% end # method_list["methods"] %>
+<% end %>
+<% end # sections["method_list"] %>
+      </method-list>
+<% end %>
+<% end # classes["sections"] %>
+<% end %>
+<% if defined? classes and classes["includes"] then %>
+      <included-module-list>
+<% classes["includes"].each do |includes| %>
+        <included-module name="<%= includes["name"] %>"
+<% if includes["aref"] then %>
+                         href="<%= includes["aref"] %>"
+<% end %>
+        />
+<% end # classes["includes"] %>
+      </included-module-list>
+<% end %>
+    </contents>
+  EOF
+
+  ONE_PAGE = %{<?xml version="1.0" encoding="utf-8"?>
+<rdoc>
+<file-list>
+<% values["files"].each do |files| %>
+  <file name="<%= files["short_name"] %>" id="<%= files["href"] %>">
+    <file-info>
+      <path><%= files["full_path"] %></path>
+      <dtm-modified><%= files["dtm_modified"] %></dtm-modified>
+    </file-info>
+} + CONTENTS_XML + %{
+  </file>
+<% end # values["files"] %>
+</file-list>
+<class-module-list>
+<% values["classes"].each do |classes| %>
+  <<%= classes["classmod"] %> name="<%= classes["full_name"] %>" id="<%= classes["full_name"] %>">
+    <classmod-info>
+<% if classes["infiles"] then %>
+      <infiles>
+<% classes["infiles"].each do |infiles|  %>
+        <infile><%= href infiles["full_path_url"], infiles["full_path"] %></infile>
+<% end # classes["infiles"] %>
+      </infiles>
+<% end %>
+<% if classes["parent"] then %>
+     <superclass><%= href classes["par_url"], classes["parent"] %></superclass>
+<% end %>
+    </classmod-info>
+} + CONTENTS_XML + %{
+  </<%= classes["classmod"] %>>
+<% end # values["classes"] %>
+</class-module-list>
+</rdoc>
+}
+
+end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generator/xml.rb ../rdoc-f95-20090109-1/generator/xml.rb
--- ruby-1.8.7-p72/lib/rdoc/generator/xml.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/generator/xml.rb	2008-03-08 21:21:34.000000000 +0900
@@ -0,0 +1,120 @@
+require 'rdoc/generator/html'
+
+##
+# Generate XML output as one big file
+
+class RDoc::Generator::XML < RDoc::Generator::HTML
+
+  ##
+  # Standard generator factory
+
+  def self.for(options)
+    new(options)
+  end
+
+  def initialize(*args)
+    super
+  end
+
+  ##
+  # Build the initial indices and output objects
+  # based on an array of TopLevel objects containing
+  # the extracted information.
+
+  def generate(info)
+    @info       = info
+    @files      = []
+    @classes    = []
+    @hyperlinks = {}
+
+    build_indices
+    generate_xml
+  end
+
+  ##
+  # Generate:
+  #
+  # * a list of HtmlFile objects for each TopLevel object.
+  # * a list of HtmlClass objects for each first level
+  #   class or module in the TopLevel objects
+  # * a complete list of all hyperlinkable terms (file,
+  #   class, module, and method names)
+
+  def build_indices
+    @info.each do |toplevel|
+      @files << RDoc::Generator::HtmlFile.new(toplevel, @options, RDoc::Generator::FILE_DIR)
+    end
+
+    RDoc::TopLevel.all_classes_and_modules.each do |cls|
+      build_class_list(cls, @files[0], RDoc::Generator::CLASS_DIR)
+    end
+  end
+
+  def build_class_list(from, html_file, class_dir)
+    @classes << RDoc::Generator::HtmlClass.new(from, html_file, class_dir, @options)
+    from.each_classmodule do |mod|
+      build_class_list(mod, html_file, class_dir)
+    end
+  end
+
+  ##
+  # Generate all the HTML. For the one-file case, we generate
+  # all the information in to one big hash
+
+  def generate_xml
+    values = {
+      'charset' => @options.charset,
+      'files'   => gen_into(@files),
+      'classes' => gen_into(@classes)
+    }
+
+    # this method is defined in the template file
+    write_extra_pages if defined? write_extra_pages
+
+    template = RDoc::TemplatePage.new @template::ONE_PAGE
+
+    if @options.op_name
+      opfile = File.open(@options.op_name, "w")
+    else
+      opfile = $stdout
+    end
+    template.write_html_on(opfile, values)
+  end
+
+  def gen_into(list)
+    res = []
+    list.each do |item|
+      res << item.value_hash
+    end
+    res
+  end
+
+  def gen_file_index
+    gen_an_index(@files, 'Files')
+  end
+
+  def gen_class_index
+    gen_an_index(@classes, 'Classes')
+  end
+
+  def gen_method_index
+    gen_an_index(RDoc::Generator::HtmlMethod.all_methods, 'Methods')
+  end
+
+  def gen_an_index(collection, title)
+    res = []
+    collection.sort.each do |f|
+      if f.document_self
+        res << { "href" => f.path, "name" => f.index_name }
+      end
+    end
+
+    return {
+      "entries" => res,
+      'list_title' => title,
+      'index_url'  => main_url,
+    }
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generator.rb ../rdoc-f95-20090109-1/generator.rb
--- ruby-1.8.7-p72/lib/rdoc/generator.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/generator.rb	2008-03-09 07:52:46.000000000 +0900
@@ -0,0 +1,1088 @@
+require 'cgi'
+require 'rdoc/options'
+require 'rdoc/markup/to_html_crossref'
+require 'rdoc/markup/to_xhtml_texparser'
+require 'rdoc/template'
+
+module RDoc::Generator
+
+  ##
+  # Name of sub-direcory that holds file descriptions
+
+  FILE_DIR  = "files"
+
+  ##
+  # Name of sub-direcory that holds class descriptions
+
+  CLASS_DIR = "classes"
+
+  ##
+  # Name of the RDoc CSS file
+
+  CSS_NAME  = "rdoc-style.css"
+
+  ##
+  # Converts a target url to one that is relative to a given path
+
+  def self.gen_url(path, target)
+    from          = ::File.dirname path
+    to, to_file   = ::File.split target
+
+    from = from.split "/"
+    to   = to.split "/"
+
+    while from.size > 0 and to.size > 0 and from[0] == to[0] do
+      from.shift
+      to.shift
+    end
+
+    from.delete_if{|f| f =~ /^\.$/}
+    from.fill ".."
+    from.concat to
+    from << to_file
+    ::File.join(*from)
+  end
+
+  ##
+  # Build a hash of all items that can be cross-referenced.  This is used when
+  # we output required and included names: if the names appear in this hash,
+  # we can generate an html cross reference to the appropriate description.
+  # We also use this when parsing comment blocks: any decorated words matching
+  # an entry in this list are hyperlinked.
+
+  class AllReferences
+    @@refs = {}
+
+    def AllReferences::reset
+      @@refs = {}
+    end
+
+    def AllReferences.add(name, html_class)
+      @@refs[name] = html_class
+    end
+
+    def AllReferences.[](name)
+      @@refs[name]
+    end
+
+    def AllReferences.keys
+      @@refs.keys
+    end
+  end
+
+  ##
+  # Handle common markup tasks for the various Context subclasses
+
+  module MarkUp
+
+    ##
+    # Convert a string in markup format into HTML.
+
+    def markup(str, remove_para = false)
+      return '' unless str
+
+      unless defined? @formatter then
+        unless @options.mathml
+          @formatter = RDoc::Markup::ToHtmlCrossref.new(path, self,
+                                                        @options.show_hash)
+        else
+          @formatter = RDoc::Markup::ToXHtmlTexParser.new(path, self,
+                                                          @options.show_hash, 
+                                                          @options.mathml)
+        end
+      end
+
+      # Convert leading comment markers to spaces, but only if all non-blank
+      # lines have them
+      if str =~ /^(?>\s*)[^\#]/ then
+        content = str
+      else
+        content = str.gsub(/^\s*(#+)/) { $1.tr '#', ' ' }
+      end
+
+      unless @options.mathml
+        res = @formatter.convert content
+      else
+        res = @formatter.convert content, @formatter.block_exceptions
+      end
+
+      if remove_para then
+        res.sub!(/^<p>/, '')
+        res.sub!(/<\/p>$/, '')
+      end
+
+      res
+    end
+
+    ##
+    # Qualify a stylesheet URL; if if +css_name+ does not begin with '/' or
+    # 'http[s]://', prepend a prefix relative to +path+. Otherwise, return it
+    # unmodified.
+
+    def style_url(path, css_name=nil)
+#      $stderr.puts "style_url( #{path.inspect}, #{css_name.inspect} )"
+      css_name ||= CSS_NAME
+      if %r{^(https?:/)?/} =~ css_name
+        css_name
+      else
+        RDoc::Generator.gen_url path, css_name
+      end
+    end
+
+    ##
+    # Build a webcvs URL with the given 'url' argument. URLs with a '%s' in them
+    # get the file's path sprintfed into them; otherwise they're just catenated
+    # together.
+
+    def cvs_url(url, full_path)
+      if /%s/ =~ url
+        return sprintf( url, full_path )
+      else
+        return url + full_path
+      end
+    end
+
+  end
+
+  ##
+  # A Context is built by the parser to represent a container: contexts hold
+  # classes, modules, methods, require lists and include lists.  ClassModule
+  # and TopLevel are the context objects we process here
+
+  class Context
+
+    include MarkUp
+
+    attr_reader :context
+
+    ##
+    # Generate:
+    #
+    # * a list of RDoc::Generator::File objects for each TopLevel object
+    # * a list of RDoc::Generator::Class objects for each first level class or
+    #   module in the TopLevel objects
+    # * a complete list of all hyperlinkable terms (file, class, module, and
+    #   method names)
+
+    def self.build_indicies(toplevels, options)
+      files = []
+      classes = []
+
+      toplevels.each do |toplevel|
+        files << RDoc::Generator::File.new(toplevel, options,
+                                           RDoc::Generator::FILE_DIR)
+      end
+
+      RDoc::TopLevel.all_classes_and_modules.each do |cls|
+        build_class_list(classes, options, cls, files[0], 
+                         RDoc::Generator::CLASS_DIR)
+      end
+
+      return files, classes
+    end
+
+    def self.build_class_list(classes, options, from, html_file, class_dir)
+      classes << RDoc::Generator::Class.new(from, html_file, class_dir, options)
+
+      from.each_classmodule do |mod|
+        build_class_list(classes, options, mod, html_file, class_dir)
+      end
+    end
+
+    def initialize(context, options)
+      @context = context
+      @options = options
+
+      # HACK ugly
+      @template = options.template_class
+    end
+
+    ##
+    # convenience method to build a hyperlink
+
+    def href(link, cls, name)
+      %{<a href="#{link}" class="#{cls}">#{name}</a>} #"
+    end
+
+    ##
+    # Returns a reference to outselves to be used as an href= the form depends
+    # on whether we're all in one file or in multiple files
+
+    def as_href(from_path)
+      if @options.all_one_file
+        "#" + path
+      else
+        RDoc::Generator.gen_url from_path, path
+      end
+    end
+
+    ##
+    # Create a list of Method objects for each method in the corresponding
+    # context object. If the @options.show_all variable is set (corresponding
+    # to the <tt>--all</tt> option, we include all methods, otherwise just the
+    # public ones.
+
+    def collect_methods
+      list = @context.method_list
+
+      unless @options.show_all then
+        list = list.find_all do |m|
+          m.visibility == :public or
+            m.visibility == :protected or
+            m.force_documentation
+        end
+      end
+
+      @methods = list.collect do |m|
+        RDoc::Generator::Method.new m, self, @options
+      end
+    end
+
+    ##
+    # Build a summary list of all the methods in this context
+
+    def build_method_summary_list(path_prefix="")
+      collect_methods unless @methods
+      meths = @methods.sort
+      res = []
+      meths.each do |meth|
+        res << {
+          "name" => CGI.escapeHTML(meth.name),
+          "aref" => "#{path_prefix}\##{meth.aref}"
+        }
+      end
+      res
+    end
+
+    ##
+    # Build a list of aliases for which we couldn't find a
+    # corresponding method
+
+    def build_alias_summary_list(section)
+      values = []
+      @context.aliases.each do |al|
+        next unless al.section == section
+        res = {
+          'old_name' => al.old_name,
+          'new_name' => al.new_name,
+        }
+        if al.comment && !al.comment.empty?
+          res['desc'] = markup(al.comment, true)
+        end
+        values << res
+      end
+      values
+    end
+
+    ##
+    # Build a list of constants
+
+    def build_constants_summary_list(section)
+      values = []
+      @context.constants.each do |co|
+        next unless co.section == section
+        res = {
+          'name'  => co.name,
+          'value' => CGI.escapeHTML(co.value)
+        }
+        res['desc'] = markup(co.comment, true) if co.comment && !co.comment.empty?
+        values << res
+      end
+      values
+    end
+
+    def build_requires_list(context)
+      potentially_referenced_list(context.requires) {|fn| [fn + ".rb"] }
+    end
+
+    def build_include_list(context)
+      potentially_referenced_list(context.includes)
+    end
+
+    ##
+    # Build a list from an array of Context items. Look up each in the
+    # AllReferences hash: if we find a corresponding entry, we generate a
+    # hyperlink to it, otherwise just output the name.  However, some names
+    # potentially need massaging. For example, you may require a Ruby file
+    # without the .rb extension, but the file names we know about may have it.
+    # To deal with this, we pass in a block which performs the massaging,
+    # returning an array of alternative names to match
+
+    def potentially_referenced_list(array)
+      res = []
+      array.each do |i|
+        ref = AllReferences[i.name]
+#         if !ref
+#           container = @context.parent
+#           while !ref && container
+#             name = container.name + "::" + i.name
+#             ref = AllReferences[name]
+#             container = container.parent
+#           end
+#         end
+
+        ref = @context.find_symbol(i.name, nil, @options.ignore_case)  || \
+              @context.find_file(i.name)
+        ref = ref.viewer if ref
+
+        if !ref && block_given?
+          possibles = yield(i.name)
+          while !ref and !possibles.empty?
+            ref = AllReferences[possibles.shift]
+          end
+        end
+        h_name = CGI.escapeHTML(i.name)
+        if ref and ref.document_self
+          path = url(ref.path)
+          res << { "name" => h_name, "aref" => path }
+        else
+          res << { "name" => h_name }
+        end
+      end
+      res
+    end
+
+    ##
+    # Build an array of arrays of method details. The outer array has up
+    # to six entries, public, private, and protected for both class
+    # methods, the other for instance methods. The inner arrays contain
+    # a hash for each method
+
+    def build_method_detail_list(section)
+      outer = []
+
+      methods = @methods.sort
+      for singleton in [true, false]
+        for vis in [ :public, :protected, :private ]
+          res = []
+          methods.each do |m|
+            if m.section == section and
+                m.document_self and
+                m.visibility == vis and
+                m.singleton == singleton
+              row = {}
+              if m.call_seq
+                row["callseq"] = m.call_seq.gsub(/->/, '&rarr;')
+              else
+                row["name"]        = CGI.escapeHTML(m.name)
+                row["params"]      = m.params
+              end
+              desc = m.description.strip
+              row["m_desc"]      = desc unless desc.empty?
+              row["aref"]        = m.aref
+              row["visibility"]  = m.visibility.to_s
+
+              alias_names = []
+              m.aliases.each do |other|
+                if other.viewer   # won't be if the alias is private
+                  alias_names << {
+                    'name' => other.name,
+                    'aref'  => other.viewer.as_href(path)
+                  }
+                end
+              end
+              unless alias_names.empty?
+                row["aka"] = alias_names
+              end
+
+              if @options.inline_source
+                code = m.source_code
+                row["sourcecode"] = code if code
+              else
+                code = m.src_url
+                if code
+                  row["codeurl"] = code
+                  row["imgurl"]  = m.img_url
+                end
+              end
+              res << row
+            end
+          end
+          if res.size > 0
+            outer << {
+              "type"     => vis.to_s.capitalize,
+              "category" => singleton ? "Class" : "Instance",
+              "methods"  => res
+            }
+          end
+        end
+      end
+      outer
+    end
+
+    ##
+    # Build the structured list of classes and modules contained
+    # in this context.
+
+    def build_class_list(level, from, section, infile=nil)
+      res = ""
+      prefix = "&nbsp;&nbsp;::" * level;
+
+      from.modules.sort.each do |mod|
+        next unless mod.section == section
+        next if infile && !mod.defined_in?(infile)
+        if mod.document_self
+          res <<
+            prefix <<
+            "Module " <<
+            href(url(mod.viewer.path), "link", mod.full_name) <<
+            "<br />\n" <<
+            build_class_list(level + 1, mod, section, infile)
+        end
+      end
+
+      from.classes.sort.each do |cls|
+        next unless cls.section == section
+        next if infile && !cls.defined_in?(infile)
+        if cls.document_self
+          res      <<
+            prefix <<
+            "Class " <<
+            href(url(cls.viewer.path), "link", cls.full_name) <<
+            "<br />\n" <<
+            build_class_list(level + 1, cls, section, infile)
+        end
+      end
+
+      res
+    end
+
+    def url(target)
+      RDoc::Generator.gen_url path, target
+    end
+
+    def aref_to(target)
+      if @options.all_one_file
+        "#" + target
+      else
+        url(target)
+      end
+    end
+
+    def document_self
+      @context.document_self
+    end
+
+    def diagram_reference(diagram)
+      res = diagram.gsub(/((?:src|href)=")(.*?)"/) {
+        $1 + url($2) + '"'
+      }
+      res
+    end
+
+    ##
+    # Find a symbol in ourselves or our parent
+
+    def find_symbol(symbol, method=nil)
+      res = @context.find_symbol(symbol, method, @options.ignore_case)
+      if res
+        res = res.viewer
+      end
+      res
+    end
+
+    # Find a filenames in ourselves or our parent
+    def find_file(file, method=nil)
+      res = @context.find_file(file, method, @options.ignore_case)
+      if res
+        res = res.viewer
+      end
+      res
+    end
+
+    ##
+    # create table of contents if we contain sections
+
+    def add_table_of_sections
+      toc = []
+      @context.sections.each do |section|
+        if section.title
+          toc << {
+            'secname' => section.title,
+            'href'    => section.sequence
+          }
+        end
+      end
+
+      @values['toc'] = toc unless toc.empty?
+    end
+
+  end
+
+  ##
+  # Wrap a ClassModule context
+
+  class Class < Context
+
+    attr_reader :methods
+    attr_reader :path
+
+    def initialize(context, html_file, prefix, options)
+      super(context, options)
+
+      @html_file = html_file
+      @is_module = context.is_module?
+      @values    = {}
+
+      context.viewer = self
+
+      if options.all_one_file
+        @path = context.full_name
+      else
+        @path = http_url(context.full_name, prefix)
+      end
+
+      collect_methods
+
+      AllReferences.add(name, self)
+    end
+
+    ##
+    # Returns the relative file name to store this class in, which is also its
+    # url
+
+    def http_url(full_name, prefix)
+      path = full_name.dup
+
+      path.gsub!(/<<\s*(\w*)/, 'from-\1') if path['<<']
+      suffix = ".html"
+      suffix = ".xhtml" if @options.template == "xhtml"
+
+      ::File.join(prefix, path.split("::")) + suffix
+    end
+
+    def name
+      @context.full_name
+    end
+
+    def parent_name
+      @context.parent.full_name
+    end
+
+    def index_name
+      name
+    end
+
+    def write_on(f)
+      value_hash
+      template = RDoc::TemplatePage.new(@template::BODY,
+                                        @template::CLASS_PAGE,
+                                        @template::METHOD_LIST)
+      template.write_html_on(f, @values)
+    end
+
+    def value_hash
+      class_attribute_values
+      add_table_of_sections
+
+      @values["charset"] = @options.charset
+      @values["style_url"] = style_url(path, @options.css)
+      @values["mathml_xsl_url"] = style_url(path, "mathml.xsl")
+
+      d = markup(@context.comment)
+      @values["description"] = d unless d.empty?
+
+      ml = build_method_summary_list
+      @values["methods"] = ml unless ml.empty?
+
+      il = build_include_list(@context)
+      @values["includes"] = il unless il.empty?
+
+      @values["sections"] = @context.sections.map do |section|
+
+        secdata = {
+          "sectitle" => section.title,
+          "secsequence" => section.sequence,
+          "seccomment" => markup(section.comment)
+        }
+
+        al = build_alias_summary_list(section)
+        secdata["aliases"] = al unless al.empty?
+
+        co = build_constants_summary_list(section)
+        secdata["constants"] = co unless co.empty?
+
+        al = build_attribute_list(section)
+        secdata["attributes"] = al unless al.empty?
+
+        cl = build_class_list(0, @context, section)
+        secdata["classlist"] = cl unless cl.empty?
+
+        mdl = build_method_detail_list(section)
+        secdata["method_list"] = mdl unless mdl.empty?
+
+        secdata
+      end
+
+      @values
+    end
+
+    def build_attribute_list(section)
+      atts = @context.attributes.sort
+      res = []
+      atts.each do |att|
+        next unless att.section == section
+        if att.visibility == :public || att.visibility == :protected || @options.show_all
+          entry = {
+            "name"   => CGI.escapeHTML(att.name),
+            "rw"     => att.rw,
+            "a_desc" => markup(att.comment, true)
+          }
+          unless att.visibility == :public || att.visibility == :protected
+            entry["rw"] << "-"
+          end
+          res << entry
+        end
+      end
+      res
+    end
+
+    def class_attribute_values
+      h_name = CGI.escapeHTML(name)
+
+      @values["path"]      = @path
+      @values["classmod"]  = @is_module ? "Module" : "Class"
+      @values["title"]     = "#{@values['classmod']}: #{h_name}"
+
+      c = @context
+      c = c.parent while c and !c.diagram
+      if c && c.diagram
+        @values["diagram"] = diagram_reference(c.diagram)
+      end
+
+      @values["full_name"] = h_name
+
+      parent_class = @context.superclass
+
+      if parent_class
+        @values["parent"] = CGI.escapeHTML(parent_class)
+
+        if parent_name
+          lookup = parent_name + "::" + parent_class
+        else
+          lookup = parent_class
+        end
+
+        parent_url = AllReferences[lookup] || AllReferences[parent_class]
+
+        if parent_url and parent_url.document_self
+          @values["par_url"] = aref_to(parent_url.path)
+        end
+      end
+
+      files = []
+      @context.in_files.each do |f|
+        res = {}
+        full_path = CGI.escapeHTML(f.file_absolute_name)
+
+        res["full_path"]     = full_path
+        res["full_path_url"] = aref_to(f.viewer.path) if f.document_self
+
+        if @options.webcvs
+          res["cvsurl"] = cvs_url( @options.webcvs, full_path )
+        end
+
+        files << res
+      end
+
+      @values['infiles'] = files
+    end
+
+    def <=>(other)
+      self.name <=> other.name
+    end
+
+  end
+
+  ##
+  # Handles the mapping of a file's information to HTML. In reality, a file
+  # corresponds to a +TopLevel+ object, containing modules, classes, and
+  # top-level methods. In theory it _could_ contain attributes and aliases,
+  # but we ignore these for now.
+
+  class File < Context
+
+    attr_reader :path
+    attr_reader :name
+
+    def initialize(context, options, file_dir)
+      super(context, options)
+
+      @values = {}
+
+      if options.all_one_file
+        @path = filename_to_label
+      else
+        @path = http_url(file_dir)
+      end
+
+      @name = @context.file_relative_name
+
+      collect_methods
+      AllReferences.add(name, self)
+      context.viewer = self
+    end
+
+    def http_url(file_dir)
+      suffix = ".html"
+      suffix = ".xhtml" if @options.template == "xhtml"
+
+      ::File.join file_dir, "#{@context.file_relative_name.tr '.', '_'}" + suffix
+    end
+
+    def filename_to_label
+      @context.file_relative_name.gsub(/%|\/|\?|\#/) do
+        '%%%x' % $&[0].unpack('C')
+      end
+    end
+
+    def index_name
+      name
+    end
+
+    def parent_name
+      nil
+    end
+
+    def value_hash
+      file_attribute_values
+      add_table_of_sections
+
+      @values["charset"]   = @options.charset
+      @values["href"]      = path
+      @values["style_url"] = style_url(path, @options.css)
+      @values["mathml_xsl_url"] = style_url(path, "mathml.xsl")
+
+      if @context.comment
+        d = markup(@context.comment)
+        @values["description"] = d if d.size > 0
+      end
+
+      ml = build_method_summary_list
+      @values["methods"] = ml unless ml.empty?
+
+      il = build_include_list(@context)
+      @values["includes"] = il unless il.empty?
+
+      rl = build_requires_list(@context)
+      @values["requires"] = rl unless rl.empty?
+
+      if @options.promiscuous
+        file_context = nil
+      else
+        file_context = @context
+      end
+
+
+      @values["sections"] = @context.sections.map do |section|
+
+        secdata = {
+          "sectitle" => section.title,
+          "secsequence" => section.sequence,
+          "seccomment" => markup(section.comment)
+        }
+
+        cl = build_class_list(0, @context, section, file_context)
+        @values["classlist"] = cl unless cl.empty?
+
+        mdl = build_method_detail_list(section)
+        secdata["method_list"] = mdl unless mdl.empty?
+
+        al = build_alias_summary_list(section)
+        secdata["aliases"] = al unless al.empty?
+
+        co = build_constants_summary_list(section)
+        @values["constants"] = co unless co.empty?
+
+        secdata
+      end
+
+      @values
+    end
+
+    def write_on(f)
+      value_hash
+
+      template = RDoc::TemplatePage.new(@template::BODY,
+                                        @template::FILE_PAGE,
+                                        @template::METHOD_LIST)
+
+      template.write_html_on(f, @values)
+    end
+
+    def file_attribute_values
+      full_path = @context.file_absolute_name
+      short_name = ::File.basename full_path
+
+      @values["title"] = CGI.escapeHTML("File: #{short_name}")
+
+      if @context.diagram then
+        @values["diagram"] = diagram_reference(@context.diagram)
+      end
+
+      @values["short_name"]   = CGI.escapeHTML(short_name)
+      @values["full_path"]    = CGI.escapeHTML(full_path)
+      @values["dtm_modified"] = @context.file_stat.mtime.to_s
+
+      if @options.webcvs then
+        @values["cvsurl"] = cvs_url @options.webcvs, @values["full_path"]
+      end
+    end
+
+    def <=>(other)
+      self.name <=> other.name
+    end
+
+  end
+
+  class Method
+
+    include MarkUp
+
+    attr_reader :context
+    attr_reader :src_url
+    attr_reader :img_url
+    attr_reader :source_code
+
+    @@seq = "M000000"
+
+    @@all_methods = []
+
+    def self.all_methods
+      @@all_methods
+    end
+
+    def self.reset
+      @@all_methods = []
+    end
+
+    def initialize(context, html_class, options)
+      @context    = context
+      @html_class = html_class
+      @options    = options
+
+      # HACK ugly
+      @template = options.template_class
+
+      @@seq       = @@seq.succ
+      @seq        = @@seq
+      @@all_methods << self
+
+      context.viewer = self
+
+      if (ts = @context.token_stream)
+        @source_code = markup_code(ts)
+        unless @options.inline_source
+          @src_url = create_source_code_file(@source_code)
+          @img_url = RDoc::Generator.gen_url path, 'source.png'
+        end
+      end
+
+      AllReferences.add(name, self)
+    end
+
+    ##
+    # Returns a reference to outselves to be used as an href= the form depends
+    # on whether we're all in one file or in multiple files
+
+    def as_href(from_path)
+      if @options.all_one_file
+        "#" + path
+      else
+        RDoc::Generator.gen_url from_path, path
+      end
+    end
+
+    def name
+      @context.name
+    end
+
+    def section
+      @context.section
+    end
+
+    def index_name
+      "#{@context.name} (#{@html_class.name})"
+    end
+
+    def parent_name
+      if @context.parent.parent
+        @context.parent.parent.full_name
+      else
+        nil
+      end
+    end
+
+    def aref
+      @seq
+    end
+
+    def path
+      if @options.all_one_file
+        aref
+      else
+        @html_class.path + "#" + aref
+      end
+    end
+
+    def description
+      markup(@context.comment)
+    end
+
+    def visibility
+      @context.visibility
+    end
+
+    def singleton
+      @context.singleton
+    end
+
+    def call_seq
+      cs = @context.call_seq
+      if cs
+        cs.gsub(/\n/, "<br />\n")
+      else
+        nil
+      end
+    end
+
+    def params
+      # params coming from a call-seq in 'C' will start with the
+      # method name
+      if p !~ /^\w/
+        p = @context.params.gsub(/\s*\#.*/, '')
+        p = p.tr("\n", " ").squeeze(" ")
+        p = "(" + p + ")" unless p[0] == ?( || p == ''
+
+        if (block = @context.block_params)
+         # If this method has explicit block parameters, remove any
+         # explicit &block
+
+         p.sub!(/,?\s*&\w+/, '')
+
+          block.gsub!(/\s*\#.*/, '')
+          block = block.tr("\n", " ").squeeze(" ")
+          if block[0] == ?(
+            block.sub!(/^\(/, '').sub!(/\)/, '')
+          end
+          p << " {|#{block.strip}| ...}"
+        end
+      end
+      CGI.escapeHTML(p)
+    end
+
+    def create_source_code_file(code_body)
+      suffix = "html"
+      suffix = "xhtml" if @options.template == "xhtml"
+      template_regexp = Regexp.new("\\." + suffix + "$")
+      meth_path = @html_class.path.sub(template_regexp, '.src')
+      FileUtils.mkdir_p(meth_path)
+      file_path = ::File.join(meth_path, @seq) + '.' + suffix
+
+      template = RDoc::TemplatePage.new(@template::SRC_PAGE)
+
+      open file_path, 'w' do |f|
+        values = {
+          'title'     => CGI.escapeHTML(index_name),
+          'code'      => code_body,
+          'style_url' => style_url(file_path, @options.css),
+          'mathml_xsl_url' => style_url(file_path, "mathml.xsl"),
+          'charset'   => @options.charset
+        }
+        template.write_html_on(f, values)
+      end
+
+      RDoc::Generator.gen_url path, file_path
+    end
+
+    def <=>(other)
+      @context <=> other.context
+    end
+
+    ##
+    # Given a sequence of source tokens, mark up the source code
+    # to make it look purty.
+
+    def markup_code(tokens)
+      src = ""
+      tokens.each do |t|
+        next unless t
+        #    p t.class
+#        style = STYLE_MAP[t.class]
+        style = case t
+                when RubyToken::TkCONSTANT then "ruby-constant"
+                when RubyToken::TkKW       then "ruby-keyword kw"
+                when RubyToken::TkIVAR     then "ruby-ivar"
+                when RubyToken::TkOp       then "ruby-operator"
+                when RubyToken::TkId       then "ruby-identifier"
+                when RubyToken::TkNode     then "ruby-node"
+                when RubyToken::TkCOMMENT  then "ruby-comment cmt"
+                when RubyToken::TkREGEXP   then "ruby-regexp re"
+                when RubyToken::TkSTRING   then "ruby-value str"
+                when RubyToken::TkVal      then "ruby-value"
+                else
+                    nil
+                end
+
+        text = CGI.escapeHTML(t.text)
+
+        if style
+          src << "<span class=\"#{style}\">#{text}</span>"
+        else
+          src << text
+        end
+      end
+
+      add_line_numbers(src) if @options.include_line_numbers
+      src
+    end
+
+    ##
+    # We rely on the fact that the first line of a source code listing has
+    #    # File xxxxx, line dddd
+
+    def add_line_numbers(src)
+      if src =~ /\A.*, line (\d+)/
+        first = $1.to_i - 1
+        last  = first + src.count("\n")
+        size = last.to_s.length
+        real_fmt = "%#{size}d: "
+        fmt = " " * (size+2)
+        src.gsub!(/^/) do
+          res = sprintf(fmt, first)
+          first += 1
+          fmt = real_fmt
+          res
+        end
+      end
+    end
+
+    def document_self
+      @context.document_self
+    end
+
+    def aliases
+      @context.aliases
+    end
+
+    def find_symbol(symbol, method=nil)
+      res = @context.parent.find_symbol(symbol, method, @options.ignore_case)
+      if res
+        res = res.viewer
+      end
+      res
+    end
+
+    # Find a filenames in ourselves or our parent
+    def find_file(file, method=nil)
+      res = @context.parent.find_file(file, method, @options.ignore_case)
+      if res
+        res = res.viewer
+      end
+      res
+    end
+
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generators/chm_generator.rb ../rdoc-f95-20090109-1/generators/chm_generator.rb
--- ruby-1.8.7-p72/lib/rdoc/generators/chm_generator.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/generators/chm_generator.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,112 +0,0 @@
-require 'rdoc/generators/html_generator'
-
-module Generators
-
-  class CHMGenerator < HTMLGenerator
-
-    HHC_PATH = "c:/Program Files/HTML Help Workshop/hhc.exe"
-
-    # Standard generator factory
-    def CHMGenerator.for(options)
-      CHMGenerator.new(options)
-    end
-
-    
-    def initialize(*args)
-      super
-      @op_name = @options.op_name || "rdoc"
-      check_for_html_help_workshop
-    end
-
-    def check_for_html_help_workshop
-      stat = File.stat(HHC_PATH)
-    rescue
-      $stderr <<
-	"\n.chm output generation requires that Microsoft's Html Help\n" <<
-	"Workshop is installed. RDoc looks for it in:\n\n    " <<
-	HHC_PATH <<
-	"\n\nYou can download a copy for free from:\n\n" <<
-	"    http://msdn.microsoft.com/library/default.asp?" <<
-	"url=/library/en-us/htmlhelp/html/hwMicrosoftHTMLHelpDownloads.asp\n\n"
-      
-      exit 99
-    end
-
-    # Generate the html as normal, then wrap it
-    # in a help project
-    def generate(info)
-      super
-      @project_name = @op_name + ".hhp"
-      create_help_project
-    end
-
-    # The project contains the project file, a table of contents
-    # and an index
-    def create_help_project
-      create_project_file
-      create_contents_and_index
-      compile_project
-    end
-
-    # The project file links together all the various
-    # files that go to make up the help.
-
-    def create_project_file
-      template = TemplatePage.new(RDoc::Page::HPP_FILE)
-      values = { "title" => @options.title, "opname" => @op_name }
-      files = []
-      @files.each do |f|
-	files << { "html_file_name" => f.path }
-      end
-
-      values['all_html_files'] = files
-      
-      File.open(@project_name, "w") do |f|
-        template.write_html_on(f, values)
-      end
-    end
-
-    # The contents is a list of all files and modules.
-    # For each we include  as sub-entries the list
-    # of methods they contain. As we build the contents
-    # we also build an index file
-
-    def create_contents_and_index
-      contents = []
-      index    = []
-
-      (@files+@classes).sort.each do |entry|
-	content_entry = { "c_name" => entry.name, "ref" => entry.path }
-	index << { "name" => entry.name, "aref" => entry.path }
-
-	internals = []
-
-	methods = entry.build_method_summary_list(entry.path)
-
-	content_entry["methods"] = methods unless methods.empty?
-        contents << content_entry
-	index.concat methods
-      end
-
-      values = { "contents" => contents }
-      template = TemplatePage.new(RDoc::Page::CONTENTS)
-      File.open("contents.hhc", "w") do |f|
-	template.write_html_on(f, values)
-      end
-
-      values = { "index" => index }
-      template = TemplatePage.new(RDoc::Page::CHM_INDEX)
-      File.open("index.hhk", "w") do |f|
-	template.write_html_on(f, values)
-      end      
-    end
-
-    # Invoke the windows help compiler to compiler the project
-    def compile_project
-      system(HHC_PATH, @project_name)
-    end
-
-  end
-
-
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generators/html_generator.rb ../rdoc-f95-20090109-1/generators/html_generator.rb
--- ruby-1.8.7-p72/lib/rdoc/generators/html_generator.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/generators/html_generator.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,1509 +0,0 @@
-# We're responsible for generating all the HTML files
-# from the object tree defined in code_objects.rb. We
-# generate:
-#
-# [files]   an html file for each input file given. These
-#           input files appear as objects of class
-#           TopLevel
-#
-# [classes] an html file for each class or module encountered.
-#           These classes are not grouped by file: if a file
-#           contains four classes, we'll generate an html
-#           file for the file itself, and four html files 
-#           for the individual classes. 
-#
-# [indices] we generate three indices for files, classes,
-#           and methods. These are displayed in a browser
-#           like window with three index panes across the
-#           top and the selected description below
-#
-# Method descriptions appear in whatever entity (file, class,
-# or module) that contains them.
-#
-# We generate files in a structure below a specified subdirectory,
-# normally +doc+.
-#
-#  opdir
-#     |
-#     |___ files
-#     |       |__  per file summaries
-#     |
-#     |___ classes
-#             |__ per class/module descriptions
-#
-# HTML is generated using the Template class.
-#
-
-require 'ftools'
-
-require 'rdoc/options'
-require 'rdoc/template'
-require 'rdoc/markup/simple_markup'
-require 'rdoc/markup/simple_markup/to_html'
-require 'cgi'
-
-module Generators
-
-  # Name of sub-direcories that hold file and class/module descriptions
-
-  FILE_DIR  = "files"
-  CLASS_DIR = "classes"
-  CSS_NAME  = "rdoc-style.css"
-  
-
-  ##
-  # Build a hash of all items that can be cross-referenced.
-  # This is used when we output required and included names: 
-  # if the names appear in this hash, we can generate
-  # an html cross reference to the appropriate description.
-  # We also use this when parsing comment blocks: any decorated 
-  # words matching an entry in this list are hyperlinked.
-
-  class AllReferences
-    @@refs = {}
-    
-    def AllReferences::reset
-      @@refs = {}
-    end
-
-    def AllReferences.add(name, html_class)
-      @@refs[name] = html_class
-    end
-
-    def AllReferences.[](name)
-      @@refs[name]
-    end
-
-    def AllReferences.keys
-      @@refs.keys
-    end
-  end
-
-
-  ##
-  # Subclass of the SM::ToHtml class that supports looking
-  # up words in the AllReferences list. Those that are
-  # found (like AllReferences in this comment) will
-  # be hyperlinked
-
-  class HyperlinkHtml < SM::ToHtml
-    # We need to record the html path of our caller so we can generate
-    # correct relative paths for any hyperlinks that we find
-    def initialize(from_path, context)
-      super()
-      @from_path = from_path
-
-      @parent_name = context.parent_name
-      @parent_name += "::" if @parent_name
-      @context = context
-    end
-
-    # We're invoked when any text matches the CROSSREF pattern
-    # (defined in MarkUp). If we fine the corresponding reference,
-    # generate a hyperlink. If the name we're looking for contains
-    # no punctuation, we look for it up the module/class chain. For
-    # example, HyperlinkHtml is found, even without the Generators::
-    # prefix, because we look for it in module Generators first.
-
-    def handle_special_CROSSREF(special)
-      name = special.text
-      if name[0,1] == '#'
-        lookup = name[1..-1]
-        name = lookup unless Options.instance.show_hash
-      else
-        lookup = name
-      end
-
-      # Find class, module, or method in class or module.
-      if /([A-Z]\w*)[.\#](\w+[!?=]?)/ =~ lookup
-        container = $1
-        method = $2
-        ref = @context.find_symbol(container, method)
-      elsif /([A-Za-z]\w*)[.\#](\w+(\([\.\w+\*\/\+\-\=\<\>]+\))?)/ =~ lookup
-        container = $1
-        method = $2
-        ref = @context.find_symbol(container, method)
-      else
-        ref = @context.find_symbol(lookup)
-      end
-
-      if ref and ref.document_self
-        "<a href=\"#{ref.as_href(@from_path)}\">#{name}</a>"
-      else
-        name
-      end
-    end
-
-
-    # Generate a hyperlink for url, labeled with text. Handle the
-    # special cases for img: and link: described under handle_special_HYPEDLINK
-    def gen_url(url, text)
-      if url =~ /([A-Za-z]+):(.*)/
-        type = $1
-        path = $2
-      else
-        type = "http"
-        path = url
-        url  = "http://#{url}"
-      end
-
-      if type == "link"
-        if path[0,1] == '#'     # is this meaningful?
-          url = path
-        else
-          url = HTMLGenerator.gen_url(@from_path, path)
-        end
-      end
-
-      if (type == "http" || type == "link") && 
-          url =~ /\.(gif|png|jpg|jpeg|bmp)$/
-
-        "<img src=\"#{url}\" />"
-      else
-        "<a href=\"#{url}\">#{text.sub(%r{^#{type}:/*}, '')}</a>"
-      end
-    end
-
-    # And we're invoked with a potential external hyperlink mailto:
-    # just gets inserted. http: links are checked to see if they
-    # reference an image. If so, that image gets inserted using an
-    # <img> tag. Otherwise a conventional <a href> is used.  We also
-    # support a special type of hyperlink, link:, which is a reference
-    # to a local file whose path is relative to the --op directory.
-
-    def handle_special_HYPERLINK(special)
-      url = special.text
-      gen_url(url, url)
-    end
-
-    # HEre's a hypedlink where the label is different to the URL
-    #  <label>[url]
-    #
-    
-    def handle_special_TIDYLINK(special)
-      text = special.text
-#      unless text =~ /(\S+)\[(.*?)\]/
-      unless text =~ /\{(.*?)\}\[(.*?)\]/ or text =~ /(\S+)\[(.*?)\]/ 
-        return text
-      end
-      label = $1
-      url   = $2
-      gen_url(url, label)
-    end
-
-  end
-
-
-  
-  #####################################################################
-  #
-  # Handle common markup tasks for the various Html classes
-  #
-
-  module MarkUp
-
-    # Convert a string in markup format into HTML. We keep a cached
-    # SimpleMarkup object lying around after the first time we're
-    # called per object.
-
-    def markup(str, remove_para=false)
-      return '' unless str
-      unless defined? @markup
-        @markup = SM::SimpleMarkup.new
-
-        # class names, variable names, or instance variables
-        @markup.add_special(/(
-                               \w+(::\w+)*[.\#]\w+(\([\.\w+\*\/\+\-\=\<\>]+\))?  # A::B.meth(**) (for operator in Fortran95)
-                             | \#\w+(\([.\w\*\/\+\-\=\<\>]+\))?  #  meth(**) (for operator in Fortran95)
-                             | \b([A-Z]\w*(::\w+)*[.\#]\w+)  #    A::B.meth
-                             | \b([A-Z]\w+(::\w+)*)       #    A::B..
-                             | \#\w+[!?=]?                #    #meth_name 
-                             | \b\w+([_\/\.]+\w+)*[!?=]?  #    meth_name
-                             )/x, 
-                            :CROSSREF)
-
-        # external hyperlinks
-        @markup.add_special(/((link:|https?:|mailto:|ftp:|www\.)\S+\w)/, :HYPERLINK)
-
-        # and links of the form  <text>[<url>]
-        @markup.add_special(/(((\{.*?\})|\b\S+?)\[\S+?\.\S+?\])/, :TIDYLINK)
-#        @markup.add_special(/\b(\S+?\[\S+?\.\S+?\])/, :TIDYLINK)
-
-      end
-      unless defined? @html_formatter
-        @html_formatter = HyperlinkHtml.new(self.path, self)
-      end
-
-      # Convert leading comment markers to spaces, but only
-      # if all non-blank lines have them
-
-      if str =~ /^(?>\s*)[^\#]/
-        content = str
-      else
-        content = str.gsub(/^\s*(#+)/)  { $1.tr('#',' ') }
-      end
-
-      res = @markup.convert(content, @html_formatter)
-      if remove_para
-        res.sub!(/^<p>/, '')
-        res.sub!(/<\/p>$/, '')
-      end
-      res
-    end
-
-    # Qualify a stylesheet URL; if if +css_name+ does not begin with '/' or
-    # 'http[s]://', prepend a prefix relative to +path+. Otherwise, return it
-    # unmodified.
-
-    def style_url(path, css_name=nil)
-#      $stderr.puts "style_url( #{path.inspect}, #{css_name.inspect} )"
-      css_name ||= CSS_NAME
-      if %r{^(https?:/)?/} =~ css_name
-        return css_name
-      else
-        return HTMLGenerator.gen_url(path, css_name)
-      end
-    end
-
-    # Build a webcvs URL with the given 'url' argument. URLs with a '%s' in them
-    # get the file's path sprintfed into them; otherwise they're just catenated
-    # together.
-
-    def cvs_url(url, full_path)
-      if /%s/ =~ url
-        return sprintf( url, full_path )
-      else
-        return url + full_path
-      end
-    end
-  end
-
-
-  #####################################################################
-  #
-  # A Context is built by the parser to represent a container: contexts
-  # hold classes, modules, methods, require lists and include lists.
-  # ClassModule and TopLevel are the context objects we process here
-  # 
-  class ContextUser
-
-    include MarkUp
-
-    attr_reader :context
-    
-    def initialize(context, options)
-      @context = context
-      @options = options
-    end
-      
-    # convenience method to build a hyperlink
-    def href(link, cls, name)
-      %{<a href="#{link}" class="#{cls}">#{name}</a>} #"
-    end
-
-    # return a reference to outselves to be used as an href=
-    # the form depends on whether we're all in one file
-    # or in multiple files
-
-    def as_href(from_path)
-      if @options.all_one_file
-        "#" + path
-      else
-        HTMLGenerator.gen_url(from_path, path)
-      end
-    end
-
-    # Create a list of HtmlMethod objects for each method
-    # in the corresponding context object. If the @options.show_all
-    # variable is set (corresponding to the <tt>--all</tt> option,
-    # we include all methods, otherwise just the public ones.
-
-    def collect_methods
-      list = @context.method_list
-      unless @options.show_all
-        list = list.find_all {|m| m.visibility == :public || m.visibility == :protected || m.force_documentation }
-      end
-      @methods = list.collect {|m| HtmlMethod.new(m, self, @options) }
-    end
-
-    # Build a summary list of all the methods in this context
-    def build_method_summary_list(path_prefix="")
-      collect_methods unless @methods
-      meths = @methods.sort
-      res = []
-      meths.each do |meth|
-	res << {
-          "name" => CGI.escapeHTML(meth.name),
-          "aref" => "#{path_prefix}\##{meth.aref}" 
-        }
-      end
-      res
-    end
-
-
-    # Build a list of aliases for which we couldn't find a
-    # corresponding method
-    def build_alias_summary_list(section)
-      values = []
-      @context.aliases.each do |al|
-        next unless al.section == section
-        res = {
-          'old_name' => al.old_name,
-          'new_name' => al.new_name,
-        }
-        if al.comment && !al.comment.empty?
-          res['desc'] = markup(al.comment, true)
-        end
-        values << res
-      end
-      values
-    end
-    
-    # Build a list of constants
-    def build_constants_summary_list(section)
-      values = []
-      @context.constants.each do |co|
-        next unless co.section == section
-        res = {
-          'name'  => co.name,
-          'value' => CGI.escapeHTML(co.value)
-        }
-        res['desc'] = markup(co.comment, true) if co.comment && !co.comment.empty?
-        values << res
-      end
-      values
-    end
-    
-    def build_requires_list(context)
-      potentially_referenced_list(context.requires) {|fn| [fn + ".rb"] }
-    end
-
-    def build_include_list(context)
-      potentially_referenced_list(context.includes)
-    end
-
-    # Build a list from an array of <i>Htmlxxx</i> items. Look up each
-    # in the AllReferences hash: if we find a corresponding entry,
-    # we generate a hyperlink to it, otherwise just output the name.
-    # However, some names potentially need massaging. For example,
-    # you may require a Ruby file without the .rb extension,
-    # but the file names we know about may have it. To deal with
-    # this, we pass in a block which performs the massaging,
-    # returning an array of alternative names to match
-
-    def potentially_referenced_list(array)
-      res = []
-      array.each do |i|
-        ref = AllReferences[i.name] 
-#         if !ref
-#           container = @context.parent
-#           while !ref && container
-#             name = container.name + "::" + i.name
-#             ref = AllReferences[name] 
-#             container = container.parent
-#           end
-#         end
-
-        ref = @context.find_symbol(i.name)
-        ref = ref.viewer if ref
-
-        if !ref && block_given?
-          possibles = yield(i.name)
-          while !ref and !possibles.empty?
-            ref = AllReferences[possibles.shift]
-          end
-        end
-        h_name = CGI.escapeHTML(i.name)
-        if ref and ref.document_self
-          path = url(ref.path)
-          res << { "name" => h_name, "aref" => path }
-        else
-          res << { "name" => h_name }
-        end
-      end
-      res
-    end
-
-    # Build an array of arrays of method details. The outer array has up
-    # to six entries, public, private, and protected for both class
-    # methods, the other for instance methods. The inner arrays contain
-    # a hash for each method
-
-    def build_method_detail_list(section)
-      outer = []
-
-      methods = @methods.sort
-      for singleton in [true, false]
-        for vis in [ :public, :protected, :private ] 
-          res = []
-          methods.each do |m|
-            if m.section == section and
-                m.document_self and 
-                m.visibility == vis and 
-                m.singleton == singleton
-              row = {}
-              if m.call_seq
-                row["callseq"] = m.call_seq.gsub(/->/, '&rarr;')
-              else
-                row["name"]        = CGI.escapeHTML(m.name)
-                row["params"]      = m.params
-              end
-              desc = m.description.strip
-              row["m_desc"]      = desc unless desc.empty?
-              row["aref"]        = m.aref
-              row["visibility"]  = m.visibility.to_s
-
-              alias_names = []
-              m.aliases.each do |other|
-                if other.viewer   # won't be if the alias is private
-                  alias_names << {
-                    'name' => other.name,
-                    'aref'  => other.viewer.as_href(path)
-                  } 
-                end
-              end
-              unless alias_names.empty?
-                row["aka"] = alias_names
-              end
-
-              if @options.inline_source
-                code = m.source_code
-                row["sourcecode"] = code if code
-              else
-                code = m.src_url
-                if code
-                  row["codeurl"] = code
-                  row["imgurl"]  = m.img_url
-                end
-              end
-              res << row
-            end
-          end
-          if res.size > 0 
-            outer << {
-              "type"    => vis.to_s.capitalize,
-              "category"    => singleton ? "Class" : "Instance",
-              "methods" => res
-            }
-          end
-        end
-      end
-      outer
-    end
-
-    # Build the structured list of classes and modules contained
-    # in this context. 
-
-    def build_class_list(level, from, section, infile=nil)
-      res = ""
-      prefix = "&nbsp;&nbsp;::" * level;
-
-      from.modules.sort.each do |mod|
-        next unless mod.section == section
-        next if infile && !mod.defined_in?(infile)
-        if mod.document_self
-          res << 
-            prefix <<
-            "Module " <<
-            href(url(mod.viewer.path), "link", mod.full_name) <<
-            "<br />\n" <<
-            build_class_list(level + 1, mod, section, infile)
-        end
-      end
-
-      from.classes.sort.each do |cls|
-        next unless cls.section == section
-        next if infile && !cls.defined_in?(infile)
-        if cls.document_self
-          res      <<
-            prefix << 
-            "Class " <<
-            href(url(cls.viewer.path), "link", cls.full_name) <<
-            "<br />\n" <<
-            build_class_list(level + 1, cls, section, infile)
-        end
-      end
-
-      res
-    end
-    
-    def url(target)
-      HTMLGenerator.gen_url(path, target)
-    end
-
-    def aref_to(target)
-      if @options.all_one_file
-        "#" + target
-      else
-        url(target)
-      end
-    end
-
-    def document_self
-      @context.document_self
-    end
-
-    def diagram_reference(diagram)
-      res = diagram.gsub(/((?:src|href)=")(.*?)"/) {
-        $1 + url($2) + '"'
-      }
-      res
-    end
-
-
-    # Find a symbol in ourselves or our parent
-    def find_symbol(symbol, method=nil)
-      res = @context.find_symbol(symbol, method)
-      if res
-        res = res.viewer
-      end
-      res
-    end
-
-    # create table of contents if we contain sections
-      
-    def add_table_of_sections
-      toc = []
-      @context.sections.each do |section|
-        if section.title
-          toc << {
-            'secname' => section.title,
-            'href'    => section.sequence
-          }
-        end
-      end
-      
-      @values['toc'] = toc unless toc.empty?
-    end
-
-
-  end
-
-  #####################################################################
-  #
-  # Wrap a ClassModule context
-
-  class HtmlClass < ContextUser
-
-    attr_reader :path
-
-    def initialize(context, html_file, prefix, options)
-      super(context, options)
-
-      @html_file = html_file
-      @is_module = context.is_module?
-      @values    = {}
-
-      context.viewer = self
-
-      if options.all_one_file
-        @path = context.full_name
-      else
-        @path = http_url(context.full_name, prefix)
-      end
-
-      collect_methods
-
-      AllReferences.add(name, self)
-    end
-
-    # return the relative file name to store this class in,
-    # which is also its url
-    def http_url(full_name, prefix)
-      path = full_name.dup
-      if path['<<']
-        path.gsub!(/<<\s*(\w*)/) { "from-#$1" }
-      end
-      File.join(prefix, path.split("::")) + ".html"
-    end
-
-
-    def name
-      @context.full_name
-    end
-
-    def parent_name
-      @context.parent.full_name
-    end
-
-    def index_name
-      name
-    end
-
-    def write_on(f)
-      value_hash
-      template = TemplatePage.new(RDoc::Page::BODY,
-                                      RDoc::Page::CLASS_PAGE,
-                                      RDoc::Page::METHOD_LIST)
-      template.write_html_on(f, @values)
-    end
-
-    def value_hash
-      class_attribute_values
-      add_table_of_sections
-
-      @values["charset"] = @options.charset
-      @values["style_url"] = style_url(path, @options.css)
-
-      d = markup(@context.comment)
-      @values["description"] = d unless d.empty?
-
-      ml = build_method_summary_list
-      @values["methods"] = ml unless ml.empty?
-
-      il = build_include_list(@context)
-      @values["includes"] = il unless il.empty?
-
-      @values["sections"] = @context.sections.map do |section|
-
-        secdata = {
-          "sectitle" => section.title,
-          "secsequence" => section.sequence,
-          "seccomment" => markup(section.comment)
-        }
-
-        al = build_alias_summary_list(section)
-        secdata["aliases"] = al unless al.empty?
-        
-        co = build_constants_summary_list(section)
-        secdata["constants"] = co unless co.empty?
-        
-        al = build_attribute_list(section)
-        secdata["attributes"] = al unless al.empty?
-        
-        cl = build_class_list(0, @context, section)
-        secdata["classlist"] = cl unless cl.empty?
-        
-        mdl = build_method_detail_list(section)
-        secdata["method_list"] = mdl unless mdl.empty?
-
-        secdata
-      end
-
-      @values
-    end
-
-    def build_attribute_list(section)
-      atts = @context.attributes.sort
-      res = []
-      atts.each do |att|
-        next unless att.section == section
-        if att.visibility == :public || att.visibility == :protected || @options.show_all
-          entry = {
-            "name"   => CGI.escapeHTML(att.name), 
-            "rw"     => att.rw, 
-            "a_desc" => markup(att.comment, true)
-          }
-          unless att.visibility == :public || att.visibility == :protected
-            entry["rw"] << "-"
-          end
-          res << entry
-        end
-      end
-      res
-    end
-
-    def class_attribute_values
-      h_name = CGI.escapeHTML(name)
-
-      @values["classmod"]  = @is_module ? "Module" : "Class"
-      @values["title"]     = "#{@values['classmod']}: #{h_name}"
-
-      c = @context
-      c = c.parent while c and !c.diagram
-      if c && c.diagram
-        @values["diagram"] = diagram_reference(c.diagram)
-      end
-
-      @values["full_name"] = h_name
-
-      parent_class = @context.superclass
-
-      if parent_class
-	@values["parent"] = CGI.escapeHTML(parent_class)
-
-	if parent_name
-	  lookup = parent_name + "::" + parent_class
-	else
-	  lookup = parent_class
-	end
-
-	parent_url = AllReferences[lookup] || AllReferences[parent_class]
-
-	if parent_url and parent_url.document_self
-	  @values["par_url"] = aref_to(parent_url.path)
-	end
-      end
-
-      files = []
-      @context.in_files.each do |f|
-        res = {}
-        full_path = CGI.escapeHTML(f.file_absolute_name)
-
-        res["full_path"]     = full_path
-        res["full_path_url"] = aref_to(f.viewer.path) if f.document_self
-
-        if @options.webcvs
-          res["cvsurl"] = cvs_url( @options.webcvs, full_path )
-        end
-
-        files << res
-      end
-
-      @values['infiles'] = files
-    end
-
-    def <=>(other)
-      self.name <=> other.name
-    end
-
-  end
-
-  #####################################################################
-  #
-  # Handles the mapping of a file's information to HTML. In reality,
-  # a file corresponds to a +TopLevel+ object, containing modules,
-  # classes, and top-level methods. In theory it _could_ contain
-  # attributes and aliases, but we ignore these for now.
-
-  class HtmlFile < ContextUser
-
-    attr_reader :path
-    attr_reader :name
-
-    def initialize(context, options, file_dir)
-      super(context, options)
-
-      @values = {}
-
-      if options.all_one_file
-        @path = filename_to_label
-      else
-        @path = http_url(file_dir)
-      end
-
-      @name = @context.file_relative_name
-
-      collect_methods
-      AllReferences.add(name, self)
-      context.viewer = self
-    end
-
-    def http_url(file_dir)
-      File.join(file_dir, @context.file_relative_name.tr('.', '_')) +
-        ".html"
-    end
-
-    def filename_to_label
-      @context.file_relative_name.gsub(/%|\/|\?|\#/) {|s| '%' + ("%x" % s[0]) }
-    end
-
-    def index_name
-      name
-    end
-
-    def parent_name
-      nil
-    end
-
-    def value_hash
-      file_attribute_values
-      add_table_of_sections
-
-      @values["charset"]   = @options.charset
-      @values["href"]      = path
-      @values["style_url"] = style_url(path, @options.css)
-
-      if @context.comment
-        d = markup(@context.comment)
-        @values["description"] = d if d.size > 0
-      end
-
-      ml = build_method_summary_list
-      @values["methods"] = ml unless ml.empty?
-
-      il = build_include_list(@context)
-      @values["includes"] = il unless il.empty?
-
-      rl = build_requires_list(@context)
-      @values["requires"] = rl unless rl.empty?
-
-      if @options.promiscuous
-        file_context = nil
-      else
-        file_context = @context
-      end
-
-
-      @values["sections"] = @context.sections.map do |section|
-
-        secdata = {
-          "sectitle" => section.title,
-          "secsequence" => section.sequence,
-          "seccomment" => markup(section.comment)
-        }
-
-        cl = build_class_list(0, @context, section, file_context)
-        @values["classlist"] = cl unless cl.empty?
-
-        mdl = build_method_detail_list(section)
-        secdata["method_list"] = mdl unless mdl.empty?
-
-        al = build_alias_summary_list(section)
-        secdata["aliases"] = al unless al.empty?
-        
-        co = build_constants_summary_list(section)
-        @values["constants"] = co unless co.empty?
-
-        secdata
-      end
-      
-      @values
-    end
-    
-    def write_on(f)
-      value_hash
-      template = TemplatePage.new(RDoc::Page::BODY,
-                                  RDoc::Page::FILE_PAGE,
-                                  RDoc::Page::METHOD_LIST)
-      template.write_html_on(f, @values)
-    end
-
-    def file_attribute_values
-      full_path = @context.file_absolute_name
-      short_name = File.basename(full_path)
-      
-      @values["title"] = CGI.escapeHTML("File: #{short_name}")
-
-      if @context.diagram
-        @values["diagram"] = diagram_reference(@context.diagram)
-      end
-
-      @values["short_name"]   = CGI.escapeHTML(short_name)
-      @values["full_path"]    = CGI.escapeHTML(full_path)
-      @values["dtm_modified"] = @context.file_stat.mtime.to_s
-
-      if @options.webcvs
-        @values["cvsurl"] = cvs_url( @options.webcvs, @values["full_path"] )
-      end
-    end
-
-    def <=>(other)
-      self.name <=> other.name
-    end
-  end
-
-  #####################################################################
-
-  class HtmlMethod
-    include MarkUp
-
-    attr_reader :context
-    attr_reader :src_url
-    attr_reader :img_url
-    attr_reader :source_code
-
-    @@seq = "M000000"
-
-    @@all_methods = []
-
-    def HtmlMethod::reset
-      @@all_methods = []
-    end
-
-    def initialize(context, html_class, options)
-      @context    = context
-      @html_class = html_class
-      @options    = options
-      @@seq       = @@seq.succ
-      @seq        = @@seq
-      @@all_methods << self
-
-      context.viewer = self
-
-      if (ts = @context.token_stream)
-        @source_code = markup_code(ts)
-        unless @options.inline_source
-          @src_url = create_source_code_file(@source_code)
-          @img_url = HTMLGenerator.gen_url(path, 'source.png')
-        end
-      end
-
-      AllReferences.add(name, self)
-    end
-    
-    # return a reference to outselves to be used as an href=
-    # the form depends on whether we're all in one file
-    # or in multiple files
-
-    def as_href(from_path)
-      if @options.all_one_file
-        "#" + path
-      else
-        HTMLGenerator.gen_url(from_path, path)
-      end
-    end
-
-    def name
-      @context.name
-    end
-
-    def section
-      @context.section
-    end
-
-    def index_name
-      "#{@context.name} (#{@html_class.name})"
-    end
-
-    def parent_name
-      if @context.parent.parent
-        @context.parent.parent.full_name
-      else
-        nil
-      end
-    end
-
-    def aref
-      @seq
-    end
-
-    def path
-      if @options.all_one_file
-	aref
-      else
-	@html_class.path + "#" + aref
-      end
-    end
-
-    def description
-      markup(@context.comment)
-    end
-
-    def visibility
-      @context.visibility
-    end
-
-    def singleton
-      @context.singleton
-    end
-
-    def call_seq
-      cs = @context.call_seq
-      if cs
-        cs.gsub(/\n/, "<br />\n")
-      else
-        nil
-      end
-    end
-
-    def params
-      # params coming from a call-seq in 'C' will start with the
-      # method name
-      p = @context.params
-      if p !~ /^\w/
-        p = @context.params.gsub(/\s*\#.*/, '')
-        p = p.tr("\n", " ").squeeze(" ")
-        p = "(" + p + ")" unless p[0] == ?(
-        
-        if (block = @context.block_params)
-         # If this method has explicit block parameters, remove any
-         # explicit &block
-
-         p.sub!(/,?\s*&\w+/, '')
-
-          block.gsub!(/\s*\#.*/, '')
-          block = block.tr("\n", " ").squeeze(" ")
-          if block[0] == ?(
-            block.sub!(/^\(/, '').sub!(/\)/, '')
-          end
-          p << " {|#{block.strip}| ...}"
-        end
-      end
-      CGI.escapeHTML(p)
-    end
-    
-    def create_source_code_file(code_body)
-      meth_path = @html_class.path.sub(/\.html$/, '.src')
-      File.makedirs(meth_path)
-      file_path = File.join(meth_path, @seq) + ".html"
-
-      template = TemplatePage.new(RDoc::Page::SRC_PAGE)
-      File.open(file_path, "w") do |f|
-        values = {
-          'title'     => CGI.escapeHTML(index_name),
-          'code'      => code_body,
-          'style_url' => style_url(file_path, @options.css),
-          'charset'   => @options.charset
-        }
-        template.write_html_on(f, values)
-      end
-      HTMLGenerator.gen_url(path, file_path)
-    end
-
-    def HtmlMethod.all_methods
-      @@all_methods
-    end
-
-    def <=>(other)
-      @context <=> other.context
-    end
-
-    ##
-    # Given a sequence of source tokens, mark up the source code
-    # to make it look purty.
-
-
-    def markup_code(tokens)
-      src = ""
-      tokens.each do |t|
-        next unless t
-        #    p t.class
-#        style = STYLE_MAP[t.class]
-        style = case t
-                when RubyToken::TkCONSTANT then "ruby-constant"
-                when RubyToken::TkKW       then "ruby-keyword kw"
-                when RubyToken::TkIVAR     then "ruby-ivar"
-                when RubyToken::TkOp       then "ruby-operator"
-                when RubyToken::TkId       then "ruby-identifier"
-                when RubyToken::TkNode     then "ruby-node"
-                when RubyToken::TkCOMMENT  then "ruby-comment cmt"
-                when RubyToken::TkREGEXP   then "ruby-regexp re"
-                when RubyToken::TkSTRING   then "ruby-value str"
-                when RubyToken::TkVal      then "ruby-value"
-                else
-                    nil
-                end
-
-        text = CGI.escapeHTML(t.text)
-
-        if style
-          src << "<span class=\"#{style}\">#{text}</span>"
-        else
-          src << text
-        end
-      end
-
-      add_line_numbers(src) if Options.instance.include_line_numbers
-      src
-    end
-
-    # we rely on the fact that the first line of a source code
-    # listing has 
-    #    # File xxxxx, line dddd
-
-    def add_line_numbers(src)
-      if src =~ /\A.*, line (\d+)/
-        first = $1.to_i - 1
-        last  = first + src.count("\n")
-        size = last.to_s.length
-        real_fmt = "%#{size}d: "
-        fmt = " " * (size+2)
-        src.gsub!(/^/) do
-          res = sprintf(fmt, first) 
-          first += 1
-          fmt = real_fmt
-          res
-        end
-      end
-    end
-
-    def document_self
-      @context.document_self
-    end
-
-    def aliases
-      @context.aliases
-    end
-
-    def find_symbol(symbol, method=nil)
-      res = @context.parent.find_symbol(symbol, method)
-      if res
-        res = res.viewer
-      end
-      res
-    end
-  end
-
-  #####################################################################
-
-  class HTMLGenerator
-
-    include MarkUp
-
-    ##
-    # convert a target url to one that is relative to a given
-    # path
-    
-    def HTMLGenerator.gen_url(path, target)
-      from          = File.dirname(path)
-      to, to_file   = File.split(target)
-      
-      from = from.split("/")
-      to   = to.split("/")
-      
-      while from.size > 0 and to.size > 0 and from[0] == to[0]
-        from.shift
-        to.shift
-      end
-      
-      from.fill("..")
-      from.concat(to)
-      from << to_file
-      File.join(*from)
-    end
-
-    # Generators may need to return specific subclasses depending
-    # on the options they are passed. Because of this
-    # we create them using a factory
-
-    def HTMLGenerator.for(options)
-      AllReferences::reset
-      HtmlMethod::reset
-
-      if options.all_one_file
-        HTMLGeneratorInOne.new(options)
-      else
-        HTMLGenerator.new(options)
-      end
-    end
-
-    class <<self
-      protected :new
-    end
-
-    # Set up a new HTML generator. Basically all we do here is load
-    # up the correct output temlate
-
-    def initialize(options) #:not-new:
-      @options    = options
-      load_html_template
-    end
-
-
-    ##
-    # Build the initial indices and output objects
-    # based on an array of TopLevel objects containing
-    # the extracted information. 
-
-    def generate(toplevels)
-      @toplevels  = toplevels
-      @files      = []
-      @classes    = []
-
-      write_style_sheet
-      gen_sub_directories()
-      build_indices
-      generate_html
-    end
-
-    private
-
-    ##
-    # Load up the HTML template specified in the options.
-    # If the template name contains a slash, use it literally
-    #
-    def load_html_template
-      template = @options.template
-      unless template =~ %r{/|\\}
-        template = File.join("rdoc/generators/template",
-                             @options.generator.key, template)
-      end
-      require template
-      extend RDoc::Page
-    rescue LoadError
-      $stderr.puts "Could not find HTML template '#{template}'"
-      exit 99
-    end
-
-    ##
-    # Write out the style sheet used by the main frames
-    #
-    
-    def write_style_sheet
-      template = TemplatePage.new(RDoc::Page::STYLE)
-      unless @options.css
-        File.open(CSS_NAME, "w") do |f|
-          values = { "fonts" => RDoc::Page::FONTS }
-          template.write_html_on(f, values)
-        end
-      end
-    end
-
-    ##
-    # See the comments at the top for a description of the
-    # directory structure
-
-    def gen_sub_directories
-      File.makedirs(FILE_DIR, CLASS_DIR)
-    rescue 
-      $stderr.puts $!.message
-      exit 1
-    end
-
-    ##
-    # Generate:
-    #
-    # * a list of HtmlFile objects for each TopLevel object.
-    # * a list of HtmlClass objects for each first level
-    #   class or module in the TopLevel objects
-    # * a complete list of all hyperlinkable terms (file,
-    #   class, module, and method names)
-
-    def build_indices
-
-      @toplevels.each do |toplevel|
-        @files << HtmlFile.new(toplevel, @options, FILE_DIR)
-      end
-
-      RDoc::TopLevel.all_classes_and_modules.each do |cls|
-        build_class_list(cls, @files[0], CLASS_DIR)
-      end
-    end
-
-    def build_class_list(from, html_file, class_dir)
-      @classes << HtmlClass.new(from, html_file, class_dir, @options)
-      from.each_classmodule do |mod|
-        build_class_list(mod, html_file, class_dir)
-      end
-    end
-
-    ##
-    # Generate all the HTML
-    #
-    def generate_html
-      # the individual descriptions for files and classes
-      gen_into(@files)
-      gen_into(@classes)
-      # and the index files
-      gen_file_index
-      gen_class_index
-      gen_method_index
-      gen_main_index
-      
-      # this method is defined in the template file
-      write_extra_pages if defined? write_extra_pages
-    end
-
-    def gen_into(list)
-      list.each do |item|
-        if item.document_self
-          op_file = item.path
-          File.makedirs(File.dirname(op_file))
-          File.open(op_file, "w") { |file| item.write_on(file) }
-        end
-      end
-
-    end
-
-    def gen_file_index
-      gen_an_index(@files, 'Files', 
-                   RDoc::Page::FILE_INDEX, 
-                   "fr_file_index.html")
-    end
-
-    def gen_class_index
-      gen_an_index(@classes, 'Classes',
-                   RDoc::Page::CLASS_INDEX,
-                   "fr_class_index.html")
-    end
-
-    def gen_method_index
-      gen_an_index(HtmlMethod.all_methods, 'Methods', 
-                   RDoc::Page::METHOD_INDEX,
-                   "fr_method_index.html")
-    end
-
-    
-    def gen_an_index(collection, title, template, filename)
-      template = TemplatePage.new(RDoc::Page::FR_INDEX_BODY, template)
-      res = []
-      collection.sort.each do |f|
-        if f.document_self
-          res << { "href" => f.path, "name" => f.index_name }
-        end
-      end
-
-      values = {
-        "entries"    => res,
-        'list_title' => CGI.escapeHTML(title),
-        'index_url'  => main_url,
-        'charset'    => @options.charset,
-        'style_url'  => style_url('', @options.css),
-      }
-
-      File.open(filename, "w") do |f|
-        template.write_html_on(f, values)
-      end
-    end
-
-    # The main index page is mostly a template frameset, but includes
-    # the initial page. If the <tt>--main</tt> option was given,
-    # we use this as our main page, otherwise we use the
-    # first file specified on the command line.
-
-    def gen_main_index
-      template = TemplatePage.new(RDoc::Page::INDEX)
-      File.open("index.html", "w") do |f|
-        values = {
-          "initial_page" => main_url,
-          'title'        => CGI.escapeHTML(@options.title),
-          'charset'      => @options.charset
-        }
-        if @options.inline_source
-          values['inline_source'] = true
-        end
-        template.write_html_on(f, values)
-      end
-    end
-
-    # return the url of the main page
-    def main_url
-      main_page = @options.main_page
-      ref = nil
-      if main_page
-        ref = AllReferences[main_page]
-        if ref
-          ref = ref.path
-        else
-          $stderr.puts "Could not find main page #{main_page}"
-        end
-      end
-
-      unless ref
-        for file in @files
-          if file.document_self
-            ref = file.path 
-            break
-          end
-        end
-      end
-
-      unless ref
-        $stderr.puts "Couldn't find anything to document"
-        $stderr.puts "Perhaps you've used :stopdoc: in all classes"
-        exit(1)
-      end
-
-      ref
-    end
-
-
-  end
-
-
-  ######################################################################
-
-
-  class HTMLGeneratorInOne < HTMLGenerator
-
-    def initialize(*args)
-      super
-    end
-
-    ##
-    # Build the initial indices and output objects
-    # based on an array of TopLevel objects containing
-    # the extracted information. 
-
-    def generate(info)
-      @toplevels  = info
-      @files      = []
-      @classes    = []
-      @hyperlinks = {}
-
-      build_indices
-      generate_xml
-    end
-
-
-    ##
-    # Generate:
-    #
-    # * a list of HtmlFile objects for each TopLevel object.
-    # * a list of HtmlClass objects for each first level
-    #   class or module in the TopLevel objects
-    # * a complete list of all hyperlinkable terms (file,
-    #   class, module, and method names)
-
-    def build_indices
-
-      @toplevels.each do |toplevel|
-        @files << HtmlFile.new(toplevel, @options, FILE_DIR)
-      end
-
-      RDoc::TopLevel.all_classes_and_modules.each do |cls|
-        build_class_list(cls, @files[0], CLASS_DIR)
-      end
-    end
-
-    def build_class_list(from, html_file, class_dir)
-      @classes << HtmlClass.new(from, html_file, class_dir, @options)
-      from.each_classmodule do |mod|
-        build_class_list(mod, html_file, class_dir)
-      end
-    end
-
-    ##
-    # Generate all the HTML. For the one-file case, we generate
-    # all the information in to one big hash
-    #
-    def generate_xml
-      values = { 
-        'charset' => @options.charset,
-        'files'   => gen_into(@files),
-        'classes' => gen_into(@classes),
-        'title'        => CGI.escapeHTML(@options.title),
-      }
-      
-      # this method is defined in the template file
-      write_extra_pages if defined? write_extra_pages
-
-      template = TemplatePage.new(RDoc::Page::ONE_PAGE)
-
-      if @options.op_name
-        opfile = File.open(@options.op_name, "w")
-      else
-        opfile = $stdout
-      end
-      template.write_html_on(opfile, values)
-    end
-
-    def gen_into(list)
-      res = []
-      list.each do |item|
-        res << item.value_hash
-      end
-      res
-    end
-
-    def gen_file_index
-      gen_an_index(@files, 'Files')
-    end
-
-    def gen_class_index
-      gen_an_index(@classes, 'Classes')
-    end
-
-    def gen_method_index
-      gen_an_index(HtmlMethod.all_methods, 'Methods')
-    end
-
-    
-    def gen_an_index(collection, title)
-      res = []
-      collection.sort.each do |f|
-        if f.document_self
-          res << { "href" => f.path, "name" => f.index_name }
-        end
-      end
-
-      return {
-        "entries" => res,
-        'list_title' => title,
-        'index_url'  => main_url,
-      }
-    end
-
-  end
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generators/ri_generator.rb ../rdoc-f95-20090109-1/generators/ri_generator.rb
--- ruby-1.8.7-p72/lib/rdoc/generators/ri_generator.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/generators/ri_generator.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,268 +0,0 @@
-# We're responsible for generating all the HTML files
-# from the object tree defined in code_objects.rb. We
-# generate:
-#
-# [files]   an html file for each input file given. These
-#           input files appear as objects of class
-#           TopLevel
-#
-# [classes] an html file for each class or module encountered.
-#           These classes are not grouped by file: if a file
-#           contains four classes, we'll generate an html
-#           file for the file itself, and four html files 
-#           for the individual classes. 
-#
-# [indices] we generate three indices for files, classes,
-#           and methods. These are displayed in a browser
-#           like window with three index panes across the
-#           top and the selected description below
-#
-# Method descriptions appear in whatever entity (file, class,
-# or module) that contains them.
-#
-# We generate files in a structure below a specified subdirectory,
-# normally +doc+.
-#
-#  opdir
-#     |
-#     |___ files
-#     |       |__  per file summaries
-#     |
-#     |___ classes
-#             |__ per class/module descriptions
-#
-# HTML is generated using the Template class.
-#
-
-require 'ftools'
-
-require 'rdoc/options'
-require 'rdoc/template'
-require 'rdoc/markup/simple_markup'
-require 'rdoc/markup/simple_markup/to_flow'
-require 'cgi'
-
-require 'rdoc/ri/ri_cache'
-require 'rdoc/ri/ri_reader'
-require 'rdoc/ri/ri_writer'
-require 'rdoc/ri/ri_descriptions'
-
-module Generators
-
-
-  class RIGenerator
-
-    # Generators may need to return specific subclasses depending
-    # on the options they are passed. Because of this
-    # we create them using a factory
-
-    def RIGenerator.for(options)
-      new(options)
-    end
-
-    class <<self
-      protected :new
-    end
-
-    # Set up a new HTML generator. Basically all we do here is load
-    # up the correct output temlate
-
-    def initialize(options) #:not-new:
-      @options   = options
-      @ri_writer = RI::RiWriter.new(".")
-      @markup    = SM::SimpleMarkup.new
-      @to_flow   = SM::ToFlow.new
-    end
-
-
-    ##
-    # Build the initial indices and output objects
-    # based on an array of TopLevel objects containing
-    # the extracted information. 
-
-    def generate(toplevels)
-      RDoc::TopLevel.all_classes_and_modules.each do |cls|
-        process_class(cls)
-      end
-    end
-
-    def process_class(from_class)
-      generate_class_info(from_class)
-
-      # now recure into this classes constituent classess
-      from_class.each_classmodule do |mod|
-        process_class(mod)
-      end
-    end
-
-    def generate_class_info(cls)
-      if cls === RDoc::NormalModule
-        cls_desc = RI::ModuleDescription.new
-      else
-        cls_desc = RI::ClassDescription.new
-        cls_desc.superclass  = cls.superclass
-      end
-      cls_desc.name        = cls.name
-      cls_desc.full_name   = cls.full_name
-      cls_desc.comment     = markup(cls.comment)
-
-      cls_desc.attributes =cls.attributes.sort.map do |a|
-        RI::Attribute.new(a.name, a.rw, markup(a.comment))
-      end
-
-      cls_desc.constants = cls.constants.map do |c|
-        RI::Constant.new(c.name, c.value, markup(c.comment))
-      end
-
-      cls_desc.includes = cls.includes.map do |i|
-        RI::IncludedModule.new(i.name)
-      end
-
-      class_methods, instance_methods = method_list(cls)
-
-      cls_desc.class_methods = class_methods.map do |m|
-        RI::MethodSummary.new(m.name)
-      end
-      cls_desc.instance_methods = instance_methods.map do |m|
-        RI::MethodSummary.new(m.name)
-      end
-
-      update_or_replace(cls_desc)
-
-      class_methods.each do |m|
-        generate_method_info(cls_desc, m)
-      end
-
-      instance_methods.each do |m|
-        generate_method_info(cls_desc, m)
-      end
-    end
-
-
-    def generate_method_info(cls_desc, method)
-      meth_desc = RI::MethodDescription.new
-      meth_desc.name = method.name
-      meth_desc.full_name = cls_desc.full_name
-      if method.singleton
-        meth_desc.full_name += "::"
-      else
-        meth_desc.full_name += "#"
-      end
-      meth_desc.full_name << method.name
-
-      meth_desc.comment = markup(method.comment)
-      meth_desc.params = params_of(method)
-      meth_desc.visibility = method.visibility.to_s
-      meth_desc.is_singleton = method.singleton
-      meth_desc.block_params = method.block_params
-
-      meth_desc.aliases = method.aliases.map do |a|
-        RI::AliasName.new(a.name)
-      end
-
-      @ri_writer.add_method(cls_desc, meth_desc)
-    end
-
-    private
-
-    # return a list of class and instance methods that we'll be
-    # documenting
-
-    def method_list(cls)
-      list = cls.method_list
-      unless @options.show_all
-        list = list.find_all do |m|
-          m.visibility == :public || m.visibility == :protected || m.force_documentation
-        end
-      end
-
-      c = []
-      i = []
-      list.sort.each do |m|
-        if m.singleton
-          c << m
-        else
-          i << m
-        end
-      end
-      return c,i
-    end
-    
-    def params_of(method)
-      if method.call_seq
-        method.call_seq
-      else
-        params = method.params || ""
-        
-        p = params.gsub(/\s*\#.*/, '')
-        p = p.tr("\n", " ").squeeze(" ")
-        p = "(" + p + ")" unless p[0] == ?(
-        
-        if (block = method.block_params)
-          block.gsub!(/\s*\#.*/, '')
-          block = block.tr("\n", " ").squeeze(" ")
-          if block[0] == ?(
-            block.sub!(/^\(/, '').sub!(/\)/, '')
-          end
-          p << " {|#{block.strip}| ...}"
-        end
-        p
-      end
-    end
-
-    def markup(comment)
-      return nil if !comment || comment.empty?
-
-      # Convert leading comment markers to spaces, but only
-      # if all non-blank lines have them
-      
-      if comment =~ /^(?>\s*)[^\#]/
-        content = comment
-      else
-        content = comment.gsub(/^\s*(#+)/)  { $1.tr('#',' ') }
-      end
-      @markup.convert(content, @to_flow)
-    end
-
-
-    # By default we replace existing classes with the
-    # same name. If the --merge option was given, we instead
-    # merge this definition into an existing class. We add
-    # our methods, aliases, etc to that class, but do not
-    # change the class's description.
-
-    def update_or_replace(cls_desc)
-      old_cls = nil
-
-      if @options.merge
-        rdr = RI::RiReader.new(RI::RiCache.new(@options.op_dir))
-
-        namespace = rdr.top_level_namespace
-        namespace = rdr.lookup_namespace_in(cls_desc.name, namespace)
-        if namespace.empty?
-          $stderr.puts "You asked me to merge this source into existing "
-          $stderr.puts "documentation. This file references a class or "
-          $stderr.puts "module called #{cls_desc.name} which I don't"
-          $stderr.puts "have existing documentation for."
-          $stderr.puts 
-          $stderr.puts "Perhaps you need to generate its documentation first"
-          exit 1
-        else
-          old_cls = namespace[0]
-        end
-      end
-
-      if old_cls.nil?
-        # no merge: simply overwrite
-        @ri_writer.remove_class(cls_desc)
-        @ri_writer.add_class(cls_desc)
-      else
-        # existing class: merge in
-        old_desc = rdr.get_class(old_cls)
-
-        old_desc.merge_in(cls_desc)
-        @ri_writer.add_class(old_desc)
-      end
-    end
-  end
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generators/template/chm/chm.rb ../rdoc-f95-20090109-1/generators/template/chm/chm.rb
--- ruby-1.8.7-p72/lib/rdoc/generators/template/chm/chm.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/generators/template/chm/chm.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,87 +0,0 @@
-module RDoc
-module Page
-
-require "rdoc/generators/template/html/html"
-
-# This is a nasty little hack, but hhc doesn't support the <?xml
-# tag, so...
-
-BODY.sub!(/<\?xml.*\?>/, '')
-SRC_PAGE.sub!(/<\?xml.*\?>/, '')
-
-HPP_FILE = %{
-[OPTIONS]
-Auto Index = Yes
-Compatibility=1.1 or later
-Compiled file=%opname%.chm
-Contents file=contents.hhc
-Full-text search=Yes
-Index file=index.hhk
-Language=0x409 English(United States)
-Title=%title%
-
-[FILES]
-START:all_html_files
-%html_file_name%
-END:all_html_files
-}
-
-CONTENTS = %{
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML>
-<HEAD>
-<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
-<!-- Sitemap 1.0 -->
-</HEAD><BODY>
-<OBJECT type="text/site properties">
-	<param name="Foreground" value="0x80">
-	<param name="Window Styles" value="0x800025">
-	<param name="ImageType" value="Folder">
-</OBJECT>
-<UL>
-START:contents
-	<LI> <OBJECT type="text/sitemap">
-		<param name="Name" value="%c_name%">
-		<param name="Local" value="%ref%">
-		</OBJECT>
-IF:methods
-<ul>
-START:methods
-	<LI> <OBJECT type="text/sitemap">
-		<param name="Name" value="%name%">
-		<param name="Local" value="%aref%">
-		</OBJECT>
-END:methods
-</ul>
-ENDIF:methods
-        </LI>
-END:contents
-</UL>
-</BODY></HTML>
-}
-
-
-CHM_INDEX  = %{
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<HTML>
-<HEAD>
-<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
-<!-- Sitemap 1.0 -->
-</HEAD><BODY>
-<OBJECT type="text/site properties">
-	<param name="Foreground" value="0x80">
-	<param name="Window Styles" value="0x800025">
-	<param name="ImageType" value="Folder">
-</OBJECT>
-<UL>
-START:index
-	<LI> <OBJECT type="text/sitemap">
-		<param name="Name" value="%name%">
-		<param name="Local" value="%aref%">
-		</OBJECT>
-END:index
-</UL>
-</BODY></HTML>
-}
-end
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generators/template/html/hefss.rb ../rdoc-f95-20090109-1/generators/template/html/hefss.rb
--- ruby-1.8.7-p72/lib/rdoc/generators/template/html/hefss.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/generators/template/html/hefss.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,418 +0,0 @@
-module RDoc
-module Page
-
-
-FONTS = "Verdana, Arial, Helvetica, sans-serif"
-
-STYLE = %{
-body,p { font-family: Verdana, Arial, Helvetica, sans-serif; 
-       color: #000040; background: #BBBBBB;
-}
-
-td { font-family: Verdana, Arial, Helvetica, sans-serif; 
-       color: #000040;
-}
-
-.attr-rw { font-size: small; color: #444488 }
-
-.title-row {color:      #eeeeff;
-	    background: #BBBBDD;
-}
-
-.big-title-font { color: white;
-                  font-family: Verdana, Arial, Helvetica, sans-serif;
-                  font-size: large; 
-                  height: 50px}
-
-.small-title-font { color: purple;
-                    font-family: Verdana, Arial, Helvetica, sans-serif;
-                    font-size: small; }
-
-.aqua { color: purple }
-
-.method-name, attr-name {
-      font-family: monospace; font-weight: bold;
-}
-
-.tablesubtitle {
-   width: 100%;
-   margin-top: 1ex;
-   margin-bottom: .5ex;
-   padding: 5px 0px 5px 20px;
-   font-size: large;
-   color: purple;
-   background: #BBBBCC;
-}
-
-.tablesubsubtitle {
-   width: 100%;
-   margin-top: 1ex;
-   margin-bottom: .5ex;
-   padding: 5px 0px 5px 20px;
-   font-size: medium;
-   color: white;
-   background: #BBBBCC;
-}
-
-.name-list {
-  font-family: monospace;
-  margin-left: 40px;
-  margin-bottom: 2ex;
-  line-height: 140%;
-}
-
-.description {
-  margin-left: 40px;
-  margin-bottom: 2ex;
-  line-height: 140%;
-}
-
-.methodtitle {
-  font-size: medium;
-  text_decoration: none;
-  padding: 3px 3px 3px 20px;
-  color: #0000AA;
-}
-
-.column-title {
-  font-size: medium;
-  font-weight: bold;
-  text_decoration: none;
-  padding: 3px 3px 3px 20px;
-  color: #3333CC;
-  }
-
-.variable-name {
-  font-family: monospace;
-  font-size: medium;
-  text_decoration: none;
-  padding: 3px 3px 3px 20px;
-  color: #0000AA;
-}
-
-.row-name {
-  font-size: medium;
-  font-weight: medium;
-  font-family: monospace;
-  text_decoration: none;
-  padding: 3px 3px 3px 20px;
-}
-
-.paramsig {
-   font-size: small;
-}
-
-.srcbut { float: right }
-
-}
-
-
-############################################################################
-
-
-BODY = %{
-<html><head>
-  <title>%title%</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
-  <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
-  <script type="text/javascript" language="JavaScript">
-  <!--
-  function popCode(url) {
-    parent.frames.source.location = url
-  }
-  //-->
-  </script>
-</head>
-<body bgcolor="#BBBBBB">
-
-!INCLUDE!  <!-- banner header -->
-
-IF:diagram
-<table width="100%"><tr><td align="center">
-%diagram%
-</td></tr></table>
-ENDIF:diagram
-
-IF:description
-<div class="description">%description%</div>
-ENDIF:description
-
-IF:requires
-<table cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">Required files</td></tr>
-</table><br />
-<div class="name-list">
-START:requires
-HREF:aref:name:
-END:requires
-ENDIF:requires
-</div>
-
-IF:methods
-<table cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">Subroutines and Functions</td></tr>
-</table><br />
-<div class="name-list">
-START:methods
-HREF:aref:name:,
-END:methods
-</div>
-ENDIF:methods
-
-IF:attributes
-<table cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">Arguments</td></tr>
-</table><br />
-<table cellspacing="5">
-START:attributes
-     <tr valign="top">
-IF:rw
-       <td align="center" class="attr-rw">&nbsp;[%rw%]&nbsp;</td>
-ENDIF:rw
-IFNOT:rw
-       <td></td>
-ENDIF:rw
-       <td class="attr-name">%name%</td>
-       <td>%a_desc%</td>
-     </tr>
-END:attributes
-</table>
-ENDIF:attributes
-
-IF:classlist
-<table cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">Modules</td></tr>
-</table><br />
-%classlist%<br />
-ENDIF:classlist
-
-  !INCLUDE!  <!-- method descriptions -->
-
-</body>
-</html>
-}
-
-###############################################################################
-
-FILE_PAGE = <<_FILE_PAGE_
-<table width="100%">
- <tr class="title-row">
- <td><table width="100%"><tr>
-   <td class="big-title-font" colspan="2"><font size="-3"><b>File</b><br /></font>%short_name%</td>
-   <td align="right"><table cellspacing="0" cellpadding="2">
-         <tr>
-           <td  class="small-title-font">Path:</td>
-           <td class="small-title-font">%full_path%
-IF:cvsurl
-				&nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
-ENDIF:cvsurl
-           </td>
-         </tr>
-         <tr>
-           <td class="small-title-font">Modified:</td>
-           <td class="small-title-font">%dtm_modified%</td>
-         </tr>
-        </table>
-    </td></tr></table></td>
-  </tr>
-</table><br />
-_FILE_PAGE_
-
-###################################################################
-
-CLASS_PAGE = %{
-<table width="100%" border="0" cellspacing="0">
- <tr class="title-row">
- <td class="big-title-font">
-   <font size="-3"><b>%classmod%</b><br /></font>%full_name%
- </td>
- <td align="right">
-   <table cellspacing="0" cellpadding="2">
-     <tr valign="top">
-      <td class="small-title-font">In:</td>
-      <td class="small-title-font">
-START:infiles
-HREF:full_path_url:full_path:
-IF:cvsurl
-&nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
-ENDIF:cvsurl
-END:infiles
-      </td>
-     </tr>
-IF:parent
-     <tr>
-      <td class="small-title-font">Parent:</td>
-      <td class="small-title-font">
-IF:par_url
-        <a href="%par_url%" class="cyan">
-ENDIF:par_url
-%parent%
-IF:par_url
-         </a>
-ENDIF:par_url
-      </td>
-     </tr>
-ENDIF:parent
-   </table>
-  </td>
-  </tr>
-</table><br />
-}
-
-###################################################################
-
-METHOD_LIST = %{
-IF:includes
-<div class="tablesubsubtitle">Uses</div><br />
-<div class="name-list">
-START:includes
-    <span class="method-name">HREF:aref:name:</span>
-END:includes
-</div>
-ENDIF:includes
-
-IF:method_list
-START:method_list
-IF:methods
-<table cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">%type% %category% methods</td></tr>
-</table>
-START:methods
-<table width="100%" cellspacing="0" cellpadding="5" border="0">
-<tr><td class="methodtitle">
-<a name="%aref%">
-<b>%name%</b>%params% 
-IF:codeurl
-<a href="%codeurl%" target="source" class="srclink">src</a>
-ENDIF:codeurl
-</a></td></tr>
-</table>
-IF:m_desc
-<div class="description">
-%m_desc%
-</div>
-ENDIF:m_desc
-END:methods
-ENDIF:methods
-END:method_list
-ENDIF:method_list
-}
-
-=begin
-=end
-
-########################## Source code ##########################
-
-SRC_PAGE = %{
-<html>
-<head><title>%title%</title>
-<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
-<style type="text/css">
-  .kw { color: #3333FF; font-weight: bold }
-  .cmt { color: green; font-style: italic }
-  .str { color: #662222; font-style: italic }
-  .re  { color: #662222; }
-.ruby-comment    { color: green; font-style: italic }
-.ruby-constant   { color: #4433aa; font-weight: bold; }
-.ruby-identifier { color: #222222;  }
-.ruby-ivar       { color: #2233dd; }
-.ruby-keyword    { color: #3333FF; font-weight: bold }
-.ruby-node       { color: #777777; }
-.ruby-operator   { color: #111111;  }
-.ruby-regexp     { color: #662222; }
-.ruby-value      { color: #662222; font-style: italic }
-</style>
-</head>
-<body bgcolor="#BBBBBB">
-<pre>%code%</pre>
-</body>
-</html>
-}
-
-########################## Index ################################
-
-FR_INDEX_BODY = %{
-!INCLUDE!
-}
-
-FILE_INDEX = %{
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
-<style type="text/css">
-<!--
-  body {
-background-color: #bbbbbb;
-     font-family: #{FONTS}; 
-       font-size: 11px; 
-      font-style: normal;
-     line-height: 14px; 
-           color: #000040;
-  }
-div.banner {
-  background: #bbbbcc;
-  color:      white;
-  padding: 1;
-  margin: 0;
-  font-size: 90%;
-  font-weight: bold;
-  line-height: 1.1;
-  text-align: center;
-  width: 100%;
-}
-  
--->
-</style>
-<base target="docwin">
-</head>
-<body>
-<div class="banner">%list_title%</div>
-START:entries
-<a href="%href%">%name%</a><br />
-END:entries
-</body></html>
-}
-
-CLASS_INDEX = FILE_INDEX
-METHOD_INDEX = FILE_INDEX
-
-INDEX = %{
-<html>
-<head>
-  <title>%title%</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
-</head>
-
-<frameset cols="20%,*">
-    <frameset rows="15%,35%,50%">
-        <frame src="fr_file_index.html"   title="Files" name="Files">
-        <frame src="fr_class_index.html"  name="Modules">
-        <frame src="fr_method_index.html" name="Subroutines and Functions">
-    </frameset>
-    <frameset rows="80%,20%">
-      <frame  src="%initial_page%" name="docwin">
-      <frame  src="blank.html" name="source">
-    </frameset>
-    <noframes>
-          <body bgcolor="#BBBBBB">
-            Click <a href="html/index.html">here</a> for a non-frames
-            version of this page.
-          </body>
-    </noframes>
-</frameset>
-
-</html>
-}
-
-# and a blank page to use as a target
-BLANK = %{
-<html><body bgcolor="#BBBBBB"></body></html>
-}
-
-def write_extra_pages
-  template = TemplatePage.new(BLANK)
-  File.open("blank.html", "w") { |f| template.write_html_on(f, {}) }
-end
-
-end
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generators/template/html/html.rb ../rdoc-f95-20090109-1/generators/template/html/html.rb
--- ruby-1.8.7-p72/lib/rdoc/generators/template/html/html.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/generators/template/html/html.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,711 +0,0 @@
-#
-# = CSS2 RDoc HTML template
-#
-# This is a template for RDoc that uses XHTML 1.0 Transitional and dictates a
-# bit more of the appearance of the output to cascading stylesheets than the
-# default. It was designed for clean inline code display, and uses DHTMl to
-# toggle the visbility of each method's source with each click on the '[source]'
-# link.
-#
-# == Authors
-#
-# * Michael Granger <ged@FaerieMUD.org>
-#
-# Copyright (c) 2002, 2003 The FaerieMUD Consortium. Some rights reserved.
-#
-# This work is licensed under the Creative Commons Attribution License. To view
-# a copy of this license, visit http://creativecommons.org/licenses/by/1.0/ or
-# send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
-# 94305, USA.
-#
-
-module RDoc
-  module Page
-
-    FONTS = "Verdana,Arial,Helvetica,sans-serif"
-
-STYLE = %{
-body {
-    font-family: Verdana,Arial,Helvetica,sans-serif;
-    font-size:   90%;
-    margin: 0;
-    margin-left: 40px;
-    padding: 0;
-    background: white;
-}
-
-h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
-h1 { font-size: 150%; }
-h2,h3,h4 { margin-top: 1em; }
-
-a { background: #eef; color: #039; text-decoration: none; }
-a:hover { background: #039; color: #eef; }
-
-/* Override the base stylesheet's Anchor inside a table cell */
-td > a {
-  background: transparent;
-  color: #039;
-  text-decoration: none;
-}
-
-/* and inside a section title */
-.section-title > a {
-  background: transparent;
-  color: #eee;
-  text-decoration: none;
-}
-
-/* === Structural elements =================================== */
-
-div#index {
-    margin: 0;
-    margin-left: -40px;
-    padding: 0;
-    font-size: 90%;
-}
-
-
-div#index a {
-    margin-left: 0.7em;
-}
-
-div#index .section-bar {
-   margin-left: 0px;
-   padding-left: 0.7em;
-   background: #ccc;
-   font-size: small;
-}
-
-
-div#classHeader, div#fileHeader {
-    width: auto;
-    color: white;
-    padding: 0.5em 1.5em 0.5em 1.5em;
-    margin: 0;
-    margin-left: -40px;
-    border-bottom: 3px solid #006;
-}
-
-div#classHeader a, div#fileHeader a {
-    background: inherit;
-    color: white;
-}
-
-div#classHeader td, div#fileHeader td {
-    background: inherit;
-    color: white;
-}
-
-
-div#fileHeader {
-    background: #057;
-}
-
-div#classHeader {
-    background: #048;
-}
-
-
-.class-name-in-header {
-  font-size:  180%;
-  font-weight: bold;
-}
-
-
-div#bodyContent {
-    padding: 0 1.5em 0 1.5em;
-}
-
-div#description {
-    padding: 0.5em 1.5em;
-    background: #efefef;
-    border: 1px dotted #999;
-}
-
-div#description h1,h2,h3,h4,h5,h6 {
-    color: #125;;
-    background: transparent;
-}
-
-div#validator-badges {
-    text-align: center;
-}
-div#validator-badges img { border: 0; }
-
-div#copyright {
-    color: #333;
-    background: #efefef;
-    font: 0.75em sans-serif;
-    margin-top: 5em;
-    margin-bottom: 0;
-    padding: 0.5em 2em;
-}
-
-
-/* === Classes =================================== */
-
-table.header-table {
-    color: white;
-    font-size: small;
-}
-
-.type-note {
-    font-size: small;
-    color: #DEDEDE;
-}
-
-.xxsection-bar {
-    background: #eee;
-    color: #333;
-    padding: 3px;
-}
-
-.section-bar {
-   color: #333;
-   border-bottom: 1px solid #999;
-    margin-left: -20px;
-}
-
-
-.section-title {
-    background: #79a;
-    color: #eee;
-    padding: 3px;
-    margin-top: 2em;
-    margin-left: -30px;
-    border: 1px solid #999;
-}
-
-.top-aligned-row {  vertical-align: top }
-.bottom-aligned-row { vertical-align: bottom }
-
-/* --- Context section classes ----------------------- */
-
-.context-row { }
-.context-item-name { font-family: monospace; font-weight: bold; color: black; }
-.context-item-value { font-size: small; color: #448; }
-.context-item-desc { color: #333; padding-left: 2em; }
-
-/* --- Method classes -------------------------- */
-.method-detail {
-    background: #efefef;
-    padding: 0;
-    margin-top: 0.5em;
-    margin-bottom: 1em;
-    border: 1px dotted #ccc;
-}
-.method-heading {
-  color: black;
-  background: #ccc;
-  border-bottom: 1px solid #666;
-  padding: 0.2em 0.5em 0 0.5em;
-}
-.method-signature { color: black; background: inherit; }
-.method-name { font-weight: bold; }
-.method-args { font-style: italic; }
-.method-description { padding: 0 0.5em 0 0.5em; }
-
-/* --- Source code sections -------------------- */
-
-a.source-toggle { font-size: 90%; }
-div.method-source-code {
-    background: #262626;
-    color: #ffdead;
-    margin: 1em;
-    padding: 0.5em;
-    border: 1px dashed #999;
-    overflow: hidden;
-}
-
-div.method-source-code pre { color: #ffdead; overflow: hidden; }
-
-/* --- Ruby keyword styles --------------------- */
-
-.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
-
-.ruby-constant  { color: #7fffd4; background: transparent; }
-.ruby-keyword { color: #00ffff; background: transparent; }
-.ruby-ivar    { color: #eedd82; background: transparent; }
-.ruby-operator  { color: #00ffee; background: transparent; }
-.ruby-identifier { color: #ffdead; background: transparent; }
-.ruby-node    { color: #ffa07a; background: transparent; }
-.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
-.ruby-regexp  { color: #ffa07a; background: transparent; }
-.ruby-value   { color: #7fffd4; background: transparent; }
-}
-
-
-#####################################################################
-### H E A D E R   T E M P L A T E  
-#####################################################################
-
-XHTML_PREAMBLE = %{<?xml version="1.0" encoding="%charset%"?>
-<!DOCTYPE html 
-     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-}
-
-HEADER = XHTML_PREAMBLE + %{
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-  <title>%title%</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
-  <meta http-equiv="Content-Script-Type" content="text/javascript" />
-  <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
-  <script type="text/javascript">
-  // <![CDATA[
-
-  function popupCode( url ) {
-    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
-  }
-
-  function toggleCode( id ) {
-    if ( document.getElementById )
-      elem = document.getElementById( id );
-    else if ( document.all )
-      elem = eval( "document.all." + id );
-    else
-      return false;
-
-    elemStyle = elem.style;
-    
-    if ( elemStyle.display != "block" ) {
-      elemStyle.display = "block"
-    } else {
-      elemStyle.display = "none"
-    }
-
-    return true;
-  }
-  
-  // Make codeblocks hidden by default
-  document.writeln( "<style type=\\"text/css\\">div.method-source-code { display: none }</style>" )
-  
-  // ]]>
-  </script>
-
-</head>
-<body>
-}
-
-
-#####################################################################
-### C O N T E X T   C O N T E N T   T E M P L A T E
-#####################################################################
-
-CONTEXT_CONTENT = %{
-}
-
-
-#####################################################################
-### F O O T E R   T E M P L A T E
-#####################################################################
-FOOTER = %{
-<div id="validator-badges">
-  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
-</div>
-
-</body>
-</html>
-}
-
-
-#####################################################################
-### F I L E   P A G E   H E A D E R   T E M P L A T E
-#####################################################################
-
-FILE_PAGE = %{
-  <div id="fileHeader">
-    <h1>%short_name%</h1>
-    <table class="header-table">
-    <tr class="top-aligned-row">
-      <td><strong>Path:</strong></td>
-      <td>%full_path%
-IF:cvsurl
-        &nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
-ENDIF:cvsurl
-      </td>
-    </tr>
-    <tr class="top-aligned-row">
-      <td><strong>Last Update:</strong></td>
-      <td>%dtm_modified%</td>
-    </tr>
-    </table>
-  </div>
-}
-
-
-#####################################################################
-### C L A S S   P A G E   H E A D E R   T E M P L A T E
-#####################################################################
-
-CLASS_PAGE = %{
-    <div id="classHeader">
-        <table class="header-table">
-        <tr class="top-aligned-row">
-          <td><strong>%classmod%</strong></td>
-          <td class="class-name-in-header">%full_name%</td>
-        </tr>
-        <tr class="top-aligned-row">
-            <td><strong>In:</strong></td>
-            <td>
-START:infiles
-IF:full_path_url
-                <a href="%full_path_url%">
-ENDIF:full_path_url
-                %full_path%
-IF:full_path_url
-                </a>
-ENDIF:full_path_url
-IF:cvsurl
-        &nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
-ENDIF:cvsurl
-        <br />
-END:infiles
-            </td>
-        </tr>
-
-IF:parent
-        <tr class="top-aligned-row">
-            <td><strong>Parent:</strong></td>
-            <td>
-IF:par_url
-                <a href="%par_url%">
-ENDIF:par_url
-                %parent%
-IF:par_url
-               </a>
-ENDIF:par_url
-            </td>
-        </tr>
-ENDIF:parent
-        </table>
-    </div>
-}
-
-
-#####################################################################
-### M E T H O D   L I S T   T E M P L A T E
-#####################################################################
-
-METHOD_LIST = %{
-
-  <div id="contextContent">
-IF:diagram
-    <div id="diagram">
-      %diagram%
-    </div>
-ENDIF:diagram
-
-IF:description
-    <div id="description">
-      %description%
-    </div>
-ENDIF:description
-
-IF:requires
-    <div id="requires-list">
-      <h3 class="section-bar">Required files</h3>
-
-      <div class="name-list">
-START:requires
-      HREF:aref:name:&nbsp;&nbsp;
-END:requires
-      </div>
-    </div>
-ENDIF:requires
-
-IF:toc
-    <div id="contents-list">
-      <h3 class="section-bar">Contents</h3>
-      <ul>
-START:toc
-      <li><a href="#%href%">%secname%</a></li>
-END:toc
-     </ul>
-ENDIF:toc
-   </div>
-
-IF:methods
-    <div id="method-list">
-      <h3 class="section-bar">Methods</h3>
-
-      <div class="name-list">
-START:methods
-      HREF:aref:name:&nbsp;&nbsp;
-END:methods
-      </div>
-    </div>
-ENDIF:methods
-
-  </div>
-
-
-    <!-- if includes -->
-IF:includes
-    <div id="includes">
-      <h3 class="section-bar">Included Modules</h3>
-
-      <div id="includes-list">
-START:includes
-        <span class="include-name">HREF:aref:name:</span>
-END:includes
-      </div>
-    </div>
-ENDIF:includes
-
-START:sections
-    <div id="section">
-IF:sectitle
-      <h2 class="section-title"><a name="%secsequence%">%sectitle%</a></h2>
-IF:seccomment
-      <div class="section-comment">
-        %seccomment%
-      </div>      
-ENDIF:seccomment
-ENDIF:sectitle
-
-IF:classlist
-    <div id="class-list">
-      <h3 class="section-bar">Classes and Modules</h3>
-
-      %classlist%
-    </div>
-ENDIF:classlist
-
-IF:constants
-    <div id="constants-list">
-      <h3 class="section-bar">Constants</h3>
-
-      <div class="name-list">
-        <table summary="Constants">
-START:constants
-        <tr class="top-aligned-row context-row">
-          <td class="context-item-name">%name%</td>
-          <td>=</td>
-          <td class="context-item-value">%value%</td>
-IF:desc
-          <td width="3em">&nbsp;</td>
-          <td class="context-item-desc">%desc%</td>
-ENDIF:desc
-        </tr>
-END:constants
-        </table>
-      </div>
-    </div>
-ENDIF:constants
-
-IF:aliases
-    <div id="aliases-list">
-      <h3 class="section-bar">External Aliases</h3>
-
-      <div class="name-list">
-                        <table summary="aliases">
-START:aliases
-        <tr class="top-aligned-row context-row">
-          <td class="context-item-name">%old_name%</td>
-          <td>-&gt;</td>
-          <td class="context-item-value">%new_name%</td>
-        </tr>
-IF:desc
-      <tr class="top-aligned-row context-row">
-        <td>&nbsp;</td>
-        <td colspan="2" class="context-item-desc">%desc%</td>
-      </tr>
-ENDIF:desc
-END:aliases
-                        </table>
-      </div>
-    </div>
-ENDIF:aliases
-
-
-IF:attributes
-    <div id="attribute-list">
-      <h3 class="section-bar">Attributes</h3>
-
-      <div class="name-list">
-        <table>
-START:attributes
-        <tr class="top-aligned-row context-row">
-          <td class="context-item-name">%name%</td>
-IF:rw
-          <td class="context-item-value">&nbsp;[%rw%]&nbsp;</td>
-ENDIF:rw
-IFNOT:rw
-          <td class="context-item-value">&nbsp;&nbsp;</td>
-ENDIF:rw
-          <td class="context-item-desc">%a_desc%</td>
-        </tr>
-END:attributes
-        </table>
-      </div>
-    </div>
-ENDIF:attributes
-      
-
-
-    <!-- if method_list -->
-IF:method_list
-    <div id="methods">
-START:method_list
-IF:methods
-      <h3 class="section-bar">%type% %category% methods</h3>
-
-START:methods
-      <div id="method-%aref%" class="method-detail">
-        <a name="%aref%"></a>
-
-        <div class="method-heading">
-IF:codeurl
-          <a href="%codeurl%" target="Code" class="method-signature"
-            onclick="popupCode('%codeurl%');return false;">
-ENDIF:codeurl
-IF:sourcecode
-          <a href="#%aref%" class="method-signature">
-ENDIF:sourcecode
-IF:callseq
-          <span class="method-name">%callseq%</span>
-ENDIF:callseq
-IFNOT:callseq
-          <span class="method-name">%name%</span><span class="method-args">%params%</span>
-ENDIF:callseq
-IF:codeurl
-          </a>
-ENDIF:codeurl
-IF:sourcecode
-          </a>
-ENDIF:sourcecode
-        </div>
-      
-        <div class="method-description">
-IF:m_desc
-          %m_desc%
-ENDIF:m_desc
-IF:sourcecode
-          <p><a class="source-toggle" href="#"
-            onclick="toggleCode('%aref%-source');return false;">[Source]</a></p>
-          <div class="method-source-code" id="%aref%-source">
-<pre>
-%sourcecode%
-</pre>
-          </div>
-ENDIF:sourcecode
-        </div>
-      </div>
-
-END:methods
-ENDIF:methods
-END:method_list
-
-    </div>
-ENDIF:method_list
-END:sections
-}
-
-
-#####################################################################
-### B O D Y   T E M P L A T E
-#####################################################################
-
-BODY = HEADER + %{
-
-!INCLUDE!  <!-- banner header -->
-
-  <div id="bodyContent">
-
-} +  METHOD_LIST + %{
-
-  </div>
-
-} + FOOTER
-
-
-
-#####################################################################
-### S O U R C E   C O D E   T E M P L A T E
-#####################################################################
-
-SRC_PAGE = XHTML_PREAMBLE + %{
-<html>
-<head>
-  <title>%title%</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
-  <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
-</head>
-<body class="standalone-code">
-  <pre>%code%</pre>
-</body>
-</html>
-}
-
-
-#####################################################################
-### I N D E X   F I L E   T E M P L A T E S
-#####################################################################
-
-FR_INDEX_BODY = %{
-!INCLUDE!
-}
-
-FILE_INDEX = XHTML_PREAMBLE + %{
-<!--
-
-    %list_title%
-
-  -->
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-  <title>%list_title%</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
-  <link rel="stylesheet" href="%style_url%" type="text/css" />
-  <base target="docwin" />
-</head>
-<body>
-<div id="index">
-  <h1 class="section-bar">%list_title%</h1>
-  <div id="index-entries">
-START:entries
-    <a href="%href%">%name%</a><br />
-END:entries
-  </div>
-</div>
-</body>
-</html>
-}
-
-CLASS_INDEX = FILE_INDEX
-METHOD_INDEX = FILE_INDEX
-
-INDEX = %{<?xml version="1.0" encoding="%charset%"?>
-<!DOCTYPE html 
-     PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
-     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
-
-<!--
-
-    %title%
-
-  -->
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-  <title>%title%</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
-</head>
-<frameset rows="20%, 80%">
-    <frameset cols="25%,35%,45%">
-        <frame src="fr_file_index.html"   title="Files" name="Files" />
-        <frame src="fr_class_index.html"  name="Classes" />
-        <frame src="fr_method_index.html" name="Methods" />
-    </frameset>
-    <frame src="%initial_page%" name="docwin" />
-</frameset>
-</html>
-}
-
-
-
-  end # module Page
-end # class RDoc
-
-require 'rdoc/generators/template/html/one_page_html'
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generators/template/html/kilmer.rb ../rdoc-f95-20090109-1/generators/template/html/kilmer.rb
--- ruby-1.8.7-p72/lib/rdoc/generators/template/html/kilmer.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/generators/template/html/kilmer.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,435 +0,0 @@
-module RDoc
-module Page
-
-
-FONTS = "Verdana, Arial, Helvetica, sans-serif"
-
-STYLE = %{
-body,td,p { font-family: %fonts%; 
-       color: #000040;
-}
-
-.attr-rw { font-size: xx-small; color: #444488 }
-
-.title-row { background-color: #CCCCFF;
-             color:      #000010;
-}
-
-.big-title-font { 
-  color: black;
-  font-weight: bold;
-  font-family: %fonts%; 
-  font-size: large; 
-  height: 60px;
-  padding: 10px 3px 10px 3px;
-}
-
-.small-title-font { color: black;
-                    font-family: %fonts%;
-                    font-size:10; }
-
-.aqua { color: black }
-
-.method-name, .attr-name {
-      font-family: font-family: %fonts%; 
-      font-weight: bold;
-      font-size: small;
-      margin-left: 20px;
-      color: #000033;
-}
-
-.tablesubtitle, .tablesubsubtitle {
-   width: 100%;
-   margin-top: 1ex;
-   margin-bottom: .5ex;
-   padding: 5px 0px 5px 3px;
-   font-size: large;
-   color: black;
-   background-color: #CCCCFF;
-   border: thin;
-}
-
-.name-list {
-  margin-left: 5px;
-  margin-bottom: 2ex;
-  line-height: 105%;
-}
-
-.description {
-  margin-left: 5px;
-  margin-bottom: 2ex;
-  line-height: 105%;
-  font-size: small;
-}
-
-.methodtitle {
-  font-size: small;
-  font-weight: bold;
-  text-decoration: none;
-  color: #000033;
-  background-color: white; 
-}
-
-.srclink {
-  font-size: small;
-  font-weight: bold;
-  text-decoration: none;
-  color: #0000DD;
-  background-color: white;
-}
-
-.paramsig {
-   font-size: small;
-}
-
-.srcbut { float: right }
-
-}
-
-
-############################################################################
-
-
-BODY = %{
-<html><head>
-  <title>%title%</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
-  <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
-  <script type="text/javascript" language="JavaScript">
-  <!--
-  function popCode(url) {
-    parent.frames.source.location = url
-  }
-  //-->
-  </script>
-</head>
-<body bgcolor="white">
-
-!INCLUDE!  <!-- banner header -->
-
-IF:diagram
-<table width="100%"><tr><td align="center">
-%diagram%
-</td></tr></table>
-ENDIF:diagram
-
-IF:description
-<div class="description">%description%</div>
-ENDIF:description
-
-IF:requires
-<table cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">Required files</td></tr>
-</table><br />
-<div class="name-list">
-START:requires
-HREF:aref:name:
-END:requires
-ENDIF:requires
-</div>
-
-IF:methods
-<table cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">Methods</td></tr>
-</table><br />
-<div class="name-list">
-START:methods
-HREF:aref:name:,
-END:methods
-</div>
-ENDIF:methods
-
-
-START:sections
-    <div id="section">
-IF:sectitle
-      <h2 class="section-title"><a name="%secsequence%">%sectitle%</a></h2>
-IF:seccomment
-      <div class="section-comment">
-        %seccomment%
-      </div>      
-ENDIF:seccomment
-ENDIF:sectitle
-
-IF:attributes
-<table cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">Attributes</td></tr>
-</table><br />
-<table cellspacing="5">
-START:attributes
-     <tr valign="top">
-IF:rw
-       <td align="center" class="attr-rw">&nbsp;[%rw%]&nbsp;</td>
-ENDIF:rw
-IFNOT:rw
-       <td></td>
-ENDIF:rw
-       <td class="attr-name">%name%</td>
-       <td>%a_desc%</td>
-     </tr>
-END:attributes
-</table>
-ENDIF:attributes
-
-IF:classlist
-<table cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">Classes and Modules</td></tr>
-</table><br />
-%classlist%<br />
-ENDIF:classlist
-
-  !INCLUDE!  <!-- method descriptions -->
-
-END:sections
-
-</body>
-</html>
-}
-
-###############################################################################
-
-FILE_PAGE = <<_FILE_PAGE_
-<table width="100%">
- <tr class="title-row">
- <td><table width="100%"><tr>
-   <td class="big-title-font" colspan="2"><font size="-3"><b>File</b><br /></font>%short_name%</td>
-   <td align="right"><table cellspacing="0" cellpadding="2">
-         <tr>
-           <td  class="small-title-font">Path:</td>
-           <td class="small-title-font">%full_path%
-IF:cvsurl
-				&nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
-ENDIF:cvsurl
-           </td>
-         </tr>
-         <tr>
-           <td class="small-title-font">Modified:</td>
-           <td class="small-title-font">%dtm_modified%</td>
-         </tr>
-        </table>
-    </td></tr></table></td>
-  </tr>
-</table><br />
-_FILE_PAGE_
-
-###################################################################
-
-CLASS_PAGE = %{
-<table width="100%" border="0" cellspacing="0">
- <tr class="title-row">
- <td class="big-title-font">
-   <font size="-3"><b>%classmod%</b><br /></font>%full_name%
- </td>
- <td align="right">
-   <table cellspacing="0" cellpadding="2">
-     <tr valign="top">
-      <td class="small-title-font">In:</td>
-      <td class="small-title-font">
-START:infiles
-HREF:full_path_url:full_path:
-IF:cvsurl
-&nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
-ENDIF:cvsurl
-END:infiles
-      </td>
-     </tr>
-IF:parent
-     <tr>
-      <td class="small-title-font">Parent:</td>
-      <td class="small-title-font">
-IF:par_url
-        <a href="%par_url%" class="cyan">
-ENDIF:par_url
-%parent%
-IF:par_url
-         </a>
-ENDIF:par_url
-      </td>
-     </tr>
-ENDIF:parent
-   </table>
-  </td>
-  </tr>
-</table><br />
-}
-
-###################################################################
-
-METHOD_LIST = %{
-IF:includes
-<div class="tablesubsubtitle">Included modules</div><br />
-<div class="name-list">
-START:includes
-    <span class="method-name">HREF:aref:name:</span>
-END:includes
-</div>
-ENDIF:includes
-
-IF:method_list
-START:method_list
-IF:methods
-<table cellpadding=5 width="100%">
-<tr><td class="tablesubtitle">%type% %category% methods</td></tr>
-</table>
-START:methods
-<table width="100%" cellspacing="0" cellpadding="5" border="0">
-<tr><td class="methodtitle">
-<a name="%aref%">
-IF:callseq
-<b>%callseq%</b>
-ENDIF:callseq
-IFNOT:callseq
- <b>%name%</b>%params%
-ENDIF:callseq
-IF:codeurl
-<a href="%codeurl%" target="source" class="srclink">src</a>
-ENDIF:codeurl
-</a></td></tr>
-</table>
-IF:m_desc
-<div class="description">
-%m_desc%
-</div>
-ENDIF:m_desc
-IF:aka
-<div class="aka">
-This method is also aliased as
-START:aka
-<a href="%aref%">%name%</a>
-END:aka
-</div>
-ENDIF:aka
-IF:sourcecode
-<pre class="source">
-%sourcecode%
-</pre>
-ENDIF:sourcecode
-END:methods
-ENDIF:methods
-END:method_list
-ENDIF:method_list
-}
-
-=begin
-=end
-
-########################## Source code ##########################
-
-SRC_PAGE = %{
-<html>
-<head><title>%title%</title>
-<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
-<style type="text/css">
-.ruby-comment    { color: green; font-style: italic }
-.ruby-constant   { color: #4433aa; font-weight: bold; }
-.ruby-identifier { color: #222222;  }
-.ruby-ivar       { color: #2233dd; }
-.ruby-keyword    { color: #3333FF; font-weight: bold }
-.ruby-node       { color: #777777; }
-.ruby-operator   { color: #111111;  }
-.ruby-regexp     { color: #662222; }
-.ruby-value      { color: #662222; font-style: italic }
-  .kw { color: #3333FF; font-weight: bold }
-  .cmt { color: green; font-style: italic }
-  .str { color: #662222; font-style: italic }
-  .re  { color: #662222; }
-</style>
-</head>
-<body bgcolor="white">
-<pre>%code%</pre>
-</body>
-</html>
-}
-
-########################## Index ################################
-
-FR_INDEX_BODY = %{
-!INCLUDE!
-}
-
-FILE_INDEX = %{
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
-<style>
-<!--
-  body {
-background-color: #ddddff;
-     font-family: #{FONTS}; 
-       font-size: 11px; 
-      font-style: normal;
-     line-height: 14px; 
-           color: #000040;
-  }
-div.banner {
-  background: #0000aa;
-  color:      white;
-  padding: 1;
-  margin: 0;
-  font-size: 90%;
-  font-weight: bold;
-  line-height: 1.1;
-  text-align: center;
-  width: 100%;
-}
-  
--->
-</style>
-<base target="docwin">
-</head>
-<body>
-<div class="banner">%list_title%</div>
-START:entries
-<a href="%href%">%name%</a><br />
-END:entries
-</body></html>
-}
-
-CLASS_INDEX = FILE_INDEX
-METHOD_INDEX = FILE_INDEX
-
-INDEX = %{
-<html>
-<head>
-  <title>%title%</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=%charset%">
-</head>
-
-<frameset cols="20%,*">
-    <frameset rows="15%,35%,50%">
-        <frame src="fr_file_index.html"   title="Files" name="Files">
-        <frame src="fr_class_index.html"  name="Classes">
-        <frame src="fr_method_index.html" name="Methods">
-    </frameset>
-IF:inline_source
-      <frame  src="%initial_page%" name="docwin">
-ENDIF:inline_source
-IFNOT:inline_source
-    <frameset rows="80%,20%">
-      <frame  src="%initial_page%" name="docwin">
-      <frame  src="blank.html" name="source">
-    </frameset>
-ENDIF:inline_source
-    <noframes>
-          <body bgcolor="white">
-            Click <a href="html/index.html">here</a> for a non-frames
-            version of this page.
-          </body>
-    </noframes>
-</frameset>
-
-</html>
-}
-
-# and a blank page to use as a target
-BLANK = %{
-<html><body bgcolor="white"></body></html>
-}
-
-def write_extra_pages
-  template = TemplatePage.new(BLANK)
-  File.open("blank.html", "w") { |f| template.write_html_on(f, {}) }
-end
-
-end
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generators/template/html/old_html.rb ../rdoc-f95-20090109-1/generators/template/html/old_html.rb
--- ruby-1.8.7-p72/lib/rdoc/generators/template/html/old_html.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/generators/template/html/old_html.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,728 +0,0 @@
-module RDoc
-
-# This is how you define the HTML that RDoc generates. Simply create
-# a file in rdoc/generators/html_templates that creates the
-# module RDoc::Page and populate it as described below. Then invoke
-# rdoc using the --template <name of your file> option, and
-# your template will be used.
-#
-# The constants defining pages use a simple templating system:
-#
-# * The templating system is passed a hash. Keys in the hash correspond
-#   to tags on this page. The tag %abc% is looked up in the hash,
-#   and is replaced by the corresponding hash value.
-#
-# * Some tags are optional. You can detect this using IF/ENDIF
-#
-#      IF: title
-#      The value of title is %title%
-#      ENDIF: title
-#
-# * Some entries in the hash have values that are arrays, where each
-#   entry in the array is itself a hash. These are used to generate
-#   lists using the START: construct. For example, given a hash
-#   containing
-# 
-#      { 'people' => [ { 'name' => 'Fred', 'age' => '12' },
-#                      { 'name' => 'Mary', 'age' => '21' } ]
-#
-#   You could generate a simple table using
-#
-#      <table>
-#      START:people
-#        <tr><td>%name%<td>%age%</tr>
-#      END:people
-#      </table>
-#
-#   These lists can be nested to an arbitrary depth
-#
-# * the construct HREF:url:name: generates <a href="%url%">%name%</a>
-#   if +url+ is defined in the hash, or %name% otherwise.
-#
-#
-# Your file must contain the following constants
-#
-# [*FONTS*]  a list of fonts to be used
-# [*STYLE*]  a CSS section (without the <style> or comments). This is
-#            used to generate a style.css file
-#
-# [*BODY*] 
-#   The main body of all non-index RDoc pages. BODY will contain
-#   two !INCLUDE!s. The first is used to include a document-type
-#   specific header (FILE_PAGE or CLASS_PAGE). The second include
-#   is for the method list (METHOD_LIST). THe body is passed:
-#
-#   %title%::
-#       the page's title
-#
-#   %style_url%::
-#       the url of a style sheet for this page
-#
-#   %diagram%::
-#       the optional URL of a diagram for this page
-#
-#   %description%::
-#       a (potentially multi-paragraph) string containing the
-#       description for th file/class/module.
-#
-#   %requires%::
-#       an optional list of %aref%/%name% pairs, one for each module
-#       required by this file.
-#
-#   %methods%::
-#       an optional list of %aref%/%name%, one for each method
-#       documented on this page. This is intended to be an index.
-#
-#   %attributes%::  
-#       An optional list. For each attribute it contains:
-#       %name%::   the attribute name
-#       %rw%::     r/o, w/o, or r/w
-#       %a_desc%:: description of the attribute
-#
-#   %classlist%:: 
-#       An optional string containing an already-formatted list of
-#       classes and modules documented in this file
-#
-#   For FILE_PAGE entries, the body will be passed
-#
-#   %short_name%::  
-#       The name of the file
-#
-#   %full_path%::
-#       The full path to the file
-#
-#   %dtm_modified%::
-#       The date/time the file was last changed
-#
-#   For class and module pages, the body will be passed
-#
-#   %classmod%::
-#       The name of the class or module
-#
-#   %files%::
-#       A list. For each file this class is defined in, it contains:
-#       %full_path_url%:: an (optional) URL of the RDoc page
-#                         for this file
-#       %full_path%::     the name of the file
-#
-#   %par_url%::
-#       The (optional) URL of the RDoc page documenting this class's
-#       parent class
-#
-#   %parent%::
-#       The name of this class's parent.
-#
-#   For both files and classes, the body is passed the following information
-#   on includes and methods:
-#
-#   %includes%::    
-#       Optional list of included modules. For each, it receives
-#       %aref%:: optional URL to RDoc page for the module
-#       %name%:: the name of the module
-#
-#   %method_list%::
-#       Optional list of methods of a particular class and category.
-#
-#   Each method list entry contains:
-#
-#   %type%::        public/private/protected
-#   %category%::    instance/class
-#   %methods%::     a list of method descriptions
-#
-#   Each method description contains:
-#
-#   %aref%::        a target aref, used when referencing this method
-#                   description. You should code this as <a name="%aref%">
-#   %codeurl%::     the optional URL to the page containing this method's
-#                   source code.
-#   %name%::        the method's name
-#   %params%::      the method's parameters
-#   %callseq%::     a full calling sequence
-#   %m_desc%::      the (potentially multi-paragraph) description of
-#                   this method.
-#
-# [*CLASS_PAGE*]
-#         Header for pages documenting classes and modules. See
-#         BODY above for the available parameters.
-#
-# [*FILE_PAGE*]
-#         Header for pages documenting files. See
-#         BODY above for the available parameters.
-#
-# [*METHOD_LIST*]
-#         Controls the display of the listing of methods. See BODY for
-#         parameters.
-#
-# [*INDEX*]
-#         The top-level index page. For a browser-like environment
-#         define a frame set that includes the file, class, and 
-#         method indices. Passed
-#         %title%:: title of page
-#         %initial_page% :: url of initial page to display
-#
-# [*CLASS_INDEX*]
-#         Individual files for the three indexes. Passed:
-#         %index_url%:: URL of main index page
-#         %entries%::   List of
-#                       %name%:: name of an index entry
-#                       %href%:: url of corresponding page
-# [*METHOD_INDEX*]
-#         Same as CLASS_INDEX for methods
-#
-# [*FILE_INDEX*]
-#         Same as CLASS_INDEX for methods
-#
-# [*FR_INDEX_BODY*]
-#         A wrapper around CLASS_INDEX, METHOD_INDEX, and FILE_INDEX.
-#         If those index strings contain the complete HTML for the
-#         output, then FR_INDEX_BODY can simply be !INCLUDE!
-#
-# [*SRC_PAGE*]
-#         Page used to display source code. Passed %title% and %code%,
-#         the latter being a multi-line string of code.
-
-module Page
-
-FONTS = "Verdana, Arial, Helvetica, sans-serif"
-
-STYLE = %{
-body,td,p { font-family: %fonts%; 
-       color: #000040;
-}
-
-.attr-rw { font-size: x-small; color: #444488 }
-
-.title-row { background: #0000aa;
-             color:      #eeeeff;
-}
-
-.big-title-font { color: white;
-                  font-family: %fonts%;
-                  font-size: large; 
-                  height: 50px}
-
-.small-title-font { color: aqua;
-                    font-family: %fonts%;
-                    font-size: xx-small; }
-
-.aqua { color: aqua }
-
-.method-name, attr-name {
-      font-family: monospace; font-weight: bold;
-}
-
-.tablesubtitle, .tablesubsubtitle {
-   width: 100%;
-   margin-top: 1ex;
-   margin-bottom: .5ex;
-   padding: 5px 0px 5px 20px;
-   font-size: large;
-   color: aqua;
-   background: #3333cc;
-}
-
-.name-list {
-  font-family: monospace;
-  margin-left: 40px;
-  margin-bottom: 2ex;
-  line-height: 140%;
-}
-
-.description {
-  margin-left: 40px;
-  margin-top: -2ex;
-  margin-bottom: 2ex;
-}
-
-.description p {
-  line-height: 140%;
-}
-
-.aka {
-  margin-left: 40px;
-  margin-bottom: 2ex;
-  line-height: 100%;
-  font-size:   small;
-  color:       #808080;
-}
-
-.methodtitle {
-  font-size: medium;
-  text-decoration: none;
-  color: #0000AA;
-  background: white; 
-}
-
-.paramsig {
-   font-size: small;
-}
-
-.srcbut { float: right }
-
-pre { font-size: 1.2em; }
-tt  { font-size: 1.2em; }
-
-pre.source {
-  border-style: groove;
-  background-color: #ddddff;
-  margin-left:  40px;
-  padding: 1em 0em 1em 2em;
-}
-
-.classlist {
-  margin-left: 40px;
-  margin-bottom: 2ex;
-  line-height: 140%;
-}
-
-li {
-  display:    list-item;
-  margin-top: .6em;
-}
-
-.ruby-comment    { color: green; font-style: italic }
-.ruby-constant   { color: #4433aa; font-weight: bold; }
-.ruby-identifier { color: #222222;  }
-.ruby-ivar       { color: #2233dd; }
-.ruby-keyword    { color: #3333FF; font-weight: bold }
-.ruby-node       { color: #777777; }
-.ruby-operator   { color: #111111;  }
-.ruby-regexp     { color: #662222; }
-.ruby-value      { color: #662222; font-style: italic }
-
-}
-
-
-############################################################################
-
-
-HEADER = %{
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-  <title>%title%</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
-  <link rel=StyleSheet href="%style_url%" type="text/css" media="screen" />
-  <script type="text/javascript" language="JavaScript">
-  <!--
-  function popCode(url) {
-    window.open(url, "Code", 
-          "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
-  }
-  //-->
-  </script>
-</head>
-}
-
-
-###################################################################
-
-METHOD_LIST = %{
-IF:includes
-<table summary="Included modules" cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">Included modules</td></tr>
-</table>
-<div class="name-list">
-START:includes
-    <span class="method-name">HREF:aref:name:</span>
-END:includes
-</div>
-ENDIF:includes
-
-IF:method_list
-START:method_list
-IF:methods
-<table summary="Method list" cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">%type% %category% methods</td></tr>
-</table>
-START:methods
-<table summary="method"  width="100%" cellspacing="0" cellpadding="5" border="0">
-<tr><td class="methodtitle">
-<a name="%aref%"></a>
-IF:codeurl
-<a href="%codeurl%" target="Code" class="methodtitle"
- onClick="popCode('%codeurl%');return false;">
-ENDIF:codeurl
-IF:callseq
-<b>%callseq%</b>
-ENDIF:callseq
-IFNOT:callseq
-<b>%name%</b>%params%
-ENDIF:callseq
-IF:codeurl
-</a>
-ENDIF:codeurl
-</td></tr>
-</table>
-IF:m_desc
-<div class="description">
-%m_desc%
-</div>
-ENDIF:m_desc
-IF:aka
-<div class="aka">
-This method is also aliased as
-START:aka
-<a href="%aref%">%name%</a>
-END:aka
-</div>
-ENDIF:aka
-IF:sourcecode
-<pre class="source">
-%sourcecode%
-</pre>
-ENDIF:sourcecode
-END:methods
-ENDIF:methods
-END:method_list
-ENDIF:method_list
-}
-
-###################################################################
-
-CONTEXT_CONTENT = %{
-IF:diagram
-<table summary="Diagram of classes and modules" width="100%">
-<tr><td align="center">
-%diagram%
-</td></tr></table>
-ENDIF:diagram
-
-
-IF:description
-<div class="description">%description%</div>
-ENDIF:description
-
-IF:requires
-<table summary="Requires" cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">Required files</td></tr>
-</table>
-<div class="name-list">
-START:requires
-HREF:aref:name:&nbsp; &nbsp;
-END:requires
-</div>
-ENDIF:requires
-
-IF:methods
-<table summary="Methods" cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">Methods</td></tr>
-</table>
-<div class="name-list">
-START:methods
-HREF:aref:name:&nbsp; &nbsp;
-END:methods
-</div>
-ENDIF:methods
-
-IF:constants
-<table summary="Constants" cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">Constants</td></tr>
-</table>
-<table cellpadding="5">
-START:constants
-<tr valign="top"><td>%name%</td><td>=</td><td>%value%</td></tr>
-IF:desc
-<tr><td></td><td></td><td>%desc%</td></tr>
-ENDIF:desc
-END:constants
-</table>
-ENDIF:constants
-
-IF:aliases
-<table summary="Aliases" cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">External Aliases</td></tr>
-</table>
-<div class="name-list">
-START:aliases
-%old_name% -> %new_name%<br />
-END:aliases
-</div>
-ENDIF:aliases
-
-IF:attributes
-<table summary="Attributes" cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">Attributes</td></tr>
-</table>
-<table summary="Attribute details" cellspacing="5">
-START:attributes
-     <tr valign="top">
-       <td class="attr-name">%name%</td>
-IF:rw
-       <td align="center" class="attr-rw">&nbsp;[%rw%]&nbsp;</td>
-ENDIF:rw
-IFNOT:rw
-       <td></td>
-ENDIF:rw
-       <td>%a_desc%</td>
-     </tr>
-END:attributes
-</table>
-ENDIF:attributes
-
-IF:classlist
-<table summary="List of classes" cellpadding="5" width="100%">
-<tr><td class="tablesubtitle">Classes and Modules</td></tr>
-</table>
-<div class="classlist">
-%classlist%
-</div>
-ENDIF:classlist
-}
-
-###############################################################################
-
-BODY = HEADER + %{
-<body bgcolor="white">
-!INCLUDE!  <!-- banner header -->
-} +
-CONTEXT_CONTENT + METHOD_LIST +
-%{
-</body>
-</html>
-}
-
-
-###############################################################################
-
-FILE_PAGE = <<_FILE_PAGE_
-<table summary="Information on file" width="100%">
- <tr class="title-row">
- <td><table summary="layout" width="100%"><tr>
-   <td class="big-title-font" colspan="2">%short_name%</td>
-   <td align="right"><table summary="layout" cellspacing="0" cellpadding="2">
-         <tr>
-           <td  class="small-title-font">Path:</td>
-           <td class="small-title-font">%full_path%
-IF:cvsurl
-				&nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
-ENDIF:cvsurl
-           </td>
-         </tr>
-         <tr>
-           <td class="small-title-font">Modified:</td>
-           <td class="small-title-font">%dtm_modified%</td>
-         </tr>
-        </table>
-    </td></tr></table></td>
-  </tr>
-</table>
-_FILE_PAGE_
-
-###################################################################
-
-CLASS_PAGE = %{
-<table summary="Information on class" width="100%" border="0" cellspacing="0">
- <tr class="title-row">
- <td class="big-title-font">
-   <sup><font color="aqua">%classmod%</font></sup> %full_name%
- </td>
- <td align="right">
-   <table summary="layout" cellspacing="0" cellpadding="2">
-     <tr valign="top">
-      <td class="small-title-font">In:</td>
-      <td class="small-title-font">
-START:infiles
-IF:full_path_url
-        <a href="%full_path_url%" class="aqua">
-ENDIF:full_path_url
-%full_path%
-IF:full_path_url
-         </a>
-ENDIF:full_path_url
-IF:cvsurl
-         &nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
-ENDIF:cvsurl
-<br />
-END:infiles
-      </td>
-     </tr>
-IF:parent
-     <tr>
-      <td class="small-title-font">Parent:</td>
-      <td class="small-title-font">
-IF:par_url
-        <a href="%par_url%" class="aqua">
-ENDIF:par_url
-%parent%
-IF:par_url
-         </a>
-ENDIF:par_url
-      </td>
-     </tr>
-ENDIF:parent
-   </table>
-  </td>
-  </tr>
-</table>
-}
-
-=begin
-=end
-
-########################## Source code ##########################
-
-SRC_PAGE = %{
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
-<title>%title%</title>
-<link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
-</head>
-<body bgcolor="white">
-<pre>%code%</pre>
-</body>
-</html>
-}
-
-########################## Index ################################
-
-FR_INDEX_BODY = %{
-!INCLUDE!
-}
-
-FILE_INDEX = %{
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
-<title>%list_title%</title>
-<style type="text/css">
-<!--
-  body {
-background-color: #ddddff;
-     font-family: #{FONTS}; 
-       font-size: 11px; 
-      font-style: normal;
-     line-height: 14px; 
-           color: #000040;
-  }
-div.banner {
-  background: #0000aa;
-  color:      white;
-  padding: 1;
-  margin: 0;
-  font-size: 90%;
-  font-weight: bold;
-  line-height: 1.1;
-  text-align: center;
-  width: 100%;
-}
-
-A.xx { color: white; font-weight: bold; }
--->
-</style>
-<base target="docwin">
-</head>
-<body>
-<div class="banner"><a href="%index_url%" class="xx">%list_title%</a></div>
-START:entries
-<a href="%href%">%name%</a><br />
-END:entries
-</body></html>
-}
-
-CLASS_INDEX = FILE_INDEX
-METHOD_INDEX = FILE_INDEX
-
-INDEX = %{
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
-<title>%title%</title></head>
-
-<frameset rows="20%, 80%">
-    <frameset cols="25%,35%,45%">
-        <frame src="fr_file_index.html"   title="Files" name="Files">
-        <frame src="fr_class_index.html"  name="Classes">
-        <frame src="fr_method_index.html" name="Methods">
-    </frameset>
-    <frame  src="%initial_page%" name="docwin">
-    <noframes>
-          <body bgcolor="white">
-            Sorry, RDoc currently only generates HTML using frames.
-          </body>
-    </noframes>
-</frameset>
-
-</html>
-}
-
-######################################################################
-#
-# The following is used for the -1 option
-#
-
-CONTENTS_XML = %{
-IF:description
-%description%
-ENDIF:description
-
-IF:requires
-<h4>Requires:</h4>
-<ul>
-START:requires
-IF:aref
-<li><a href="%aref%">%name%</a></li>
-ENDIF:aref
-IFNOT:aref
-<li>%name%</li>
-ENDIF:aref 
-END:requires
-</ul>
-ENDIF:requires
-
-IF:attributes
-<h4>Attributes</h4>
-<table>
-START:attributes
-<tr><td>%name%</td><td>%rw%</td><td>%a_desc%</td></tr>
-END:attributes
-</table>
-ENDIF:attributes
-
-IF:includes
-<h4>Includes</h4>
-<ul>
-START:includes
-IF:aref
-<li><a href="%aref%">%name%</a></li>
-ENDIF:aref
-IFNOT:aref
-<li>%name%</li>
-ENDIF:aref 
-END:includes
-</ul>
-ENDIF:includes
-
-IF:method_list
-<h3>Methods</h3>
-START:method_list
-IF:methods
-START:methods
-<h4>%type% %category% method: <a name="%aref%">%name%%params%</a></h4>
-
-IF:m_desc
-%m_desc%
-ENDIF:m_desc
-
-IF:sourcecode
-<blockquote><pre>
-%sourcecode%
-</pre></blockquote>
-ENDIF:sourcecode
-END:methods
-ENDIF:methods
-END:method_list
-ENDIF:method_list
-}
-
-
-end
-end
-
-require 'rdoc/generators/template/html/one_page_html'
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generators/template/html/one_page_html.rb ../rdoc-f95-20090109-1/generators/template/html/one_page_html.rb
--- ruby-1.8.7-p72/lib/rdoc/generators/template/html/one_page_html.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/generators/template/html/one_page_html.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,122 +0,0 @@
-module RDoc
-module Page
-######################################################################
-#
-# The following is used for the -1 option
-#
-
-CONTENTS_XML = %{
-IF:description
-%description%
-ENDIF:description
-
-IF:requires
-<h4>Requires:</h4>
-<ul>
-START:requires
-IF:aref
-<li><a href="%aref%">%name%</a></li>
-ENDIF:aref
-IFNOT:aref
-<li>%name%</li>
-ENDIF:aref 
-END:requires
-</ul>
-ENDIF:requires
-
-IF:attributes
-<h4>Attributes</h4>
-<table>
-START:attributes
-<tr><td>%name%</td><td>%rw%</td><td>%a_desc%</td></tr>
-END:attributes
-</table>
-ENDIF:attributes
-
-IF:includes
-<h4>Includes</h4>
-<ul>
-START:includes
-IF:aref
-<li><a href="%aref%">%name%</a></li>
-ENDIF:aref
-IFNOT:aref
-<li>%name%</li>
-ENDIF:aref 
-END:includes
-</ul>
-ENDIF:includes
-
-IF:method_list
-<h3>Methods</h3>
-START:method_list
-IF:methods
-START:methods
-<h4>%type% %category% method: 
-IF:callseq
-<a name="%aref%">%callseq%</a>
-ENDIF:callseq
-IFNOT:callseq
-<a name="%aref%">%name%%params%</a></h4>
-ENDIF:callseq
-
-IF:m_desc
-%m_desc%
-ENDIF:m_desc
-
-IF:sourcecode
-<blockquote><pre>
-%sourcecode%
-</pre></blockquote>
-ENDIF:sourcecode
-END:methods
-ENDIF:methods
-END:method_list
-ENDIF:method_list
-}
-
-########################################################################
-
-ONE_PAGE = %{
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-  <title>%title%</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
-</head>
-<body>
-START:files
-<h2>File: %short_name%</h2>
-<table>
-  <tr><td>Path:</td><td>%full_path%</td></tr>
-  <tr><td>Modified:</td><td>%dtm_modified%</td></tr>
-</table>
-} + CONTENTS_XML + %{
-END:files
-
-IF:classes
-<h2>Classes</h2>
-START:classes
-IF:parent
-<h3>%classmod% %full_name% &lt; HREF:par_url:parent:</h3>
-ENDIF:parent
-IFNOT:parent
-<h3>%classmod% %full_name%</h3>
-ENDIF:parent
-
-IF:infiles
-(in files
-START:infiles
-HREF:full_path_url:full_path:
-END:infiles
-)
-ENDIF:infiles
-} + CONTENTS_XML + %{
-END:classes
-ENDIF:classes
-</body>
-</html>
-}
-
-end
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generators/template/xml/rdf.rb ../rdoc-f95-20090109-1/generators/template/xml/rdf.rb
--- ruby-1.8.7-p72/lib/rdoc/generators/template/xml/rdf.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/generators/template/xml/rdf.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,112 +0,0 @@
-module RDoc
-module Page
-
-
-
-CONTENTS_RDF = %{
-IF:description
-    <description rd:parseType="Literal">
-%description%
-    </description>
-ENDIF:description
-
-IF:requires
-START:requires
-         <rd:required-file rd:name="%name%" />
-END:requires
-ENDIF:requires
-
-IF:attributes
-START:attributes
-        <contents>
-        <Attribute rd:name="%name%">
-IF:rw
-          <attribute-rw>%rw%</attribute-rw>
-ENDIF:rw
-          <description rdf:parseType="Literal">%a_desc%</description>
-        </Attribute>
-        </contents>
-END:attributes
-ENDIF:attributes
-
-IF:includes
-      <IncludedModuleList>
-START:includes
-        <included-module rd:name="%name%"  />
-END:includes
-      </IncludedModuleList>
-ENDIF:includes
-
-IF:method_list
-START:method_list
-IF:methods
-START:methods
-	<contents>
-        <Method rd:name="%name%" rd:visibility="%type%"
-                rd:category="%category%" rd:id="%aref%">
-          <parameters>%params%</parameters>
-IF:m_desc
-          <description rdf:parseType="Literal">
-%m_desc%
-          </description>
-ENDIF:m_desc
-IF:sourcecode
-          <source-code-listing rdf:parseType="Literal">
-%sourcecode%
-          </source-code-listing>
-ENDIF:sourcecode
-        </Method>
-       </contents>
-END:methods
-ENDIF:methods
-END:method_list
-ENDIF:method_list
-     <!-- end method list -->
-}
-
-########################################################################
-
-ONE_PAGE = %{<?xml version="1.0" encoding="utf-8"?>
-<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-        xmlns="http://pragprog.com/rdoc/rdoc.rdf#"
-        xmlns:rd="http://pragprog.com/rdoc/rdoc.rdf#">
-
-<!-- RDoc -->
-START:files
-  <rd:File rd:name="%short_name%" rd:id="%href%">
-      <path>%full_path%</path>
-      <dtm-modified>%dtm_modified%</dtm-modified>
-} + CONTENTS_RDF + %{
-  </rd:File>
-END:files
-START:classes
-  <%classmod% rd:name="%full_name%" rd:id="%full_name%">
-    <classmod-info>
-IF:infiles
-      <InFiles>
-START:infiles
-        <infile>
-          <File rd:name="%full_path%"
-IF:full_path_url
-                rdf:about="%full_path_url%"
-ENDIF:full_path_url
-           />
-         </infile>
-END:infiles
-      </InFiles>
-ENDIF:infiles
-IF:parent
-     <superclass>HREF:par_url:parent:</superclass>
-ENDIF:parent
-    </classmod-info>
-} + CONTENTS_RDF + %{
-  </%classmod%>
-END:classes
-<!-- /RDoc -->
-</rdf:RDF>
-}
-
-
-end
-end
-
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generators/template/xml/xml.rb ../rdoc-f95-20090109-1/generators/template/xml/xml.rb
--- ruby-1.8.7-p72/lib/rdoc/generators/template/xml/xml.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/generators/template/xml/xml.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,112 +0,0 @@
-module RDoc
-module Page
-
-
-
-CONTENTS_XML = %{
-IF:description
-    <description>
-%description%
-    </description>
-ENDIF:description
-    <contents>
-IF:requires
-      <required-file-list>
-START:requires
-         <required-file name="%name%"
-IF:aref 
-                        href="%aref%"
-ENDIF:aref
-         />
-END:requires
-      </required-file-list>
-ENDIF:requires
-IF:attributes
-      <attribute-list>
-START:attributes
-        <attribute name="%name%">
-IF:rw
-          <attribute-rw>%rw%</attribute-rw>
-ENDIF:rw
-          <description>%a_desc%</description>
-        </attribute>
-END:attributes
-      </attribute-list>
-ENDIF:attributes
-IF:includes
-      <included-module-list>
-START:includes
-        <included-module name="%name%"
-IF:aref
-                         href="%aref%"
-ENDIF:aref
-        />
-END:includes
-      </included-module-list>
-ENDIF:includes
-IF:method_list
-      <method-list>
-START:method_list
-IF:methods
-START:methods
-        <method name="%name%" type="%type%" category="%category%" id="%aref%">
-          <parameters>%params%</parameters>
-IF:m_desc
-          <description>
-%m_desc%
-          </description>
-ENDIF:m_desc
-IF:sourcecode
-          <source-code-listing>
-%sourcecode%
-          </source-code-listing>
-ENDIF:sourcecode
-        </method>
-END:methods
-ENDIF:methods
-END:method_list
-      </method-list>
-ENDIF:method_list
-     </contents>
-}
-
-########################################################################
-
-ONE_PAGE = %{<?xml version="1.0" encoding="utf-8"?>
-<rdoc>
-<file-list>
-START:files
-  <file name="%short_name%" id="%href%">
-    <file-info>
-      <path>%full_path%</path>
-      <dtm-modified>%dtm_modified%</dtm-modified>
-    </file-info>
-} + CONTENTS_XML + %{
-  </file>
-END:files
-</file-list>
-<class-module-list>
-START:classes
-  <%classmod% name="%full_name%" id="%full_name%">
-    <classmod-info>
-IF:infiles
-      <infiles>      
-START:infiles
-        <infile>HREF:full_path_url:full_path:</infile>
-END:infiles
-      </infiles>
-ENDIF:infiles
-IF:parent
-     <superclass>HREF:par_url:parent:</superclass>
-ENDIF:parent
-    </classmod-info>
-} + CONTENTS_XML + %{
-  </%classmod%>
-END:classes
-</class-module-list>
-</rdoc>
-}
-
-
-end
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/generators/xml_generator.rb ../rdoc-f95-20090109-1/generators/xml_generator.rb
--- ruby-1.8.7-p72/lib/rdoc/generators/xml_generator.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/generators/xml_generator.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,130 +0,0 @@
-
-require 'ftools'
-
-require 'rdoc/options'
-require 'rdoc/markup/simple_markup'
-require 'rdoc/markup/simple_markup/to_html'
-require 'rdoc/generators/html_generator'
-
-module Generators
-
-  # Generate XML output as one big file
-
-  class XMLGenerator < HTMLGenerator
-
-    # Standard generator factory
-    def XMLGenerator.for(options)
-      XMLGenerator.new(options)
-    end
-
-    
-    def initialize(*args)
-      super
-    end
-
-    ##
-    # Build the initial indices and output objects
-    # based on an array of TopLevel objects containing
-    # the extracted information. 
-
-    def generate(info)
-      @info       = info
-      @files      = []
-      @classes    = []
-      @hyperlinks = {}
-
-      build_indices
-      generate_xml
-    end
-
-
-    ##
-    # Generate:
-    #
-    # * a list of HtmlFile objects for each TopLevel object.
-    # * a list of HtmlClass objects for each first level
-    #   class or module in the TopLevel objects
-    # * a complete list of all hyperlinkable terms (file,
-    #   class, module, and method names)
-
-    def build_indices
-
-      @info.each do |toplevel|
-        @files << HtmlFile.new(toplevel, @options, FILE_DIR)
-      end
-
-      RDoc::TopLevel.all_classes_and_modules.each do |cls|
-        build_class_list(cls, @files[0], CLASS_DIR)
-      end
-    end
-
-    def build_class_list(from, html_file, class_dir)
-      @classes << HtmlClass.new(from, html_file, class_dir, @options)
-      from.each_classmodule do |mod|
-        build_class_list(mod, html_file, class_dir)
-      end
-    end
-
-    ##
-    # Generate all the HTML. For the one-file case, we generate
-    # all the information in to one big hash
-    #
-    def generate_xml
-      values = { 
-        'charset' => @options.charset,
-        'files'   => gen_into(@files),
-        'classes' => gen_into(@classes)
-      }
-      
-      # this method is defined in the template file
-      write_extra_pages if defined? write_extra_pages
-
-      template = TemplatePage.new(RDoc::Page::ONE_PAGE)
-
-      if @options.op_name
-        opfile = File.open(@options.op_name, "w")
-      else
-        opfile = $stdout
-      end
-      template.write_html_on(opfile, values)
-    end
-
-    def gen_into(list)
-      res = []
-      list.each do |item|
-        res << item.value_hash
-      end
-      res
-    end
-
-    def gen_file_index
-      gen_an_index(@files, 'Files')
-    end
-
-    def gen_class_index
-      gen_an_index(@classes, 'Classes')
-    end
-
-    def gen_method_index
-      gen_an_index(HtmlMethod.all_methods, 'Methods')
-    end
-
-    
-    def gen_an_index(collection, title)
-      res = []
-      collection.sort.each do |f|
-        if f.document_self
-          res << { "href" => f.path, "name" => f.index_name }
-        end
-      end
-
-      return {
-        "entries" => res,
-        'list_title' => title,
-        'index_url'  => main_url,
-      }
-    end
-
-  end
-
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/install.rb ../rdoc-f95-20090109-1/install.rb
--- ruby-1.8.7-p72/lib/rdoc/install.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/install.rb	2008-03-09 03:43:55.000000000 +0900
@@ -0,0 +1,166 @@
+require 'rbconfig'
+require 'find'
+require 'fileutils'
+require 'optparse'
+
+include Config
+
+$ruby = CONFIG['ruby_install_name']
+
+##
+# Install a binary file. We patch in on the way through to
+# insert a #! line. If this is a Unix install, we name
+# the command (for example) 'rdoc' and let the shebang line
+# handle running it. Under windows, we add a '.rb' extension
+# and let file associations to their stuff
+#
+
+def installBIN(from, opfile)
+
+  tmp_dir = nil
+  [".", "/tmp", "c:/temp", $bindir].each{|t|
+    stat = File.stat(t) rescue next
+    if stat.directory? and stat.writable?
+      tmp_dir = t
+      break
+    end
+  }
+
+  fail "Cannot find a temporary directory" unless tmp_dir
+  tmp_file = File.join(tmp_dir, "_tmp")
+    
+    
+  File.open(from) do |ip|
+    File.open(tmp_file, "w") do |op|
+      ruby = File.join($realbindir, $ruby)
+#      op.puts "#!#{ruby}"
+      op.write ip.read
+    end
+  end
+
+  opfile += ".rb" if CONFIG["target_os"] =~ /mswin/i
+  FileUtils::makedirs($bindir, {:verbose => true})
+  FileUtils::install(tmp_file, File.join($bindir, opfile), 
+                     {:mode => 0755, :verbose => true})
+  FileUtils::safe_unlink(tmp_file)
+end
+
+# Main Program
+
+opt = OptionParser.new
+OPTS = {}
+opt.summary_width = 23
+opt.summary_indent = ''*1
+opt.on('--bindir=VAL',
+       'Directory to which the executable file is installed') \
+      {|v| $bindir = v.to_s}
+opt.on('--binname=VAL',
+       'Name of the executable file (default name is "rdoc")') \
+      {|v| $binname = v.to_s}
+opt.on('--libdir=VAL', 
+       'Directory to which the libraries are installed') \
+       {|v| $libdir = v.to_s}
+opt.on('--help', 'Show help message') {|v| OPTS[:help] = v}
+
+opt.parse!(ARGV)
+
+$bindir = File.expand_path($bindir) if $bindir
+$binname ||= "rdoc"
+$libdir = File.expand_path($libdir) if $libdir
+
+install_opt = ""
+install_opt = "--libdir=#{$libdir}" if $libdir
+
+if $libdir
+  $sitedir = $libdir
+else
+  $sitedir = CONFIG["sitelibdir"]
+  unless $sitedir
+    version = CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
+    $libdir = File.join(CONFIG["libdir"], "ruby", version)
+    $sitedir = $:.find {|x| x =~ /site_ruby/}
+    if !$sitedir
+      $sitedir = File.join($libdir, "site_ruby")
+    elsif $sitedir !~ Regexp.quote(version)
+      $sitedir = File.join($sitedir, version)
+    end
+  end
+end
+
+$bindir ||= CONFIG["bindir"]
+$realbindir = $bindir
+
+bindir = CONFIG["bindir"]
+
+rdoc_dest = File.join($sitedir, "rdoc")
+rdoc_generator = File.join(rdoc_dest, "generator")
+rdoc_parsers   = File.join(rdoc_dest, "parsers")
+rdoc_ri        = File.join(rdoc_dest, "ri")
+
+# help message
+if ARGV[0] || OPTS[:help]
+  print <<-HELP
+
+  This ruby script installs libraries to \"#{$sitedir}\",
+  and executables to \"#{$bindir}/#{$binname}\". (See \"rbconfig.rb\")
+
+  If you want to install other directory, use following options.
+
+  #{opt.help}
+
+HELP
+  exit
+end
+
+# make directories
+[
+  rdoc_dest,  
+  rdoc_generator, 
+  rdoc_parsers,
+  rdoc_ri].each{|d|
+  FileUtils::makedirs(d, {:verbose => true})
+}
+
+FileUtils::chmod(0755, rdoc_dest)
+
+
+
+# The library files
+files = %w{
+ code_objects.rb
+ generator.rb
+ generator/*.rb
+ options.rb
+ parsers/parserfactory.rb  
+ parsers/parse_*.rb  
+ template.rb
+ tokenstream.rb
+ diagram.rb
+ rdoc.rb
+ dot.rb
+ ri/*.rb
+ ri.rb
+ markup.rb
+ stats.rb
+}.collect {|f| Dir.glob(f)}.flatten
+
+["chm", "html", "xml", "xhtml"].each{ |template|
+  d = File.join(rdoc_generator, template)
+  FileUtils::makedirs(d, {:verbose => true})
+  files.concat Dir.glob("generator/#{template}/*.rb")
+  files.concat Dir.glob("generator/#{template}/*.xsl")
+}
+
+files.each{ |aFile|
+  dst = File.join(rdoc_dest, aFile)
+  FileUtils::install(aFile, dst, {:mode => 0644, :verbose => true})
+}
+
+# and the executable
+
+installBIN("rdoc", $binname)
+
+# 'Markup' will eventually be a separate package, but
+# for now we'll install it automatically 
+
+Dir.chdir("markup") && system("#$ruby install.rb #{install_opt}")
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/.document ../rdoc-f95-20090109-1/markup/.document
--- ruby-1.8.7-p72/lib/rdoc/markup/.document	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/.document	1970-01-01 09:00:00.000000000 +0900
@@ -1,2 +0,0 @@
-simple_markup
-simple_markup.rb
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/formatter.rb ../rdoc-f95-20090109-1/markup/formatter.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/formatter.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/formatter.rb	2008-03-09 06:49:08.000000000 +0900
@@ -0,0 +1,14 @@
+require 'rdoc/markup'
+
+class RDoc::Markup::Formatter
+
+  def initialize
+    @markup = RDoc::Markup.new
+  end
+
+  def convert(content, block_exceptions=nil)
+    @markup.convert content, self, block_exceptions
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/fragments.rb ../rdoc-f95-20090109-1/markup/fragments.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/fragments.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/fragments.rb	2008-03-08 18:36:21.000000000 +0900
@@ -0,0 +1,337 @@
+require 'rdoc/markup'
+require 'rdoc/markup/lines'
+
+class RDoc::Markup
+
+  ##
+  # A Fragment is a chunk of text, subclassed as a paragraph, a list
+  # entry, or verbatim text.
+
+  class Fragment
+    attr_reader   :level, :param, :txt
+    attr_accessor :type
+
+    ######
+    # This is a simple factory system that lets us associate fragement
+    # types (a string) with a subclass of fragment
+
+    TYPE_MAP = {}
+
+    def self.type_name(name)
+      TYPE_MAP[name] = self
+    end
+
+    def self.for(line)
+      klass =  TYPE_MAP[line.type] ||
+        raise("Unknown line type: '#{line.type.inspect}:' '#{line.text}'")
+      return klass.new(line.level, line.param, line.flag, line.text)
+    end
+
+    def initialize(level, param, type, txt)
+      @level = level
+      @param = param
+      @type  = type
+      @txt   = ""
+      add_text(txt) if txt
+    end
+
+    def add_text(txt)
+      @txt << " " if @txt.length > 0
+      @txt << txt.tr_s("\n ", "  ").strip
+    end
+
+    def to_s
+      "L#@level: #{self.class.name.split('::')[-1]}\n#@txt"
+    end
+
+  end
+
+  ##
+  # A paragraph is a fragment which gets wrapped to fit. We remove all
+  # newlines when we're created, and have them put back on output.
+
+  class Paragraph < Fragment
+    type_name :PARAGRAPH
+  end
+
+  class BlankLine < Paragraph
+    type_name :BLANK
+  end
+
+  class Heading < Paragraph
+    type_name :HEADING
+
+    def head_level
+      @param.to_i
+    end
+  end
+
+  ##
+  # A List is a fragment with some kind of label
+
+  class ListBase < Paragraph
+    LIST_TYPES = [
+      :BULLET,
+      :NUMBER,
+      :UPPERALPHA,
+      :LOWERALPHA,
+      :LABELED,
+      :NOTE,
+    ]
+  end
+
+  class ListItem < ListBase
+    type_name :LIST
+
+    def to_s
+      text = if [:NOTE, :LABELED].include? type then
+               "#{@param}: #{@txt}"
+             else
+               @txt
+             end
+
+      "L#@level: #{type} #{self.class.name.split('::')[-1]}\n#{text}"
+    end
+
+  end
+
+  class ListStart < ListBase
+    def initialize(level, param, type)
+      super(level, param, type, nil)
+    end
+  end
+
+  class ListEnd < ListBase
+    def initialize(level, type)
+      super(level, "", type, nil)
+    end
+  end
+
+  ##
+  # Verbatim code contains lines that don't get wrapped.
+
+  class Verbatim < Fragment
+    type_name  :VERBATIM
+
+    def add_text(txt)
+      @txt << txt.chomp << "\n"
+    end
+
+  end
+
+  ##
+  # A horizontal rule
+
+  class Rule < Fragment
+    type_name :RULE
+  end
+
+  ##
+  # Collect groups of lines together. Each group will end up containing a flow
+  # of text.
+
+  class LineCollection
+
+    def initialize
+      @fragments = []
+    end
+
+    def add(fragment)
+      @fragments << fragment
+    end
+
+    def each(&b)
+      @fragments.each(&b)
+    end
+
+    def to_a # :nodoc:
+      @fragments.map {|fragment| fragment.to_s}
+    end
+
+    ##
+    # Factory for different fragment types
+
+    def fragment_for(*args)
+      Fragment.for(*args)
+    end
+
+    ##
+    # Tidy up at the end
+
+    def normalize
+      change_verbatim_blank_lines
+      add_list_start_and_ends
+      add_list_breaks
+      tidy_blank_lines
+    end
+
+    def to_s
+      @fragments.join("\n----\n")
+    end
+
+    def accept(am, visitor)
+      visitor.start_accepting
+
+      @fragments.each do |fragment|
+        case fragment
+        when Verbatim
+          visitor.accept_verbatim(am, fragment)
+        when Rule
+          visitor.accept_rule(am, fragment)
+        when ListStart
+          visitor.accept_list_start(am, fragment)
+        when ListEnd
+          visitor.accept_list_end(am, fragment)
+        when ListItem
+          visitor.accept_list_item(am, fragment)
+        when BlankLine
+          visitor.accept_blank_line(am, fragment)
+        when Heading
+          visitor.accept_heading(am, fragment)
+        when Paragraph
+          visitor.accept_paragraph(am, fragment)
+        end
+      end
+
+      visitor.end_accepting
+    end
+
+    private
+
+    # If you have:
+    #
+    #    normal paragraph text.
+    #
+    #       this is code
+    #   
+    #       and more code
+    #
+    # You'll end up with the fragments Paragraph, BlankLine, Verbatim,
+    # BlankLine, Verbatim, BlankLine, etc.
+    #
+    # The BlankLine in the middle of the verbatim chunk needs to be changed to
+    # a real verbatim newline, and the two verbatim blocks merged
+
+    def change_verbatim_blank_lines
+      frag_block = nil
+      blank_count = 0
+      @fragments.each_with_index do |frag, i|
+        if frag_block.nil?
+          frag_block = frag if Verbatim === frag
+        else
+          case frag
+          when Verbatim
+            blank_count.times { frag_block.add_text("\n") }
+            blank_count = 0
+            frag_block.add_text(frag.txt)
+            @fragments[i] = nil    # remove out current fragment
+          when BlankLine
+            if frag_block
+              blank_count += 1
+              @fragments[i] = nil
+            end
+          else
+            frag_block = nil
+            blank_count = 0
+          end
+        end
+      end
+      @fragments.compact!
+    end
+
+    ##
+    # List nesting is implicit given the level of indentation. Make it
+    # explicit, just to make life a tad easier for the output processors
+
+    def add_list_start_and_ends
+      level = 0
+      res = []
+      type_stack = []
+
+      @fragments.each do |fragment|
+        # $stderr.puts "#{level} : #{fragment.class.name} : #{fragment.level}"
+        new_level = fragment.level
+        while (level < new_level)
+          level += 1
+          type = fragment.type
+          res << ListStart.new(level, fragment.param, type) if type
+          type_stack.push type
+          # $stderr.puts "Start: #{level}"
+        end
+
+        while level > new_level
+          type = type_stack.pop
+          res << ListEnd.new(level, type) if type
+          level -= 1
+          # $stderr.puts "End: #{level}, #{type}"
+        end
+
+        res << fragment
+        level = fragment.level
+      end
+      level.downto(1) do |i|
+        type = type_stack.pop
+        res << ListEnd.new(i, type) if type
+      end
+
+      @fragments = res
+    end
+
+    ##
+    # Inserts start/ends between list entries at the same level that have
+    # different element types
+
+    def add_list_breaks
+      res = @fragments
+
+      @fragments = []
+      list_stack = []
+
+      res.each do |fragment|
+        case fragment
+        when ListStart
+          list_stack.push fragment
+        when ListEnd
+          start = list_stack.pop
+          fragment.type = start.type
+        when ListItem
+          l = list_stack.last
+          if fragment.type != l.type
+            @fragments << ListEnd.new(l.level, l.type)
+            start = ListStart.new(l.level, fragment.param, fragment.type)
+            @fragments << start
+            list_stack.pop
+            list_stack.push start
+          end
+        else
+          ;
+        end
+        @fragments << fragment
+      end
+    end
+
+    ##
+    # Tidy up the blank lines:
+    # * change Blank/ListEnd into ListEnd/Blank
+    # * remove blank lines at the front
+
+    def tidy_blank_lines
+      (@fragments.size - 1).times do |i|
+        if BlankLine === @fragments[i] and ListEnd === @fragments[i+1] then
+          @fragments[i], @fragments[i+1] = @fragments[i+1], @fragments[i]
+        end
+      end
+
+      # remove leading blanks
+      @fragments.each_with_index do |f, i|
+        break unless f.kind_of? BlankLine
+        @fragments[i] = nil
+      end
+
+      @fragments.compact!
+    end
+
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/inline.rb ../rdoc-f95-20090109-1/markup/inline.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/inline.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/inline.rb	2008-03-08 18:36:21.000000000 +0900
@@ -0,0 +1,361 @@
+require 'rdoc/markup'
+
+class RDoc::Markup
+
+  ##
+  # We manage a set of attributes. Each attribute has a symbol name and a bit
+  # value.
+
+  class Attribute
+    SPECIAL = 1
+
+    @@name_to_bitmap = { :_SPECIAL_ => SPECIAL }
+    @@next_bitmap = 2
+
+    def self.bitmap_for(name)
+      bitmap = @@name_to_bitmap[name]
+      unless bitmap then
+        bitmap = @@next_bitmap
+        @@next_bitmap <<= 1
+        @@name_to_bitmap[name] = bitmap
+      end
+      bitmap
+    end
+
+    def self.as_string(bitmap)
+      return "none" if bitmap.zero?
+      res = []
+      @@name_to_bitmap.each do |name, bit|
+        res << name if (bitmap & bit) != 0
+      end
+      res.join(",")
+    end
+
+    def self.each_name_of(bitmap)
+      @@name_to_bitmap.each do |name, bit|
+        next if bit == SPECIAL
+        yield name.to_s if (bitmap & bit) != 0
+      end
+    end
+  end
+
+  ##
+  # An AttrChanger records a change in attributes. It contains a bitmap of the
+  # attributes to turn on, and a bitmap of those to turn off.
+
+  AttrChanger = Struct.new(:turn_on, :turn_off)
+
+  class AttrChanger
+    def to_s
+      "Attr: +#{Attribute.as_string(@turn_on)}/-#{Attribute.as_string(@turn_on)}"
+    end
+  end
+
+  ##
+  # An array of attributes which parallels the characters in a string.
+
+  class AttrSpan
+    def initialize(length)
+      @attrs = Array.new(length, 0)
+    end
+
+    def set_attrs(start, length, bits)
+      for i in start ... (start+length)
+        @attrs[i] |= bits
+      end
+    end
+
+    def [](n)
+      @attrs[n]
+    end
+  end
+
+  ##
+  # Hold details of a special sequence
+
+  class Special
+    attr_reader   :type
+    attr_accessor :text
+
+    def initialize(type, text)
+      @type, @text = type, text
+    end
+
+    def ==(o)
+      self.text == o.text && self.type == o.type
+    end
+
+    def inspect
+      "#<RDoc::Markup::Special:0x%x @type=%p, name=%p @text=%p>" % [
+        object_id, @type, RDoc::Markup::Attribute.as_string(type), text.dump]
+    end
+
+    def to_s
+      "Special: type=#{type}, name=#{RDoc::Markup::Attribute.as_string type}, text=#{text.dump}"
+    end
+
+  end
+
+  class AttributeManager
+
+    NULL = "\000".freeze
+
+    ##
+    # We work by substituting non-printing characters in to the text. For now
+    # I'm assuming that I can substitute a character in the range 0..8 for a 7
+    # bit character without damaging the encoded string, but this might be
+    # optimistic
+
+    A_PROTECT  = 004
+    PROTECT_ATTR  = A_PROTECT.chr
+
+    ##
+    # This maps delimiters that occur around words (such as *bold* or +tt+)
+    # where the start and end delimiters and the same. This lets us optimize
+    # the regexp
+
+    MATCHING_WORD_PAIRS = {}
+
+    ##
+    # And this is used when the delimiters aren't the same. In this case the
+    # hash maps a pattern to the attribute character
+
+    WORD_PAIR_MAP = {}
+
+    ##
+    # This maps HTML tags to the corresponding attribute char
+
+    HTML_TAGS = {}
+
+    ##
+    # And this maps _special_ sequences to a name. A special sequence is
+    # something like a WikiWord
+
+    SPECIAL = {}
+
+    ##
+    # Return an attribute object with the given turn_on and turn_off bits set
+
+    def attribute(turn_on, turn_off)
+      AttrChanger.new(turn_on, turn_off)
+    end
+
+    def change_attribute(current, new)
+      diff = current ^ new
+      attribute(new & diff, current & diff)
+    end
+
+    def changed_attribute_by_name(current_set, new_set)
+      current = new = 0
+      current_set.each {|name| current |= Attribute.bitmap_for(name) }
+      new_set.each {|name| new |= Attribute.bitmap_for(name) }
+      change_attribute(current, new)
+    end
+
+    def copy_string(start_pos, end_pos)
+      res = @str[start_pos...end_pos]
+      res.gsub!(/\000/, '')
+      res
+    end
+
+    ##
+    # Map attributes like <b>text</b>to the sequence
+    # \001\002<char>\001\003<char>, where <char> is a per-attribute specific
+    # character
+
+    def convert_attrs(str, attrs)
+      # first do matching ones
+      tags = MATCHING_WORD_PAIRS.keys.join("")
+
+      re = /(^|\W)([#{tags}])([#\\]?[\w.\/]+?\S?)\2(\W|$)/
+
+      1 while str.gsub!(re) do
+        attr = MATCHING_WORD_PAIRS[$2]
+        attrs.set_attrs($`.length + $1.length + $2.length, $3.length, attr)
+        $1 + NULL * $2.length + $3 + NULL * $2.length + $4
+      end
+
+      # then non-matching
+      unless WORD_PAIR_MAP.empty? then
+        WORD_PAIR_MAP.each do |regexp, attr|
+          str.gsub!(regexp) {
+            attrs.set_attrs($`.length + $1.length, $2.length, attr)
+            NULL * $1.length + $2 + NULL * $3.length
+          }
+        end
+      end
+    end
+
+    def convert_html(str, attrs)
+      tags = HTML_TAGS.keys.join '|'
+
+      1 while str.gsub!(/<(#{tags})>(.*?)<\/\1>/i) {
+        attr = HTML_TAGS[$1.downcase]
+        html_length = $1.length + 2
+        seq = NULL * html_length
+        attrs.set_attrs($`.length + html_length, $2.length, attr)
+        seq + $2 + seq + NULL
+      }
+    end
+
+    def convert_specials(str, attrs)
+      unless SPECIAL.empty?
+        SPECIAL.each do |regexp, attr|
+          str.scan(regexp) do
+            attrs.set_attrs($`.length, $&.length, attr | Attribute::SPECIAL)
+          end
+        end
+      end
+    end
+
+    ##
+    # A \ in front of a character that would normally be processed turns off
+    # processing. We do this by turning \< into <#{PROTECT}
+
+    PROTECTABLE = %w[<\\]
+
+    def mask_protected_sequences
+      protect_pattern = Regexp.new("\\\\([#{Regexp.escape(PROTECTABLE.join(''))}])")
+      @str.gsub!(protect_pattern, "\\1#{PROTECT_ATTR}")
+    end
+
+    def unmask_protected_sequences
+      @str.gsub!(/(.)#{PROTECT_ATTR}/, "\\1\000")
+    end
+
+    def initialize
+      add_word_pair("*", "*", :BOLD)
+      add_word_pair("_", "_", :EM)
+      add_word_pair("+", "+", :TT)
+
+      add_html("em", :EM)
+      add_html("i",  :EM)
+      add_html("b",  :BOLD)
+      add_html("tt",   :TT)
+      add_html("code", :TT)
+
+      add_special(/<!--(.*?)-->/, :COMMENT)
+    end
+
+    def add_word_pair(start, stop, name)
+      raise "Word flags may not start '<'" if start[0] == ?<
+      bitmap = Attribute.bitmap_for(name)
+      if start == stop
+        MATCHING_WORD_PAIRS[start] = bitmap
+      else
+        pattern = Regexp.new("(" + Regexp.escape(start) + ")" +
+#                             "([A-Za-z]+)" +
+                             "(\\S+)" +
+                             "(" + Regexp.escape(stop) +")")
+        WORD_PAIR_MAP[pattern] = bitmap
+      end
+      PROTECTABLE << start[0,1]
+      PROTECTABLE.uniq!
+    end
+
+    def add_html(tag, name)
+      HTML_TAGS[tag.downcase] = Attribute.bitmap_for(name)
+    end
+
+    def add_special(pattern, name)
+      SPECIAL[pattern] = Attribute.bitmap_for(name)
+    end
+
+    def flow(str)
+      @str = str
+
+      puts("Before flow, str='#{@str.dump}'") if $DEBUG_RDOC
+      mask_protected_sequences
+
+      @attrs = AttrSpan.new(@str.length)
+
+      puts("After protecting, str='#{@str.dump}'") if $DEBUG_RDOC
+
+      convert_attrs(@str, @attrs)
+      convert_html(@str, @attrs)
+      convert_specials(str, @attrs)
+
+      unmask_protected_sequences
+
+      puts("After flow, str='#{@str.dump}'") if $DEBUG_RDOC
+
+      return split_into_flow
+    end
+
+    def display_attributes
+      puts
+      puts @str.tr(NULL, "!")
+      bit = 1
+      16.times do |bno|
+        line = ""
+        @str.length.times do |i|
+          if (@attrs[i] & bit) == 0
+            line << " "
+          else
+            if bno.zero?
+              line << "S"
+            else
+              line << ("%d" % (bno+1))
+            end
+          end
+        end
+        puts(line) unless line =~ /^ *$/
+        bit <<= 1
+      end
+    end
+
+    def split_into_flow
+      display_attributes if $DEBUG_RDOC
+
+      res = []
+      current_attr = 0
+      str = ""
+
+      str_len = @str.length
+
+      # skip leading invisible text
+      i = 0
+      i += 1 while i < str_len and @str[i] == "\0"
+      start_pos = i
+
+      # then scan the string, chunking it on attribute changes
+      while i < str_len
+        new_attr = @attrs[i]
+        if new_attr != current_attr
+          if i > start_pos
+            res << copy_string(start_pos, i)
+            start_pos = i
+          end
+
+          res << change_attribute(current_attr, new_attr)
+          current_attr = new_attr
+
+          if (current_attr & Attribute::SPECIAL) != 0
+            i += 1 while i < str_len and (@attrs[i] & Attribute::SPECIAL) != 0
+            res << Special.new(current_attr, copy_string(start_pos, i))
+            start_pos = i
+            next
+          end
+        end
+
+        # move on, skipping any invisible characters
+        begin
+          i += 1
+        end while i < str_len and @str[i] == "\0"
+      end
+
+      # tidy up trailing text
+      if start_pos < str_len
+        res << copy_string(start_pos, str_len)
+      end
+
+      # and reset to all attributes off
+      res << change_attribute(current_attr, 0) if current_attr != 0
+
+      return res
+    end
+
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/install.rb ../rdoc-f95-20090109-1/markup/install.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/install.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/install.rb	2008-03-08 18:36:21.000000000 +0900
@@ -0,0 +1,57 @@
+require 'rbconfig'
+require 'find'
+require 'fileutils'
+require 'optparse'
+
+include Config
+
+opt = OptionParser.new
+libdir = nil
+opt.on('--libdir=VAL') {|v| libdir  = v}
+opt.parse!(ARGV)
+
+libdir = File.expand_path(libdir) if libdir
+
+if libdir
+  sitedir = libdir
+else
+  sitedir = CONFIG["sitelibdir"]
+  unless sitedir
+    version = CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
+    libdir = File.join(CONFIG["libdir"], "ruby", version)
+    sitedir = $:.find {|x| x =~ /site_ruby/}
+    if !sitedir
+      sitedir = File.join(libdir, "site_ruby")
+    elsif sitedir !~ Regexp.quote(version)
+      sitedir = File.join(sitedir, version)
+    end
+  end
+end
+
+unless /^\// =~ sitedir.strip
+  sitedir = File.join("..", sitedir)
+end
+
+if !File.directory?(sitedir)
+  $stderr.puts "Cannot find sitedir #{sitedir}"
+  exit 1
+end
+
+rdoc_dest = File.join(sitedir, "rdoc")
+
+dest = File.join(rdoc_dest, "markup")
+
+FileUtils::makedirs(dest, {:verbose => true})
+
+Find.find("./",
+          "sample") do |fname|
+  if File.directory?(fname)
+    next if fname =~ /CVS/
+    FileUtils::makedirs(File.join(dest, fname), {:verbose => true})
+  else
+    next unless fname =~ /\.rb$/
+    next if fname =~ /install.rb$/
+    FileUtils::install(fname, File.join(dest, fname), 
+                       {:mode => 0444, :verbose => true})
+  end
+end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/lines.rb ../rdoc-f95-20090109-1/markup/lines.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/lines.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/lines.rb	2008-03-08 18:36:21.000000000 +0900
@@ -0,0 +1,152 @@
+class RDoc::Markup
+
+  ##
+  # We store the lines we're working on as objects of class Line.  These
+  # contain the text of the line, along with a flag indicating the line type,
+  # and an indentation level.
+
+  class Line
+    INFINITY = 9999
+
+    LINE_TYPES = [
+      :BLANK,
+      :HEADING,
+      :LIST,
+      :PARAGRAPH,
+      :RULE,
+      :VERBATIM,
+    ]
+
+    # line type
+    attr_accessor :type
+
+    # The indentation nesting level
+    attr_accessor :level
+
+    # The contents
+    attr_accessor :text
+
+    # A prefix or parameter. For LIST lines, this is
+    # the text that introduced the list item (the label)
+    attr_accessor  :param
+
+    # A flag. For list lines, this is the type of the list
+    attr_accessor :flag
+
+    # the number of leading spaces
+    attr_accessor :leading_spaces
+
+    # true if this line has been deleted from the list of lines
+    attr_accessor :deleted
+
+    def initialize(text)
+      @text    = text.dup
+      @deleted = false
+
+      # expand tabs
+      1 while @text.gsub!(/\t+/) { ' ' * (8*$&.length - $`.length % 8)}  && $~ #`
+
+      # Strip trailing whitespace
+      @text.sub!(/\s+$/, '')
+
+      # and look for leading whitespace
+      if @text.length > 0
+        @text =~ /^(\s*)/
+        @leading_spaces = $1.length
+      else
+        @leading_spaces = INFINITY
+      end
+    end
+
+    # Return true if this line is blank
+    def blank?
+      @text.empty?
+    end
+
+    # stamp a line with a type, a level, a prefix, and a flag
+    def stamp(type, level, param="", flag=nil)
+      @type, @level, @param, @flag = type, level, param, flag
+    end
+
+    ##
+    # Strip off the leading margin
+
+    def strip_leading(size)
+      if @text.size > size
+        @text[0,size] = ""
+      else
+        @text = ""
+      end
+    end
+
+    def to_s
+      "#@type#@level: #@text"
+    end
+  end
+
+  ##
+  # A container for all the lines.
+
+  class Lines
+
+    include Enumerable
+
+    attr_reader :lines # :nodoc:
+
+    def initialize(lines)
+      @lines = lines
+      rewind
+    end
+
+    def empty?
+      @lines.size.zero?
+    end
+
+    def each
+      @lines.each do |line|
+        yield line unless line.deleted
+      end
+    end
+
+#    def [](index)
+#      @lines[index]
+#    end
+
+    def rewind
+      @nextline = 0
+    end
+
+    def next
+      begin
+        res = @lines[@nextline]
+        @nextline += 1 if @nextline < @lines.size
+      end while res and res.deleted and @nextline < @lines.size
+      res
+    end
+
+    def unget
+      @nextline -= 1
+    end
+
+    def delete(a_line)
+      a_line.deleted = true
+    end
+
+    def normalize
+      margin = @lines.collect{|l| l.leading_spaces}.min
+      margin = 0 if margin == :INFINITY
+      @lines.each {|line| line.strip_leading(margin) } if margin > 0
+    end
+
+    def as_text
+      @lines.map {|l| l.text}.join("\n")
+    end
+
+    def line_types
+      @lines.map {|l| l.type }
+    end
+
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/mathml_wrapper.rb ../rdoc-f95-20090109-1/markup/mathml_wrapper.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/mathml_wrapper.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/mathml_wrapper.rb	2008-03-17 00:59:29.000000000 +0900
@@ -0,0 +1,91 @@
+# This class is MathML module wrapper.
+# If MathML module can not be loaded, methods in this module return
+# raw argument without modification.
+require 'fileutils'
+
+class MathMLWrapper
+
+  # Mathml library name
+  MATHML_NAME = [ "mathml", "math_ml" ]
+
+  # $LOAD_PATH/MATHML_NAME/MACRO_REL_PATH/* files are parsed as TeX macro
+  MACRO_REL_PATH = "macro"
+
+  @@mathml_required = false
+  @@macro_input_flag = false
+  @@macro_path = ''
+
+  def initialize
+
+    err_count = 0
+    if !@@mathml_required
+      MATHML_NAME.each{ |ml|
+        begin
+          require ml
+          @@macro_path = File.join(ml, MACRO_REL_PATH)
+        rescue LoadError
+          err_count = err_count + 1
+        end
+      }
+      if err_count < MATHML_NAME.size
+        @@mathml_required = true
+      else
+        raise LoadError, 
+          "  Error: \"#{MATHML_NAME.join('" or "')}\" library is not found\n" +
+          "         in $LOAD_PATH=[#{$LOAD_PATH.join(',')}]\n\n"
+      end
+    end
+
+    if (@@mathml_required && !@@macro_input_flag)
+      @@mathml_formula_macro = MathML::LaTeX::Parser.new
+      @@macro_input_flag = true
+      $LOAD_PATH.each{ |lpath|
+        macro_files = Dir::glob(File.join(lpath, @@macro_path, "*"))
+        macro_files.each{ |mfile|
+          if File.file?(mfile)
+            File.open(mfile, "r" ) { |io|
+              if $DEBUG_RDOC 
+                puts \
+                  "\n##### Debug messages about \"#{__FILE__}\" #####", 
+                  "  \"#{mfile}\" is loading as a TeX macro file.", 
+                  "  Following macros have been included."
+              end
+              io.each{ |line|
+                line.chomp!
+                macroerrormsg = nil
+                begin
+                  @@mathml_formula_macro.macro.parse(line)
+                rescue MathML::LaTeX::ParseError
+                  macroerrormsg = $!.to_s
+                rescue
+                  macroerrormsg = $!.to_s
+                end
+                if macroerrormsg
+                  $stderr.puts "Warning: in #{mfile}, following TeX macro causes #{macroerrormsg.to_s}\n\n",
+                  "    #{line}\n\n"
+                else
+                  if $DEBUG_RDOC && !(line.empty?) && !(line =~ /\s*\%/)
+                    puts "    #{line}"
+                  end
+                end
+              }
+            }
+          end
+        }
+      }
+    end
+
+  end
+  def parse(formula, block=false)
+    return formula if !@@mathml_required
+    mathml_formula = @@mathml_formula_macro
+    begin
+      mathml_formula_str = mathml_formula.parse(formula, block).to_s
+    rescue MathML::LaTeX::ParseError
+      return formula, 1
+    rescue
+      return formula, 1
+    end
+    return mathml_formula_str, 0
+  end
+end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/preprocess.rb ../rdoc-f95-20090109-1/markup/preprocess.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/preprocess.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/preprocess.rb	2008-03-08 18:36:21.000000000 +0900
@@ -0,0 +1,71 @@
+require 'rdoc/markup'
+
+##
+# Handle common directives that can occur in a block of text:
+#
+# : include : filename
+
+class RDoc::Markup::PreProcess
+
+  def initialize(input_file_name, include_path)
+    @input_file_name = input_file_name
+    @include_path = include_path
+  end
+
+  ##
+  # Look for common options in a chunk of text. Options that we don't handle
+  # are passed back to our caller as |directive, param|
+
+  def handle(text)
+    text.gsub!(/^([ \t#]*):(\w+):\s*(.+)?\n/) do
+      prefix    = $1
+      directive = $2.downcase
+      param     = $3
+
+      case directive
+      when "include"
+        filename = param.split[0]
+        include_file(filename, prefix)
+
+      else
+        yield(directive, param)
+      end
+    end
+  end
+
+  private
+
+  ##
+  # Include a file, indenting it correctly.
+
+  def include_file(name, indent)
+    if full_name = find_include_file(name) then
+      content = File.open(full_name) {|f| f.read}
+      # strip leading '#'s, but only if all lines start with them
+      if content =~ /^[^#]/
+        content.gsub(/^/, indent)
+      else
+        content.gsub(/^#?/, indent)
+      end
+    else
+      $stderr.puts "Couldn't find file to include: '#{name}'"
+      ''
+    end
+  end
+
+  ##
+  # Look for the given file in the directory containing the current file,
+  # and then in each of the directories specified in the RDOC_INCLUDE path
+
+  def find_include_file(name)
+    to_search = [ File.dirname(@input_file_name) ].concat @include_path
+    to_search.each do |dir|
+      full_name = File.join(dir, name)
+      stat = File.stat(full_name) rescue next
+      return full_name if stat.readable?
+    end
+    nil
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/simple_markup/fragments.rb ../rdoc-f95-20090109-1/markup/simple_markup/fragments.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/simple_markup/fragments.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/simple_markup/fragments.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,328 +0,0 @@
-require 'rdoc/markup/simple_markup/lines.rb'
-#require 'rdoc/markup/simple_markup/to_flow.rb'
-
-module SM
-
-  ##
-  # A Fragment is a chunk of text, subclassed as a paragraph, a list
-  # entry, or verbatim text
-
-  class Fragment
-    attr_reader   :level, :param, :txt
-    attr_accessor :type
-
-    def initialize(level, param, type, txt)
-      @level = level
-      @param = param
-      @type  = type
-      @txt   = ""
-      add_text(txt) if txt
-    end
-
-    def add_text(txt)
-      @txt << " " if @txt.length > 0
-      @txt << txt.tr_s("\n ", "  ").strip
-    end
-
-    def to_s
-      "L#@level: #{self.class.name.split('::')[-1]}\n#@txt"
-    end
-
-    ######
-    # This is a simple factory system that lets us associate fragement
-    # types (a string) with a subclass of fragment
-
-    TYPE_MAP = {}
-
-    def Fragment.type_name(name)
-      TYPE_MAP[name] = self
-    end
-
-    def Fragment.for(line)
-      klass =  TYPE_MAP[line.type] ||
-        raise("Unknown line type: '#{line.type.inspect}:' '#{line.text}'")
-      return klass.new(line.level, line.param, line.flag, line.text)
-    end
-  end
-
-  ##
-  # A paragraph is a fragment which gets wrapped to fit. We remove all
-  # newlines when we're created, and have them put back on output
-
-  class Paragraph < Fragment
-    type_name Line::PARAGRAPH
-  end
-
-  class BlankLine < Paragraph
-    type_name Line::BLANK
-  end
-
-  class Heading < Paragraph
-    type_name Line::HEADING
-
-    def head_level
-      @param.to_i
-    end
-  end
-
-  ##
-  # A List is a fragment with some kind of label
-  #
-
-  class ListBase < Paragraph
-    # List types
-    BULLET  = :BULLET
-    NUMBER  = :NUMBER
-    UPPERALPHA  = :UPPERALPHA
-    LOWERALPHA  = :LOWERALPHA
-    LABELED = :LABELED
-    NOTE    = :NOTE
-  end
-
-  class ListItem < ListBase
-    type_name Line::LIST
-
-    #  def label
-    #    am = AttributeManager.new(@param)
-    #    am.flow
-    #  end
-  end
-
-  class ListStart < ListBase
-    def initialize(level, param, type)
-      super(level, param, type, nil)
-    end
-  end
-
-  class ListEnd < ListBase
-    def initialize(level, type)
-      super(level, "", type, nil)
-    end
-  end
-
-  ##
-  # Verbatim code contains lines that don't get wrapped.
-
-  class Verbatim < Fragment
-    type_name  Line::VERBATIM
-
-    def add_text(txt)
-      @txt << txt.chomp << "\n"
-    end
-
-  end
-
-  ##
-  # A horizontal rule
-  class Rule < Fragment
-    type_name Line::RULE
-  end
-
-
-  # Collect groups of lines together. Each group
-  # will end up containing a flow of text
-
-  class LineCollection
-    
-    def initialize
-      @fragments = []
-    end
-
-    def add(fragment)
-      @fragments << fragment
-    end
-
-    def each(&b)
-      @fragments.each(&b)
-    end
-
-    # For testing
-    def to_a
-      @fragments.map {|fragment| fragment.to_s}
-    end
-
-    # Factory for different fragment types
-    def fragment_for(*args)
-      Fragment.for(*args)
-    end
-
-    # tidy up at the end
-    def normalize
-      change_verbatim_blank_lines
-      add_list_start_and_ends
-      add_list_breaks
-      tidy_blank_lines
-    end
-
-    def to_s
-      @fragments.join("\n----\n")
-    end
-
-    def accept(am, visitor)
-
-      visitor.start_accepting
-
-      @fragments.each do |fragment|
-        case fragment
-        when Verbatim
-          visitor.accept_verbatim(am, fragment)
-        when Rule
-          visitor.accept_rule(am, fragment)
-        when ListStart
-          visitor.accept_list_start(am, fragment)
-        when ListEnd
-          visitor.accept_list_end(am, fragment)
-        when ListItem
-          visitor.accept_list_item(am, fragment)
-        when BlankLine
-          visitor.accept_blank_line(am, fragment)
-        when Heading
-          visitor.accept_heading(am, fragment)
-        when Paragraph
-          visitor.accept_paragraph(am, fragment)
-        end
-      end
-
-      visitor.end_accepting
-    end
-    #######
-    private
-    #######
-
-    # If you have:
-    #
-    #    normal paragraph text.
-    #
-    #       this is code
-    #   
-    #       and more code
-    #
-    # You'll end up with the fragments Paragraph, BlankLine, 
-    # Verbatim, BlankLine, Verbatim, BlankLine, etc
-    #
-    # The BlankLine in the middle of the verbatim chunk needs to
-    # be changed to a real verbatim newline, and the two
-    # verbatim blocks merged
-    #
-    #    
-    def change_verbatim_blank_lines
-      frag_block = nil
-      blank_count = 0
-      @fragments.each_with_index do |frag, i|
-        if frag_block.nil?
-          frag_block = frag if Verbatim === frag
-        else
-          case frag
-          when Verbatim
-            blank_count.times { frag_block.add_text("\n") }
-            blank_count = 0
-            frag_block.add_text(frag.txt)
-            @fragments[i] = nil    # remove out current fragment
-          when BlankLine
-            if frag_block
-              blank_count += 1
-              @fragments[i] = nil
-            end
-          else
-            frag_block = nil
-            blank_count = 0
-          end
-        end
-      end
-      @fragments.compact!
-    end
-
-    # List nesting is implicit given the level of
-    # Make it explicit, just to make life a tad
-    # easier for the output processors
-
-    def add_list_start_and_ends
-      level = 0
-      res = []
-      type_stack = []
-
-      @fragments.each do |fragment|
-        # $stderr.puts "#{level} : #{fragment.class.name} : #{fragment.level}"
-        new_level = fragment.level
-        while (level < new_level)
-          level += 1
-          type = fragment.type
-          res << ListStart.new(level, fragment.param, type) if type
-          type_stack.push type
-          # $stderr.puts "Start: #{level}"
-        end
-
-        while level > new_level
-          type = type_stack.pop
-          res << ListEnd.new(level, type) if type
-          level -= 1
-          # $stderr.puts "End: #{level}, #{type}"
-        end
-
-        res << fragment
-        level = fragment.level
-      end
-      level.downto(1) do |i|
-        type = type_stack.pop
-        res << ListEnd.new(i, type) if type
-      end
-
-      @fragments = res
-    end
-
-    # now insert start/ends between list entries at the
-    # same level that have different element types
-
-    def add_list_breaks
-      res = @fragments
-
-      @fragments = []
-      list_stack = []
-
-      res.each do |fragment|
-        case fragment
-        when ListStart
-          list_stack.push fragment
-        when ListEnd
-          start = list_stack.pop
-          fragment.type = start.type
-        when ListItem
-          l = list_stack.last
-          if fragment.type != l.type
-            @fragments << ListEnd.new(l.level, l.type)
-            start = ListStart.new(l.level, fragment.param, fragment.type)
-            @fragments << start
-            list_stack.pop
-            list_stack.push start
-          end
-        else
-          ;
-        end
-        @fragments << fragment
-      end
-    end
-
-    # Finally tidy up the blank lines:
-    # * change Blank/ListEnd into ListEnd/Blank
-    # * remove blank lines at the front
-
-    def tidy_blank_lines
-      (@fragments.size - 1).times do |i|
-        if @fragments[i].kind_of?(BlankLine) and 
-            @fragments[i+1].kind_of?(ListEnd)
-          @fragments[i], @fragments[i+1] = @fragments[i+1], @fragments[i] 
-        end
-      end
-
-      # remove leading blanks
-      @fragments.each_with_index do |f, i|
-        break unless f.kind_of? BlankLine
-        @fragments[i] = nil
-      end
-
-      @fragments.compact!
-    end
-
-  end
-  
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/simple_markup/inline.rb ../rdoc-f95-20090109-1/markup/simple_markup/inline.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/simple_markup/inline.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/simple_markup/inline.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,340 +0,0 @@
-module SM
-
-  # We manage a set of attributes. Each attribute has a symbol name
-  # and a bit value
-
-  class Attribute
-    SPECIAL = 1
-
-    @@name_to_bitmap = { :_SPECIAL_ => SPECIAL }
-    @@next_bitmap = 2
-
-    def Attribute.bitmap_for(name)
-      bitmap = @@name_to_bitmap[name]
-      if !bitmap
-        bitmap = @@next_bitmap
-        @@next_bitmap <<= 1
-        @@name_to_bitmap[name] = bitmap
-      end
-      bitmap
-    end
-
-    def Attribute.as_string(bitmap)
-      return "none" if bitmap.zero?
-      res = []
-      @@name_to_bitmap.each do |name, bit|
-        res << name if (bitmap & bit) != 0
-      end
-      res.join(",")
-    end
-
-    def Attribute.each_name_of(bitmap)
-      @@name_to_bitmap.each do |name, bit|
-        next if bit == SPECIAL
-        yield name.to_s if (bitmap & bit) != 0
-      end
-    end
-  end
-
-
-  # An AttrChanger records a change in attributes. It contains
-  # a bitmap of the attributes to turn on, and a bitmap of those to
-  # turn off
-
-  AttrChanger = Struct.new(:turn_on, :turn_off)
-  class AttrChanger
-    def to_s
-      "Attr: +#{Attribute.as_string(@turn_on)}/-#{Attribute.as_string(@turn_on)}"
-    end
-  end
-
-  # An array of attributes which parallels the characters in a string
-  class AttrSpan
-    def initialize(length)
-      @attrs = Array.new(length, 0)
-    end
-
-    def set_attrs(start, length, bits)
-      for i in start ... (start+length)
-        @attrs[i] |= bits
-      end
-    end
-
-    def [](n)
-      @attrs[n]
-    end
-  end
-
-  ##
-  # Hold details of a special sequence
-
-  class Special
-    attr_reader   :type
-    attr_accessor :text
-
-    def initialize(type, text)
-      @type, @text = type, text
-    end
-
-    def ==(o)
-      self.text == o.text && self.type == o.type
-    end
-
-    def to_s
-      "Special: type=#{type}, text=#{text.dump}"
-    end
-  end
-  
-  class AttributeManager
-
-    NULL = "\000".freeze
-
-    ##
-    # We work by substituting non-printing characters in to the
-    # text. For now I'm assuming that I can substitute
-    # a character in the range 0..8 for a 7 bit character
-    # without damaging the encoded string, but this might
-    # be optimistic
-    #
-
-    A_PROTECT  = 004
-    PROTECT_ATTR  = A_PROTECT.chr
-
-    # This maps delimiters that occur around words (such as
-    # *bold* or +tt+) where the start and end delimiters
-    # and the same. This lets us optimize the regexp
-    MATCHING_WORD_PAIRS = {}
-
-    # And this is used when the delimiters aren't the same. In this
-    # case the hash maps a pattern to the attribute character
-    WORD_PAIR_MAP = {}
-
-    # This maps HTML tags to the corresponding attribute char
-    HTML_TAGS = {}
-
-    # And this maps _special_ sequences to a name. A special sequence
-    # is something like a WikiWord
-    SPECIAL = {}
-
-    # Return an attribute object with the given turn_on
-    # and turn_off bits set
-
-    def attribute(turn_on, turn_off)
-      AttrChanger.new(turn_on, turn_off)
-    end
-
-
-    def change_attribute(current, new)
-      diff = current ^ new
-      attribute(new & diff, current & diff)
-    end
-
-    def changed_attribute_by_name(current_set, new_set)
-      current = new = 0
-      current_set.each {|name| current |= Attribute.bitmap_for(name) }
-      new_set.each {|name| new |= Attribute.bitmap_for(name) }
-      change_attribute(current, new)
-    end
-
-    def copy_string(start_pos, end_pos)
-      res = @str[start_pos...end_pos]
-      res.gsub!(/\000/, '')
-      res
-    end
-
-    # Map attributes like <b>text</b>to the sequence \001\002<char>\001\003<char>,
-    # where <char> is a per-attribute specific character
-
-    def convert_attrs(str, attrs)
-      # first do matching ones
-      tags = MATCHING_WORD_PAIRS.keys.join("")
-      re = "(^|\\W)([#{tags}])([A-Za-z_]+?)\\2(\\W|\$)"
-#      re = "(^|\\W)([#{tags}])(\\S+?)\\2(\\W|\$)"
-      1 while str.gsub!(Regexp.new(re)) {
-        attr = MATCHING_WORD_PAIRS[$2];
-        attrs.set_attrs($`.length + $1.length + $2.length, $3.length, attr)
-        $1 + NULL*$2.length + $3 + NULL*$2.length + $4
-      }
-
-      # then non-matching
-      unless WORD_PAIR_MAP.empty?
-        WORD_PAIR_MAP.each do |regexp, attr|
-          str.gsub!(regexp) { 
-            attrs.set_attrs($`.length + $1.length, $2.length, attr)
-            NULL*$1.length + $2 + NULL*$3.length
-          }
-        end
-      end
-    end
-
-    def convert_html(str, attrs)
-      tags = HTML_TAGS.keys.join("|")
-      re = "<(#{tags})>(.*?)</\\1>"
-      1 while str.gsub!(Regexp.new(re, Regexp::IGNORECASE)) {
-        attr = HTML_TAGS[$1.downcase]
-        html_length = $1.length + 2
-        seq = NULL * html_length
-        attrs.set_attrs($`.length + html_length, $2.length, attr)
-        seq + $2 + seq + NULL
-      }
-    end
-
-    def convert_specials(str, attrs)
-      unless SPECIAL.empty?
-        SPECIAL.each do |regexp, attr|
-          str.scan(regexp) do
-            attrs.set_attrs($`.length, $&.length, attr | Attribute::SPECIAL)
-          end
-        end
-      end
-    end
-
-    # A \ in front of a character that would normally be
-    # processed turns off processing. We do this by turning
-    # \< into <#{PROTECT}
-    
-    PROTECTABLE = [ "<" << "\\" ]  #"
-
-
-    def mask_protected_sequences
-      protect_pattern = Regexp.new("\\\\([#{Regexp.escape(PROTECTABLE.join(''))}])")
-      @str.gsub!(protect_pattern, "\\1#{PROTECT_ATTR}")
-    end
-
-    def unmask_protected_sequences
-      @str.gsub!(/(.)#{PROTECT_ATTR}/, "\\1\000")
-    end
-
-    def initialize
-      add_word_pair("*", "*", :BOLD)
-      add_word_pair("_", "_", :EM)
-      add_word_pair("+", "+", :TT)
-      
-      add_html("em", :EM)
-      add_html("i",  :EM)
-      add_html("b",  :BOLD)
-      add_html("tt",   :TT)
-      add_html("code", :TT)
-
-      add_special(/<!--(.*?)-->/, :COMMENT)
-    end
-
-    def add_word_pair(start, stop, name)
-      raise "Word flags may not start '<'" if start[0] == ?<
-      bitmap = Attribute.bitmap_for(name)
-      if start == stop
-        MATCHING_WORD_PAIRS[start] = bitmap
-      else
-        pattern = Regexp.new("(" + Regexp.escape(start) + ")" +
-#                             "([A-Za-z]+)" +
-                             "(\\S+)" +
-                             "(" + Regexp.escape(stop) +")")
-        WORD_PAIR_MAP[pattern] = bitmap
-      end
-      PROTECTABLE << start[0,1]
-      PROTECTABLE.uniq!
-    end
-
-    def add_html(tag, name)
-      HTML_TAGS[tag.downcase] = Attribute.bitmap_for(name)
-    end
-
-    def add_special(pattern, name)
-      SPECIAL[pattern] = Attribute.bitmap_for(name)
-    end
-
-    def flow(str)
-      @str = str
-
-      puts("Before flow, str='#{@str.dump}'") if $DEBUG
-      mask_protected_sequences
- 
-      @attrs = AttrSpan.new(@str.length)
-
-      puts("After protecting, str='#{@str.dump}'") if $DEBUG
-      convert_attrs(@str, @attrs)
-      convert_html(@str, @attrs)
-      convert_specials(str, @attrs)
-      unmask_protected_sequences
-      puts("After flow, str='#{@str.dump}'") if $DEBUG
-      return split_into_flow
-    end
-
-    def display_attributes
-      puts
-      puts @str.tr(NULL, "!")
-      bit = 1
-      16.times do |bno|
-        line = ""
-        @str.length.times do |i|
-          if (@attrs[i] & bit) == 0
-            line << " "
-          else
-            if bno.zero?
-              line << "S"
-            else
-              line << ("%d" % (bno+1))
-            end
-          end
-        end
-        puts(line) unless line =~ /^ *$/
-        bit <<= 1
-      end
-    end
-
-    def split_into_flow
-
-      display_attributes if $DEBUG
-
-      res = []
-      current_attr = 0
-      str = ""
-
-      
-      str_len = @str.length
-
-      # skip leading invisible text
-      i = 0
-      i += 1 while i < str_len and @str[i].zero?
-      start_pos = i
-
-      # then scan the string, chunking it on attribute changes
-      while i < str_len
-        new_attr = @attrs[i]
-        if new_attr != current_attr
-          if i > start_pos
-            res << copy_string(start_pos, i)
-            start_pos = i
-          end
-
-          res << change_attribute(current_attr, new_attr)
-          current_attr = new_attr
-
-          if (current_attr & Attribute::SPECIAL) != 0
-            i += 1 while i < str_len and (@attrs[i] & Attribute::SPECIAL) != 0
-            res << Special.new(current_attr, copy_string(start_pos, i))
-            start_pos = i
-            next
-          end
-        end
-
-        # move on, skipping any invisible characters
-        begin
-          i += 1
-        end while i < str_len and @str[i].zero?
-      end
-      
-      # tidy up trailing text
-      if start_pos < str_len
-        res << copy_string(start_pos, str_len)
-      end
-
-      # and reset to all attributes off
-      res << change_attribute(current_attr, 0) if current_attr != 0
-
-      return res
-    end
-
-  end
-
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/simple_markup/lines.rb ../rdoc-f95-20090109-1/markup/simple_markup/lines.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/simple_markup/lines.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/simple_markup/lines.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,151 +0,0 @@
-##########################################################################
-#
-# We store the lines we're working on as objects of class Line.
-# These contain the text of the line, along with a flag indicating the
-# line type, and an indentation level
-
-module SM
-
-  class Line
-    INFINITY = 9999
-
-    BLANK     = :BLANK
-    HEADING   = :HEADING
-    LIST      = :LIST
-    RULE      = :RULE
-    PARAGRAPH = :PARAGRAPH
-    VERBATIM  = :VERBATIM
-    
-    # line type
-    attr_accessor :type
-
-    # The indentation nesting level
-    attr_accessor :level
-
-    # The contents
-    attr_accessor :text
-
-    # A prefix or parameter. For LIST lines, this is
-    # the text that introduced the list item (the label)
-    attr_accessor  :param
-
-    # A flag. For list lines, this is the type of the list
-    attr_accessor :flag
-
-    # the number of leading spaces
-    attr_accessor :leading_spaces
-
-    # true if this line has been deleted from the list of lines
-    attr_accessor :deleted
-    
-
-    def initialize(text)
-      @text    = text.dup
-      @deleted = false
-
-      # expand tabs
-      1 while @text.gsub!(/\t+/) { ' ' * (8*$&.length - $`.length % 8)}  && $~ #`
-
-      # Strip trailing whitespace
-      @text.sub!(/\s+$/, '')
-
-      # and look for leading whitespace
-      if @text.length > 0
-        @text =~ /^(\s*)/
-        @leading_spaces = $1.length
-      else
-        @leading_spaces = INFINITY
-      end
-    end
-
-    # Return true if this line is blank
-    def isBlank?
-      @text.length.zero?
-    end
-
-    # stamp a line with a type, a level, a prefix, and a flag
-    def stamp(type, level, param="", flag=nil)
-      @type, @level, @param, @flag = type, level, param, flag
-    end
-
-    ##
-    # Strip off the leading margin
-    #
-
-    def strip_leading(size)
-      if @text.size > size
-        @text[0,size] = ""
-      else
-        @text = ""
-      end
-    end
-
-    def to_s
-      "#@type#@level: #@text"
-    end
-  end
-
-  ###############################################################################
-  #
-  # A container for all the lines
-  #
-
-  class Lines
-    include Enumerable
-
-    attr_reader :lines   # for debugging
-
-    def initialize(lines)
-      @lines = lines
-      rewind
-    end
-
-    def empty?
-      @lines.size.zero?
-    end
-
-    def each
-      @lines.each do |line|
-        yield line unless line.deleted
-      end
-    end
-
-#    def [](index)
-#      @lines[index]
-#    end
-
-    def rewind
-      @nextline = 0
-    end
-
-    def next
-      begin
-        res = @lines[@nextline]
-        @nextline += 1 if @nextline < @lines.size
-      end while res and res.deleted and @nextline < @lines.size
-      res
-    end
-
-    def unget
-      @nextline -= 1
-    end
-
-    def delete(a_line)
-      a_line.deleted = true
-    end
-
-    def normalize
-      margin = @lines.collect{|l| l.leading_spaces}.min
-      margin = 0 if margin == Line::INFINITY
-      @lines.each {|line| line.strip_leading(margin) } if margin > 0
-    end
-
-    def as_text
-      @lines.map {|l| l.text}.join("\n")
-    end
-
-    def line_types
-      @lines.map {|l| l.type }
-    end
-  end
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/simple_markup/preprocess.rb ../rdoc-f95-20090109-1/markup/simple_markup/preprocess.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/simple_markup/preprocess.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/simple_markup/preprocess.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,73 +0,0 @@
-module SM
-
-  ## 
-  # Handle common directives that can occur in a block of text:
-  #
-  # : include : filename
-  #
-
-  class PreProcess
-
-    def initialize(input_file_name, include_path)
-      @input_file_name = input_file_name
-      @include_path = include_path
-    end
-
-    # Look for common options in a chunk of text. Options that
-    # we don't handle are passed back to our caller
-    # as |directive, param| 
-
-    def handle(text)
-      text.gsub!(/^([ \t#]*):(\w+):\s*(.+)?\n/) do 
-        prefix    = $1
-        directive = $2.downcase
-        param     = $3
-
-        case directive
-        when "include"
-          filename = param.split[0]
-          include_file(filename, prefix)
-
-        else
-          yield(directive, param)
-        end
-      end
-    end
-
-    #######
-    private
-    #######
-
-    # Include a file, indenting it correctly
-
-    def include_file(name, indent)
-      if (full_name = find_include_file(name))
-        content = File.open(full_name) {|f| f.read}
-        # strip leading '#'s, but only if all lines start with them
-        if content =~ /^[^#]/
-          content.gsub(/^/, indent)
-        else
-          content.gsub(/^#?/, indent)
-        end
-      else
-        $stderr.puts "Couldn't find file to include: '#{name}'"
-        ''
-      end
-    end
-
-    # Look for the given file in the directory containing the current
-    # file, and then in each of the directories specified in the
-    # RDOC_INCLUDE path
-
-    def find_include_file(name)
-      to_search = [ File.dirname(@input_file_name) ].concat @include_path
-      to_search.each do |dir|
-        full_name = File.join(dir, name)
-        stat = File.stat(full_name) rescue next
-        return full_name if stat.readable?
-      end
-      nil
-    end
-
-  end
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/simple_markup/to_flow.rb ../rdoc-f95-20090109-1/markup/simple_markup/to_flow.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/simple_markup/to_flow.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/simple_markup/to_flow.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,188 +0,0 @@
-require 'rdoc/markup/simple_markup/fragments'
-require 'rdoc/markup/simple_markup/inline'
-require 'cgi'
-
-module SM
-
-  module Flow
-    P = Struct.new(:body)
-    VERB = Struct.new(:body)
-    RULE = Struct.new(:width)
-    class LIST
-      attr_reader :type, :contents
-      def initialize(type)
-        @type = type
-        @contents = []
-      end
-      def <<(stuff)
-        @contents << stuff
-      end
-    end
-    LI = Struct.new(:label, :body)
-    H = Struct.new(:level, :text)
-  end
-
-  class ToFlow
-    LIST_TYPE_TO_HTML = {
-      SM::ListBase::BULLET     =>  [ "<ul>", "</ul>" ],
-      SM::ListBase::NUMBER     =>  [ "<ol>", "</ol>" ],
-      SM::ListBase::UPPERALPHA =>  [ "<ol>", "</ol>" ],
-      SM::ListBase::LOWERALPHA =>  [ "<ol>", "</ol>" ],
-      SM::ListBase::LABELED    =>  [ "<dl>", "</dl>" ],
-      SM::ListBase::NOTE       =>  [ "<table>", "</table>" ],
-    }
-
-    InlineTag = Struct.new(:bit, :on, :off)
-
-    def initialize
-      init_tags
-    end
-
-    ##
-    # Set up the standard mapping of attributes to HTML tags
-    #
-    def init_tags
-      @attr_tags = [
-        InlineTag.new(SM::Attribute.bitmap_for(:BOLD), "<b>", "</b>"),
-        InlineTag.new(SM::Attribute.bitmap_for(:TT),   "<tt>", "</tt>"),
-        InlineTag.new(SM::Attribute.bitmap_for(:EM),   "<em>", "</em>"),
-      ]
-    end
-
-    ##
-    # Add a new set of HTML tags for an attribute. We allow
-    # separate start and end tags for flexibility
-    #
-    def add_tag(name, start, stop)
-      @attr_tags << InlineTag.new(SM::Attribute.bitmap_for(name), start, stop)
-    end
-
-    ##
-    # Given an HTML tag, decorate it with class information
-    # and the like if required. This is a no-op in the base
-    # class, but is overridden in HTML output classes that
-    # implement style sheets
-
-    def annotate(tag)
-      tag
-    end
-
-    ## 
-    # Here's the client side of the visitor pattern
-
-    def start_accepting
-      @res = []
-      @list_stack = []
-    end
-
-    def end_accepting
-      @res
-    end
-
-    def accept_paragraph(am, fragment)
-      @res << Flow::P.new((convert_flow(am.flow(fragment.txt))))
-    end
-
-    def accept_verbatim(am, fragment)
-      @res << Flow::VERB.new((convert_flow(am.flow(fragment.txt))))
-    end
-
-    def accept_rule(am, fragment)
-      size = fragment.param
-      size = 10 if size > 10
-      @res << Flow::RULE.new(size)
-    end
-
-    def accept_list_start(am, fragment)
-      @list_stack.push(@res)
-      list = Flow::LIST.new(fragment.type)
-      @res << list
-      @res = list
-    end
-
-    def accept_list_end(am, fragment)
-      @res = @list_stack.pop
-    end
-
-    def accept_list_item(am, fragment)
-      @res << Flow::LI.new(fragment.param, convert_flow(am.flow(fragment.txt)))
-    end
-
-    def accept_blank_line(am, fragment)
-      # @res << annotate("<p />") << "\n"
-    end
-
-    def accept_heading(am, fragment)
-      @res << Flow::H.new(fragment.head_level, convert_flow(am.flow(fragment.txt)))
-    end
-
-
-    #######################################################################
-
-    private
-
-    #######################################################################
-
-    def on_tags(res, item)
-      attr_mask = item.turn_on
-      return if attr_mask.zero?
-
-      @attr_tags.each do |tag|
-        if attr_mask & tag.bit != 0
-          res << annotate(tag.on)
-        end
-      end
-    end
-
-    def off_tags(res, item)
-      attr_mask = item.turn_off
-      return if attr_mask.zero?
-
-      @attr_tags.reverse_each do |tag|
-        if attr_mask & tag.bit != 0
-          res << annotate(tag.off)
-        end
-      end
-    end
-
-    def convert_flow(flow)
-      res = ""
-      flow.each do |item|
-        case item
-        when String
-          res << convert_string(item)
-        when AttrChanger
-          off_tags(res, item)
-          on_tags(res,  item)
-        when Special
-          res << convert_special(item)
-        else
-          raise "Unknown flow element: #{item.inspect}"
-        end
-      end
-      res
-    end
-
-    # some of these patterns are taken from SmartyPants...
-
-    def convert_string(item)
-      CGI.escapeHTML(item)
-    end
-
-    def convert_special(special)
-      handled = false
-      Attribute.each_name_of(special.type) do |name|
-        method_name = "handle_special_#{name}"
-        if self.respond_to? method_name
-          special.text = send(method_name, special)
-          handled = true
-        end
-      end
-      raise "Unhandled special: #{special}" unless handled
-      special.text
-    end
-
-
-  end
-
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/simple_markup/to_html.rb ../rdoc-f95-20090109-1/markup/simple_markup/to_html.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/simple_markup/to_html.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/simple_markup/to_html.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,289 +0,0 @@
-require 'rdoc/markup/simple_markup/fragments'
-require 'rdoc/markup/simple_markup/inline'
-
-require 'cgi'
-
-module SM
-
-  class ToHtml
-
-    LIST_TYPE_TO_HTML = {
-      ListBase::BULLET =>  [ "<ul>", "</ul>" ],
-      ListBase::NUMBER =>  [ "<ol>", "</ol>" ],
-      ListBase::UPPERALPHA =>  [ "<ol>", "</ol>" ],
-      ListBase::LOWERALPHA =>  [ "<ol>", "</ol>" ],
-      ListBase::LABELED => [ "<dl>", "</dl>" ],
-      ListBase::NOTE    => [ "<table>", "</table>" ],
-    }
-
-    InlineTag = Struct.new(:bit, :on, :off)
-
-    def initialize
-      init_tags
-    end
-
-    ##
-    # Set up the standard mapping of attributes to HTML tags
-    #
-    def init_tags
-      @attr_tags = [
-        InlineTag.new(SM::Attribute.bitmap_for(:BOLD), "<b>", "</b>"),
-        InlineTag.new(SM::Attribute.bitmap_for(:TT),   "<tt>", "</tt>"),
-        InlineTag.new(SM::Attribute.bitmap_for(:EM),   "<em>", "</em>"),
-      ]
-    end
-
-    ##
-    # Add a new set of HTML tags for an attribute. We allow
-    # separate start and end tags for flexibility
-    #
-    def add_tag(name, start, stop)
-      @attr_tags << InlineTag.new(SM::Attribute.bitmap_for(name), start, stop)
-    end
-
-    ##
-    # Given an HTML tag, decorate it with class information
-    # and the like if required. This is a no-op in the base
-    # class, but is overridden in HTML output classes that
-    # implement style sheets
-
-    def annotate(tag)
-      tag
-    end
-
-    ## 
-    # Here's the client side of the visitor pattern
-
-    def start_accepting
-      @res = ""
-      @in_list_entry = []
-    end
-
-    def end_accepting
-      @res
-    end
-
-    def accept_paragraph(am, fragment)
-      @res << annotate("<p>") + "\n"
-      @res << wrap(convert_flow(am.flow(fragment.txt)))
-      @res << annotate("</p>") + "\n"
-    end
-
-    def accept_verbatim(am, fragment)
-      @res << annotate("<pre>") + "\n"
-      @res << CGI.escapeHTML(fragment.txt)
-      @res << annotate("</pre>") << "\n"
-    end
-
-    def accept_rule(am, fragment)
-      size = fragment.param
-      size = 10 if size > 10
-      @res << "<hr size=\"#{size}\"></hr>"
-    end
-
-    def accept_list_start(am, fragment)
-      @res << html_list_name(fragment.type, true) <<"\n"
-      @in_list_entry.push false
-    end
-
-    def accept_list_end(am, fragment)
-      if tag = @in_list_entry.pop
-        @res << annotate(tag) << "\n"
-      end
-      @res << html_list_name(fragment.type, false) <<"\n"
-    end
-
-    def accept_list_item(am, fragment)
-      if tag = @in_list_entry.last
-        @res << annotate(tag) << "\n"
-      end
-      @res << list_item_start(am, fragment)
-      @res << wrap(convert_flow(am.flow(fragment.txt))) << "\n"
-      @in_list_entry[-1] = list_end_for(fragment.type)
-    end
-
-    def accept_blank_line(am, fragment)
-      # @res << annotate("<p />") << "\n"
-    end
-
-    def accept_heading(am, fragment)
-      @res << convert_heading(fragment.head_level, am.flow(fragment.txt))
-    end
-
-    # This is a higher speed (if messier) version of wrap
-
-    def wrap(txt, line_len = 76)
-      res = ""
-      sp = 0
-      ep = txt.length
-      while sp < ep
-        # scan back for a space
-        p = sp + line_len - 1
-        if p >= ep
-          p = ep
-        else
-          while p > sp and txt[p] != ?\s
-            p -= 1
-          end
-          if p <= sp
-            p = sp + line_len
-            while p < ep and txt[p] != ?\s
-              p += 1
-            end
-          end
-        end
-        res << txt[sp...p] << "\n"
-        sp = p
-        sp += 1 while sp < ep and txt[sp] == ?\s
-      end
-      res
-    end
-
-    #######################################################################
-
-    private
-
-    #######################################################################
-
-    def on_tags(res, item)
-      attr_mask = item.turn_on
-      return if attr_mask.zero?
-
-      @attr_tags.each do |tag|
-        if attr_mask & tag.bit != 0
-          res << annotate(tag.on)
-        end
-      end
-    end
-
-    def off_tags(res, item)
-      attr_mask = item.turn_off
-      return if attr_mask.zero?
-
-      @attr_tags.reverse_each do |tag|
-        if attr_mask & tag.bit != 0
-          res << annotate(tag.off)
-        end
-      end
-    end
-
-    def convert_flow(flow)
-      res = ""
-      flow.each do |item|
-        case item
-        when String
-          res << convert_string(item)
-        when AttrChanger
-          off_tags(res, item)
-          on_tags(res,  item)
-        when Special
-          res << convert_special(item)
-        else
-          raise "Unknown flow element: #{item.inspect}"
-        end
-      end
-      res
-    end
-
-    # some of these patterns are taken from SmartyPants...
-
-    def convert_string(item)
-      CGI.escapeHTML(item).
-      
-      
-      # convert -- to em-dash, (-- to en-dash)
-        gsub(/---?/, '&#8212;'). #gsub(/--/, '&#8211;').
-
-      # convert ... to elipsis (and make sure .... becomes .<elipsis>)
-        gsub(/\.\.\.\./, '.&#8230;').gsub(/\.\.\./, '&#8230;').
-
-      # convert single closing quote
-        gsub(%r{([^ \t\r\n\[\{\(])\'}) { "#$1&#8217;" }.
-        gsub(%r{\'(?=\W|s\b)}) { "&#8217;" }.
-
-      # convert single opening quote
-        gsub(/'/, '&#8216;').
-
-      # convert double closing quote
-        gsub(%r{([^ \t\r\n\[\{\(])\'(?=\W)}) { "#$1&#8221;" }.
-
-      # convert double opening quote
-        gsub(/'/, '&#8220;').
-
-      # convert copyright
-        gsub(/\(c\)/, '&#169;').
-
-      # convert and registered trademark
-        gsub(/\(r\)/, '&#174;')
-
-    end
-
-    def convert_special(special)
-      handled = false
-      Attribute.each_name_of(special.type) do |name|
-        method_name = "handle_special_#{name}"
-        if self.respond_to? method_name
-          special.text = send(method_name, special)
-          handled = true
-        end
-      end
-      raise "Unhandled special: #{special}" unless handled
-      special.text
-    end
-
-    def convert_heading(level, flow)
-      res =
-        annotate("<h#{level}>") + 
-        convert_flow(flow) + 
-        annotate("</h#{level}>\n")
-    end
-
-    def html_list_name(list_type, is_open_tag)
-      tags = LIST_TYPE_TO_HTML[list_type] || raise("Invalid list type: #{list_type.inspect}")
-      annotate(tags[ is_open_tag ? 0 : 1])
-    end
-
-    def list_item_start(am, fragment)
-      case fragment.type
-      when ListBase::BULLET, ListBase::NUMBER
-        annotate("<li>")
-
-      when ListBase::UPPERALPHA
-	annotate("<li type=\"A\">")
-
-      when ListBase::LOWERALPHA
-	annotate("<li type=\"a\">")
-
-      when ListBase::LABELED
-        annotate("<dt>") +
-          convert_flow(am.flow(fragment.param)) + 
-          annotate("</dt>") +
-          annotate("<dd>")
-
-      when ListBase::NOTE
-        annotate("<tr>") +
-          annotate("<td valign=\"top\">") +
-          convert_flow(am.flow(fragment.param)) + 
-          annotate("</td>") +
-          annotate("<td>")
-      else
-        raise "Invalid list type"
-      end
-    end
-
-    def list_end_for(fragment_type)
-      case fragment_type
-      when ListBase::BULLET, ListBase::NUMBER, ListBase::UPPERALPHA, ListBase::LOWERALPHA
-        "</li>"
-      when ListBase::LABELED
-        "</dd>"
-      when ListBase::NOTE
-        "</td></tr>"
-      else
-        raise "Invalid list type"
-      end
-    end
-
-  end
-
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/simple_markup/to_latex.rb ../rdoc-f95-20090109-1/markup/simple_markup/to_latex.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/simple_markup/to_latex.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/simple_markup/to_latex.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,333 +0,0 @@
-require 'rdoc/markup/simple_markup/fragments'
-require 'rdoc/markup/simple_markup/inline'
-
-require 'cgi'
-
-module SM
-
-  # Convert SimpleMarkup to basic LaTeX report format
-
-  class ToLaTeX
-
-    BS = "\020"   # \
-    OB = "\021"   # {
-    CB = "\022"   # }
-    DL = "\023"   # Dollar
-
-    BACKSLASH   = "#{BS}symbol#{OB}92#{CB}"
-    HAT         = "#{BS}symbol#{OB}94#{CB}"
-    BACKQUOTE   = "#{BS}symbol#{OB}0#{CB}"
-    TILDE       = "#{DL}#{BS}sim#{DL}"
-    LESSTHAN    = "#{DL}<#{DL}"
-    GREATERTHAN = "#{DL}>#{DL}"
-
-    def self.l(str)
-      str.tr('\\', BS).tr('{', OB).tr('}', CB).tr('$', DL)
-    end
-
-    def l(arg)
-      SM::ToLaTeX.l(arg)
-    end
-
-    LIST_TYPE_TO_LATEX = {
-      ListBase::BULLET =>  [ l("\\begin{itemize}"), l("\\end{itemize}") ],
-      ListBase::NUMBER =>  [ l("\\begin{enumerate}"), l("\\end{enumerate}"), "\\arabic" ],
-      ListBase::UPPERALPHA =>  [ l("\\begin{enumerate}"), l("\\end{enumerate}"), "\\Alph" ],
-      ListBase::LOWERALPHA =>  [ l("\\begin{enumerate}"), l("\\end{enumerate}"), "\\alph" ],
-      ListBase::LABELED => [ l("\\begin{description}"), l("\\end{description}") ],
-      ListBase::NOTE    => [
-        l("\\begin{tabularx}{\\linewidth}{@{} l X @{}}"), 
-        l("\\end{tabularx}") ],
-    }
-
-    InlineTag = Struct.new(:bit, :on, :off)
-
-    def initialize
-      init_tags
-      @list_depth = 0
-      @prev_list_types = []
-    end
-
-    ##
-    # Set up the standard mapping of attributes to LaTeX
-    #
-    def init_tags
-      @attr_tags = [
-        InlineTag.new(SM::Attribute.bitmap_for(:BOLD), l("\\textbf{"), l("}")),
-        InlineTag.new(SM::Attribute.bitmap_for(:TT),   l("\\texttt{"), l("}")),
-        InlineTag.new(SM::Attribute.bitmap_for(:EM),   l("\\emph{"), l("}")),
-      ]
-    end
-
-    ##
-    # Escape a LaTeX string
-    def escape(str)
-# $stderr.print "FE: ", str
-      s = str.
-#        sub(/\s+$/, '').
-        gsub(/([_\${}&%#])/, "#{BS}\\1").
-        gsub(/\\/, BACKSLASH).
-        gsub(/\^/, HAT).
-        gsub(/~/,  TILDE).
-        gsub(/</,  LESSTHAN).
-        gsub(/>/,  GREATERTHAN).
-        gsub(/,,/, ",{},").
-        gsub(/\`/,  BACKQUOTE)
-# $stderr.print "-> ", s, "\n"
-      s
-    end
-
-    ##
-    # Add a new set of LaTeX tags for an attribute. We allow
-    # separate start and end tags for flexibility
-    #
-    def add_tag(name, start, stop)
-      @attr_tags << InlineTag.new(SM::Attribute.bitmap_for(name), start, stop)
-    end
-
-
-    ## 
-    # Here's the client side of the visitor pattern
-
-    def start_accepting
-      @res = ""
-      @in_list_entry = []
-    end
-
-    def end_accepting
-      @res.tr(BS, '\\').tr(OB, '{').tr(CB, '}').tr(DL, '$')
-    end
-
-    def accept_paragraph(am, fragment)
-      @res << wrap(convert_flow(am.flow(fragment.txt)))
-      @res << "\n"
-    end
-
-    def accept_verbatim(am, fragment)
-      @res << "\n\\begin{code}\n"
-      @res << fragment.txt.sub(/[\n\s]+\Z/, '')
-      @res << "\n\\end{code}\n\n"
-    end
-
-    def accept_rule(am, fragment)
-      size = fragment.param
-      size = 10 if size > 10
-      @res << "\n\n\\rule{\\linewidth}{#{size}pt}\n\n"
-    end
-
-    def accept_list_start(am, fragment)
-      @res << list_name(fragment.type, true) <<"\n"
-      @in_list_entry.push false
-    end
-
-    def accept_list_end(am, fragment)
-      if tag = @in_list_entry.pop
-        @res << tag << "\n"
-      end
-      @res << list_name(fragment.type, false) <<"\n"
-    end
-
-    def accept_list_item(am, fragment)
-      if tag = @in_list_entry.last
-        @res << tag << "\n"
-      end
-      @res << list_item_start(am, fragment)
-      @res << wrap(convert_flow(am.flow(fragment.txt))) << "\n"
-      @in_list_entry[-1] = list_end_for(fragment.type)
-    end
-
-    def accept_blank_line(am, fragment)
-      # @res << "\n"
-    end
-
-    def accept_heading(am, fragment)
-      @res << convert_heading(fragment.head_level, am.flow(fragment.txt))
-    end
-
-    # This is a higher speed (if messier) version of wrap
-
-    def wrap(txt, line_len = 76)
-      res = ""
-      sp = 0
-      ep = txt.length
-      while sp < ep
-        # scan back for a space
-        p = sp + line_len - 1
-        if p >= ep
-          p = ep
-        else
-          while p > sp and txt[p] != ?\s
-            p -= 1
-          end
-          if p <= sp
-            p = sp + line_len
-            while p < ep and txt[p] != ?\s
-              p += 1
-            end
-          end
-        end
-        res << txt[sp...p] << "\n"
-        sp = p
-        sp += 1 while sp < ep and txt[sp] == ?\s
-      end
-      res
-    end
-
-    #######################################################################
-
-    private
-
-    #######################################################################
-
-    def on_tags(res, item)
-      attr_mask = item.turn_on
-      return if attr_mask.zero?
-
-      @attr_tags.each do |tag|
-        if attr_mask & tag.bit != 0
-          res << tag.on
-        end
-      end
-    end
-
-    def off_tags(res, item)
-      attr_mask = item.turn_off
-      return if attr_mask.zero?
-
-      @attr_tags.reverse_each do |tag|
-        if attr_mask & tag.bit != 0
-          res << tag.off
-        end
-      end
-    end
-
-    def convert_flow(flow)
-      res = ""
-      flow.each do |item|
-        case item
-        when String
-#          $stderr.puts "Converting '#{item}'"
-          res << convert_string(item)
-        when AttrChanger
-          off_tags(res, item)
-          on_tags(res,  item)
-        when Special
-          res << convert_special(item)
-        else
-          raise "Unknown flow element: #{item.inspect}"
-        end
-      end
-      res
-    end
-
-    # some of these patterns are taken from SmartyPants...
-
-    def convert_string(item)
-
-      escape(item).
-      
-      
-      # convert ... to elipsis (and make sure .... becomes .<elipsis>)
-        gsub(/\.\.\.\./, '.\ldots{}').gsub(/\.\.\./, '\ldots{}').
-
-      # convert single closing quote
-        gsub(%r{([^ \t\r\n\[\{\(])\'}) { "#$1'" }.
-        gsub(%r{\'(?=\W|s\b)}) { "'" }.
-
-      # convert single opening quote
-        gsub(/'/, '`').
-
-      # convert double closing quote
-        gsub(%r{([^ \t\r\n\[\{\(])\"(?=\W)}) { "#$1''" }.
-
-      # convert double opening quote
-        gsub(/"/, "``").
-
-      # convert copyright
-        gsub(/\(c\)/, '\copyright{}')
-
-    end
-
-    def convert_special(special)
-      handled = false
-      Attribute.each_name_of(special.type) do |name|
-        method_name = "handle_special_#{name}"
-        if self.respond_to? method_name
-          special.text = send(method_name, special)
-          handled = true
-        end
-      end
-      raise "Unhandled special: #{special}" unless handled
-      special.text
-    end
-
-    def convert_heading(level, flow)
-      res =
-        case level
-        when 1 then "\\chapter{"
-        when 2 then "\\section{"
-        when 3 then "\\subsection{"
-        when 4 then "\\subsubsection{"
-        else  "\\paragraph{"
-        end +
-        convert_flow(flow) + 
-        "}\n"
-    end
-
-    def list_name(list_type, is_open_tag)
-      tags = LIST_TYPE_TO_LATEX[list_type] || raise("Invalid list type: #{list_type.inspect}")
-      if tags[2] # enumerate
-        if is_open_tag
-          @list_depth += 1
-          if @prev_list_types[@list_depth] != tags[2]
-            case @list_depth
-            when 1
-              roman = "i"
-            when 2
-              roman = "ii"
-            when 3
-              roman = "iii"
-            when 4
-              roman = "iv"
-            else
-              raise("Too deep list: level #{@list_depth}")
-            end
-            @prev_list_types[@list_depth] = tags[2]
-            return l("\\renewcommand{\\labelenum#{roman}}{#{tags[2]}{enum#{roman}}}") + "\n" + tags[0]
-          end
-        else
-          @list_depth -= 1
-        end
-      end
-      tags[ is_open_tag ? 0 : 1]
-    end
-
-    def list_item_start(am, fragment)
-      case fragment.type
-      when ListBase::BULLET, ListBase::NUMBER, ListBase::UPPERALPHA, ListBase::LOWERALPHA
-        "\\item "
-
-      when ListBase::LABELED
-        "\\item[" + convert_flow(am.flow(fragment.param)) + "] "
-
-      when ListBase::NOTE
-          convert_flow(am.flow(fragment.param)) + " & "
-      else
-        raise "Invalid list type"
-      end
-    end
-
-    def list_end_for(fragment_type)
-      case fragment_type
-      when ListBase::BULLET, ListBase::NUMBER, ListBase::UPPERALPHA, ListBase::LOWERALPHA, ListBase::LABELED
-        ""
-      when ListBase::NOTE
-        "\\\\\n"
-      else
-        raise "Invalid list type"
-      end
-    end
-
-  end
-
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/simple_markup.rb ../rdoc-f95-20090109-1/markup/simple_markup.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/simple_markup.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/simple_markup.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,476 +0,0 @@
-# = Introduction
-#
-# SimpleMarkup parses plain text documents and attempts to decompose
-# them into their constituent parts. Some of these parts are high-level:
-# paragraphs, chunks of verbatim text, list entries and the like. Other
-# parts happen at the character level: a piece of bold text, a word in
-# code font. This markup is similar in spirit to that used on WikiWiki
-# webs, where folks create web pages using a simple set of formatting
-# rules.
-#
-# SimpleMarkup itself does no output formatting: this is left to a
-# different set of classes.
-#
-# SimpleMarkup is extendable at runtime: you can add new markup
-# elements to be recognised in the documents that SimpleMarkup parses.
-#
-# SimpleMarkup is intended to be the basis for a family of tools which
-# share the common requirement that simple, plain-text should be
-# rendered in a variety of different output formats and media. It is
-# envisaged that SimpleMarkup could be the basis for formating RDoc
-# style comment blocks, Wiki entries, and online FAQs.
-#
-# = Basic Formatting
-#
-# * SimpleMarkup looks for a document's natural left margin. This is
-#   used as the initial margin for the document.
-#
-# * Consecutive lines starting at this margin are considered to be a
-#   paragraph.
-#
-# * If a paragraph starts with a "*", "-", or with "<digit>.", then it is
-#   taken to be the start of a list. The margin in increased to be the
-#   first non-space following the list start flag. Subsequent lines
-#   should be indented to this new margin until the list ends. For
-#   example:
-#
-#      * this is a list with three paragraphs in
-#        the first item. This is the first paragraph.
-#
-#        And this is the second paragraph.
-#
-#        1. This is an indented, numbered list.
-#        2. This is the second item in that list
-#
-#        This is the third conventional paragraph in the
-#        first list item.
-#
-#      * This is the second item in the original list
-#
-# * You can also construct labeled lists, sometimes called description
-#   or definition lists. Do this by putting the label in square brackets
-#   and indenting the list body:
-#
-#       [cat]  a small furry mammal
-#              that seems to sleep a lot
-#
-#       [ant]  a little insect that is known
-#              to enjoy picnics
-#
-#   A minor variation on labeled lists uses two colons to separate the
-#   label from the list body:
-#
-#       cat::  a small furry mammal
-#              that seems to sleep a lot
-#
-#       ant::  a little insect that is known
-#              to enjoy picnics
-#     
-#   This latter style guarantees that the list bodies' left margins are
-#   aligned: think of them as a two column table.
-#
-# * Any line that starts to the right of the current margin is treated
-#   as verbatim text. This is useful for code listings. The example of a
-#   list above is also verbatim text.
-#
-# * A line starting with an equals sign (=) is treated as a
-#   heading. Level one headings have one equals sign, level two headings
-#   have two,and so on.
-#
-# * A line starting with three or more hyphens (at the current indent)
-#   generates a horizontal rule. THe more hyphens, the thicker the rule
-#   (within reason, and if supported by the output device)
-#
-# * You can use markup within text (except verbatim) to change the
-#   appearance of parts of that text. Out of the box, SimpleMarkup
-#   supports word-based and general markup.
-#
-#   Word-based markup uses flag characters around individual words:
-#
-#   [\*word*]  displays word in a *bold* font
-#   [\_word_]  displays word in an _emphasized_ font
-#   [\+word+]  displays word in a +code+ font
-#
-#   General markup affects text between a start delimiter and and end
-#   delimiter. Not surprisingly, these delimiters look like HTML markup.
-#
-#   [\<b>text...</b>]    displays word in a *bold* font
-#   [\<em>text...</em>]  displays word in an _emphasized_ font
-#   [\<i>text...</i>]    displays word in an _emphasized_ font
-#   [\<tt>text...</tt>]  displays word in a +code+ font
-#
-#   Unlike conventional Wiki markup, general markup can cross line
-#   boundaries. You can turn off the interpretation of markup by
-#   preceding the first character with a backslash, so \\\<b>bold
-#   text</b> and \\\*bold* produce \<b>bold text</b> and \*bold
-#   respectively.
-#
-# = Using SimpleMarkup
-#
-# For information on using SimpleMarkup programatically, 
-# see SM::SimpleMarkup.
-#
-# Author::   Dave Thomas,  dave@pragmaticprogrammer.com
-# Version::  0.0
-# License::  Ruby license
-
-
-
-require 'rdoc/markup/simple_markup/fragments'
-require 'rdoc/markup/simple_markup/lines.rb'
-
-module SM  #:nodoc:
-
-  # == Synopsis
-  #
-  # This code converts <tt>input_string</tt>, which is in the format
-  # described in markup/simple_markup.rb, to HTML. The conversion
-  # takes place in the +convert+ method, so you can use the same
-  # SimpleMarkup object to convert multiple input strings.
-  #
-  #   require 'rdoc/markup/simple_markup'
-  #   require 'rdoc/markup/simple_markup/to_html'
-  #
-  #   p = SM::SimpleMarkup.new
-  #   h = SM::ToHtml.new
-  #
-  #   puts p.convert(input_string, h)
-  #
-  # You can extend the SimpleMarkup parser to recognise new markup
-  # sequences, and to add special processing for text that matches a
-  # regular epxression. Here we make WikiWords significant to the parser,
-  # and also make the sequences {word} and \<no>text...</no> signify
-  # strike-through text. When then subclass the HTML output class to deal
-  # with these:
-  #
-  #   require 'rdoc/markup/simple_markup'
-  #   require 'rdoc/markup/simple_markup/to_html'
-  #
-  #   class WikiHtml < SM::ToHtml
-  #     def handle_special_WIKIWORD(special)
-  #       "<font color=red>" + special.text + "</font>"
-  #     end
-  #   end
-  #
-  #   p = SM::SimpleMarkup.new
-  #   p.add_word_pair("{", "}", :STRIKE)
-  #   p.add_html("no", :STRIKE)
-  #
-  #   p.add_special(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD)
-  #
-  #   h = WikiHtml.new
-  #   h.add_tag(:STRIKE, "<strike>", "</strike>")
-  #
-  #   puts "<body>" + p.convert(ARGF.read, h) + "</body>"
-  #
-  # == Output Formatters
-  #
-  # _missing_
-  #
-  #
-
-  class SimpleMarkup
-
-    SPACE = ?\s
-
-    # List entries look like:
-    #  *       text
-    #  1.      text
-    #  [label] text
-    #  label:: text
-    #
-    # Flag it as a list entry, and
-    # work out the indent for subsequent lines
-
-    SIMPLE_LIST_RE = /^(
-                  (  \*          (?# bullet)
-                    |-           (?# bullet)
-                    |\d+\.       (?# numbered )
-                    |[A-Za-z]\.  (?# alphabetically numbered )
-                  )
-                  \s+
-                )\S/x
-
-    LABEL_LIST_RE = /^(
-                        (  \[.*?\]    (?# labeled  )
-                          |\S.*::     (?# note     )
-                        )(?:\s+|$)
-                      )/x
-
-
-    ##
-    # take a block of text and use various heuristics to determine
-    # it's structure (paragraphs, lists, and so on). Invoke an
-    # event handler as we identify significant chunks.
-    #
-
-    def initialize
-      @am = AttributeManager.new
-      @output = nil
-    end
-
-    ##
-    # Add to the sequences used to add formatting to an individual word 
-    # (such as *bold*). Matching entries will generate attibutes
-    # that the output formatters can recognize by their +name+
-
-    def add_word_pair(start, stop, name)
-      @am.add_word_pair(start, stop, name)
-    end
-
-    ##
-    # Add to the sequences recognized as general markup
-    #
-
-    def add_html(tag, name)
-      @am.add_html(tag, name)
-    end
-
-    ##
-    # Add to other inline sequences. For example, we could add
-    # WikiWords using something like:
-    #
-    #    parser.add_special(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD)
-    #
-    # Each wiki word will be presented to the output formatter 
-    # via the accept_special method
-    #
-
-    def add_special(pattern, name)
-      @am.add_special(pattern, name)
-    end
-
-
-    # We take a string, split it into lines, work out the type of
-    # each line, and from there deduce groups of lines (for example
-    # all lines in a paragraph). We then invoke the output formatter
-    # using a Visitor to display the result
-
-    def convert(str, op)
-      @lines = Lines.new(str.split(/\r?\n/).collect { |aLine| 
-                           Line.new(aLine) })
-      return "" if @lines.empty?
-      @lines.normalize
-      assign_types_to_lines
-      group = group_lines
-      # call the output formatter to handle the result
-      #      group.to_a.each {|i| p i}
-      group.accept(@am, op)
-    end
-
-
-    #######
-    private
-    #######
-
-
-    ##
-    # Look through the text at line indentation. We flag each line as being
-    # Blank, a paragraph, a list element, or verbatim text
-    #
-
-    def assign_types_to_lines(margin = 0, level = 0)
-
-      while line = @lines.next
-        if line.isBlank?
-          line.stamp(Line::BLANK, level)
-          next
-        end
-        
-        # if a line contains non-blanks before the margin, then it must belong
-        # to an outer level
-
-        text = line.text
-        
-        for i in 0...margin
-          if text[i] != SPACE
-            @lines.unget
-            return
-          end
-        end
-
-        active_line = text[margin..-1]
-
-        # Rules (horizontal lines) look like
-        #
-        #  ---   (three or more hyphens)
-        #
-        # The more hyphens, the thicker the rule
-        #
-
-        if /^(---+)\s*$/ =~ active_line
-          line.stamp(Line::RULE, level, $1.length-2)
-          next
-        end
-
-        # Then look for list entries. First the ones that have to have
-        # text following them (* xxx, - xxx, and dd. xxx)
-
-        if SIMPLE_LIST_RE =~ active_line
-
-          offset = margin + $1.length
-          prefix = $2
-          prefix_length = prefix.length
-
-          flag = case prefix
-                 when "*","-" then ListBase::BULLET
-                 when /^\d/   then ListBase::NUMBER
-                 when /^[A-Z]/ then ListBase::UPPERALPHA
-                 when /^[a-z]/ then ListBase::LOWERALPHA
-                 else raise "Invalid List Type: #{self.inspect}"
-                 end
-
-          line.stamp(Line::LIST, level+1, prefix, flag)
-          text[margin, prefix_length] = " " * prefix_length
-          assign_types_to_lines(offset, level + 1)
-          next
-        end
-
-
-        if LABEL_LIST_RE =~ active_line
-          offset = margin + $1.length
-          prefix = $2
-          prefix_length = prefix.length
-
-          next if handled_labeled_list(line, level, margin, offset, prefix)
-        end
-
-        # Headings look like
-        # = Main heading
-        # == Second level
-        # === Third
-        #
-        # Headings reset the level to 0
-
-        if active_line[0] == ?= and active_line =~ /^(=+)\s*(.*)/
-          prefix_length = $1.length
-          prefix_length = 6 if prefix_length > 6
-          line.stamp(Line::HEADING, 0, prefix_length)
-          line.strip_leading(margin + prefix_length)
-          next
-        end
-        
-        # If the character's a space, then we have verbatim text,
-        # otherwise 
-
-        if active_line[0] == SPACE
-          line.strip_leading(margin) if margin > 0
-          line.stamp(Line::VERBATIM, level)
-        else
-          line.stamp(Line::PARAGRAPH, level)
-        end
-      end
-    end
-
-    # Handle labeled list entries, We have a special case
-    # to deal with. Because the labels can be long, they force
-    # the remaining block of text over the to right:
-    #
-    # this is a long label that I wrote:: and here is the
-    #                                     block of text with
-    #                                     a silly margin
-    #
-    # So we allow the special case. If the label is followed
-    # by nothing, and if the following line is indented, then
-    # we take the indent of that line as the new margin
-    #
-    # this is a long label that I wrote::
-    #     here is a more reasonably indented block which
-    #     will ab attached to the label.
-    #
-    
-    def handled_labeled_list(line, level, margin, offset, prefix)
-      prefix_length = prefix.length
-      text = line.text
-      flag = nil
-      case prefix
-      when /^\[/
-        flag = ListBase::LABELED
-        prefix = prefix[1, prefix.length-2]
-      when /:$/
-        flag = ListBase::NOTE
-        prefix.chop!
-      else raise "Invalid List Type: #{self.inspect}"
-      end
-      
-      # body is on the next line
-      
-      if text.length <= offset
-        original_line = line
-        line = @lines.next
-        return(false) unless line
-        text = line.text
-        
-        for i in 0..margin
-          if text[i] != SPACE
-            @lines.unget
-            return false
-          end
-        end
-        i = margin
-        i += 1 while text[i] == SPACE
-        if i >= text.length
-          @lines.unget
-          return false
-        else
-          offset = i
-          prefix_length = 0
-          @lines.delete(original_line)
-        end
-      end
-      
-      line.stamp(Line::LIST, level+1, prefix, flag)
-      text[margin, prefix_length] = " " * prefix_length
-      assign_types_to_lines(offset, level + 1)
-      return true
-    end
-
-    # Return a block consisting of fragments which are
-    # paragraphs, list entries or verbatim text. We merge consecutive
-    # lines of the same type and level together. We are also slightly
-    # tricky with lists: the lines following a list introduction
-    # look like paragraph lines at the next level, and we remap them
-    # into list entries instead
-
-    def group_lines
-      @lines.rewind
-
-      inList = false
-      wantedType = wantedLevel = nil
-
-      block = LineCollection.new
-      group = nil
-
-      while line = @lines.next
-        if line.level == wantedLevel and line.type == wantedType
-          group.add_text(line.text)
-        else
-          group = block.fragment_for(line)
-          block.add(group)
-          if line.type == Line::LIST
-            wantedType = Line::PARAGRAPH
-          else
-            wantedType = line.type
-          end
-          wantedLevel = line.type == Line::HEADING ? line.param : line.level
-        end
-      end
-
-      block.normalize
-      block
-    end
-
-    ## for debugging, we allow access to our line contents as text
-    def content
-      @lines.as_text
-    end
-    public :content
-
-    ## for debugging, return the list of line types
-    def get_line_types
-      @lines.line_types
-    end
-    public :get_line_types
-  end
-
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/test/AllTests.rb ../rdoc-f95-20090109-1/markup/test/AllTests.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/test/AllTests.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/test/AllTests.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,2 +0,0 @@
-require 'TestParse.rb'
-require 'TestInline.rb'
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/test/TestInline.rb ../rdoc-f95-20090109-1/markup/test/TestInline.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/test/TestInline.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/test/TestInline.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,154 +0,0 @@
-require "test/unit"
-
-$:.unshift "../../.."
-
-require "rdoc/markup/simple_markup/inline"
-
-class TestInline < Test::Unit::TestCase
-
-
-  def setup
-    @am = SM::AttributeManager.new
-
-    @bold_on  = @am.changed_attribute_by_name([], [:BOLD])
-    @bold_off = @am.changed_attribute_by_name([:BOLD], [])
-    
-    @tt_on    = @am.changed_attribute_by_name([], [:TT])
-    @tt_off   = @am.changed_attribute_by_name([:TT], [])
-    
-    @em_on    = @am.changed_attribute_by_name([], [:EM])
-    @em_off   = @am.changed_attribute_by_name([:EM], [])
-    
-    @bold_em_on   = @am.changed_attribute_by_name([], [:BOLD] | [:EM])
-    @bold_em_off  = @am.changed_attribute_by_name([:BOLD] | [:EM], [])
-    
-    @em_then_bold = @am.changed_attribute_by_name([:EM], [:EM] | [:BOLD])
-    
-    @em_to_bold   = @am.changed_attribute_by_name([:EM], [:BOLD])
-    
-    @am.add_word_pair("{", "}", :WOMBAT)
-    @wombat_on    = @am.changed_attribute_by_name([], [:WOMBAT])
-    @wombat_off   = @am.changed_attribute_by_name([:WOMBAT], [])
-  end
-
-  def crossref(text)
-    [ @am.changed_attribute_by_name([], [:CROSSREF] | [:_SPECIAL_]),
-      SM::Special.new(33, text),
-      @am.changed_attribute_by_name([:CROSSREF] | [:_SPECIAL_], [])
-    ]
-  end
-
-  def test_special
-    # class names, variable names, file names, or instance variables
-    @am.add_special(/(
-                       \b([A-Z]\w+(::\w+)*)
-                       | \#\w+[!?=]?
-                       | \b\w+([_\/\.]+\w+)+[!?=]?
-                      )/x, 
-                    :CROSSREF)
-    
-    assert_equal(["cat"], @am.flow("cat"))
-
-    assert_equal(["cat ", crossref("#fred"), " dog"].flatten,
-                  @am.flow("cat #fred dog"))
-
-    assert_equal([crossref("#fred"), " dog"].flatten,
-                  @am.flow("#fred dog"))
-
-    assert_equal(["cat ", crossref("#fred")].flatten, @am.flow("cat #fred"))
-  end
-
-  def test_basic
-    assert_equal(["cat"], @am.flow("cat"))
-
-    assert_equal(["cat ", @bold_on, "and", @bold_off, " dog"],
-                  @am.flow("cat *and* dog"))
-
-    assert_equal(["cat ", @bold_on, "AND", @bold_off, " dog"],
-                  @am.flow("cat *AND* dog"))
-
-    assert_equal(["cat ", @em_on, "And", @em_off, " dog"],
-                  @am.flow("cat _And_ dog"))
-
-    assert_equal(["cat *and dog*"], @am.flow("cat *and dog*"))
-
-    assert_equal(["*cat and* dog"], @am.flow("*cat and* dog"))
-
-    assert_equal(["cat *and ", @bold_on, "dog", @bold_off],
-                  @am.flow("cat *and *dog*"))
-
-    assert_equal(["cat ", @em_on, "and", @em_off, " dog"],
-                  @am.flow("cat _and_ dog"))
-
-    assert_equal(["cat_and_dog"],
-                  @am.flow("cat_and_dog"))
-
-    assert_equal(["cat ", @tt_on, "and", @tt_off, " dog"],
-                  @am.flow("cat +and+ dog"))
-
-    assert_equal(["cat ", @bold_on, "a_b_c", @bold_off, " dog"],
-                  @am.flow("cat *a_b_c* dog"))
-
-    assert_equal(["cat __ dog"],
-                  @am.flow("cat __ dog"))
-
-    assert_equal(["cat ", @em_on, "_", @em_off, " dog"],
-                  @am.flow("cat ___ dog"))
-
-  end
-
-  def test_combined
-    assert_equal(["cat ", @em_on, "and", @em_off, " ", @bold_on, "dog", @bold_off],
-                  @am.flow("cat _and_ *dog*"))
-
-    assert_equal(["cat ", @em_on, "a__nd", @em_off, " ", @bold_on, "dog", @bold_off], 
-                  @am.flow("cat _a__nd_ *dog*"))
-  end
-
-  def test_html_like
-    assert_equal(["cat ", @tt_on, "dog", @tt_off], @am.flow("cat <tt>dog</Tt>"))
-
-    assert_equal(["cat ", @em_on, "and", @em_off, " ", @bold_on, "dog", @bold_off], 
-                  @am.flow("cat <i>and</i> <B>dog</b>"))
-    
-    assert_equal(["cat ", @em_on, "and ", @em_then_bold, "dog", @bold_em_off], 
-                  @am.flow("cat <i>and <B>dog</B></I>"))
-    
-    assert_equal(["cat ", @em_on, "and ", @em_to_bold, "dog", @bold_off], 
-                  @am.flow("cat <i>and </i><b>dog</b>"))
-    
-    assert_equal(["cat ", @em_on, "and ", @em_to_bold, "dog", @bold_off], 
-                  @am.flow("cat <i>and <b></i>dog</b>"))
-    
-    assert_equal([@tt_on, "cat", @tt_off, " ", @em_on, "and ", @em_to_bold, "dog", @bold_off], 
-                  @am.flow("<tt>cat</tt> <i>and <b></i>dog</b>"))
-
-    assert_equal(["cat ", @em_on, "and ", @em_then_bold, "dog", @bold_em_off], 
-                  @am.flow("cat <i>and <b>dog</b></i>"))
-    
-    assert_equal(["cat ", @bold_em_on, "and", @bold_em_off, " dog"], 
-                  @am.flow("cat <i><b>and</b></i> dog"))
-    
-    
-  end
-
-  def test_protect
-    assert_equal(['cat \\ dog'], @am.flow('cat \\ dog'))
-
-    assert_equal(["cat <tt>dog</Tt>"], @am.flow("cat \\<tt>dog</Tt>"))
-
-    assert_equal(["cat ", @em_on, "and", @em_off, " <B>dog</b>"], 
-                  @am.flow("cat <i>and</i> \\<B>dog</b>"))
-    
-    assert_equal(["*word* or <b>text</b>"], @am.flow("\\*word* or \\<b>text</b>"))
-
-    assert_equal(["_cat_", @em_on, "dog", @em_off], 
-                  @am.flow("\\_cat_<i>dog</i>"))
-  end
-
-  def test_adding
-    assert_equal(["cat ", @wombat_on, "and", @wombat_off, " dog" ],
-                  @am.flow("cat {and} dog"))
-#    assert_equal(["cat {and} dog" ], @am.flow("cat \\{and} dog"))
-  end
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/test/TestParse.rb ../rdoc-f95-20090109-1/markup/test/TestParse.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/test/TestParse.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/test/TestParse.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,503 +0,0 @@
-require 'test/unit'
-
-$:.unshift "../../.."
-
-require 'rdoc/markup/simple_markup'
-
-include SM
-
-class TestParse < Test::Unit::TestCase
-
-  class MockOutput
-    def start_accepting
-      @res = []
-      end
-    
-    def end_accepting
-      @res
-    end
-
-    def accept_paragraph(am, fragment)
-      @res << fragment.to_s
-    end
-
-    def accept_verbatim(am, fragment)
-      @res << fragment.to_s
-    end
-
-    def accept_list_start(am, fragment)
-      @res << fragment.to_s
-    end
-
-    def accept_list_end(am, fragment)
-      @res << fragment.to_s
-    end
-
-    def accept_list_item(am, fragment)
-      @res << fragment.to_s
-    end
-
-    def accept_blank_line(am, fragment)
-      @res << fragment.to_s
-    end
-
-    def accept_heading(am, fragment)
-      @res << fragment.to_s
-    end
-
-    def accept_rule(am, fragment)
-      @res << fragment.to_s
-    end
-
-  end
-
-  def basic_conv(str)
-    sm = SimpleMarkup.new
-    mock = MockOutput.new
-    sm.convert(str, mock)
-    sm.content
-  end
-
-  def line_types(str, expected)
-    p = SimpleMarkup.new
-    mock = MockOutput.new
-    p.convert(str, mock)
-    assert_equal(expected, p.get_line_types.map{|type| type.to_s[0,1]}.join(''))
-  end
-
-  def line_groups(str, expected)
-    p = SimpleMarkup.new
-    mock = MockOutput.new
-
-    block = p.convert(str, mock)
-
-    if block != expected
-      rows = (0...([expected.size, block.size].max)).collect{|i|
-        [expected[i]||"nil", block[i]||"nil"] 
-      }
-      printf "\n\n%35s %35s\n", "Expected", "Got"
-      rows.each {|e,g| printf "%35s %35s\n", e.dump, g.dump }
-    end
-
-    assert_equal(expected, block)
-  end
-
-  def test_tabs
-    str = "hello\n  dave"
-    assert_equal(str, basic_conv(str))
-    str = "hello\n\tdave"
-    assert_equal("hello\n        dave", basic_conv(str))
-    str = "hello\n \tdave"
-    assert_equal("hello\n        dave", basic_conv(str))
-    str = "hello\n  \tdave"
-    assert_equal("hello\n        dave", basic_conv(str))
-    str = "hello\n   \tdave"
-    assert_equal("hello\n        dave", basic_conv(str))
-    str = "hello\n    \tdave"
-    assert_equal("hello\n        dave", basic_conv(str))
-    str = "hello\n     \tdave"
-    assert_equal("hello\n        dave", basic_conv(str))
-    str = "hello\n      \tdave"
-    assert_equal("hello\n        dave", basic_conv(str))
-    str = "hello\n       \tdave"
-    assert_equal("hello\n        dave", basic_conv(str))
-    str = "hello\n        \tdave"
-    assert_equal("hello\n                dave", basic_conv(str))
-    str = ".\t\t."
-    assert_equal(".               .", basic_conv(str))
-  end
-
-  def test_whitespace
-    assert_equal("hello", basic_conv("hello"))
-    assert_equal("hello", basic_conv(" hello "))
-    assert_equal("hello", basic_conv(" \t \t hello\t\t"))
-
-    assert_equal("1\n 2\n  3", basic_conv("1\n 2\n  3"))
-    assert_equal("1\n 2\n  3", basic_conv("  1\n   2\n    3"))
-
-    assert_equal("1\n 2\n  3\n1\n 2", basic_conv("1\n 2\n  3\n1\n 2"))
-    assert_equal("1\n 2\n  3\n1\n 2", basic_conv("  1\n   2\n    3\n  1\n   2"))
-
-    assert_equal("1\n 2\n\n  3", basic_conv("  1\n   2\n\n    3"))
-  end
-
-  def test_types
-    str = "now is the time"
-    line_types(str, 'P')
-
-    str = "now is the time\nfor all good men"
-    line_types(str, 'PP')
-
-    str = "now is the time\n  code\nfor all good men"
-    line_types(str, 'PVP')
-
-    str = "now is the time\n  code\n more code\nfor all good men"
-    line_types(str, 'PVVP')
-
-    str = "now is\n---\nthe time"
-    line_types(str, 'PRP')
-
-    str = %{\
-       now is
-       * l1
-       * l2
-       the time}
-    line_types(str, 'PLLP')
-
-    str = %{\
-       now is
-       * l1
-         l1+
-       * l2
-       the time}
-    line_types(str, 'PLPLP')
-
-    str = %{\
-       now is
-       * l1
-         * l1.1
-       * l2
-       the time}
-    line_types(str, 'PLLLP')
-
-    str = %{\
-       now is
-       * l1
-         * l1.1
-           text
-             code
-             code
-
-           text
-       * l2
-       the time}
-    line_types(str, 'PLLPVVBPLP')
-
-    str = %{\
-       now is
-       1. l1
-          * l1.1
-       2. l2
-       the time}
-    line_types(str, 'PLLLP')
-
-    str = %{\
-       now is
-       [cat] l1
-             * l1.1
-       [dog] l2
-       the time}
-    line_types(str, 'PLLLP')
-
-    str = %{\
-       now is
-       [cat] l1
-             continuation
-       [dog] l2
-       the time}
-    line_types(str, 'PLPLP')
-  end
-
-  def test_groups
-    str = "now is the time"
-    line_groups(str, ["L0: Paragraph\nnow is the time"] )
-
-    str = "now is the time\nfor all good men"
-    line_groups(str, ["L0: Paragraph\nnow is the time for all good men"] )
-
-    str = %{\
-      now is the time
-        code _line_ here
-      for all good men}
-
-    line_groups(str,
-                [ "L0: Paragraph\nnow is the time",
-                  "L0: Verbatim\n  code _line_ here\n",
-                  "L0: Paragraph\nfor all good men"
-                ] )
-
-    str = "now is the time\n  code\n more code\nfor all good men"
-    line_groups(str,
-                [ "L0: Paragraph\nnow is the time",
-                  "L0: Verbatim\n  code\n more code\n",
-                  "L0: Paragraph\nfor all good men"
-                ] )
-
-    str = %{\
-       now is
-       * l1
-       * l2
-       the time}
-    line_groups(str,
-                [ "L0: Paragraph\nnow is",
-                  "L1: ListStart\n",
-                  "L1: ListItem\nl1",
-                  "L1: ListItem\nl2",
-                  "L1: ListEnd\n",
-                  "L0: Paragraph\nthe time"
-                ])
-
-    str = %{\
-       now is
-       * l1
-         l1+
-       * l2
-       the time}
-    line_groups(str,
-                [ "L0: Paragraph\nnow is",
-                  "L1: ListStart\n",
-                  "L1: ListItem\nl1 l1+",
-                  "L1: ListItem\nl2",
-                  "L1: ListEnd\n",
-                  "L0: Paragraph\nthe time"
-                ])
-
-    str = %{\
-       now is
-       * l1
-         * l1.1
-       * l2
-       the time}
-    line_groups(str,
-                [ "L0: Paragraph\nnow is",
-                  "L1: ListStart\n",
-                  "L1: ListItem\nl1",
-                  "L2: ListStart\n",
-                  "L2: ListItem\nl1.1",
-                  "L2: ListEnd\n",
-                  "L1: ListItem\nl2",
-                  "L1: ListEnd\n",
-                  "L0: Paragraph\nthe time"
-                ])
-
-
-    str = %{\
-       now is
-       * l1
-         * l1.1
-           text
-             code
-               code
-
-           text
-       * l2
-       the time}
-    line_groups(str,
-                [ "L0: Paragraph\nnow is",
-                  "L1: ListStart\n",
-                  "L1: ListItem\nl1",
-                  "L2: ListStart\n",
-                  "L2: ListItem\nl1.1 text",
-                  "L2: Verbatim\n  code\n    code\n",
-                  "L2: Paragraph\ntext",
-                  "L2: ListEnd\n",
-                  "L1: ListItem\nl2",
-                  "L1: ListEnd\n",
-                  "L0: Paragraph\nthe time"
-                ])
-
-
-    str = %{\
-       now is
-       1. l1
-          * l1.1
-       2. l2
-       the time}
-    line_groups(str,
-                [ "L0: Paragraph\nnow is",
-                  "L1: ListStart\n",
-                  "L1: ListItem\nl1",
-                  "L2: ListStart\n",
-                  "L2: ListItem\nl1.1",
-                  "L2: ListEnd\n",
-                  "L1: ListItem\nl2",
-                  "L1: ListEnd\n",
-                  "L0: Paragraph\nthe time"
-                ])
-
-    str = %{\
-       now is
-       [cat] l1
-             * l1.1
-       [dog] l2
-       the time}
-    line_groups(str,
-                [ "L0: Paragraph\nnow is",
-                  "L1: ListStart\n",
-                  "L1: ListItem\nl1",
-                  "L2: ListStart\n",
-                  "L2: ListItem\nl1.1",
-                  "L2: ListEnd\n",
-                  "L1: ListItem\nl2",
-                  "L1: ListEnd\n",
-                  "L0: Paragraph\nthe time"
-                ])
-
-    str = %{\
-       now is
-       [cat] l1
-             continuation
-       [dog] l2
-       the time}
-    line_groups(str,
-                [ "L0: Paragraph\nnow is",
-                  "L1: ListStart\n",
-                  "L1: ListItem\nl1 continuation",
-                  "L1: ListItem\nl2",
-                  "L1: ListEnd\n",
-                  "L0: Paragraph\nthe time"
-                ])
-
-    
-  end
-
-  def test_verbatim_merge
-    str = %{\
-       now is
-          code
-       the time}
-
-    line_groups(str,
-                [ "L0: Paragraph\nnow is",
-                  "L0: Verbatim\n   code\n",
-                  "L0: Paragraph\nthe time"
-                ])
-
-
-    str = %{\
-       now is
-          code
-          code1
-       the time}
-
-    line_groups(str,
-                [ "L0: Paragraph\nnow is",
-                  "L0: Verbatim\n   code\n   code1\n",
-                  "L0: Paragraph\nthe time"
-                ])
-
-
-    str = %{\
-       now is
-          code
-
-          code1
-       the time}
-
-    line_groups(str,
-                [ "L0: Paragraph\nnow is",
-                  "L0: Verbatim\n   code\n\n   code1\n",
-                  "L0: Paragraph\nthe time"
-                ])
-
-
-    str = %{\
-       now is
-          code
-
-          code1
-
-       the time}
-
-    line_groups(str,
-                [ "L0: Paragraph\nnow is",
-                  "L0: Verbatim\n   code\n\n   code1\n",
-                  "L0: Paragraph\nthe time"
-                ])
-
-
-    str = %{\
-       now is
-          code
-
-          code1
-
-          code2
-       the time}
-
-    line_groups(str,
-                [ "L0: Paragraph\nnow is",
-                  "L0: Verbatim\n   code\n\n   code1\n\n   code2\n",
-                  "L0: Paragraph\nthe time"
-                ])
-
-
-    # Folds multiple blank lines
-    str = %{\
-       now is
-          code
-
-
-          code1
-
-       the time}
-
-    line_groups(str,
-                [ "L0: Paragraph\nnow is",
-                  "L0: Verbatim\n   code\n\n   code1\n",
-                  "L0: Paragraph\nthe time"
-                ])
-
-
-  end
- 
-  def test_list_split
-    str = %{\
-       now is
-       * l1
-       1. n1
-       2. n2
-       * l2
-       the time}
-    line_groups(str,
-                [ "L0: Paragraph\nnow is",
-                  "L1: ListStart\n",
-                  "L1: ListItem\nl1",
-                  "L1: ListEnd\n",
-                  "L1: ListStart\n",
-                  "L1: ListItem\nn1",
-                  "L1: ListItem\nn2",
-                  "L1: ListEnd\n",
-                  "L1: ListStart\n",
-                  "L1: ListItem\nl2",
-                  "L1: ListEnd\n",
-                  "L0: Paragraph\nthe time"
-                ])
-
-  end
-
-
-  def test_headings
-    str = "= heading one"
-    line_groups(str, 
-                [ "L0: Heading\nheading one"
-                ])
-
-    str = "=== heading three"
-    line_groups(str, 
-                [ "L0: Heading\nheading three"
-                ])
-
-    str = "text\n   === heading three"
-    line_groups(str, 
-                [ "L0: Paragraph\ntext",
-                  "L0: Verbatim\n   === heading three\n"
-                ])
-
-    str = "text\n   code\n   === heading three"
-    line_groups(str, 
-                [ "L0: Paragraph\ntext",
-                  "L0: Verbatim\n   code\n   === heading three\n"
-                ])
-
-    str = "text\n   code\n=== heading three"
-    line_groups(str, 
-                [ "L0: Paragraph\ntext",
-                  "L0: Verbatim\n   code\n",
-                  "L0: Heading\nheading three"
-                ])
-
-  end
-
-  
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/to_flow.rb ../rdoc-f95-20090109-1/markup/to_flow.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/to_flow.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/to_flow.rb	2008-03-08 18:36:21.000000000 +0900
@@ -0,0 +1,185 @@
+require 'rdoc/markup/formatter'
+require 'rdoc/markup/fragments'
+require 'rdoc/markup/inline'
+require 'cgi'
+
+class RDoc::Markup
+
+  module Flow
+    P = Struct.new(:body)
+    VERB = Struct.new(:body)
+    RULE = Struct.new(:width)
+    class LIST
+      attr_reader :type, :contents
+      def initialize(type)
+        @type = type
+        @contents = []
+      end
+      def <<(stuff)
+        @contents << stuff
+      end
+    end
+    LI = Struct.new(:label, :body)
+    H = Struct.new(:level, :text)
+  end
+
+  class ToFlow < RDoc::Markup::Formatter
+    LIST_TYPE_TO_HTML = {
+      :BULLET     =>  [ "<ul>", "</ul>" ],
+      :NUMBER     =>  [ "<ol>", "</ol>" ],
+      :UPPERALPHA =>  [ "<ol>", "</ol>" ],
+      :LOWERALPHA =>  [ "<ol>", "</ol>" ],
+      :LABELED    =>  [ "<dl>", "</dl>" ],
+      :NOTE       =>  [ "<table>", "</table>" ],
+    }
+
+    InlineTag = Struct.new(:bit, :on, :off)
+
+    def initialize
+      super
+
+      init_tags
+    end
+
+    ##
+    # Set up the standard mapping of attributes to HTML tags
+
+    def init_tags
+      @attr_tags = [
+        InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:BOLD), "<b>", "</b>"),
+        InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:TT),   "<tt>", "</tt>"),
+        InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:EM),   "<em>", "</em>"),
+      ]
+    end
+
+    ##
+    # Add a new set of HTML tags for an attribute. We allow separate start and
+    # end tags for flexibility
+
+    def add_tag(name, start, stop)
+      @attr_tags << InlineTag.new(RDoc::Markup::Attribute.bitmap_for(name), start, stop)
+    end
+
+    ##
+    # Given an HTML tag, decorate it with class information and the like if
+    # required. This is a no-op in the base class, but is overridden in HTML
+    # output classes that implement style sheets
+
+    def annotate(tag)
+      tag
+    end
+
+    ##
+    # Here's the client side of the visitor pattern
+
+    def start_accepting
+      @res = []
+      @list_stack = []
+    end
+
+    def end_accepting
+      @res
+    end
+
+    def accept_paragraph(am, fragment)
+      @res << Flow::P.new((convert_flow(am.flow(fragment.txt))))
+    end
+
+    def accept_verbatim(am, fragment)
+      @res << Flow::VERB.new((convert_flow(am.flow(fragment.txt))))
+    end
+
+    def accept_rule(am, fragment)
+      size = fragment.param
+      size = 10 if size > 10
+      @res << Flow::RULE.new(size)
+    end
+
+    def accept_list_start(am, fragment)
+      @list_stack.push(@res)
+      list = Flow::LIST.new(fragment.type)
+      @res << list
+      @res = list
+    end
+
+    def accept_list_end(am, fragment)
+      @res = @list_stack.pop
+    end
+
+    def accept_list_item(am, fragment)
+      @res << Flow::LI.new(fragment.param, convert_flow(am.flow(fragment.txt)))
+    end
+
+    def accept_blank_line(am, fragment)
+      # @res << annotate("<p />") << "\n"
+    end
+
+    def accept_heading(am, fragment)
+      @res << Flow::H.new(fragment.head_level, convert_flow(am.flow(fragment.txt)))
+    end
+
+    private
+
+    def on_tags(res, item)
+      attr_mask = item.turn_on
+      return if attr_mask.zero?
+
+      @attr_tags.each do |tag|
+        if attr_mask & tag.bit != 0
+          res << annotate(tag.on)
+        end
+      end
+    end
+
+    def off_tags(res, item)
+      attr_mask = item.turn_off
+      return if attr_mask.zero?
+
+      @attr_tags.reverse_each do |tag|
+        if attr_mask & tag.bit != 0
+          res << annotate(tag.off)
+        end
+      end
+    end
+
+    def convert_flow(flow)
+      res = ""
+      flow.each do |item|
+        case item
+        when String
+          res << convert_string(item)
+        when AttrChanger
+          off_tags(res, item)
+          on_tags(res,  item)
+        when Special
+          res << convert_special(item)
+        else
+          raise "Unknown flow element: #{item.inspect}"
+        end
+      end
+      res
+    end
+
+    def convert_string(item)
+      CGI.escapeHTML(item)
+    end
+
+    def convert_special(special)
+      handled = false
+      Attribute.each_name_of(special.type) do |name|
+        method_name = "handle_special_#{name}"
+        if self.respond_to? method_name
+          special.text = send(method_name, special)
+          handled = true
+        end
+      end
+
+      raise "Unhandled special: #{special}" unless handled
+
+      special.text
+    end
+
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/to_html.rb ../rdoc-f95-20090109-1/markup/to_html.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/to_html.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/to_html.rb	2008-03-09 03:43:59.000000000 +0900
@@ -0,0 +1,357 @@
+require 'rdoc/markup/formatter'
+require 'rdoc/markup/fragments'
+require 'rdoc/markup/inline'
+require 'rdoc/generator'
+
+require 'cgi'
+
+class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
+
+  LIST_TYPE_TO_HTML = {
+    :BULLET =>     %w[<ul> </ul>],
+    :NUMBER =>     %w[<ol> </ol>],
+    :UPPERALPHA => %w[<ol> </ol>],
+    :LOWERALPHA => %w[<ol> </ol>],
+    :LABELED =>    %w[<dl> </dl>],
+    :NOTE    =>    %w[<table> </table>],
+  }
+
+  InlineTag = Struct.new(:bit, :on, :off)
+
+  def initialize
+    super
+
+    # external hyperlinks
+    @markup.add_special(/((link:|https?:|mailto:|ftp:|www\.)\S+\w)/, :HYPERLINK)
+
+    # and links of the form  <text>[<url>]
+    @markup.add_special(/(((\{.*?\})|\b\S+?)\[\S+?\.\S+?\])/, :TIDYLINK)
+
+    init_tags
+  end
+
+  ##
+  # Generate a hyperlink for url, labeled with text. Handle the
+  # special cases for img: and link: described under handle_special_HYPEDLINK
+
+  def gen_url(url, text)
+    if url =~ /([A-Za-z]+):(.*)/ then
+      type = $1
+      path = $2
+    else
+      type = "http"
+      path = url
+      url  = "http://#{url}"
+    end
+
+    if type == "link" then
+      url = if path[0, 1] == '#' then # is this meaningful?
+              path
+            else
+              RDoc::Generator.gen_url @from_path, path
+            end
+    end
+
+    if (type == "http" or type == "link") and
+       url =~ /\.(gif|png|jpg|jpeg|bmp)$/ then
+      "<img src=\"#{url}\" />"
+
+    elsif type == "link"
+      "<a href=\"#{url}\">#{text.sub(%r{^#{type}:/*}, '')}</a>"
+    else
+      "<a href=\"#{url}\" target=\"_top\">#{text.sub(%r{^#{type}:/*}, '')}</a>"
+    end
+  end
+
+  ##
+  # And we're invoked with a potential external hyperlink mailto:
+  # just gets inserted. http: links are checked to see if they
+  # reference an image. If so, that image gets inserted using an
+  # <img> tag. Otherwise a conventional <a href> is used.  We also
+  # support a special type of hyperlink, link:, which is a reference
+  # to a local file whose path is relative to the --op directory.
+
+  def handle_special_HYPERLINK(special)
+    url = special.text
+    gen_url url, url
+  end
+
+  ##
+  # Here's a hypedlink where the label is different to the URL
+  #  <label>[url] or {long label}[url]
+
+  def handle_special_TIDYLINK(special)
+    text = special.text
+
+    return text unless text =~ /\{(.*?)\}\[(.*?)\]/ or text =~ /(\S+)\[(.*?)\]/
+
+    label = $1
+    url   = $2
+    gen_url url, label
+  end
+
+  ##
+  # Set up the standard mapping of attributes to HTML tags
+
+  def init_tags
+    @attr_tags = [
+      InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:BOLD), "<b>", "</b>"),
+      InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:TT),   "<tt>", "</tt>"),
+      InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:EM),   "<em>", "</em>"),
+    ]
+  end
+
+  ##
+  # Add a new set of HTML tags for an attribute. We allow separate start and
+  # end tags for flexibility.
+
+  def add_tag(name, start, stop)
+    @attr_tags << InlineTag.new(RDoc::Markup::Attribute.bitmap_for(name), start, stop)
+  end
+
+  ##
+  # Given an HTML tag, decorate it with class information and the like if
+  # required. This is a no-op in the base class, but is overridden in HTML
+  # output classes that implement style sheets.
+
+  def annotate(tag)
+    tag
+  end
+
+  ##
+  # Here's the client side of the visitor pattern
+
+  def start_accepting
+    @res = ""
+    @in_list_entry = []
+  end
+
+  def end_accepting
+    @res
+  end
+
+  def accept_paragraph(am, fragment)
+    @res << annotate("<p>") + "\n"
+    @res << wrap(convert_flow(am.flow(fragment.txt)))
+    @res << annotate("</p>") + "\n"
+  end
+
+  def accept_verbatim(am, fragment)
+    @res << annotate("<pre>") + "\n"
+    @res << CGI.escapeHTML(fragment.txt)
+    @res << annotate("</pre>") << "\n"
+  end
+
+  def accept_rule(am, fragment)
+    size = fragment.param
+    size = 10 if size > 10
+    @res << "<hr size=\"#{size}\"></hr>"
+  end
+
+  def accept_list_start(am, fragment)
+    @res << html_list_name(fragment.type, true) << "\n"
+    @in_list_entry.push false
+  end
+
+  def accept_list_end(am, fragment)
+    if tag = @in_list_entry.pop
+      @res << annotate(tag) << "\n"
+    end
+    @res << html_list_name(fragment.type, false) << "\n"
+  end
+
+  def accept_list_item(am, fragment)
+    if tag = @in_list_entry.last
+      @res << annotate(tag) << "\n"
+    end
+
+    @res << list_item_start(am, fragment)
+
+    @res << wrap(convert_flow(am.flow(fragment.txt))) << "\n"
+
+    @in_list_entry[-1] = list_end_for(fragment.type)
+  end
+
+  def accept_blank_line(am, fragment)
+    # @res << annotate("<p />") << "\n"
+  end
+
+  def accept_heading(am, fragment)
+    @res << convert_heading(fragment.head_level, am.flow(fragment.txt))
+  end
+
+  ##
+  # This is a higher speed (if messier) version of wrap
+
+  def wrap(txt, line_len = 76)
+    res = ""
+    sp = 0
+    ep = txt.length
+    while sp < ep
+      # scan back for a space
+      p = sp + line_len - 1
+      if p >= ep
+        p = ep
+      else
+        while p > sp and txt[p] != ?\s
+          p -= 1
+        end
+        if p <= sp
+          p = sp + line_len
+          while p < ep and txt[p] != ?\s
+            p += 1
+          end
+        end
+      end
+      res << txt[sp...p] << "\n"
+      sp = p
+      sp += 1 while sp < ep and txt[sp] == ?\s
+    end
+    res
+  end
+
+  private
+
+  def on_tags(res, item)
+    attr_mask = item.turn_on
+    return if attr_mask.zero?
+
+    @attr_tags.each do |tag|
+      if attr_mask & tag.bit != 0
+        res << annotate(tag.on)
+      end
+    end
+  end
+
+  def off_tags(res, item)
+    attr_mask = item.turn_off
+    return if attr_mask.zero?
+
+    @attr_tags.reverse_each do |tag|
+      if attr_mask & tag.bit != 0
+        res << annotate(tag.off)
+      end
+    end
+  end
+
+  def convert_flow(flow)
+    res = ""
+
+    flow.each do |item|
+      case item
+      when String
+        res << convert_string(item)
+      when RDoc::Markup::AttrChanger
+        off_tags(res, item)
+        on_tags(res,  item)
+      when RDoc::Markup::Special
+        res << convert_special(item)
+      else
+        raise "Unknown flow element: #{item.inspect}"
+      end
+    end
+
+    res
+  end
+
+  ##
+  # some of these patterns are taken from SmartyPants...
+
+  def convert_string(item)
+    CGI.escapeHTML(item).
+
+    # convert -- to em-dash, (-- to en-dash)
+      gsub(/---?/, '&#8212;'). #gsub(/--/, '&#8211;').
+
+    # convert ... to elipsis (and make sure .... becomes .<elipsis>)
+      gsub(/\.\.\.\./, '.&#8230;').gsub(/\.\.\./, '&#8230;').
+
+    # convert single closing quote
+      gsub(%r{([^ \t\r\n\[\{\(])\'}, '\1&#8217;').
+      gsub(%r{\'(?=\W|s\b)}, '&#8217;').
+
+    # convert single opening quote
+      gsub(/'/, '&#8216;').
+
+    # convert double closing quote
+      gsub(%r{([^ \t\r\n\[\{\(])\'(?=\W)}, '\1&#8221;').
+
+    # convert double opening quote
+      gsub(/'/, '&#8220;').
+
+    # convert copyright
+      gsub(/\(c\)/, '&#169;').
+
+    # convert and registered trademark
+      gsub(/\(r\)/, '&#174;')
+
+  end
+
+  def convert_special(special)
+    handled = false
+    RDoc::Markup::Attribute.each_name_of(special.type) do |name|
+      method_name = "handle_special_#{name}"
+      if self.respond_to? method_name
+        special.text = send(method_name, special)
+        handled = true
+      end
+    end
+    raise "Unhandled special: #{special}" unless handled
+    special.text
+  end
+
+  def convert_heading(level, flow)
+    res =
+      annotate("<h#{level}>") +
+      convert_flow(flow) +
+      annotate("</h#{level}>\n")
+  end
+
+  def html_list_name(list_type, is_open_tag)
+    tags = LIST_TYPE_TO_HTML[list_type] || raise("Invalid list type: #{list_type.inspect}")
+    annotate(tags[ is_open_tag ? 0 : 1])
+  end
+
+  def list_item_start(am, fragment)
+    case fragment.type
+    when :BULLET, :NUMBER then
+      annotate("<li>")
+
+    when :UPPERALPHA then
+      annotate("<li type=\"A\">")
+
+    when :LOWERALPHA then
+      annotate("<li type=\"a\">")
+
+    when :LABELED then
+      annotate("<dt>") +
+        convert_flow(am.flow(fragment.param)) +
+        annotate("</dt>") +
+        annotate("<dd>")
+
+    when :NOTE then
+      annotate("<tr>") +
+        annotate("<td valign=\"top\">") +
+        convert_flow(am.flow(fragment.param)) +
+        annotate("</td>") +
+        annotate("<td>")
+    else
+      raise "Invalid list type"
+    end
+  end
+
+  def list_end_for(fragment_type)
+    case fragment_type
+    when :BULLET, :NUMBER, :UPPERALPHA, :LOWERALPHA then
+      "</li>"
+    when :LABELED then
+      "</dd>"
+    when :NOTE then
+      "</td></tr>"
+    else
+      raise "Invalid list type"
+    end
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/to_html_crossref.rb ../rdoc-f95-20090109-1/markup/to_html_crossref.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/to_html_crossref.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/to_html_crossref.rb	2008-03-09 06:49:08.000000000 +0900
@@ -0,0 +1,123 @@
+require 'rdoc/markup/to_html'
+
+##
+# Subclass of the RDoc::Markup::ToHtml class that supports looking up words in
+# the AllReferences list. Those that are found (like AllReferences in this
+# comment) will be hyperlinked
+
+class RDoc::Markup::ToHtmlCrossref < RDoc::Markup::ToHtml
+
+  attr_accessor :context
+
+  ##
+  # We need to record the html path of our caller so we can generate
+  # correct relative paths for any hyperlinks that we find
+
+  def initialize(from_path, context, show_hash)
+    super()
+
+    # class names, variable names, or instance variables
+    @markup.add_special(/(
+                           # A::B.meth(**) (for operator and assignment in Fortran 90 or 95)
+                           \b\w+(::\w+)*[\.\#]\w+(\([\.\w+\*\/\+\-\=\<\>]+\))?
+                           # meth(**) (for operator and assignment in Fortran 90 or 95)
+                         | \#\w+(\([.\w\*\/\+\-\=\<\>]+\))?
+                         | \b([A-Z]\w*(::\w+)*[.\#]\w+)  #    A::B.meth
+                         | \b([A-Z]\w+(::\w+)*)          #    A::B
+                         | \#\w+[!?=]?                   #    #meth_name
+                         | \\?\b\w+([_\/\.]+\w+)*[!?=]?  #    meth_name
+                         )/x,
+                        :CROSSREF)
+
+    # file names
+    @markup.add_special(/(
+                           ((\/|\.\.\/|\.\/|\w)[\w\#\/\.\-\~\:]*[!?=]?) # file_name
+                         | ((\/|\.\.\/|\.\/|\w)[\w\#\/\.\-\~\:]*(\([\.\w+\*\/\+\-\=\<\>]+\))?)
+                         )/x, 
+                        :CROSSREFFILE)
+
+    @from_path = from_path
+    @context = context
+    @show_hash = show_hash
+
+    @seen = {}
+    @seen_file = {}
+  end
+
+  ##
+  # We're invoked when any text matches the CROSSREF pattern
+  # (defined in MarkUp). If we fine the corresponding reference,
+  # generate a hyperlink. If the name we're looking for contains
+  # no punctuation, we look for it up the module/class chain. For
+  # example, HyperlinkHtml is found, even without the Generator::
+  # prefix, because we look for it in module Generator first.
+
+  def handle_special_CROSSREF(special)
+    name = special.text
+
+    return @seen[name] if @seen.include? name
+
+    if name[0,1] == '#' then
+      lookup = name[1..-1]
+      name = lookup unless @show_hash
+    else
+      lookup = name
+    end
+
+    # Find class, module, or method in class or module.
+    if /([A-Z]\w*)[.\#](\w+[!?=]?)/ =~ lookup then
+      container = $1
+      method = $2
+      ref = @context.find_symbol container, method
+    elsif /([A-Za-z]\w*)[.\#](\w+(\([\.\w+\*\/\+\-\=\<\>]+\))?)/ =~ lookup then
+      container = $1
+      method = $2
+      ref = @context.find_symbol container, method
+    else
+      ref = @context.find_symbol lookup
+    end
+
+    out = if lookup =~ /^\\/ then
+            $'
+          elsif ref and ref.document_self then
+            "<a href=\"#{ref.as_href(@from_path)}\">#{name}</a>"
+          else
+            name
+          end
+
+    @seen[name] = out
+
+    out
+  end
+
+  #
+  # CROSSREFFILE is similar to CROSSREF. But this pattern is
+  # hit to filenames or methods in files
+  #
+  def handle_special_CROSSREFFILE(special)
+    name = special.text
+
+    return @seen_file[name] if @seen_file.include? name
+
+    # Find file, or method in file
+    if /([\w\/\.].*\.\w+)[.\#](.*)/ =~ name
+      file_name = $1
+      method = $2
+      ref = @context.find_file file_name, method
+    else
+      ref = @context.find_file name
+    end
+
+    out = if ref and ref.document_self then
+            "<a href=\"#{ref.as_href(@from_path)}\">#{name}</a>"
+          else
+            name
+          end
+
+    @seen_file[name] = out
+
+    out
+
+  end
+
+end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/to_latex.rb ../rdoc-f95-20090109-1/markup/to_latex.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/to_latex.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/to_latex.rb	2008-03-08 18:36:21.000000000 +0900
@@ -0,0 +1,328 @@
+require 'rdoc/markup/formatter'
+require 'rdoc/markup/fragments'
+require 'rdoc/markup/inline'
+
+require 'cgi'
+
+##
+# Convert SimpleMarkup to basic LaTeX report format.
+
+class RDoc::Markup::ToLaTeX < RDoc::Markup::Formatter
+
+  BS = "\020"   # \
+  OB = "\021"   # {
+  CB = "\022"   # }
+  DL = "\023"   # Dollar
+
+  BACKSLASH   = "#{BS}symbol#{OB}92#{CB}"
+  HAT         = "#{BS}symbol#{OB}94#{CB}"
+  BACKQUOTE   = "#{BS}symbol#{OB}0#{CB}"
+  TILDE       = "#{DL}#{BS}sim#{DL}"
+  LESSTHAN    = "#{DL}<#{DL}"
+  GREATERTHAN = "#{DL}>#{DL}"
+
+  def self.l(str)
+    str.tr('\\', BS).tr('{', OB).tr('}', CB).tr('$', DL)
+  end
+
+  def l(arg)
+    RDoc::Markup::ToLaTeX.l(arg)
+  end
+
+  LIST_TYPE_TO_LATEX = {
+    :BULLET =>  [ l("\\begin{itemize}"), l("\\end{itemize}") ],
+    :NUMBER =>  [ l("\\begin{enumerate}"), l("\\end{enumerate}"), "\\arabic" ],
+    :UPPERALPHA =>  [ l("\\begin{enumerate}"), l("\\end{enumerate}"), "\\Alph" ],
+    :LOWERALPHA =>  [ l("\\begin{enumerate}"), l("\\end{enumerate}"), "\\alph" ],
+    :LABELED => [ l("\\begin{description}"), l("\\end{description}") ],
+    :NOTE    => [
+      l("\\begin{tabularx}{\\linewidth}{@{} l X @{}}"),
+      l("\\end{tabularx}") ],
+  }
+
+  InlineTag = Struct.new(:bit, :on, :off)
+
+  def initialize
+    init_tags
+    @list_depth = 0
+    @prev_list_types = []
+  end
+
+  ##
+  # Set up the standard mapping of attributes to LaTeX
+
+  def init_tags
+    @attr_tags = [
+      InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:BOLD), l("\\textbf{"), l("}")),
+      InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:TT),   l("\\texttt{"), l("}")),
+      InlineTag.new(RDoc::Markup::Attribute.bitmap_for(:EM),   l("\\emph{"), l("}")),
+    ]
+  end
+
+  ##
+  # Escape a LaTeX string
+
+  def escape(str)
+    $stderr.print "FE: ", str if $DEBUG_RDOC
+    s = str.
+       sub(/\s+$/, '').
+      gsub(/([_\${}&%#])/, "#{BS}\\1").
+      gsub(/\\/, BACKSLASH).
+      gsub(/\^/, HAT).
+      gsub(/~/,  TILDE).
+      gsub(/</,  LESSTHAN).
+      gsub(/>/,  GREATERTHAN).
+      gsub(/,,/, ",{},").
+      gsub(/\`/,  BACKQUOTE)
+    $stderr.print "-> ", s, "\n" if $DEBUG_RDOC
+    s
+  end
+
+  ##
+  # Add a new set of LaTeX tags for an attribute. We allow
+  # separate start and end tags for flexibility
+
+  def add_tag(name, start, stop)
+    @attr_tags << InlineTag.new(RDoc::Markup::Attribute.bitmap_for(name), start, stop)
+  end
+
+  ##
+  # Here's the client side of the visitor pattern
+
+  def start_accepting
+    @res = ""
+    @in_list_entry = []
+  end
+
+  def end_accepting
+    @res.tr(BS, '\\').tr(OB, '{').tr(CB, '}').tr(DL, '$')
+  end
+
+  def accept_paragraph(am, fragment)
+    @res << wrap(convert_flow(am.flow(fragment.txt)))
+    @res << "\n"
+  end
+
+  def accept_verbatim(am, fragment)
+    @res << "\n\\begin{code}\n"
+    @res << fragment.txt.sub(/[\n\s]+\Z/, '')
+    @res << "\n\\end{code}\n\n"
+  end
+
+  def accept_rule(am, fragment)
+    size = fragment.param
+    size = 10 if size > 10
+    @res << "\n\n\\rule{\\linewidth}{#{size}pt}\n\n"
+  end
+
+  def accept_list_start(am, fragment)
+    @res << list_name(fragment.type, true) << "\n"
+    @in_list_entry.push false
+  end
+
+  def accept_list_end(am, fragment)
+    if tag = @in_list_entry.pop
+      @res << tag << "\n"
+    end
+    @res << list_name(fragment.type, false) << "\n"
+  end
+
+  def accept_list_item(am, fragment)
+    if tag = @in_list_entry.last
+      @res << tag << "\n"
+    end
+    @res << list_item_start(am, fragment)
+    @res << wrap(convert_flow(am.flow(fragment.txt))) << "\n"
+    @in_list_entry[-1] = list_end_for(fragment.type)
+  end
+
+  def accept_blank_line(am, fragment)
+    # @res << "\n"
+  end
+
+  def accept_heading(am, fragment)
+    @res << convert_heading(fragment.head_level, am.flow(fragment.txt))
+  end
+
+  ##
+  # This is a higher speed (if messier) version of wrap
+
+  def wrap(txt, line_len = 76)
+    res = ""
+    sp = 0
+    ep = txt.length
+    while sp < ep
+      # scan back for a space
+      p = sp + line_len - 1
+      if p >= ep
+        p = ep
+      else
+        while p > sp and txt[p] != ?\s
+          p -= 1
+        end
+        if p <= sp
+          p = sp + line_len
+          while p < ep and txt[p] != ?\s
+            p += 1
+          end
+        end
+      end
+      res << txt[sp...p] << "\n"
+      sp = p
+      sp += 1 while sp < ep and txt[sp] == ?\s
+    end
+    res
+  end
+
+  private
+
+  def on_tags(res, item)
+    attr_mask = item.turn_on
+    return if attr_mask.zero?
+
+    @attr_tags.each do |tag|
+      if attr_mask & tag.bit != 0
+        res << tag.on
+      end
+    end
+  end
+
+  def off_tags(res, item)
+    attr_mask = item.turn_off
+    return if attr_mask.zero?
+
+    @attr_tags.reverse_each do |tag|
+      if attr_mask & tag.bit != 0
+        res << tag.off
+      end
+    end
+  end
+
+  def convert_flow(flow)
+    res = ""
+    flow.each do |item|
+      case item
+      when String
+        $stderr.puts "Converting '#{item}'" if $DEBUG_RDOC
+        res << convert_string(item)
+      when AttrChanger
+        off_tags(res, item)
+        on_tags(res,  item)
+      when Special
+        res << convert_special(item)
+      else
+        raise "Unknown flow element: #{item.inspect}"
+      end
+    end
+    res
+  end
+
+  ##
+  # some of these patterns are taken from SmartyPants...
+
+  def convert_string(item)
+    escape(item).
+
+    # convert ... to elipsis (and make sure .... becomes .<elipsis>)
+      gsub(/\.\.\.\./, '.\ldots{}').gsub(/\.\.\./, '\ldots{}').
+
+    # convert single closing quote
+      gsub(%r{([^ \t\r\n\[\{\(])\'}, '\1\'').
+      gsub(%r{\'(?=\W|s\b)}, "'" ).
+
+    # convert single opening quote
+      gsub(/'/, '`').
+
+    # convert double closing quote
+      gsub(%r{([^ \t\r\n\[\{\(])\"(?=\W)}, "\\1''").
+
+    # convert double opening quote
+      gsub(/"/, "``").
+
+    # convert copyright
+      gsub(/\(c\)/, '\copyright{}')
+
+  end
+
+  def convert_special(special)
+    handled = false
+    Attribute.each_name_of(special.type) do |name|
+      method_name = "handle_special_#{name}"
+      if self.respond_to? method_name
+        special.text = send(method_name, special)
+        handled = true
+      end
+    end
+    raise "Unhandled special: #{special}" unless handled
+    special.text
+  end
+
+  def convert_heading(level, flow)
+    res =
+      case level
+      when 1 then "\\chapter{"
+      when 2 then "\\section{"
+      when 3 then "\\subsection{"
+      when 4 then "\\subsubsection{"
+      else  "\\paragraph{"
+      end +
+      convert_flow(flow) +
+      "}\n"
+  end
+
+  def list_name(list_type, is_open_tag)
+    tags = LIST_TYPE_TO_LATEX[list_type] || raise("Invalid list type: #{list_type.inspect}")
+    if tags[2] # enumerate
+      if is_open_tag
+        @list_depth += 1
+        if @prev_list_types[@list_depth] != tags[2]
+          case @list_depth
+          when 1
+            roman = "i"
+          when 2
+            roman = "ii"
+          when 3
+            roman = "iii"
+          when 4
+            roman = "iv"
+          else
+            raise("Too deep list: level #{@list_depth}")
+          end
+          @prev_list_types[@list_depth] = tags[2]
+          return l("\\renewcommand{\\labelenum#{roman}}{#{tags[2]}{enum#{roman}}}") + "\n" + tags[0]
+        end
+      else
+        @list_depth -= 1
+      end
+    end
+    tags[ is_open_tag ? 0 : 1]
+  end
+
+  def list_item_start(am, fragment)
+    case fragment.type
+    when :BULLET, :NUMBER, :UPPERALPHA, :LOWERALPHA then
+      "\\item "
+
+    when :LABELED then
+      "\\item[" + convert_flow(am.flow(fragment.param)) + "] "
+
+    when :NOTE then
+        convert_flow(am.flow(fragment.param)) + " & "
+    else
+      raise "Invalid list type"
+    end
+  end
+
+  def list_end_for(fragment_type)
+    case fragment_type
+    when :BULLET, :NUMBER, :UPPERALPHA, :LOWERALPHA, :LABELED then
+      ""
+    when :NOTE
+      "\\\\\n"
+    else
+      raise "Invalid list type"
+    end
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/to_test.rb ../rdoc-f95-20090109-1/markup/to_test.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/to_test.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/to_test.rb	2008-03-08 18:36:21.000000000 +0900
@@ -0,0 +1,50 @@
+require 'rdoc/markup'
+require 'rdoc/markup/formatter'
+
+##
+# This Markup outputter is used for testing purposes.
+
+class RDoc::Markup::ToTest < RDoc::Markup::Formatter
+
+  def start_accepting
+    @res = []
+  end
+
+  def end_accepting
+    @res
+  end
+
+  def accept_paragraph(am, fragment)
+    @res << fragment.to_s
+  end
+
+  def accept_verbatim(am, fragment)
+    @res << fragment.to_s
+  end
+
+  def accept_list_start(am, fragment)
+    @res << fragment.to_s
+  end
+
+  def accept_list_end(am, fragment)
+    @res << fragment.to_s
+  end
+
+  def accept_list_item(am, fragment)
+    @res << fragment.to_s
+  end
+
+  def accept_blank_line(am, fragment)
+    @res << fragment.to_s
+  end
+
+  def accept_heading(am, fragment)
+    @res << fragment.to_s
+  end
+
+  def accept_rule(am, fragment)
+    @res << fragment.to_s
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup/to_xhtml_texparser.rb ../rdoc-f95-20090109-1/markup/to_xhtml_texparser.rb
--- ruby-1.8.7-p72/lib/rdoc/markup/to_xhtml_texparser.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup/to_xhtml_texparser.rb	2008-03-09 12:19:47.000000000 +0900
@@ -0,0 +1,234 @@
+require 'fileutils'
+require 'rdoc/markup/to_html_crossref'
+require 'rdoc/markup/mathml_wrapper'
+
+##
+#<b>Note that Japanese and English are described in parallel.</b>
+#
+#== TeX ¤Î¿ô¼°¤ò MathML ¤ËÊÑ´¹
+#
+#TeX ¤Çµ­½Ò¤µ¤ì¤¿¿ô¼°¤ò MathML ¤ËÊÑ´¹¤·¤Þ¤¹.
+#¥¤¥ó¥é¥¤¥ó¤ÇÉ½¼¨¤·¤¿¤¤¾ì¹ç, TeX ¤Î¿ô¼°¤ò°Ê²¼¤Î¤è¤¦¤Ë $ ... $ ¤Ç¤¯¤¯¤Ã¤Æ
+#µ­½Ò¤·¤Æ¤¯¤À¤µ¤¤. $ ¤Î
+#Á°¸å¤Ë¤ÏÈ¾³Ñ¶õÇò¤ò°ìÊ¸»ú°Ê¾åÆþ¤ì¤Æ²¼¤µ¤¤.
+#(¤Ê¤ª, "$ID: ... $" ¤ä "$LOG: ... $
+#¤È¤¤¤Ã¤¿, CVS ¤Î¥­¡¼¥ï¡¼¥É¤È¤·¤Æ
+#ÍÑ¤¤¤é¤ì¤Æ¤¤¤ë½ñ¤­Êý¤Ï¿ô¼°¤È¤·¤Æ°·¤ï¤ì¤Þ¤»¤ó.)
+#
+#  ¥¤¥ó¥é¥¤¥ó¤ÇÉ½¼¨¤¹¤ë¿ô¼°¤Ï $ f(x) = x^2 + 1 $ ¤Î¤è¤¦¤Ëµ­½Ò¤·¤Þ¤¹.
+#  ($ ¤ÎÁ°¸å¤Ë¶õÇò¤ò¤ªËº¤ì¤Ê¤¯).
+#
+#¥Ö¥í¥Ã¥¯¤ÇÉ½¼¨¤¹¤ë¾ì¹ç, °Ê²¼¤Î¤è¤¦¤Ë \[ ¤È
+#\] ¤È¤Ç¤¯¤¯¤Ã¤Æµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤. \[, ¤ÏÉ¬¤º¹ÔÆ¬¤Ëµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤.
+#
+#  \[
+#     \sum_{i=1}^nf_n(x)
+#  \]
+#
+#¿ô¼°¤òÊ£¿ô¹Ô¤ÇÉ½¼¨¤¹¤ë¾ì¹ç¤Ë¤Ï, ²þ¹Ô¤¹¤ëÉôÊ¬¤Ë "\] \[" ¤òµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤.
+#
+# \[
+#     d\zeta/dt + J(\psi,\zeta) = Ra \; dT/dx + \nabla\zeta, \] \[
+#     dT/dt + J(\psi,T) - d\psi/dx = \nabla T,               \] \[
+#     \nabla\psi = \zeta
+# \]
+#
+#TeX ¤Î¿ô¼°¤«¤é MathML ÊÑ´¹¤Ë¤Ï
+#<b>Ruby ÍÑ MathML ¥é¥¤¥Ö¥é¥ê¤Î¥Ð¡¼¥¸¥ç¥ó 0.8</b> ¤ò»ÈÍÑ¤·¤Æ¤¤¤Þ¤¹.
+#¤³¤Î¥é¥¤¥Ö¥é¥ê¤Ï{¤Ò¤é¤¯¤Î¹©Ë¼}[http://www.hinet.mydns.jp/~hiraku/]
+#¤Ë¤Æ¸ø³«¤µ¤ì¤Æ¤¤¤Þ¤¹. »ÈÍÑ¤Ç¤­¤ë TeX ¥³¥Þ¥ó¥É¤Î¾ÜºÙ¤Ë´Ø¤·¤Æ¤â
+#¤³¤Á¤é¤Î¥µ¥¤¥È¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤.
+#
+#ºîÀ®¤µ¤ì¤¿¥É¥­¥å¥á¥ó¥È¤ò±ÜÍ÷¤¹¤ëºÝ¤Ë¤Ï MathML ¤ËÂÐ±þ¤·¤¿
+#¥Ö¥é¥¦¥¶¤ò»ÈÍÑ¤¹¤ëÉ¬Í×¤¬
+#¤¢¤ê¤Þ¤¹. {MathML ÆüËÜ¸ì¾ðÊó}[http://washitake.com/MathML/] 
+#¤ä {MathML Software - Browsers}[http://www.w3.org/Math/Software/mathml_software_cat_browsers.html]
+#¤Ê¤É¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤.
+#
+#
+#== TeX is converted to MathML
+#
+#TeX formula is converted to MathML.
+#When inline display, TeX formula should be bundled by $ ... $
+#as follows. 
+#One or more normal-width blank is necessary before and behind "$".
+#(The format of CVS keywords, that is "$ID: ... $" or
+#"$LOG: ... $ etc. is ignored.)
+#
+#  Inline formula is $ f(x) = x^2 + 1 $ .
+#
+#When block display, TeX formula should be bundled by \[ ... \]
+#as follows. 
+#Describe \[ at the head of line.
+#
+#  \[
+#     \sum_{i=1}^nf_n(x)
+#  \]
+#
+#To write equations across multiple lines, describe "\] \["
+#as follows.
+#
+# \[
+#     d\zeta/dt + J(\psi,\zeta) = Ra \; dT/dx + \nabla\zeta, \] \[
+#     dT/dt + J(\psi,T) - d\psi/dx = \nabla T,               \] \[
+#     \nabla\psi = \zeta
+# \]
+#
+#<b>MathML library for Ruby version 0.8</b> is needed to
+#convert TeX formula to MathML.
+#This library is available from {Bottega of Hiraku (JAPANESE only)}[http://www.hinet.mydns.jp/~hiraku/].
+#See this site about available TeX commands.
+#
+#When you browse generated documents, you need to use 
+#browers that can handle MathML.
+#See {MathML Software - Browsers}[http://www.w3.org/Math/Software/mathml_software_cat_browsers.html], etc.
+#
+#
+#== \newcommand, \newenvironment ¤Î»ÈÍÑÊýË¡
+#
+#\newcommand ¤ä \newenvironment Ì¿Îá¤Ë¤è¤ë¥Þ¥¯¥í¤ò»ÈÍÑ¤¹¤ë¤Ë¤Ï,
+#Ruby ¤Î¥í¡¼¥É¥Ñ¥¹°Ê²¼¤Ë '<b><tt>mathml/macro</tt></b>' ¥Ç¥£¥ì¥¯¥È¥ê¤ò
+#ºîÀ®¤·, ¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Ë¥Þ¥¯¥íÌ¿Îá¤òµ­¤·¤¿¥Õ¥¡¥¤¥ë¤òÃÖ¤¤¤Æ¤¯¤À¤µ¤¤.
+#¥Õ¥¡¥¤¥ëÌ¾¤ÏÌä¤¤¤Þ¤»¤ó.
+#
+#Îã¤¨¤Ð, '<tt>/usr/lib/ruby/1.8</tt>' ¤¬ Ruby ¤Î¥í¡¼¥É¥Ñ¥¹¤Ç¤¢¤ë¾ì¹ç,
+#'<tt>/usr/lib/ruby/1.8/mathml</tt>' ¤ª¤è¤Ó
+#'<tt>/usr/lib/ruby/1.8/mathml/macro</tt>' ¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·,
+#¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Ë, 'D6math.sty' ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤Þ¤¹
+#(Á°½Ò¤·¤¿¤è¤¦¤Ë¤³¤Î¥Õ¥¡¥¤¥ëÌ¾¤Ï²¿¤Ç¤â¹½¤¤¤Þ¤»¤ó). ¤½¤Î¥Õ¥¡¥¤¥ëÆâ¤Ë
+#°Ê²¼¤Î¤è¤¦¤Ê \newcommand Ì¿Îá¤òµ­½Ò¤·¤Æ¤ª¤¯¤³¤È¤Ç, '<b>\DP{}{}</b>'
+#(ÊÐÈùÊ¬¤ò´ÊÃ±¤Ëµ­½Ò¤¹¤ë¤¿¤á¤Î¥Þ¥¯¥í) ¥³¥Þ¥ó¥É¤¬»ÈÍÑ²ÄÇ½¤Ë¤Ê¤ê¤Þ¤¹.
+#
+#    \newcommand{\DP}[2]{\frac{\partial #1}{\partial #2}}
+#
+#ÃÏµåÎ®ÂÎÅÅÇ¾¶æ³ÚÉô¤ÇÄó¶¡¤·¤Æ¤¤¤ë {TeX ¥Þ¥¯¥í (ÄÌ¾Î: ÅÅÇ¾¥¹¥¿¥¤¥ë)}[http://www.gfd-dennou.org/library/cc-env/TeXmacro/dennou/SIGEN.htm]
+#¤Ë´Þ¤Þ¤ì¤ë 'D6math.sty' ¤ò Ruby ÍÑ Mathml ¥é¥¤¥Ö¥é¥ê¤Ç»ÈÍÑ¤Ç¤­¤ë¤è¤¦¤Ë
+#½¤Àµ¤·¤¿¥Ñ¥Ã¥±¡¼¥¸¤ò libmathml-macro-dennou-ruby[http://www.gfd-dennou.org/library/cc-env/libmathml-macro-dennou-ruby/debian/stable/] ¤È¤·¤Æ
+#Äó¶¡¤·¤Æ¤¤¤Þ¤¹. ¥µ¥ó¥×¥ë¤È¤·¤ÆÍøÍÑ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤.
+#
+#
+#== Usage of \newcommand and \newenvironment
+#
+#If you want to use macros defined by \newcommand and 
+#\newenvironment commands, make '<b><tt>mathml/macro</tt></b>' directory
+#under load paths of Ruby, and prepare a file that macro commands are 
+#described in the directory. A name of the file is free.
+#
+#For example, if your load path of Ruby is '<tt>/usr/lib/ruby/1.8</tt>',
+#you should make '<tt>/usr/lib/ruby/1.8/mathml</tt>' and
+#'<tt>/usr/lib/ruby/1.8/mathml/macro</tt>' directories,
+#and make 'D6math.sty' file (already mentioned, the file name is free).
+#When you describe a following \newcommand command, you can use
+#'<b>\DP{}{}</b>' (a macro for partial differentiations) command.
+#
+#    \newcommand{\DP}[2]{\frac{\partial #1}{\partial #2}}
+#
+#As a sample, please use libmathml-macro-dennou-ruby[http://www.gfd-dennou.org/library/cc-env/libmathml-macro-dennou-ruby/debian/stable/].
+#The original style file is 'D6math.sty' in {TeX macro (Dennou style)}[http://www.gfd-dennou.org/library/cc-env/TeXmacro/dennou/SIGEN.htm].
+#libmathml-macro-dennou-ruby is a reconfigured package for Mathml library for Ruby.
+#
+#
+class RDoc::Markup::ToXHtmlTexParser < RDoc::Markup::ToHtmlCrossref
+
+  attr_accessor :context
+  attr_reader   :block_exceptions
+
+  ##
+  # We need to record the html path of our caller so we can generate
+  # correct relative paths for any hyperlinks that we find
+
+  def initialize(from_path, context, show_hash, mathml=nil)
+    super(from_path, context, show_hash)
+    @mathml = mathml
+
+    if @mathml
+      # TeX inline form
+      @markup.add_special(/(\$(.*?)[^\\]\$)/im, :TEXINLINE)
+
+      # TeX inline delimiter
+      @markup.add_special(/(\\\$)/im, :TEXINLINEDELIMITER)
+
+      # TeX block form
+      @markup.add_special(/(\\\[(.+?)\\\])/im, :TEXBLOCK)
+    end
+
+    @block_exceptions = []
+    if @markup
+      @block_exceptions << {
+        'name'     => :texblockform,
+        'start'    => Regexp.new("^\\\\\\["),
+        'end'      => Regexp.new("\\\\\\]$"),
+        'replaces' => []
+      }
+      @block_exceptions[0]['replaces'] << {
+        'from' => Regexp.new("\\\\\\\\"),
+        'to'   => "\\\\\\\\\\\\\\\\",
+      }
+    end
+
+  end
+
+  def file_location
+    if @context.context.parent
+      class_or_method = @context.context.name
+    end
+    context = @context.context
+    while context.parent
+      context = context.parent
+    end
+    location = context.file_relative_name
+    if class_or_method
+      location += "#"+class_or_method
+    end
+    return location
+  end
+
+  ##
+  # TEXINLINE pattern $...$ is converted to MathML format
+  # when --mathml option is given.
+  #
+  def handle_special_TEXINLINE(special)
+    text = special.text
+    return text unless @mathml
+    raw_text = text.scan(/^.*?\$/).to_s.sub(/\$$/, '')
+    return text if text =~ /^.*?\$[A-Z]\w+:/  # CVS keywords are skipped
+    text.sub!(/^.*?\$/, '')
+    text.sub!(/\$$/, '')
+    tex = MathMLWrapper.new
+    mathml, stat = tex.parse(text)
+    if !(stat == 0)
+      $stderr.puts "Warning: in #{file_location}, following TeX commands can not be converted to MathML\n\n",
+      "    #{text}\n\n"
+    end
+    return raw_text + mathml
+  end
+
+  ##
+  # TEXINLINEDELIMITER pattern "\$" is converted to single dollar "$"
+  # when --mathml option is given.
+  #
+  def handle_special_TEXINLINEDELIMITER(special)
+    text = special.text
+    return text unless @mathml
+    return text.gsub(/\\\$/, '$')
+  end
+
+  ##
+  # TEXBLOCK pattern \[...\] is converted to MathML format
+  # when --mathml option is given.
+  #
+  def handle_special_TEXBLOCK(special)
+    text = special.text
+    return text unless @mathml
+    text.sub!(/^\\\[/, '')
+    text.sub!(/\\\]$/, '')
+    tex = MathMLWrapper.new
+    mathml, stat = tex.parse(text, true)
+    if !(stat == 0)
+      $stderr.puts "Warning: in #{file_location}, following TeX commands can not be converted to MathML\n\n",
+      "    #{text}\n\n"
+    end
+    return mathml
+  end
+
+end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/markup.rb ../rdoc-f95-20090109-1/markup.rb
--- ruby-1.8.7-p72/lib/rdoc/markup.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/markup.rb	2008-03-09 06:49:04.000000000 +0900
@@ -0,0 +1,506 @@
+##
+# RDoc::Markup parses plain text documents and attempts to decompose them into
+# their constituent parts.  Some of these parts are high-level: paragraphs,
+# chunks of verbatim text, list entries and the like.  Other parts happen at
+# the character level: a piece of bold text, a word in code font.  This markup
+# is similar in spirit to that used on WikiWiki webs, where folks create web
+# pages using a simple set of formatting rules.
+#
+# RDoc::Markup itself does no output formatting: this is left to a different
+# set of classes.
+#
+# RDoc::Markup is extendable at runtime: you can add new markup elements to be
+# recognised in the documents that RDoc::Markup parses.
+#
+# RDoc::Markup is intended to be the basis for a family of tools which share
+# the common requirement that simple, plain-text should be rendered in a
+# variety of different output formats and media.  It is envisaged that
+# RDoc::Markup could be the basis for formating RDoc style comment blocks,
+# Wiki entries, and online FAQs.
+#
+# = Basic Formatting
+#
+# * RDoc::Markup looks for a document's natural left margin.  This is
+#   used as the initial margin for the document.
+#
+# * Consecutive lines starting at this margin are considered to be a
+#   paragraph.
+#
+# * If a paragraph starts with a "*", "-", or with "<digit>.", then it is
+#   taken to be the start of a list.  The margin in increased to be the
+#   first non-space following the list start flag.  Subsequent lines
+#   should be indented to this new margin until the list ends.  For
+#   example:
+#
+#      * this is a list with three paragraphs in
+#        the first item.  This is the first paragraph.
+#
+#        And this is the second paragraph.
+#
+#        1. This is an indented, numbered list.
+#        2. This is the second item in that list
+#
+#        This is the third conventional paragraph in the
+#        first list item.
+#
+#      * This is the second item in the original list
+#
+# * You can also construct labeled lists, sometimes called description
+#   or definition lists.  Do this by putting the label in square brackets
+#   and indenting the list body:
+#
+#       [cat]  a small furry mammal
+#              that seems to sleep a lot
+#
+#       [ant]  a little insect that is known
+#              to enjoy picnics
+#
+#   A minor variation on labeled lists uses two colons to separate the
+#   label from the list body:
+#
+#       cat::  a small furry mammal
+#              that seems to sleep a lot
+#
+#       ant::  a little insect that is known
+#              to enjoy picnics
+#
+#   This latter style guarantees that the list bodies' left margins are
+#   aligned: think of them as a two column table.
+#
+# * Any line that starts to the right of the current margin is treated
+#   as verbatim text.  This is useful for code listings.  The example of a
+#   list above is also verbatim text.
+#
+# * A line starting with an equals sign (=) is treated as a
+#   heading.  Level one headings have one equals sign, level two headings
+#   have two,and so on.
+#
+# * A line starting with three or more hyphens (at the current indent)
+#   generates a horizontal rule.  The more hyphens, the thicker the rule
+#   (within reason, and if supported by the output device)
+#
+# * You can use markup within text (except verbatim) to change the
+#   appearance of parts of that text.  Out of the box, RDoc::Markup
+#   supports word-based and general markup.
+#
+#   Word-based markup uses flag characters around individual words:
+#
+#   [\*word*]  displays word in a *bold* font
+#   [\_word_]  displays word in an _emphasized_ font
+#   [\+word+]  displays word in a +code+ font
+#
+#   General markup affects text between a start delimiter and and end
+#   delimiter.  Not surprisingly, these delimiters look like HTML markup.
+#
+#   [\<b>text...</b>]    displays word in a *bold* font
+#   [\<em>text...</em>]  displays word in an _emphasized_ font
+#   [\<i>text...</i>]    displays word in an _emphasized_ font
+#   [\<tt>text...</tt>]  displays word in a +code+ font
+#
+#   Unlike conventional Wiki markup, general markup can cross line
+#   boundaries.  You can turn off the interpretation of markup by
+#   preceding the first character with a backslash, so \\\<b>bold
+#   text</b> and \\\*bold* produce \<b>bold text</b> and \*bold
+#   respectively.
+#
+# * Hyperlinks to the web starting http:, mailto:, ftp:, or www. are
+#   recognized.  An HTTP url that references an external image file is
+#   converted into an inline <IMG..>.  Hyperlinks starting 'link:' are
+#   assumed to refer to local files whose path is relative to the --op
+#   directory.
+#
+#   Hyperlinks can also be of the form <tt>label</tt>[url], in which
+#   case the label is used in the displayed text, and <tt>url</tt> is
+#   used as the target.  If <tt>label</tt> contains multiple words,
+#   put it in braces: <em>{multi word label}[</em>url<em>]</em>.
+#
+# == Synopsis
+#
+# This code converts <tt>input_string</tt> to HTML.  The conversion
+# takes place in the +convert+ method, so you can use the same
+# RDoc::Markup object to convert multiple input strings.
+#
+#   require 'rdoc/markup'
+#   require 'rdoc/markup/to_html'
+#   
+#   p = RDoc::Markup.new
+#   h = RDoc::Markup::ToHtml.new
+#   
+#   puts p.convert(input_string, h)
+#
+# You can extend the RDoc::Markup parser to recognise new markup
+# sequences, and to add special processing for text that matches a
+# regular epxression.  Here we make WikiWords significant to the parser,
+# and also make the sequences {word} and \<no>text...</no> signify
+# strike-through text.  When then subclass the HTML output class to deal
+# with these:
+#
+#   require 'rdoc/markup'
+#   require 'rdoc/markup/to_html'
+#   
+#   class WikiHtml < RDoc::Markup::ToHtml
+#     def handle_special_WIKIWORD(special)
+#       "<font color=red>" + special.text + "</font>"
+#     end
+#   end
+#   
+#   m = RDoc::Markup.new
+#   m.add_word_pair("{", "}", :STRIKE)
+#   m.add_html("no", :STRIKE)
+#   
+#   m.add_special(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD)
+#   
+#   h = WikiHtml.new
+#   h.add_tag(:STRIKE, "<strike>", "</strike>")
+#   
+#   puts "<body>" + m.convert(ARGF.read, h) + "</body>"
+#
+#--
+# Author::   Dave Thomas,  dave@pragmaticprogrammer.com
+# License::  Ruby license
+
+class RDoc::Markup
+
+  SPACE = ?\s
+
+  # List entries look like:
+  #   *       text
+  #   1.      text
+  #   [label] text
+  #   label:: text
+  #
+  # Flag it as a list entry, and work out the indent for subsequent lines
+
+  SIMPLE_LIST_RE = /^(
+                (  \*          (?# bullet)
+                  |-           (?# bullet)
+                  |\d+\.       (?# numbered )
+                  |[A-Za-z]\.  (?# alphabetically numbered )
+                )
+                \s+
+              )\S/x
+
+  LABEL_LIST_RE = /^(
+                      (  \[.*?\]    (?# labeled  )
+                        |\S.*::     (?# note     )
+                      )(?:\s+|$)
+                    )/x
+
+  ##
+  # Take a block of text and use various heuristics to determine it's
+  # structure (paragraphs, lists, and so on).  Invoke an event handler as we
+  # identify significant chunks.
+
+  def initialize
+    @am = RDoc::Markup::AttributeManager.new
+    @output = nil
+  end
+
+  ##
+  # Add to the sequences used to add formatting to an individual word (such
+  # as *bold*).  Matching entries will generate attibutes that the output
+  # formatters can recognize by their +name+.
+
+  def add_word_pair(start, stop, name)
+    @am.add_word_pair(start, stop, name)
+  end
+
+  ##
+  # Add to the sequences recognized as general markup.
+
+  def add_html(tag, name)
+    @am.add_html(tag, name)
+  end
+
+  ##
+  # Add to other inline sequences.  For example, we could add WikiWords using
+  # something like:
+  #
+  #    parser.add_special(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD)
+  #
+  # Each wiki word will be presented to the output formatter via the
+  # accept_special method.
+
+  def add_special(pattern, name)
+    @am.add_special(pattern, name)
+  end
+
+  ##
+  # We take a string, split it into lines, work out the type of each line,
+  # and from there deduce groups of lines (for example all lines in a
+  # paragraph).  We then invoke the output formatter using a Visitor to
+  # display the result.
+
+  def convert(str, op, block_exceptions=nil)
+    lines = str.split(/\r?\n/).map { |line| Line.new line }
+    @lines = Lines.new lines
+    @block_exceptions = block_exceptions
+
+    return "" if @lines.empty?
+    @lines.normalize
+    assign_types_to_lines
+    group = group_lines
+    # call the output formatter to handle the result
+    #group.each { |line| p line }
+    group.accept @am, op
+  end
+
+  private
+
+  ##
+  # Look through the text at line indentation.  We flag each line as being
+  # Blank, a paragraph, a list element, or verbatim text.
+
+  def assign_types_to_lines(margin = 0, level = 0)
+    now_blocking = false
+    while line = @lines.next
+      if line.blank? then
+        line.stamp :BLANK, level
+        next
+      end
+
+      # if a line contains non-blanks before the margin, then it must belong
+      # to an outer level
+
+      text = line.text
+
+      for i in 0...margin
+        if text[i] != SPACE
+          @lines.unget
+          return
+        end
+      end
+
+      active_line = text[margin..-1]
+
+      #
+      # block_exceptions checking
+      #
+      if @block_exceptions
+        if now_blocking
+          line.stamp(:PARAGRAPH, level)
+          @block_exceptions.each{ |be|
+            if now_blocking == be['name']
+              be['replaces'].each{ |rep|
+                line.text.gsub!(rep['from'], rep['to'])
+              }
+            end
+            if now_blocking == be['name'] && line.text =~ be['end']
+              now_blocking = false
+              break
+            end
+          }
+          next
+        else
+          @block_exceptions.each{ |be|
+            if line.text =~ be['start']
+              now_blocking = be['name']
+              line.stamp(:PARAGRAPH, level)
+              break
+            end
+          }
+          next if now_blocking
+        end
+      end
+
+      # Rules (horizontal lines) look like
+      #
+      #  ---   (three or more hyphens)
+      #
+      # The more hyphens, the thicker the rule
+      #
+
+      if /^(---+)\s*$/ =~ active_line
+        line.stamp :RULE, level, $1.length-2
+        next
+      end
+
+      # Then look for list entries.  First the ones that have to have
+      # text following them (* xxx, - xxx, and dd. xxx)
+
+      if SIMPLE_LIST_RE =~ active_line
+        offset = margin + $1.length
+        prefix = $2
+        prefix_length = prefix.length
+
+        flag = case prefix
+               when "*","-" then :BULLET
+               when /^\d/   then :NUMBER
+               when /^[A-Z]/ then :UPPERALPHA
+               when /^[a-z]/ then :LOWERALPHA
+               else raise "Invalid List Type: #{self.inspect}"
+               end
+
+        line.stamp :LIST, level+1, prefix, flag
+        text[margin, prefix_length] = " " * prefix_length
+        assign_types_to_lines(offset, level + 1)
+        next
+      end
+
+      if LABEL_LIST_RE =~ active_line
+        offset = margin + $1.length
+        prefix = $2
+        prefix_length = prefix.length
+
+        next if handled_labeled_list(line, level, margin, offset, prefix)
+      end
+
+      # Headings look like
+      # = Main heading
+      # == Second level
+      # === Third
+      #
+      # Headings reset the level to 0
+
+      if active_line[0] == ?= and active_line =~ /^(=+)\s*(.*)/
+        prefix_length = $1.length
+        prefix_length = 6 if prefix_length > 6
+        line.stamp :HEADING, 0, prefix_length
+        line.strip_leading(margin + prefix_length)
+        next
+      end
+
+      # If the character's a space, then we have verbatim text,
+      # otherwise
+
+      if active_line[0] == SPACE
+        line.strip_leading(margin) if margin > 0
+        line.stamp :VERBATIM, level
+      else
+        line.stamp :PARAGRAPH, level
+      end
+    end
+  end
+
+  ##
+  # Handle labeled list entries, We have a special case to deal with.
+  # Because the labels can be long, they force the remaining block of text
+  # over the to right:
+  #
+  #   this is a long label that I wrote:: and here is the
+  #                                       block of text with
+  #                                       a silly margin
+  #
+  # So we allow the special case.  If the label is followed by nothing, and
+  # if the following line is indented, then we take the indent of that line
+  # as the new margin.
+  #
+  #   this is a long label that I wrote::
+  #       here is a more reasonably indented block which
+  #       will be attached to the label.
+  #
+
+  def handled_labeled_list(line, level, margin, offset, prefix)
+    prefix_length = prefix.length
+    text = line.text
+    flag = nil
+
+    case prefix
+    when /^\[/ then
+      flag = :LABELED
+      prefix = prefix[1, prefix.length-2]
+    when /:$/ then
+      flag = :NOTE
+      prefix.chop!
+    else
+      raise "Invalid List Type: #{self.inspect}"
+    end
+
+    # body is on the next line
+    if text.length <= offset then
+      original_line = line
+      line = @lines.next
+      return false unless line
+      text = line.text
+
+      for i in 0..margin
+        if text[i] != SPACE
+          @lines.unget
+          return false
+        end
+      end
+
+      i = margin
+      i += 1 while text[i] == SPACE
+
+      if i >= text.length then
+        @lines.unget
+        return false
+      else
+        offset = i
+        prefix_length = 0
+
+        if text[offset..-1] =~ SIMPLE_LIST_RE then
+          @lines.unget
+          line = original_line
+          line.text = ''
+        else
+          @lines.delete original_line
+        end
+      end
+    end
+
+    line.stamp :LIST, level+1, prefix, flag
+    text[margin, prefix_length] = " " * prefix_length
+    assign_types_to_lines(offset, level + 1)
+    return true
+  end
+
+  ##
+  # Return a block consisting of fragments which are paragraphs, list
+  # entries or verbatim text.  We merge consecutive lines of the same type
+  # and level together.  We are also slightly tricky with lists: the lines
+  # following a list introduction look like paragraph lines at the next
+  # level, and we remap them into list entries instead.
+
+  def group_lines
+    @lines.rewind
+
+    in_list = false
+    wanted_type = wanted_level = nil
+
+    block = LineCollection.new
+    group = nil
+
+    while line = @lines.next
+      if line.level == wanted_level and line.type == wanted_type
+        group.add_text(line.text)
+      else
+        group = block.fragment_for(line)
+        block.add(group)
+
+        if line.type == :LIST
+          wanted_type = :PARAGRAPH
+        else
+          wanted_type = line.type
+        end
+
+        wanted_level = line.type == :HEADING ? line.param : line.level
+      end
+    end
+
+    block.normalize
+    block
+  end
+
+  ##
+  # For debugging, we allow access to our line contents as text.
+
+  def content
+    @lines.as_text
+  end
+  public :content
+
+  ##
+  # For debugging, return the list of line types.
+
+  def get_line_types
+    @lines.line_types
+  end
+  public :get_line_types
+
+end
+
+require 'rdoc/markup/fragments'
+require 'rdoc/markup/inline'
+require 'rdoc/markup/lines'
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/options.rb ../rdoc-f95-20090109-1/options.rb
--- ruby-1.8.7-p72/lib/rdoc/options.rb	2008-01-11 10:24:05.000000000 +0900
+++ ../rdoc-f95-20090109-1/options.rb	2009-01-09 16:23:30.000000000 +0900
@@ -1,561 +1,661 @@
 # We handle the parsing of options, and subsequently as a singleton
 # object to be queried for option values
 
-require "rdoc/ri/ri_paths"
+require "rdoc/ri/paths"
+require 'optparse'
+require "pathname"
 
-class Options
+class RDoc::Options
 
-  require 'singleton'
-  require 'getoptlong'
+  ##
+  # Should the output be placed into a single file
 
-  include Singleton
+  attr_reader :all_one_file
+
+  ##
+  # Character-set
+
+  attr_reader :charset
+
+  ##
+  # URL of stylesheet
+
+  attr_reader :css
+
+  ##
+  # Should diagrams be drawn
+
+  attr_reader :diagram
+
+  ##
+  # Files matching this pattern will be excluded
 
-  # files matching this pattern will be excluded
   attr_accessor :exclude
 
-  # the name of the output directory
-  attr_accessor :op_dir
-  
-  # the name to use for the output
-  attr_reader :op_name
+  ##
+  # Additional attr_... style method flags
 
-  # include private and protected methods in the
-  # output
-  attr_accessor :show_all
+  attr_reader :extra_accessor_flags
+
+  ##
+  # Pattern for additional attr_... style methods
+
+  attr_accessor :extra_accessors
+
+  ##
+  # Should we draw fileboxes in diagrams
+
+  attr_reader :fileboxes
+
+  ##
+  # The list of files to be processed
+
+  attr_accessor :files
+
+  ##
+  # Scan newer sources than the flag file if true.
+
+  attr_reader :force_update
+
+  ##
+  # Description of the output generator (set with the <tt>-fmt</tt> option)
+
+  attr_accessor :generator
+
+  ##
+  # The case of names of classes or modules or methods are ignored
+  attr_reader :ignore_case
+
+  ##
+  # Formatter to mark up text with
+
+  attr_accessor :formatter
   
-  # name of the file, class or module to display in
-  # the initial index page (if not specified
-  # the first file we encounter is used)
+  ##
+  # image format for diagrams
+
+  attr_reader :image_format
+
+  ##
+  # Include line numbers in the source listings
+
+  attr_reader :include_line_numbers
+
+  ##
+  # Should source code be included inline, or displayed in a popup
+
+  attr_accessor :inline_source
+
+  ##
+  # Name of the file, class or module to display in the initial index page (if
+  # not specified the first file we encounter is used)
+
   attr_accessor :main_page
 
-  # merge into classes of the name name when generating ri
+  ##
+  # TeX formatted formula is converted to MathML
+  attr_reader :mathml
+
+  ##
+  # Merge into classes of the same name when generating ri
+
   attr_reader :merge
 
-  # Don't display progress as we process the files
-  attr_reader :quiet
+  ##
+  # The name of the output directory
 
-  # description of the output generator (set with the <tt>-fmt</tt>
-  # option
-  attr_accessor :generator
+  attr_accessor :op_dir
 
-  # and the list of files to be processed
-  attr_reader :files
+  ##
+  # The name to use for the output
 
-  # array of directories to search for files to satisfy an :include:
-  attr_reader :rdoc_include
+  attr_accessor :op_name
 
-  # title to be used out the output
-  #attr_writer :title
+  ##
+  # Are we promiscuous about showing module contents across multiple files
 
-  # template to be used when generating output
-  attr_reader :template
+  attr_reader :promiscuous
 
-  # should diagrams be drawn
-  attr_reader :diagram
+  ##
+  # Array of directories to search for files to satisfy an :include:
 
-  # should we draw fileboxes in diagrams
-  attr_reader :fileboxes
+  attr_reader :rdoc_include
 
-  # include the '#' at the front of hyperlinked instance method names
-  attr_reader :show_hash
+  ##
+  # Include private and protected methods in the output
 
-  # image format for diagrams
-  attr_reader :image_format
+  attr_accessor :show_all
 
-  # character-set
-  attr_reader :charset
+  ##
+  # Include the '#' at the front of hyperlinked instance method names
 
-  # should source code be included inline, or displayed in a popup
-  attr_reader :inline_source
+  attr_reader :show_hash
 
-  # should the output be placed into a single file
-  attr_reader :all_one_file
+  ##
+  # The number of columns in a tab
 
-  # the number of columns in a tab
   attr_reader :tab_width
 
-  # include line numbers in the source listings
-  attr_reader :include_line_numbers
+  ##
+  # template to be used when generating output
 
-  # pattern for additional attr_... style methods
-  attr_reader :extra_accessors
-  attr_reader :extra_accessor_flags
+  attr_reader :template
 
-  # URL of stylesheet
-  attr_reader :css
+  ##
+  # Template class for file generation
+  #--
+  # HACK around dependencies in lib/rdoc/generator/html.rb
+
+  attr_accessor :template_class # :nodoc:
+
+  ##
+  # Documentation title
+
+  attr_reader :title
+
+  ##
+  # Verbosity, zero means quiet
+
+  attr_accessor :verbosity
 
+  ##
   # URL of web cvs frontend
+
   attr_reader :webcvs
 
-  # Are we promiscuous about showing module contents across
-  # multiple files
-  attr_reader :promiscuous
+  def initialize(generators = {}) # :nodoc:
+    @op_dir = "doc"
+    @op_name = nil
+    @show_all = false
+    @main_page = nil
+    @merge = false
+    @exclude = []
+    @generators = generators
+    @generator_name = 'html'
+    @generator = @generators[@generator_name]
+    @rdoc_include = []
+    @title = nil
+    @template = nil
+    @template_class = nil
+    @diagram = false
+    @fileboxes = false
+    @show_hash = false
+    @image_format = 'png'
+    @inline_source = false
+    @all_one_file = false
+    @tab_width = 8
+    @include_line_numbers = false
+    @extra_accessor_flags = {}
+    @promiscuous = false
+    @force_update = false
+    @verbosity = 1
 
-  # scan newer sources than the flag file if true.
-  attr_reader :force_update
+    @mathml = false
+    @ignore_case = false
+
+    @css = nil
+    @webcvs = nil
+
+    @charset = 'utf-8'
+  end
 
-  module OptionList
+  ##
+  # Parse command line options.
 
-    OPTION_LIST = [
-      [ "--accessor",      "-A",   "accessorname[,..]",
-        "comma separated list of additional class methods\n" +
-        "that should be treated like 'attr_reader' and\n" +
-        "friends. Option may be repeated. Each accessorname\n" +
-        "may have '=text' appended, in which case that text\n" +
-        "appears where the r/w/rw appears for normal accessors."],
-                                                                   
-      [ "--all",           "-a",   nil,
-        "include all methods (not just public)\nin the output" ],
-
-      [ "--charset",       "-c",   "charset",
-        "specifies HTML character-set" ],
-
-      [ "--debug",         "-D",   nil,
-        "displays lots on internal stuff" ],
-
-      [ "--diagram",       "-d",   nil,
-        "Generate diagrams showing modules and classes.\n" +
-        "You need dot V1.8.6 or later to use the --diagram\n" +
-        "option correctly. Dot is available from\n"+
-        "http://www.research.att.com/sw/tools/graphviz/" ],
-
-      [ "--exclude",       "-x",   "pattern",
-        "do not process files or directories matching\n" +
-        "pattern. Files given explicitly on the command\n" +
-        "line will never be excluded." ],
-
-      [ "--extension",     "-E",   "new=old",
-        "Treat files ending with .new as if they ended with\n" +
-        ".old. Using '-E cgi=rb' will cause xxx.cgi to be\n" +
-        "parsed as a Ruby file"],
-
-      [ "--fileboxes",     "-F",   nil,
-        "classes are put in boxes which represents\n" +
-        "files, where these classes reside. Classes\n" +
-        "shared between more than one file are\n" +
-        "shown with list of files that sharing them.\n" +
-        "Silently discarded if --diagram is not given\n" +
-        "Experimental." ],
-
-      [ "--force-update",  "-U",   nil,
-        "forces to scan all sources even if newer than\n" +
-        "the flag file." ],
-
-      [ "--fmt",           "-f",   "format name",
-        "set the output formatter (see below)" ],
-
-      [ "--help",          "-h",   nil,
-        "you're looking at it" ],
-
-      [ "--help-output",   "-O",   nil,
-        "explain the various output options" ],
-
-      [ "--image-format",  "-I",   "gif/png/jpg/jpeg",
-        "Sets output image format for diagrams. Can\n" +
-        "be png, gif, jpeg, jpg. If this option is\n" +
-        "omitted, png is used. Requires --diagram." ],
-
-      [ "--include",       "-i",   "dir[,dir...]",
-        "set (or add to) the list of directories\n" +
-        "to be searched when satisfying :include:\n" +
-        "requests. Can be used more than once." ],
-
-      [ "--inline-source", "-S",   nil,
-        "Show method source code inline, rather\n" +
-        "than via a popup link" ],
-
-      [ "--line-numbers", "-N", nil,
-        "Include line numbers in the source code" ],
-
-      [ "--main",          "-m",   "name",
-        "'name' will be the initial page displayed" ],
-
-      [ "--merge",         "-M",   nil,
-        "when creating ri output, merge processed classes\n" +
-        "into previously documented classes of the name name"],
-
-      [ "--one-file",      "-1",   nil,
-        "put all the output into a single file" ],
-
-      [ "--op",            "-o",   "dir",
-        "set the output directory" ],
-
-      [ "--opname",       "-n",    "name",
-        "Set the 'name' of the output. Has no\n" +
-        "effect for HTML." ],
-
-      [ "--promiscuous",   "-p",   nil,
-        "When documenting a file that contains a module\n" +
-        "or class also defined in other files, show\n" +
-        "all stuff for that module/class in each files\n" +
-        "page. By default, only show stuff defined in\n" +
-        "that particular file." ],
-
-      [ "--quiet",         "-q",   nil,
-        "don't show progress as we parse" ],
-
-      [ "--ri",            "-r",   nil,
-       "generate output for use by 'ri.' The files are\n" +
-       "stored in the '.rdoc' directory under your home\n"+
-       "directory unless overridden by a subsequent\n" +
-       "--op parameter, so no special privileges are needed." ],
-
-      [ "--ri-site",       "-R",   nil,
-       "generate output for use by 'ri.' The files are\n" +
-       "stored in a site-wide directory, making them accessible\n"+
-       "to others, so special privileges are needed." ],
-
-      [ "--ri-system",     "-Y",   nil,
-       "generate output for use by 'ri.' The files are\n" +
-       "stored in a system-level directory, making them accessible\n"+
-       "to others, so special privileges are needed. This option\n"+
-       "is intended to be used during Ruby installations" ],
-
-      [ "--show-hash",     "-H",   nil,
-        "A name of the form #name in a comment\n" +
-        "is a possible hyperlink to an instance\n" +
-        "method name. When displayed, the '#' is\n" +
-        "removed unless this option is specified" ],
-
-      [ "--style",         "-s",   "stylesheet url",
-        "specifies the URL of a separate stylesheet." ],
-
-      [ "--tab-width",     "-w",   "n",
-        "Set the width of tab characters (default 8)"],
-
-      [ "--template",      "-T",   "template name",
-        "Set the template used when generating output" ],
-
-      [ "--title",         "-t",   "text",
-        "Set 'txt' as the title for the output" ],
-
-      [ "--version",       "-v",   nil,
-        "display  RDoc's version" ],
-
-      [ "--webcvs",        "-W",   "url",
-        "Specify a URL for linking to a web frontend\n" +
-        "to CVS. If the URL contains a '\%s', the\n" +
-        "name of the current file will be substituted;\n" +
-        "if the URL doesn't contain a '\%s', the\n" +
-        "filename will be appended to it." ],
-    ]
-
-    def OptionList.options
-      OPTION_LIST.map do |long, short, arg,|
-        [ long, 
-          short, 
-          arg ? GetoptLong::REQUIRED_ARGUMENT : GetoptLong::NO_ARGUMENT 
-        ]
+  def parse(argv)
+    accessors = []
+
+    opts = OptionParser.new do |opt|
+      opt.program_name = File.basename $0
+      opt.version = RDoc::VERSION
+      opt.release = nil
+      opt.summary_indent = ' ' * 4
+      opt.banner = <<-EOF
+Usage: #{opt.program_name} [options] [names...]
+
+  Files are parsed, and the information they contain collected, before any
+  output is produced. This allows cross references between all files to be
+  resolved. If a name is a directory, it is traversed. If no names are
+  specified, all Ruby files in the current directory (and subdirectories) are
+  processed.
+
+  How RDoc generates output depends on the output formatter being used, and on
+  the options you give.
+
+  - HTML output is normally produced into a number of separate files
+    (one per class, module, and file, along with various indices).
+    These files will appear in the directory given by the --op
+    option (doc/ by default).
+
+  - XHTML output is the same as HTML. 
+
+  - XML output by default is written to standard output. If a
+    --opname option is given, the output will instead be written
+    to a file with that name in the output directory.
+
+  - .chm files (Windows help files) are written in the --op directory.
+    If an --opname parameter is present, that name is used, otherwise
+    the file will be called rdoc.chm.
+      EOF
+
+#      opt.separator nil  # 1.8.2 doesn't work
+      opt.separator "Options:"
+#      opt.separator nil  # 1.8.2 doesn't work
+
+      opt.on("--accessor=ACCESSORS", "-A", Array,
+             "A comma separated list of additional class",
+             "methods that should be treated like",
+             "'attr_reader' and friends.",
+             " ",
+             "Option may be repeated.",
+             " ",
+             "Each accessorname may have '=text'",
+             "appended, in which case that text appears",
+             "where the r/w/rw appears for normal.",
+             "accessors") do |value|
+        value.each do |accessor|
+          if accessor =~ /^(\w+)(=(.*))?$/
+            accessors << $1
+            @extra_accessor_flags[$1] = $3
+          end
+        end
       end
-    end
 
+#      opt.separator nil  # 1.8.2 doesn't work
 
-    def OptionList.strip_output(text)
-      text =~ /^\s+/
-      leading_spaces = $&
-      text.gsub!(/^#{leading_spaces}/, '')
-      $stdout.puts text
-    end
+      opt.on("--all", "-a",
+             "Include all methods (not just public) in",
+             "the output.") do |value|
+        @show_all = value
+      end
 
+#      opt.separator nil  # 1.8.2 doesn't work
 
-    # Show an error and exit
+      opt.on("--charset=CHARSET", "-c",
+             "Specifies the output HTML character-set.") do |value|
+        @charset = value
+      end
 
-    def OptionList.error(msg)
-      $stderr.puts
-      $stderr.puts msg
-      $stderr.puts "\nFor help on options, try 'rdoc --help'\n\n"
-      exit 1
-    end
+#      opt.separator nil  # 1.8.2 doesn't work
 
-    # Show usage and exit
-    
-    def OptionList.usage(generator_names)
-      
-      puts
-      puts(VERSION_STRING)
-      puts
-
-      name = File.basename($0)
-      OptionList.strip_output(<<-EOT)
-          Usage:
-
-            #{name} [options]  [names...]
-
-          Files are parsed, and the information they contain
-          collected, before any output is produced. This allows cross
-          references between all files to be resolved. If a name is a
-          directory, it is traversed. If no names are specified, all
-          Ruby files in the current directory (and subdirectories) are
-          processed.
-
-          Options:
-
-      EOT
-
-      OPTION_LIST.each do |long, short, arg, desc|
-        opt = sprintf("%20s", "#{long}, #{short}")
-        oparg = sprintf("%-7s", arg)
-        print "#{opt} #{oparg}"
-        desc = desc.split("\n")
-        if arg.nil? || arg.length < 7
-          puts desc.shift
-        else
-          puts
+      opt.on("--debug", "-D",
+             "Displays lots on internal stuff.") do |value|
+        $DEBUG_RDOC = value
+      end
+
+#      opt.separator nil  # 1.8.2 doesn't work
+
+      opt.on("--diagram", "-d",
+             "Generate diagrams showing modules and",
+             "classes. You need dot V1.8.6 or later to",
+             "use the --diagram option correctly. Dot is",
+             "available from http://graphviz.org") do |value|
+        check_diagram
+        @diagram = true
+      end
+
+#      opt.separator nil  # 1.8.2 doesn't work
+
+      opt.on("--exclude=PATTERN", "-x", Regexp,
+             "Do not process files or directories",
+             "matching PATTERN.") do |value|
+        @exclude << value
+      end
+
+#      opt.separator nil  # 1.8.2 doesn't work
+
+      opt.on("--extension=NEW=OLD", "-E",
+             "Treat files ending with .new as if they",
+             "ended with .old. Using '-E cgi=rb' will",
+             "cause xxx.cgi to be parsed as a Ruby file.") do |value|
+        new, old = value.split(/=/, 2)
+
+        unless new and old then
+          raise OptionParser::InvalidArgument, "Invalid parameter to '-E'"
         end
-        desc.each do |line|
-          puts(" "*28 + line)
+
+        unless RDoc::ParserFactory.alias_extension old, new then
+          raise OptionParser::InvalidArgument, "Unknown extension .#{old} to -E"
         end
-        puts
       end
 
-      puts "\nAvailable output formatters: " +
-        generator_names.sort.join(', ') + "\n\n"
+#      opt.separator nil  # 1.8.2 doesn't work
 
-      puts "For information on where the output goes, use\n\n"
-      puts "   rdoc --help-output\n\n"
+      opt.on("--fileboxes", "-F",
+             "Classes are put in boxes which represents",
+             "files, where these classes reside. Classes",
+             "shared between more than one file are",
+             "shown with list of files that are sharing",
+             "them. Silently discarded if --diagram is",
+             "not given.") do |value|
+        @fileboxes = value
+      end
 
-      exit 0
-    end
+#      opt.separator nil  # 1.8.2 doesn't work
 
-    def OptionList.help_output
-      OptionList.strip_output(<<-EOT)
-      How RDoc generates output depends on the output formatter being
-      used, and on the options you give.
-
-      - HTML output is normally produced into a number of separate files
-        (one per class, module, and file, along with various indices). 
-        These files will appear in the directory given by the --op
-        option (doc/ by default).
-
-      - XML output by default is written to standard output. If a
-        --opname option is given, the output will instead be written
-        to a file with that name in the output directory.
-
-      - .chm files (Windows help files) are written in the --op directory.
-        If an --opname parameter is present, that name is used, otherwise
-        the file will be called rdoc.chm.
-
-      For information on other RDoc options, use "rdoc --help".
-      EOT
-      exit 0
-    end
-  end
+      opt.on("--force-update", "-U",
+             "Forces rdoc to scan all sources even if",
+             "newer than the flag file.") do |value|
+        @force_update = value
+      end
 
-  # Parse command line options. We're passed a hash containing
-  # output generators, keyed by the generator name
+#      opt.separator nil  # 1.8.2 doesn't work
 
-  def parse(argv, generators)
-    old_argv = ARGV.dup
-    begin
-      ARGV.replace(argv)
-      @op_dir = "doc"
-      @op_name = nil
-      @show_all = false
-      @main_page = nil
-      @marge     = false
-      @exclude   = []
-      @quiet = false
-      @generator_name = 'html'
-      @generator = generators[@generator_name]
-      @rdoc_include = []
-      @title = nil
-      @template = nil
-      @diagram = false
-      @fileboxes = false
-      @show_hash = false
-      @image_format = 'png'
-      @inline_source = false
-      @all_one_file  = false
-      @tab_width = 8
-      @include_line_numbers = false
-      @extra_accessor_flags = {}
-      @promiscuous = false
-      @force_update = false
-
-      @css = nil
-      @webcvs = nil
-
-      @charset = case $KCODE
-                 when /^S/i
-                   'Shift_JIS'
-                 when /^E/i
-                   'EUC-JP'
-                 else
-                   'iso-8859-1'
-                 end
-
-      accessors = []
-
-      go = GetoptLong.new(*OptionList.options)
-      go.quiet = true
-
-      go.each do |opt, arg|
-	case opt
-        when "--all"           then @show_all      = true
-        when "--charset"       then @charset       = arg
-        when "--debug"         then $DEBUG         = true
-        when "--exclude"       then @exclude       << Regexp.new(arg)
-        when "--inline-source" then @inline_source = true
-        when "--line-numbers"  then @include_line_numbers = true
-        when "--main"          then @main_page     = arg
-        when "--merge"         then @merge         = true
-        when "--one-file"      then @all_one_file  = @inline_source = true
-        when "--op"            then @op_dir        = arg
-        when "--opname"        then @op_name       = arg
-        when "--promiscuous"   then @promiscuous   = true
-        when "--quiet"         then @quiet         = true
-        when "--show-hash"     then @show_hash     = true
-        when "--style"         then @css           = arg
-        when "--template"      then @template      = arg
-        when "--title"         then @title         = arg
-        when "--webcvs"        then @webcvs        = arg
-
-        when "--accessor" 
-          arg.split(/,/).each do |accessor|
-            if accessor =~ /^(\w+)(=(.*))?$/
-              accessors << $1
-              @extra_accessor_flags[$1] = $3
-            end
-          end
+      opt.on("--fmt=FORMAT", "--format=FORMAT", "-f", @generators.keys,
+             "Set the output formatter.") do |value|
+        @generator_name = value.downcase
+        setup_generator
+      end
 
-        when "--diagram"
-          check_diagram
-          @diagram = true
-
-        when "--fileboxes"
-          @fileboxes = true if @diagram
-
-	when "--fmt"
-          @generator_name = arg.downcase
-          setup_generator(generators)
-
-        when "--help"      
-          OptionList.usage(generators.keys)
-
-        when "--help-output"      
-          OptionList.help_output
-
-        when "--image-format"
-          if ['gif', 'png', 'jpeg', 'jpg'].include?(arg)
-            @image_format = arg
-          else
-            raise GetoptLong::InvalidOption.new("unknown image format: #{arg}")
-          end
+#      opt.separator nil  # 1.8.2 doesn't work
 
-        when "--include"   
-          @rdoc_include.concat arg.split(/\s*,\s*/)
+      image_formats = %w[gif png jpg jpeg]
+      opt.on("--image-format=FORMAT", "-I", image_formats,
+             "Sets output image format for diagrams. Can",
+             "be #{image_formats.join ', '}. If this option",
+             "is omitted, png is used. Requires",
+             "diagrams.") do |value|
+        @image_format = value
+      end
 
-        when "--ri", "--ri-site", "--ri-system"
-          @generator_name = "ri"
-          @op_dir = case opt
-                    when "--ri" then RI::Paths::HOMEDIR 
-                    when "--ri-site" then RI::Paths::SITEDIR
-                    when "--ri-system" then RI::Paths::SYSDIR
-                    else fail opt
-                    end
-          setup_generator(generators)
-
-        when "--tab-width"
-          begin
-            @tab_width     = Integer(arg)
-          rescue 
-            $stderr.puts "Invalid tab width: '#{arg}'"
-            exit 1
-          end
+#      opt.separator nil  # 1.8.2 doesn't work
 
-        when "--extension"
-          new, old = arg.split(/=/, 2)
-          OptionList.error("Invalid parameter to '-E'") unless new && old
-          unless RDoc::ParserFactory.alias_extension(old, new)
-            OptionList.error("Unknown extension .#{old} to -E")
-          end
+      opt.on("--include=DIRECTORIES", "-i", Array,
+             "set (or add to) the list of directories to",
+             "be searched when satisfying :include:",
+             "requests. Can be used more than once.") do |value|
+        @rdoc_include.concat value.map { |dir| dir.strip }
+      end
 
-        when "--force-update"
-          @force_update = true
+#      opt.separator nil  # 1.8.2 doesn't work
 
-	when "--version"
-	  puts VERSION_STRING
-	  exit
-	end
+      opt.on("--inline-source", "-S",
+             "Show method source code inline, rather than",
+             "via a popup link.") do |value|
+        @inline_source = value
+      end
+
+#      opt.separator nil  # 1.8.2 doesn't work
 
+      opt.on("--line-numbers", "-N",
+             "Include line numbers in the source code.") do |value|
+        @include_line_numbers = value
       end
 
-      @files = ARGV.dup
+#      opt.separator nil  # 1.8.2 doesn't work
+
+      opt.on("--main=NAME", "-m",
+             "NAME will be the initial page displayed.") do |value|
+        @main_page = value
+      end
 
-      @rdoc_include << "." if @rdoc_include.empty?
+#      opt.separator nil  # 1.8.2 doesn't work
 
-      if @exclude.empty?
-        @exclude = nil
-      else
-        @exclude = Regexp.new(@exclude.join("|"))
+      opt.on("--merge", "-M",
+             "When creating ri output, merge previously",
+             "processed classes into previously",
+             "documented classes of the same name.") do |value|
+        @merge = value
+      end
+
+#      opt.separator nil  # 1.8.2 doesn't work
+
+      opt.on("--one-file", "-1",
+             "Put all the output into a single file.") do |value|
+        @all_one_file = value
+        @inline_source = value if value
+        @template = 'one_page_html'
+      end
+
+#      opt.separator nil  # 1.8.2 doesn't work
+
+      opt.on("--op=DIR", "-o",
+             "Set the output directory.") do |value|
+        if @css && ! (%r{^(https?:/)?/} =~ @css)
+          @css = relative_str(File.join(value, "."),
+                              relative_str(File.join(@op_dir.split("/").fill(".."), ".."), @css))
+        end
+        @op_dir = value
+      end
+
+#      opt.separator nil  # 1.8.2 doesn't work
+
+      opt.on("--opname=NAME", "-n",
+             "Set the NAME of the output. Has no effect",
+             "for HTML.") do |value|
+        @op_name = value
+      end
+
+#      opt.separator nil  # 1.8.2 doesn't work
+
+      opt.on("--promiscuous", "-p",
+             "When documenting a file that contains a",
+             "module or class also defined in other",
+             "files, show all stuff for that module or",
+             "class in each files page. By default, only",
+             "show stuff defined in that particular file.") do |value|
+        @promiscuous = value
+      end
+
+#      opt.separator nil  # 1.8.2 doesn't work
+
+      opt.on("--quiet", "-q",
+             "Don't show progress as we parse.") do |value|
+        @verbosity = 0
+      end
+
+      opt.on("--verbose", "-v",
+             "Display extra progress as we parse.") do |value|
+        @verbosity = 2
+      end
+
+
+#      opt.separator nil  # 1.8.2 doesn't work
+
+      opt.on("--ri", "-r",
+             "Generate output for use by `ri`. The files",
+             "are stored in the '.rdoc' directory under",
+             "your home directory unless overridden by a",
+             "subsequent --op parameter, so no special",
+             "privileges are needed.") do |value|
+        @generator_name = "ri"
+        @op_dir = RDoc::RI::Paths::HOMEDIR
+        setup_generator
+      end
+
+#      opt.separator nil  # 1.8.2 doesn't work
+
+      opt.on("--ri-site", "-R",
+             "Generate output for use by `ri`. The files",
+             "are stored in a site-wide directory,",
+             "making them accessible to others, so",
+             "special privileges are needed.") do |value|
+        @generator_name = "ri"
+        @op_dir = RDoc::RI::Paths::SITEDIR
+        setup_generator
+      end
+
+#      opt.separator nil  # 1.8.2 doesn't work
+
+      opt.on("--ri-system", "-Y",
+             "Generate output for use by `ri`. The files",
+             "are stored in a site-wide directory,",
+             "making them accessible to others, so",
+             "special privileges are needed.  This",
+             "option is intended to be used during Ruby",
+             "installation.") do |value|
+        @generator_name = "ri"
+        @op_dir = RDoc::RI::Paths::SYSDIR
+        setup_generator
+      end
+
+#      opt.separator nil  # 1.8.2 doesn't work
+
+      opt.on("--show-hash", "-H",
+             "A name of the form #name in a comment is a",
+             "possible hyperlink to an instance method",
+             "name. When displayed, the '#' is removed",
+             "unless this option is specified.") do |value|
+        @show_hash = value
+      end
+
+#      opt.separator nil  # 1.8.2 doesn't work
+
+      opt.on("--style=URL", "-s",
+             "Specifies the URL of a separate stylesheet.") do |value|
+        if %r{^(https?:/)?/} =~ value
+          @css = value
+        else
+          @css = relative_str(File.join(@op_dir, "."), value)
+        end
+      end
+
+#      opt.separator nil  # 1.8.2 doesn't work
+
+      opt.on("--tab-width=WIDTH", "-w", OptionParser::DecimalInteger,
+             "Set the width of tab characters.") do |value|
+        @tab_width = value
       end
 
-      check_files
+#      opt.separator nil  # 1.8.2 doesn't work
 
-      # If no template was specified, use the default
-      # template for the output formatter
+      opt.on("--template=NAME", "-T",
+             "Set the template used when generating",
+             "output.") do |value|
+        @template = value
+      end
+
+#      opt.separator nil  # 1.8.2 doesn't work
+
+      opt.on("--title=TITLE", "-t",
+             "Set TITLE as the title for HTML output.") do |value|
+        @title = value
+      end
+
+#      opt.separator nil  # 1.8.2 doesn't work
+
+      opt.on("--webcvs=URL", "-W",
+             "Specify a URL for linking to a web frontend",
+             "to CVS. If the URL contains a '\%s', the",
+             "name of the current file will be",
+             "substituted; if the URL doesn't contain a",
+             "'\%s', the filename will be appended to it.") do |value|
+        @webcvs = value
+      end
 
-      @template ||= @generator_name
+#      opt.separator nil  # 1.8.2 doesn't work
 
-      # Generate a regexp from the accessors
-      unless accessors.empty?
-        re = '^(' + accessors.map{|a| Regexp.quote(a)}.join('|') + ')$' 
-        @extra_accessors = Regexp.new(re)
+      opt.on("--mathml", "-l",
+             "TeX formatted formula is converted to MathML.", 
+             "You need mathml.rb V0.8 or later to use the --mathml", 
+             "option correctly. mathml.rb V0.8 is available from", 
+             "http://www.hinet.mydns.jp/files/math_ml-0.8.0.tar.gz") do |value|
+        check_mathml
+        @mathml = true
+        @generator_name = 'xhtml'
+        @template = @generator_name
+        setup_generator
       end
 
-    rescue GetoptLong::InvalidOption, GetoptLong::MissingArgument => error
-      OptionList.error(error.message)
+#      opt.separator nil  # 1.8.2 doesn't work
 
-    ensure
-      ARGV.replace(old_argv)
+      opt.on("--ignore-case", "-C",
+             "The case of names of classes or modules", 
+             "or methods are ignored.") do |value|
+        @ignore_case = true
+      end
     end
-  end
 
+    argv.insert(0, *ENV['RDOCOPT'].split) if ENV['RDOCOPT']
+
+    opts.parse! argv
+
+    @files = argv.dup
+
+    @rdoc_include << "." if @rdoc_include.empty?
+
+    if @exclude.empty? then
+      @exclude = nil
+    else
+      @exclude = Regexp.new(@exclude.join("|"))
+    end
+
+    check_files
+
+    # If no template was specified, use the default template for the output
+    # formatter
+
+    @template ||= @generator_name
 
-  def title
-    @title ||= "RDoc Documentation"
+    # Generate a regexp from the accessors
+    unless accessors.empty? then
+      re = '^(' + accessors.map { |a| Regexp.quote a }.join('|') + ')$'
+      @extra_accessors = Regexp.new re
+    end
+
+  rescue OptionParser::InvalidArgument, OptionParser::InvalidOption => e
+    puts opts
+    puts
+    puts e
+    exit 1
   end
-  
-  # Set the title, but only if not already set. This means that a title set from 
-  # the command line trumps one set in a source file
+
+  ##
+  # Set the title, but only if not already set. This means that a title set
+  # from the command line trumps one set in a source file
 
   def title=(string)
     @title ||= string
   end
 
+  ##
+  # Don't display progress as we process the files
+
+  def quiet
+    @verbosity.zero?
+  end
+
+  def quiet=(bool)
+    @verbosity = bool ? 0 : 1
+  end
 
   private
 
+  ##
   # Set up an output generator for the format in @generator_name
-  def setup_generator(generators)
-    @generator = generators[@generator_name]
-    if !@generator
-      OptionList.error("Invalid output formatter")
+
+  def setup_generator
+    @generator = @generators[@generator_name]
+
+    unless @generator then
+      raise OptionParser::InvalidArgument, "Invalid output formatter"
     end
-    
-    if @generator_name == "xml"
+
+    if @generator_name == "xml" then
       @all_one_file = true
       @inline_source = true
     end
   end
 
-  # Check that the right version of 'dot' is available.
-  # Unfortuately this doesn't work correctly under Windows NT, 
-  # so we'll bypass the test under Windows
+  # Check that the right version of 'dot' is available.  Unfortunately this
+  # doesn't work correctly under Windows NT, so we'll bypass the test under
+  # Windows.
 
   def check_diagram
     return if RUBY_PLATFORM =~ /mswin|cygwin|mingw|bccwin/
 
     ok = false
     ver = nil
-    IO.popen("dot -V 2>&1") do |io|
+
+    IO.popen "dot -V 2>&1" do |io|
       ver = io.read
-      if ver =~ /dot.+version(?:\s+gviz)?\s+(\d+)\.(\d+)/
+      if ver =~ /dot.+version(?:\s+gviz)?\s+(\d+)\.(\d+)/ then
         ok = ($1.to_i > 1) || ($1.to_i == 1 && $2.to_i >= 8)
       end
     end
-    unless ok
-      if ver =~ /^dot.+version/
+
+    unless ok then
+      if ver =~ /^dot.+version/ then
         $stderr.puts "Warning: You may need dot V1.8.6 or later to use\n",
           "the --diagram option correctly. You have:\n\n   ",
           ver,
@@ -565,22 +665,81 @@
           "(see http://www.research.att.com/sw/tools/graphviz/)\n\n"
         exit
       end
-#      exit
     end
   end
-  
+
+  ##
+  # Check that the right version of 'mathml.rb' is available.
+
+  def check_mathml
+    not_found = true
+    fpath = ""
+    $LOAD_PATH.each{ |lpath|
+      ["mathml.rb", "math_ml.rb"].each { |ml|
+        fpath = File.join(lpath, ml)
+        if File.exist?(fpath)
+          not_found = false
+          break
+        end
+      }
+      break unless not_found
+    }
+
+    if not_found
+      $stderr.puts <<-"EOT"
+You need the 'mathml.rb' to convert TeX to MathML.
+(see http://www.hinet.mydns.jp/~hiraku/hiki/, but only JAPANESE.
+ You can download 'mathml.rb' directly from 
+ http://www.hinet.mydns.jp/files/math_ml-0.8.0.tar.gz)
+
+EOT
+      exit
+    end
+
+    contents = File.open(fpath, "r") {|f| f.read}
+    num = 1
+    if !(contents =~ /^\s*module\s+MathML/) ||
+        !(contents =~ /^\s*module\s+LaTeX/) ||
+        !(contents =~ /^\s*class\s+Parser/) ||
+        !(contents =~ /^\s*def\s+parse/)
+      $stderr.puts <<-"EOT"
+You need the 'mathml.rb' V0.8 or later to use.
+(see http://www.hinet.mydns.jp/~hiraku/hiki/, but only JAPANESE.
+ You can download 'mathml.rb' directly from 
+ http://www.hinet.mydns.jp/files/math_ml-0.8.0.tar.gz)
+
+EOT
+
+      exit
+    end
+  end
+
+  ##
+  # Return relative path
+
+  def relative_str(from, target)
+    from_dir     = File.dirname(from)
+    target_dir   = File.dirname(target)
+    target_base  = File.basename(target)
+
+    from_ab_path   = Pathname.new(File.expand_path(from_dir))
+    target_ab_path = Pathname.new(File.expand_path(target_dir))
+
+    target_re_path = target_ab_path.relative_path_from(from_ab_path)
+
+    result = target_re_path.to_s + "/" + target_base
+
+    return result
+  end
+
+  ##
   # Check that the files on the command line exist
-  
+
   def check_files
     @files.each do |f|
-      stat = File.stat f rescue error("File not found: #{f}")
-      error("File '#{f}' not readable") unless stat.readable?
+      stat = File.stat f
+      raise RDoc::Error, "file '#{f}' not readable" unless stat.readable?
     end
   end
 
-  def error(str)
-    $stderr.puts str
-    exit(1)
-  end
-
 end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/parsers/parse_c.rb ../rdoc-f95-20090109-1/parsers/parse_c.rb
--- ruby-1.8.7-p72/lib/rdoc/parsers/parse_c.rb	2008-06-06 17:05:24.000000000 +0900
+++ ../rdoc-f95-20090109-1/parsers/parse_c.rb	2008-03-08 16:29:54.000000000 +0900
@@ -3,7 +3,6 @@
 
 require "rdoc/code_objects"
 require "rdoc/parsers/parserfactory"
-require "rdoc/options"
 require "rdoc/rdoc"
 
 module RDoc
@@ -37,6 +36,7 @@
     "rb_cTime"             => "Time",
     "rb_cTrueClass"        => "TrueClass",
     "rb_cStruct"           => "Struct",
+    "rb_cVM"               => "VM",
     "rb_eException"        => "Exception",
     "rb_eStandardError"    => "StandardError",
     "rb_eSystemExit"       => "SystemExit",
@@ -117,10 +117,10 @@
   # method in the HTML output. This method must be in the same source file
   # as the rb_define_method.
   #
-  # C classes can be diagrammed (see /tc/dl/ruby/ruby/error.c), and RDoc
+  # C classes can be diagramed (see /tc/dl/ruby/ruby/error.c), and RDoc
   # integrates C and Ruby source into one tree
   #
-  # The comment blocks may include special directives:
+  # The comment blocks may include special direcives:
   #
   # [Document-class: <i>name</i>]
   #   This comment block is documentation for the given class. Use this
@@ -131,10 +131,10 @@
   #   automatically find the method from it's declaration
   #
   # [call-seq:  <i>text up to an empty line</i>]
-  #   Because C source doesn't give descriptive names to Ruby-level parameters,
+  #   Because C source doesn't give descripive names to Ruby-level parameters,
   #   you need to document the calling sequence explicitly
   #
-  # In addition, RDoc assumes by default that the C method implementing a 
+  # In additon, RDoc assumes by default that the C method implementing a 
   # Ruby function is in the same source file as the rb_define_method call.
   # If this isn't the case, add the comment 
   #
@@ -166,23 +166,24 @@
 
   class C_Parser
 
-    attr_accessor :progress
+    attr_writer :progress
 
     extend ParserFactory
     parse_files_matching(/\.(?:([CcHh])\1?|c([+xp])\2|y)\z/)
 
+    @@enclosure_classes = {}
     @@known_bodies = {}
 
     # prepare to parse a C file
     def initialize(top_level, file_name, body, options, stats)
       @known_classes = KNOWN_CLASSES.dup
-      @body = handle_tab_width(handle_ifdefs_in(body))
       @options = options
+      @body = handle_tab_width(handle_ifdefs_in(body))
       @stats   = stats
       @top_level = top_level
       @classes = Hash.new
       @file_dir = File.dirname(file_name)
-      @progress = $stderr unless options.quiet
+      @progress = $stderr unless @options.quiet
     end
 
     # Extract the classes/modules and methods from a C file
@@ -233,7 +234,7 @@
       parent_name = @known_classes[parent] || parent
 
       if in_module
-        enclosure = @classes[in_module]
+        enclosure = @classes[in_module] || @@enclosure_classes[in_module]
         unless enclosure
           if enclosure = @known_classes[in_module]
             handle_class_module(in_module, (/^rb_m/ =~ in_module ? "module" : "class"),
@@ -261,6 +262,7 @@
 
       find_class_comment(cm.full_name, cm)
       @classes[var_name] = cm
+      @@enclosure_classes[var_name] = cm
       @known_classes[var_name] = cm.full_name
     end
 
@@ -293,7 +295,7 @@
     def find_class_comment(class_name, class_meth)
       comment = nil
       if @body =~ %r{((?>/\*.*?\*/\s+))
-                     (static\s+)?void\s+Init_#{class_name}\s*(?:_\(\s*)?\(\s*(?:void\s*)?\)}xmi
+                     (static\s+)?void\s+Init_#{class_name}\s*(?:_\(\s*)?\(\s*(?:void\s*)\)}xmi
         comment = $1
       elsif @body =~ %r{Document-(class|module):\s#{class_name}\s*?\n((?>.*?\*/))}m
         comment = $2
@@ -625,8 +627,8 @@
     # Find the C code corresponding to a Ruby method
     def find_body(meth_name, meth_obj, body, quiet = false)
       case body
-      when %r{((?>/\*.*?\*/\s*))(?:static\s+)?VALUE\s+#{meth_name}
-              \s*(\(.*?\)).*?^}xm
+      when %r"((?>/\*.*?\*/\s*))(?:static\s+)?VALUE\s+#{meth_name}
+              \s*(\([^)]*\))\s*\{.*?^\}"xm
         comment, params = $1, $2
         body_text = $&
 
@@ -750,7 +752,7 @@
 
     def handle_tab_width(body)
       if /\t/ =~ body
-        tab_width = Options.instance.tab_width
+        tab_width = @options.tab_width
         body.split(/\n/).map do |line|
           1 while line.gsub!(/\t+/) { ' ' * (tab_width*$&.length - $`.length % tab_width)}  && $~ #`
           line
@@ -764,7 +766,7 @@
     # Removes #ifdefs that would otherwise confuse us
     
     def handle_ifdefs_in(body)
-      body.gsub(/^#ifdef HAVE_PROTOTYPES.*?#else.*?\n(.*?)#endif.*?\n/m) { $1 }
+      body.gsub(/^#ifdef HAVE_PROTOTYPES.*?#else.*?\n(.*?)#endif.*?\n/m, '\1')
     end
     
   end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/parsers/parse_f95.rb ../rdoc-f95-20090109-1/parsers/parse_f95.rb
--- ruby-1.8.7-p72/lib/rdoc/parsers/parse_f95.rb	2008-06-06 17:05:24.000000000 +0900
+++ ../rdoc-f95-20090109-1/parsers/parse_f95.rb	2008-03-09 01:23:05.000000000 +0900
@@ -1,57 +1,239 @@
-#= parse_f95.rb - Fortran95 Parser
+#= parse_f95.rb - Fortran 90/95 Parser
+#
+#<b>Note that Japanese and English are described in parallel.</b>
+#
+#== ³µÍ×
+#
+#parse_f95.rb ¤Ï³ÈÄ¥»Ò¤¬ f90, F90, f95, F95 ¤Î¥Õ¥¡¥¤¥ë¤ò¹½Ê¸²òÀÏ¤·¤Þ¤¹.
+#¥½¡¼¥¹¥³¡¼¥É¤Ï Fortran 90 ¤â¤·¤¯¤Ï Fortran 95
+#µ¬³Ê¤Ë±è¤Ã¤Æµ­½Ò¤µ¤ì¤Æ¤¤¤ë¤³¤È¤òÁ°Äó¤È¤·¤Æ¤¤¤Þ¤¹.
 #
 #== Overview
 #
-#"parse_f95.rb" parses Fortran95 files with suffixes "f90", "F90", "f95"
-#and "F95". Fortran95 files are expected to be conformed to Fortran95
-#standards.
+#"parse_f95.rb" parses Fortran 90/95 files with suffixes "f90", "F90", "f95"
+#and "F95". These files are expected to conform to Fortran 90 or 
+#Fortran 95 standards.
+#
+#== ½ñË¡
+#
+#´ðËÜÅª¤Ê½ñË¡¤Ï{Ruby ¤Î½ñË¡}[http://www.ruby-doc.org/stdlib/libdoc/rdoc/rdoc/index.html]
+#¤ÈÆ±ÍÍ¤Ç¤¹¤¬, ¥³¥á¥ó¥ÈÉô¤Ï '#' ¤Ç¤Ï¤Ê¤¯ '!' ¤Ç»Ï¤Þ¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤.
 #
 #== Rules
 #
 #Fundamental rules are same as that of the Ruby parser.
 #But comment markers are '!' not '#'.
 #
-#=== Correspondence between RDoc documentation and Fortran95 programs
+#=== RDoc ¥É¥­¥å¥á¥ó¥Æ¡¼¥·¥ç¥ó¤È Fortran 90/95 ¥×¥í¥°¥é¥à¤È¤ÎÂÐ±þ
 #
-#"parse_f95.rb" parses main programs, modules, subroutines, functions,
-#derived-types, public variables, public constants,
-#defined operators and defined assignments.
-#These components are described in items of RDoc documentation, as follows.
+#parse_f95.rb ¤Ï Fortran 90/95 µ¬³Ê¤Ë¤ª¤±¤ë¸À¸ìÍ×ÁÇ, ¤¹¤Ê¤ï¤Á,
+#¼ç¥×¥í¥°¥é¥à, ¥â¥¸¥å¡¼¥ë, ¥µ¥Ö¥ë¡¼¥Á¥ó, ´Ø¿ô¤ÎÂ¾,
+#PUBLIC Â°À­¤ò»ý¤ÄÊÑ¿ô¤äÄê¿ô, ¤½¤·¤ÆÍøÍÑ¼ÔÄêµÁ±é»»»Ò,
+#ÍøÍÑ¼ÔÄêµÁÂåÆþ¤ò¹½Ê¸²òÀÏ¤·¤Þ¤¹.
+#¤³¤ì¤é¤Î¸À¸ìÍ×ÁÇ¤Ï RDoc ¥É¥­¥å¥á¥ó¥Æ¡¼¥·¥ç¥ó¤Î³Æ¹àÌÜ¤Ë,
+#°Ê²¼¤Î¤è¤¦¤Ëµ­½Ò¤µ¤ì¤Þ¤¹.
+#
+#Files :: ¥Õ¥¡¥¤¥ë (Ruby ¤ÈÆ±ÍÍ¤Ç¤¹)
+#Classes :: ¥â¥¸¥å¡¼¥ë, NAMELIST ÊÑ¿ô·²Ì¾¥ê¥¹¥È
+#Methods :: ¼ç¥×¥í¥°¥é¥à, ¥µ¥Ö¥ë¡¼¥Á¥ó, ´Ø¿ô, ÊÑ¿ô, Äê¿ô, ¹½Â¤¥Ç¡¼¥¿·¿, 
+#           ÍøÍÑ¼ÔÄêµÁ±é»»»Ò, ÍøÍÑ¼ÔÄêµÁÂåÆþ, NAMELIST ÊÑ¿ô·²Ì¾
+#Required files :: »²¾È¤¹¤ë¥â¥¸¥å¡¼¥ë¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë, 
+#                  µÚ¤Ó»²¾È¤¹¤ë³°Éô´Ø¿ô¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Î¥ê¥¹¥È
+#Included Modules :: »²¾È¤¹¤ë¥â¥¸¥å¡¼¥ë¤Î¥ê¥¹¥È
+#Attributes :: ¹½Â¤¥Ç¡¼¥¿·¿¤Î¥ê¥¹¥È, »²¾È¤·³î¤Ä¤½¤ÎÁ´¤Æ¤Î¸À¸ìÍ×ÁÇ¤ò¸ø³«¤¹¤ë
+#              ¥â¥¸¥å¡¼¥ë¤Î¥ê¥¹¥È
+#
+#'Methods' ¤Ë¥ê¥¹¥È¤µ¤ì¤ë¸À¸ìÍ×ÁÇ (¥µ¥Ö¥ë¡¼¥Á¥ó, ´Ø¿ô, ¡Ä) ¤Ï,
+#¥â¥¸¥å¡¼¥ëÆâ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤Î¤Ç¤¢¤ì¤Ð, 'Classes' ¤Î¹àÌÜ¤Ëµ­½Ò¤µ¤ì¤Þ¤¹.
+#¼ç¥×¥í¥°¥é¥àÆâ¤ÇÄêµÁ¤µ¤ì¤¿¤ê, ³°Éô¼êÂ³¤­¤È¤·¤ÆÄêµÁ¤µ¤ì¤ë¾ì¹ç¤Ë¤Ï
+#'Files' ¤Î¹àÌÜ¤Ëµ­½Ò¤µ¤ì¤Þ¤¹.
+#¼ç¥×¥í¥°¥é¥à¼«ÂÎ¤â 'Files' ¤Î¹àÌÜ¤Ëµ­½Ò¤µ¤ì¤Þ¤¹.
+#
+#
+#=== Correspondence between RDoc documentation and Fortran 90/95 programs
+#
+#"parse_f95.rb" parses entities of Fortran 90/95 standards, or main programs,
+#modules, subroutines, functions, derived types, public variables,
+#public constants, defined operators and defined assignments.
+#These entities are described in items of RDoc documentation, as follows.
 #
 #Files :: Files (same as Ruby)
-#Classes :: Modules
-#Methods :: Subroutines, functions, variables, constants, derived-types, defined operators, defined assignments
-#Required files :: Files in which imported modules, external subroutines and external functions are defined.
+#Classes :: Modules, list of NAMELIST group names
+#Methods :: Main programs, subroutines, functions, variables, constants, 
+#           derived types, defined operators, defined assignments,
+#           NAMELIST group names
+#Required files :: Files in which imported modules, external subroutines 
+#                  and external functions are defined.
 #Included Modules :: List of imported modules
-#Attributes :: List of derived-types, List of imported modules all of whose components are published again
+#Attributes :: List of derived types, List of imported modules all of 
+#              whose components are published again
 #
-#Components listed in 'Methods' (subroutines, functions, ...)
+#Entities listed in 'Methods' (subroutines, functions, ...)
 #defined in modules are described in the item of 'Classes'.
-#On the other hand, components defined in main programs or
+#On the other hand,  defined in main programs or
 #as external procedures are described in the item of 'Files'.
+#Main programs are described in the item of 'Files', too.
+#
+#=== ¹½Ê¸²òÀÏ¤µ¤ì¤ë¸À¸ìÍ×ÁÇ
 #
-#=== Components parsed by default
+#¼ç¥×¥í¥°¥é¥à¤ª¤è¤Ó, ³°Éô¤«¤é»²¾È¤¬²ÄÇ½¤Ê¥µ¥Ö¥ë¡¼¥Á¥ó,
+#´Ø¿ô, ÊÑ¿ô, Äê¿ô, ¹½Â¤¥Ç¡¼¥¿·¿, ÍøÍÑ¼ÔÄêµÁ±é»»»Ò,
+#ÍøÍÑ¼ÔÄêµÁÂåÆþ, NAMELIST ÊÑ¿ô·²Ì¾¤¬¥É¥­¥å¥á¥ó¥È¤È¤·¤Æ½ÐÎÏ¤µ¤ì¤Þ¤¹. --all
+#¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤Æ rdoc ¤ò¼Â¹Ô¤¹¤ë¾ì¹ç¤Ë¤Ï, ³°Éô¤«¤é¤Î»²¾È¤¬µö²Ä¤µ¤ì¤Ê¤¤
+#¸À¸ìÍ×ÁÇ¤â´Þ¤á, Á´¤Æ¤¬½ÐÎÏ¤µ¤ì¤Þ¤¹.
 #
-#By default, documentation on public components (subroutines, functions, 
-#variables, constants, derived-types, defined operators, 
-#defined assignments) are generated. 
-#With "--all" option, documentation on all components
+#
+#=== Parsed entities
+#
+#Documentation on public entities (main programs, 
+#subroutines, functions, variables, constants, 
+#derived types, defined operators, 
+#defined assignments, NAMELIST group names) are generated. 
+#With "--all" option, documentation on all entities
 #are generated (almost same as the Ruby parser).
 #
-#=== Information parsed automatically
+#
+#=== ¹½Ê¸²òÀÏ¤µ¤ì¤ë¾ðÊó
+#
+#°Ê²¼¤Î¾ðÊó¤Ï, ¼«Æ°Åª¤Ë¹½Ê¸²òÀÏ¤µ¤ì¤Æ¥³¥á¥ó¥ÈÉô¤È¤·¤Æ½ÐÎÏ¤µ¤ì¤Þ¤¹.
+#
+#* ¥µ¥Ö¥ë¡¼¥Á¥ó, ´Ø¿ô¤Î°ú¿ô¤Î¥Ç¡¼¥¿·¿, Â°À­
+#* ¸ø³«ÊÑ¿ô, ¸ø³«Äê¿ô¤Î¥Ç¡¼¥¿·¿, Â°À­
+#* ¹½Â¤¥Ç¡¼¥¿·¿¤ÎÍ×ÁÇ¤Î¥Ç¡¼¥¿·¿, ½é´üÃÍ, Â°À­
+#* NAMELIST Ê¸¤ÇÀë¸À¤µ¤ì¤ëÊÑ¿ôÌ¾ÊÂ¤Ó¤ÎÊÑ¿ô¤Î¥Ç¡¼¥¿·¿, ½é´üÃÍ, Â°À­
+#
+#POINTER, TARGET, ALLOCATE, INTENT, OPTIONAL, SAVE Â°À­¤Ï
+#·¿Àë¸ÀÊ¸¤È¤ÏÊÌ¤Î¹Ô¤Ç»ØÄê¤¹¤ë¤³¤È¤¬²ÄÇ½¤Ç¤¹¤¬,
+#¤½¤ì¤é·¿Àë¸ÀÊ¸¤ÈÊÌ¤Ë»ØÄê¤µ¤ì¤ëÂ°À­¤Ï¹½Ê¸²òÀÏ¤µ¤ì¤Þ¤»¤ó.
+#
+#INTERFACE Ê¸¤Ë¤è¤Ã¤Æ, ¤¢¤ë¼êÂ³¤­¤Ë´Ø¤·¤Æ¸ÄÊÌÌ¾¤È¤ÏÊÌ¤ÎÌ¾Á°¤ò
+#Àë¸À¤¹¤ë¾ì¹ç, ¤½¤ÎÊÌÌ¾¤â 'Methods' ¤ËÄÉ²Ã¤·¤Þ¤¹.
+#
+#»²¾È¤·¤¿ÊÌ¤Î¥â¥¸¥å¡¼¥ëÆâ¤Î¸ø³«¸À¸ìÍ×ÁÇ (¥µ¥Ö¥ë¡¼¥Á¥ó, ´Ø¿ô, ÊÑ¿ô¤Ê¤É)
+#¤ò¼«¿È¤Î¸À¸ìÍ×ÁÇ¤È¤·¤Æ²þ¤á¤Æ¸ø³«¤¹¤ë¾ì¹ç,
+#¤½¤Î¸À¸ìÍ×ÁÇ¤Ï¼«¿È¤Î¸À¸ìÍ×ÁÇ¤È¤·¤Æ¥â¥¸¥å¡¼¥ë¤Î 'Methods' ¥ê¥¹¥È¤ËÄÉ²Ã¤µ¤ì¤Þ¤¹.
+#
+#INTERFACE Ê¸¤Ë¤è¤Ã¤Æ³°ÉôÉû¥×¥í¥°¥é¥à¤ò¼«¿È¤ÎÉû¥×¥í¥°¥é¥à¤È¤·¤Æ¸ø³«¤¹¤ë
+#¾ì¹ç, ¤½¤Î³°ÉôÉû¥×¥í¥°¥é¥à¤â¥â¥¸¥å¡¼¥ë¤Î 'Methods' ¥ê¥¹¥È¤ËÄÉ²Ã¤·¤Þ¤¹.
+#
+#
+#=== Parsed information
 #
 #The following information is automatically parsed.
 #
-#* Types of arguments
-#* Types of variables and constants
-#* Types of variables in the derived types, and initial values
-#* NAMELISTs and types of variables in them, and initial values
+#* Data types and attributes of arguments of functions and subprograms
+#* Data types and attributes of public variables and public constants
+#* Data types, initial values, and attributes of variables in the derived types
+#* Data types, initial values, and attributes of variables declared in NAMELIST statement
+#
+#Only attributes specified in type declaration statements are parsed.
+#Attributes specified in POINTER, TARGET, ALLOCATE, INTENT, OPTIONAL, SAVE
+#statements are not parsed.
 #
-#Aliases by interface statement are described in the item of 'Methods'.
+#Aliases declared by INTERFACE statements are described in the item 
+#of 'Methods'.
 #
-#Components which are imported from other modules and published again 
+#Entities which are imported from other modules and published again 
 #are described in the item of 'Methods'.
 #
+#
+#=== ¥³¥á¥ó¥ÈÉô¤Î½ñ¤­Êý
+#
+#¥³¥á¥ó¥ÈÉô¤Ï°Ê²¼¤Î¤è¤¦¤Ëµ­½Ò¤·¤Þ¤¹. ¸¶Â§Åª¤Ë¹ÔËö¤Þ¤¿¤Ï Fortran
+#¤ÎÊ¸¤Î²¼Éô¤Ë¥³¥á¥ó¥È¤òµ­½Ò¤·¤Þ¤¹. '!' ¤ò´Þ¤Þ¤Ê¤¤¹Ô¤¬¸½¤ì¤¿»þÅÀ¤Ç,
+#¥³¥á¥ó¥ÈÉô¤Ï½ªÎ»¤·¤¿¤È¸«¤Ê¤µ¤ì¤Þ¤¹.
+#Îã¤Ç¤Ï¥³¥á¥ó¥È¹Ô¤â¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¤¬, ¥¤¥ó¥Ç¥ó¥È¤¹¤ë¤³¤È¤Ï
+#É¬¿Ü¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó.
+#
+#     ! (¥Õ¥¡¥¤¥ë¤Î¹ÔÆ¬)
+#     !
+#     ! ¥Õ¥¡¥¤¥ë¤ËÂÐ¤¹¤ë¥³¥á¥ó¥È¤Ï¤³¤³¤Ëµ­½Ò¤·¤Þ¤¹
+#     !
+#     !--
+#     ! "!--" ¤È "!++" ¤Ë°Ï¤Þ¤ì¤¿ÉôÊ¬¤Ëµ­½Ò¤µ¤ì¤¿¥³¥á¥ó¥È¤Ï
+#     ! ¥É¥­¥å¥á¥ó¥È¤ËÈ¿±Ç¤µ¤ì¤Þ¤»¤ó.
+#     !++
+#     !
+#     module hogehoge
+#       !
+#       ! ¥â¥¸¥å¡¼¥ë (PROGRAM Ê¸¤Î¾ì¹ç¤Ï¼ç¥×¥í¥°¥é¥à)
+#       ! ¤ËÂÐ¤¹¤ë¥³¥á¥ó¥È¤Ï¤³¤³¤Ëµ­½Ò¤·¤Þ¤¹
+#       !
+#
+#       private
+#
+#       logical            :: a     ! Èó¸ø³«ÊÑ¿ô
+#       real, public       :: b     ! ¸ø³«ÊÑ¿ô
+#       integer, parameter :: c = 0 ! ¸ø³«Äê¿ô
+#
+#       public :: c
+#       public :: MULTI_ARRAY
+#       public :: hoge, foo
+#
+#       type MULTI_ARRAY
+#         !
+#         ! ¹½Â¤¥Ç¡¼¥¿·¿¤ËÂÐ¤¹¤ë¥³¥á¥ó¥È¤Ï¤³¤³¤Ëµ­½Ò¤·¤Þ¤¹.
+#         !
+#         real, pointer :: var(:) =>null() ! ÊÑ¿ô¤ËÂÐ¤¹¤ë¥³¥á¥ó¥È
+#         integer       :: num = 0
+#       end type MULTI_ARRAY
+#
+#     contains
+#
+#       subroutine hoge( in,   &   ! ·ÑÂ³¹ÔÃæ¤Î¥³¥á¥ó¥È¤ÏÌµ»ë¤µ¤ì¤Þ¤¹.
+#         &              out )
+#         !
+#         ! ¥µ¥Ö¥ë¡¼¥Á¥ó¤ä´Ø¿ô¤ËÂÐ¤¹¤ë¥³¥á¥ó¥È¤Ï¤³¤³¤Ëµ­½Ò¤·¤Þ¤¹
+#         !
+#         character(*),intent(in):: in ! °ú¿ô¤ËÂÐ¤¹¤ë¥³¥á¥ó¥È
+#         character(*),intent(out),allocatable,target  :: in
+#                                       ! ²¼¤Î¹Ô¤Ëµ­½Ò¤¹¤ë
+#                                       ! ¤³¤È¤â²ÄÇ½¤Ç¤¹.
+#
+#         character(32) :: file ! NAMELIST Ê¸¤ÎÊÑ¿ô¤È¤·¤Æ¹½Ê¸²òÀÏ¤µ¤ì¤Þ¤¹
+#         integer       :: id
+#
+#         namelist /varinfo_nml/ file, id
+#                 !
+#                 ! NAMELIST Ê¸¤Ë´Ø¤¹¤ë¾ðÊó¤Ï¤³¤³¤Ëµ­½Ò¤·¤Þ¤¹. ÊÑ¿ô¤Ë
+#                 ! ´Ø¤¹¤ë¾ðÊó¤Ï, ÊÑ¿ôÄêµÁÉôÊ¬¤ò»²¾È¤·¤Þ¤¹.
+#                 !
+#
+#       ....
+#
+#       end subroutine hoge
+#
+#       integer function foo( in )
+#         !
+#         ! ¤³¤ÎÉôÊ¬¤Ï¥³¥á¥ó¥È¤È¤·¤Æ¼±ÊÌ¤µ¤ì¤Þ¤¹.
+#
+#         ! '!' ¤Î´Ö³Ö¤ò¶õ¤±¤ë¤È°Ê¹ß¤Ï¥³¥á¥ó¥È¤È¤·¤Æ°·¤ï¤ì¤Þ¤»¤ó.
+#         ! ¤Ä¤Þ¤ê¤³¤Î 2 ¹Ô¤Ï¥³¥á¥ó¥È¤È¤·¤Æ°·¤ï¤ì¤Þ¤»¤ó.
+#         !
+#         integer, intent(in):: inA ! ¥³¥á¥ó¥È¤È¤·¤Æ¼±ÊÌ¤µ¤ì¤Þ¤¹
+#
+#                                   ! ¥³¥á¥ó¥È¤È¤·¤Æ¼±ÊÌ¤µ¤ì¤Þ¤»¤ó.
+#
+#       end function foo
+#
+#       subroutine hide( in,   &
+#         &              out )      !:nodoc:
+#         !
+#         ! ¾åµ­¤Î¤è¤¦¤Ë, SUBROUTINE Ê¸¤ÎËöÈø¤Ë
+#         ! '!:nodoc:' ¤Èµ­½Ò¤¹¤ë¤³¤È¤Ç, ¤½¤Î¥µ¥Ö¥ë¡¼¥Á¥ó
+#         ! ¤Ï¥É¥­¥å¥á¥ó¥È¤ËÈ¿±Ç¤µ¤ì¤Ê¤¯¤Ê¤ê¤Þ¤¹.
+#         ! ¤³¤Î»ØÄê¤Ï, ¼ç¥×¥í¥°¥é¥à, ¥â¥¸¥å¡¼¥ë, ¥µ¥Ö¥ë¡¼¥Á¥ó, 
+#         ! ´Ø¿ô, ÊÑ¿ô, Äê¿ô, ¹½Â¤¥Ç¡¼¥¿·¿, ÍøÍÑ¼ÔÄêµÁ±é»»»Ò, 
+#         ! ÍøÍÑ¼ÔÄêµÁÂåÆþ, »²¾È¤¹¤ë¥â¥¸¥å¡¼¥ë¤Î¥ê¥¹¥È (USE Ê¸) 
+#         ! ¤ËÂÐ¤·¤ÆÍ­¸ú¤Ç¤¹.
+#         !
+#
+#       ....
+#
+#       end subroutine hide
+#
+#     end module hogehoge
+#
 #=== Format of comment blocks
 #
 #Comment blocks should be written as follows.
@@ -70,7 +252,7 @@
 #     !
 #     module hogehoge
 #       !
-#       ! Comment blocks for the modules (or the programs).
+#       ! Comment blocks for the modules (or the main programs).
 #       !
 #
 #       private
@@ -85,7 +267,7 @@
 #
 #       type MULTI_ARRAY
 #         !
-#         ! Comment blocks for the derived-types.
+#         ! Comment blocks for the derived types.
 #         !
 #         real, pointer :: var(:) =>null() ! Comments block for the variables.
 #         integer       :: num = 0
@@ -108,7 +290,7 @@
 #
 #         namelist /varinfo_nml/ file, id
 #                 !
-#                 ! Comment blocks for the NAMELISTs.
+#                 ! Comment blocks for the NAMELIST statement.
 #                 ! Information about variables are described above.
 #                 !
 #
@@ -131,12 +313,12 @@
 #       subroutine hide( in,   &
 #         &              out )      !:nodoc:
 #         !
-#         ! If "!:nodoc:" is described at end-of-line in subroutine
+#         ! If '!:nodoc:' is described at end-of-line in SUBROUTINE
 #         ! statement as above, the subroutine is ignored.
-#         ! This assignment can be used to modules, subroutines,
-#         ! functions, variables, constants, derived-types,
+#         ! This assignment can be used to main programs, modules,
+#         ! subroutines, functions, variables, constants, derived types,
 #         ! defined operators, defined assignments,
-#         ! list of imported modules ("use" statement).
+#         ! list of imported modules (USE statement).
 #         !
 #
 #       ....
@@ -145,7 +327,190 @@
 #
 #     end module hogehoge
 #
-
+#
+#=== ÍøÍÑ¼ÔÄêµÁ±é»»»Ò, ÍøÍÑ¼ÔÄêµÁÂåÆþ¤Î¥¯¥í¥¹¥ê¥Õ¥¡¥ì¥ó¥¹
+#
+#ÍøÍÑ¼ÔÄêµÁ±é»»»Ò¤ÈÍøÍÑ¼ÔÄêµÁÂåÆþ (operator(*), assignment(=) Åù)
+#¤ò¥¯¥í¥¹¥ê¥Õ¥¡¥ì¥ó¥¹¤Ë¤è¤Ã¤Æ¥Ï¥¤¥Ñ¡¼¥ê¥ó¥¯²½¤¹¤ë¾ì¹ç¤Ë¤Ï,
+#'operator' ¤ä 'assignment' ¤ÎÀèÆ¬¤Ë '<b>#</b>' ¤òÉÕµ­¤·¤Æ²¼¤µ¤¤.
+#¶ñÂÎÅª¤Ë¤Ï,
+#
+#     #operator(*)
+#     #assignment(=)
+#
+#¤Î¤è¤¦¤Ëµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤. Â¾¤Î¥â¥¸¥å¡¼¥ëÆâ¤ÎÍøÍÑ¼ÔÄêµÁ±é»»»Ò¤ä
+#ÍøÍÑ¼ÔÄêµÁÂåÆþ¤Î¥¯¥í¥¹¥ê¥Õ¥¡¥ì¥ó¥¹¤Ë´Ø¤·¤Æ¤Ï, ½¾Íè¤ÈÆ±ÍÍ¤Ë
+#
+#     module#operator(*)
+#     module#assignment(=)
+#
+#¤Î¤è¤¦¤Ëµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤.
+#
+#=== Cross-reference of defined operators and defined assignments
+#
+#If you use cross-reference about defined operators and defined
+#assignments (for example, operator(*), assignment(=), etc.),
+#add '<b>#</b>' at the head of 'operator' or 'assignment'.
+#Practically, describe as follows.
+#
+#     #operator(*)
+#     #assignment(=)
+#
+#About defined operators and defined assignments about other modules,
+#describe as in the past.
+#
+#     module#operator(*)
+#     module#assignment(=)
+#
+#
+#
+#=== ¸À¸ìÍ×ÁÇ¤ÎÉ½¼¨½ç½ø
+#
+#'Files' ¤ä 'Classes' ¤Î¹àÌÜ¤ËÉ½¼¨¤µ¤ì¤ë¸À¸ìÍ×ÁÇ¤Ï, ´ðËÜÅª¤Ë
+#ASCII ¥³¡¼¥É½ç¤ËÊÂ¤Ó¤Þ¤¹ (A-Z, a-z ¤Î½çÈÖ).
+#INTERFACE Ê¸¤ÎÍøÍÑ¤Ë¤è¤Ã¤ÆÆ±°ì¤Î 'Files' ¤Þ¤¿¤Ï 'Classes' ¤Ë
+#Æ±Ì¾¤Î°Û¤Ê¤ë¼êÂ³¤­¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ï, °ú¿ô¥­¡¼¥ï¡¼¥É¤ª¤è¤Ó
+#¥³¥á¥ó¥ÈÉô¤ÎÆâÍÆ¤Ë¤è¤Ã¤Æ½ç½ø¤¬·è¤Þ¤ê¤Þ¤¹.
+#
+#¤â¤·¤âÉ½¼¨¤Î½ç½ø¤òÌÀ¼¨Åª¤Ë»ØÄê¤·¤¿¤¤¾ì¹ç¤Ï, ¸À¸ìÍ×ÁÇ¤ÎÄêµÁÊ¸¤Î
+#¹ÔËö¤Ë '<b><tt>!:doc-priority 100:</tt></b>'
+#¤Î¤è¤¦¤Ê¥³¥á¥ó¥È¤òµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤.
+#100 ¤ÎÉôÊ¬¤ÏÍ¥Àè½ç°Ì¤òÉ½¤¹¿ôÃÍ¤Ç¤¹. Í¥Àè½ç°Ì¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹.
+#(¥Ç¥Õ¥©¥ë¥È¤Ï 50 ¤ËÀßÄê¤µ¤ì¤Æ¤¤¤Þ¤¹).
+#
+#0 °Ê²¼¤ÎÀ°¿ô         :: ¸À¸ìÍ×ÁÇ¤ò¾åÉô¤ËÉ½¼¨¤·¤Þ¤¹. ÃÍ¤¬¾®¤µ¤¤¤â¤Î¤Û¤ÉÍ¥ÀèÅª¤Ë¾åÉô¤ËÉ½¼¨¤µ¤ì¤Þ¤¹.
+#1 °Ê¾å 99 °Ê²¼¤ÎÀ°¿ô :: Æ±Ì¾¤Î¸À¸ìÍ×ÁÇ¤ÎÃæ¤Ç¤ÎÍ¥Àè½ç°Ì¤Ç¤¹. ÃÍ¤¬¾®¤µ¤¤¤â¤Î¤Û¤É¾åÉô¤ËÉ½¼¨¤µ¤ì¤Þ¤¹.
+#100 °Ê¾å¤ÎÀ°¿ô       :: ¸À¸ìÍ×ÁÇ¤ò²¼Éô¤ËÉ½¼¨¤·¤Þ¤¹. ÃÍ¤¬Âç¤­¤¤¤â¤Î¤Û¤É²¼Éô¤ËÉ½¼¨¤µ¤ì¤Þ¤¹.
+#
+#°Ê²¼¤ËÎã¤ò¼¨¤·¤Þ¤¹. Îã¤Î¤è¤¦¤Ë 'doc-priority' ¤¬»ÈÍÑ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î
+#É½¼¨½ç½ø¤Ï
+#
+#* top_display, generic_name_procedures (¼ÂÂÎ: bottom_display),
+#  generic_name_procedures (¼ÂÂÎ: top_display), bottom_display
+#
+#¤È¤Ê¤ê¤Þ¤¹. °ìÊý¤Ç, ¤â¤·¤â 'doc-priority' ¤¬»ÈÍÑ¤µ¤ì¤Æ¤¤¤Ê¤¤
+#¾ì¹ç¤Ë¤ÏÉ½¼¨½ç½ø¤Ï
+#
+#* bottom_display, generic_name_procedures (¼ÂÂÎ: top_display),
+#  generic_name_procedures (¼ÂÂÎ: bottom_display), top_display
+#
+#¤È¤Ê¤ê¤Þ¤¹. ¾Ü¤·¤¤ÍýÍ³¤Ï²¼µ­¤ÎÎã¤ÎÃæ¤Ëµ­½Ò¤µ¤ì¤ë¥³¥á¥ó¥È¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤.
+#
+#   module sample1
+#              :
+#     interface generic_name_procedures
+#       !
+#       ! ¤³¤Î INTERFACE Ê¸¤Ï top_display ¤È bottom_display ¤È¤òÁí¾ÎÌ¾¾Î
+#       ! generic_name_procedures ¤È¤·¤ÆºÆÄêµÁ¤·¤Æ¤¤¤Þ¤¹.
+#       !
+#       ! RDoc ¤Ë¤ª¤Þ¤«¤»¤Ë¤¹¤ë¾ì¹ç, ¤³¤Î 2 ¤Ä¤Î
+#       ! generic_name_procedures ¤ÎÉ½¼¨½ç½ø¤Ï¤Þ¤º°ú¿ô¥­¡¼¥ï¡¼¥É
+#       ! ¤Ë¤è¤Ã¤Æ·è¤Þ¤ê¤Þ¤¹. ½¾¤Ã¤Æ, °ú¿ô¥­¡¼¥ï¡¼¥É¤¬ 'c' ¤Ç
+#       ! »Ï¤Þ¤ë top_display ¤¬¼ÂÂÎ¤Ç¤¢¤ë generic_name_procedures
+#       ! ¤¬¾å¤ËÉ½¼¨¤µ¤ì¤Þ¤¹. (¼ÂÂÎ¤Î¼êÂ³Ì¾¤Ï¹ÍÎ¸¤µ¤ì¤Þ¤»¤ó).
+#       !
+#       ! ²¼µ­¤Ç¤Ï 'doc-priority' ¤¬»ØÄê¤·¤Æ¤¢¤ë¤¿¤á, ¿ôÃÍ¤Î¾®¤µ¤¤
+#       ! bottom_display ¤¬¼ÂÂÎ¤Ç¤¢¤ë generic_name_procedures ¤ÎÊý¤¬
+#       ! ¾å¤ËÉ½¼¨¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹.
+#       !
+#       module procedure bottom_display !:doc-priority 40:
+#       module procedure top_display    !:doc-priority 60:
+#     end interface
+#              :
+#   contains
+#              :
+#     subroutine top_display(char) !:doc-priority -10:
+#       !
+#       ! ËÜÍè¤Ï²¼µ­¤Î bottom_display ¤è¤ê¤â²¼¤ËÉ½¼¨¤µ¤ì¤Þ¤¹¤¬,
+#       ! Í¥ÀèÅÙ¤ò -10 ¤ËÀßÄê¤·¤Æ¤¤¤ë¤¿¤á, ¾åÉô¤ËÉ½¼¨¤µ¤ì¤Þ¤¹.
+#       !
+#     ....
+#     end subroutine top_display
+#
+#     subroutine bottom_display(real) !:doc-priority 110:
+#       !
+#       ! ËÜÍè¤Ï¾åµ­¤Î top_display ¤è¤ê¤â¾å¤ËÉ½¼¨¤µ¤ì¤Þ¤¹¤¬,
+#       ! Í¥ÀèÅÙ¤ò 110 ¤ËÀßÄê¤·¤Æ¤¤¤ë¤¿¤á, ²¼Éô¤ËÉ½¼¨¤µ¤ì¤Þ¤¹.
+#       !
+#     ....
+#     end subroutine bottom_display
+#              :
+#   end module sample1
+#
+#
+#=== The sequence of displayed entities
+#
+#Entities listed in 'Files' and 'Classes' are displayed in
+#ASCII order usually (in particular, A...Z, a...z, ...).
+#Entities with the same names declared by INTERFACE statements
+#are ordered by argument keywords or contents in comment blocks.
+#
+#If you want to order entities manually, describe a comment
+#like '<b><tt>!:doc-priority 100:</tt></b>' at end-of-line in
+#the statement of the entities.
+#`100` represents priority. Priority level is specified as follows.
+#(Default number is '50').
+#
+#Integer of 0 or less   :: Entities are displayed at the head of the document. Entities with more small number go upstairs.
+#Integer from 1 to 99   :: Priority within entities with the same names. Entities with more small number go upstairs.
+#Integer of 100 or more :: Entities are displayed at the foot of the document. Entities with more large number go downstairs.
+#
+#An example is showed as follows. When 'doc-priority' is written as
+#a following example, a sequence of displayed entities is
+# 
+#* top_display, generic_name_procedures (an original entity: bottom_display),
+#  generic_name_procedures (an original entity: top_display), bottom_display.
+#
+#On the other hand, if 'doc-priority' is not written, the sequence become
+#
+#* bottom_display, generic_name_procedures (an original entity: top_display),
+#  generic_name_procedures (an original entity: bottom_display), top_display.
+#
+#The details are given in the following example.
+#
+#   module sample1
+#              :
+#     interface generic_name_procedures
+#       !
+#       ! This INTERFACE statement redefines "top_display" and 
+#       ! "bottom_display" as an generic name "generic_name_procedures".
+#       !
+#       ! RDoc orders two "generic_name_procedures" by argument keywords
+#       ! essentially. Therefore "generic_name_procedures" that 
+#       ! the original entity is "top_display" is displayed above because
+#       ! an argument keyword of the procedure begins 'c'.
+#       ! (The name of the original entity is ignored).
+#       !
+#       ! In the following example, because 'doc-priority' is written, 
+#       ! "generic_name_procedures" that 
+#       ! the original entity is "bottom_display" is displayed above because 
+#       ! the numerical value is smaller.
+#       !
+#       module procedure bottom_display !:doc-priority 40:
+#       module procedure top_display    !:doc-priority 60:
+#     end interface
+#              :
+#   contains
+#              :
+#     subroutine top_display(arg) !:doc-priority -10:
+#       !
+#       ! In a normal situation, this entity is displayed below 'bottom_display'. 
+#       ! But because priority is -10, this entity is displayed above.
+#       !
+#     ....
+#     end subroutine top_display
+#
+#     subroutine bottom_display(arg) !:doc-priority 110:
+#       !
+#       ! In a normal situation, this entity is displayed above 'top_display'.
+#       ! But because priority is 110, this entity is displayed below.
+#       !
+#     ....
+#     end subroutine bottom_display
+#              :
+#   end module sample1
+#
+#
 
 require "rdoc/code_objects"
 
@@ -171,8 +536,348 @@
 
   end
 
-  # See rdoc/parsers/parse_f95.rb
 
+  # Extend Context class for parse_f95.rb
+  # Original class is defined in code_objects.rb.
+  # * The case of names of classes or modules or methods are ignored
+  # * Includes modules can be refered.
+
+  class Context
+
+    def add_method(a_method)
+      if !(a_method.visibility == :public)      &&
+           !(a_method.visibility == :private)   &&
+           !(a_method.visibility == :protected)
+        a_method.visibility = @visibility
+      end
+      puts "Adding #{a_method.visibility} method #{a_method.name} to #@name" if $DEBUG_RDOC
+      add_to(@method_list, a_method)
+    end
+
+    def add_alias(an_alias, ignore_case=nil)
+      meth = find_instance_method_named(an_alias.old_name, ignore_case)
+      if meth
+        new_meth = AnyMethod.new(an_alias.text, an_alias.new_name)
+        new_meth.is_alias_for = meth
+        new_meth.singleton    = meth.singleton
+        new_meth.params       = meth.params
+        new_meth.comment = "Alias for \##{meth.name}"
+        meth.add_alias(new_meth)
+        add_method(new_meth)
+      else
+        add_to(@aliases, an_alias)
+      end
+    end
+
+    # Find a named module
+    def find_module_named(name, ignore_case=nil)
+      res = nil
+      if !ignore_case
+        return self if self.name == name
+      else
+        return self if self.name.upcase == name.upcase
+      end
+      if !ignore_case
+        res = @modules[name] || @classes[name]
+      else
+        @modules.each{ |n, v|
+          if n.upcase == name.upcase
+            res = v ; break
+          end
+        }
+        @classes.each{ |n, v|
+          if n.upcase == name.upcase
+            res = v ; break
+          end
+        } if !res
+      end
+      return res if res
+      find_enclosing_module_named(name, ignore_case)
+    end
+
+    # find a module at a higher scope
+    def find_enclosing_module_named(name, ignore_case=nil)
+      parent && parent.find_module_named(name, ignore_case)
+    end
+
+    def each_includes
+      @includes.each {|i| yield i}
+    end
+
+    # Look up the given filename.
+    def find_file(file, method=nil, ignore_case=nil)
+      find_file_named(file, method, ignore_case)
+    end
+
+    # Look up the given symbol. If method is non-nil, then
+    # we assume the symbol references a module that
+    # contains that method
+    def find_symbol(symbol, method=nil, ignore_case=nil)
+      result = nil
+      case symbol
+      when /^::(.*)/
+        result = toplevel.find_symbol($1, nil, ignore_case)
+      when /::/
+        modules = symbol.split(/::/)
+        unless modules.empty?
+          module_name = modules.shift
+          result = find_module_named(module_name, ignore_case)
+          if result
+            modules.each do |module_name|
+              result = result.find_module_named(module_name, ignore_case)
+              break unless result
+            end
+          end
+        end
+      else
+        # if a method is specified, then we're definitely looking for
+        # a module, otherwise it could be any symbol
+        if method
+          result = find_module_named(symbol, ignore_case)
+        else
+          result = find_local_symbol(symbol, ignore_case)
+          if result.nil?
+            if symbol =~ /^[A-Z]/ ||
+                       symbol =~ /^[A-Za-z]/ && ignore_case
+              result = parent
+              while result && result.name != symbol
+                result = result.parent
+              end
+            end
+          end
+        end
+      end
+      if result && method
+        if !result.respond_to?(:find_local_symbol)
+          p result.name
+          p method
+          fail
+        end
+        result = result.find_local_symbol(method, ignore_case)
+      end
+      result
+    end
+
+    def find_local_symbol(symbol, ignore_case=nil)
+      res = find_method_named(symbol, ignore_case) ||
+            find_constant_named(symbol, ignore_case) ||
+            find_attribute_named(symbol, ignore_case) ||
+            find_module_named(symbol, ignore_case) 
+    end
+
+    def include_requires?(name, ignore_case=nil)
+      if self.kind_of? TopLevel
+        self.requires.each{|r|
+          if r.name == name ||
+              r.name.upcase == name.upcase && ignore_case
+            return true
+          end
+        }
+        return false
+      else
+        parent.include_requires?(name)
+      end
+    end
+
+    def include_includes?(name, ignore_case=nil)
+      self.includes.each{|i|
+        if i.name == name ||
+            i.name.upcase == name.upcase && ignore_case
+          return true
+        end
+      }
+      return false
+    end
+
+    # Find a named method, or return nil
+    def find_method_named(name, ignore_case=nil)
+      if !ignore_case
+        @method_list.find {|meth| meth.name == name}
+      else
+        @method_list.find {|meth| meth.name.upcase == name.upcase}
+      end
+    end
+
+    # Find a named instance method, or return nil
+    def find_instance_method_named(name, ignore_case=nil)
+      if !ignore_case
+        @method_list.find {|meth| meth.name == name && !meth.singleton}
+      else
+        @method_list.find {|meth| 
+          meth.name.upcase == name.upcase && !meth.singleton
+        } 
+      end
+    end
+
+    # Find a named constant, or return nil
+    def find_constant_named(name, ignore_case=nil)
+      if !ignore_case
+        @constants.find {|m| m.name == name}
+      else
+        @constants.find {|m| m.name.upcase == name.upcase}
+      end
+    end
+
+    # Find a named attribute, or return nil
+    def find_attribute_named(name, ignore_case=nil)
+      if !ignore_case
+        @attributes.find {|m| m.name == name}
+      else
+        @attributes.find {|m| m.name.upcase == name.upcase}
+      end
+    end
+
+  end
+
+
+
+  # Extend TopLevel class for parse_f95.rb.
+  # Original class is defined in code_objects.rb.
+  # * Cross-reference of files are enabled
+  # * The case of names of classes or modules or methods are ignored
+
+  class TopLevel
+    @@all_files   = {}
+
+    def TopLevel::reset
+      @@all_classes = {}
+      @@all_modules = {}
+      @@all_files   = {}
+    end
+
+    def initialize(file_name)
+      super()
+      @name = "TopLevel"
+      @file_relative_name = file_name
+      @file_absolute_name = file_name
+      @file_stat          = File.stat(file_name)
+      @diagram            = nil
+      @@all_files[file_name] = self
+    end
+
+    def TopLevel.all_files
+      @@all_files
+    end
+
+    def find_local_symbol(symbol, ignore_case=nil)
+      find_class_or_module_named(symbol, ignore_case) || super
+    end
+
+    def find_class_or_module_named(symbol, ignore_case=nil)
+      if !ignore_case
+        @@all_classes.each_value {|c| return c if c.name == symbol}
+        @@all_modules.each_value {|m| return m if m.name == symbol}
+      else
+        @@all_classes.each_value {|c| return c if c.name.upcase == symbol.upcase}
+        @@all_modules.each_value {|m| return m if m.name.upcase == symbol.upcase}
+      end
+      nil
+    end
+
+    # Find a named module
+    def find_module_named(name, ignore_case=nil)
+      find_class_or_module_named(name, ignore_case) || find_enclosing_module_named(name, ignore_case)
+    end
+
+    # Find a named file
+    def find_file_named(name, method=nil, ignore_case=nil)
+      return nil unless name
+      result = nil
+      @@all_files.each{|file_name, toplevel|
+        result = toplevel if file_name == name
+      }
+      dir = File.dirname(@file_relative_name)
+      @@all_files.each{|file_name, toplevel|
+        if /^#{dir}\/(.*)/ =~ file_name
+          result = toplevel if $1 == name
+        end
+      }
+      if result
+        if method
+          result_method = result.find_local_symbol(method, ignore_case)
+          return result_method
+        else
+          return result
+        end
+      else
+        return nil
+      end
+    end
+
+  end
+
+
+  # Extend ClassModule class for parse_f95.rb
+  # Original class is defined in code_objects.rb.
+  # * The case of names of classes or modules or methods are ignored
+
+  class ClassModule
+    def find_file_named(name, method=nil, ignore_case=nil)
+      parent.find_file_named(name, method, ignore_case)
+    end
+  end
+
+  # Extend AnyMethod class for parse_f95.rb
+  # Original class is defined in code_objects.rb.
+  # * A method "<=>" is modified.
+
+  class AnyMethod < CodeObject
+
+    attr_reader :doc_priority
+
+    def initialize(text, name)
+      super()
+      @text = text
+      @name = name
+      @token_stream  = nil
+      @visibility    = :public
+      @dont_rename_initialize = false
+      @block_params  = nil
+      @aliases       = []
+      @is_alias_for  = nil
+      @comment = ""
+      @call_seq = nil
+      @doc_priority = 50
+    end
+
+    def set_priority(doc_priority)
+      if doc_priority.class.to_s == 'Fixnum'
+        @doc_priority = doc_priority
+      end
+    end
+
+    def <=>(other)
+      if @doc_priority < 1 && other.doc_priority < 1
+        t = @doc_priority <=> other.doc_priority
+        return t if t != 0
+      elsif @doc_priority < 1 && other.doc_priority >= 1
+        return -1
+      elsif @doc_priority >= 1 && other.doc_priority < 1
+        return 1
+      end
+
+      if @doc_priority > 99 && other.doc_priority > 99
+        t = @doc_priority <=> other.doc_priority
+        return t if t != 0
+      elsif @doc_priority > 99 && other.doc_priority <= 99
+        return 1
+      elsif @doc_priority <= 99 && other.doc_priority > 99
+        return -1
+      end
+
+      t = @name <=> other.name
+      return t if t != 0
+      t = @doc_priority <=> other.doc_priority
+      return t if t != 0
+      t = @params <=> other.params
+      return t if t != 0
+      t = @comment <=> other.comment
+    end
+  end
+
+
+  #See rdoc/parsers/parse_f95.rb
+  #
   class Fortran95parser
 
     extend ParserFactory
@@ -189,7 +894,19 @@
     INTERNAL_ALIAS_MES = "Alias for"
 
     # External alias message
-    EXTERNAL_ALIAS_MES = "The entity is"
+    EXTERNAL_ALIAS_MES = "Original external subprogram is"
+
+    # Provided modules message
+    PROVIDED_MODULES_MES = "This file provides the following module"
+
+    # Repository of NAMELIST statements
+    NAMELIST_REPOSITORY_NAME = "NAMELIST"
+
+    # Ignored marker
+    IGNORED_MARKER_REGEXP = /^:nodoc:/
+
+    # Document priority marker
+    DOC_PRIORITY_REGEXP = /^:doc\-priority\s+([\-\+]?\d+):\s*/
 
     # prepare to parse a Fortran 95 file
     def initialize(top_level, file_name, body, options, stats)
@@ -199,9 +916,16 @@
       @options = options
       @top_level = top_level
       @progress = $stderr unless options.quiet
+
+      begin
+        @options_ignore_case = options.ignore_case
+      rescue
+        @options_ignore_case = true
+      end
+
     end
 
-    # define code constructs
+    # devine code constructs
     def scan
 
       # remove private comment
@@ -279,7 +1003,7 @@
         #
         module_program_code = block_searching_lines.join("\n")
         module_program_code = remove_empty_head_lines(module_program_code)
-        if module_program_trailing =~ /^:nodoc:/
+        if module_program_trailing =~ IGNORED_MARKER_REGEXP
           # next loop to search next block
           level_depth = 0
           block_searching_flag = false
@@ -299,38 +1023,109 @@
           f9x_module = @top_level.add_module NormalClass, module_name
           f9x_module.record_location @top_level
 
-          f9x_comment = COMMENTS_ARE_UPPER ? 
-            find_comments(pre_comment.join("\n"))  + "\n" + module_trailing :
-              module_trailing + "\n" + find_comments(module_code.sub(/^.*$\n/i, ''))
+          #
+          # Add provided modules information to @top_level comment
+          #
+          provided_modules = []
+          provided_mes_line_num = nil
+          top_level_comment_lines = []
+          line_num = 0
+          @top_level.comment.split("\n").each{|line|
+            top_level_comment_lines << line
+            line_num += 1
+            next if line.empty?
+            if !provided_mes_line_num && /^\s?#{PROVIDED_MODULES_MES}/ =~ line
+              provided_mes_line_num = line_num
+              next
+            end
+            if provided_mes_line_num
+              if /^\s?\*\s+<b>(\w+)<\/b>/ =~ line
+                provided_modules << $1
+              else
+                provided_mes_line_num = nil
+              end
+            end
+          }
+          line_num = 0
+          if provided_mes_line_num
+            top_level_comment_lines.collect!{ |line|
+              line_num += 1
+              if line_num < provided_mes_line_num
+                line
+              else
+                nil
+              end
+            }
+            top_level_comment_lines.delete_if{|line| !line }
+          end
+          top_level_comment_lines << "\n" + PROVIDED_MODULES_MES + "."
+          if provided_mes_line_num
+            top_level_comment_lines[-1].sub!(/\.$/, '')
+            top_level_comment_lines[-1] << "s."
+          end
+          provided_modules.each{ |mod|
+            top_level_comment_lines << "* <b>" + mod + "</b>"
+          }
+          top_level_comment_lines << "* <b>" + module_name + "</b>"
+          @top_level.comment = top_level_comment_lines.join("\n")
+
+          #
+          # Information about the module is parsed
+          #
+          f9x_comment = COMMENTS_ARE_UPPER ? find_comments(pre_comment.join("\n")) +
+            "\n" + module_trailing : module_trailing + "\n" +
+            find_comments(module_code.sub(/^.*$\n/i, ''))
           f9x_module.comment = f9x_comment
           parse_program_or_module(f9x_module, module_code)
 
           TopLevel.all_files.each do |name, toplevel|
-            if toplevel.include_includes?(module_name, @options.ignore_case)
-              if !toplevel.include_requires?(@file_name, @options.ignore_case)
+            if toplevel.include_includes?(module_name, @options_ignore_case)
+              if !toplevel.include_requires?(@file_name, @options_ignore_case)
                 toplevel.add_require(Require.new(@file_name, ""))
               end
             end
             toplevel.each_classmodule{|m|
-              if m.include_includes?(module_name, @options.ignore_case)
-                if !m.include_requires?(@file_name, @options.ignore_case)
+              if m.include_includes?(module_name, @options_ignore_case)
+                if !m.include_requires?(@file_name, @options_ignore_case)
                   m.add_require(Require.new(@file_name, ""))
                 end
               end
             }
           end
+
+          namelist_comment = 
+            find_namelists(f9x_module, before_contains(module_code))
+          f9x_module.comment << namelist_comment if namelist_comment
+
         elsif block_searching_flag == :program
           program_name = module_program_name
+          program_name = "main_program" if program_name.empty?
           program_code = module_program_code
           program_trailing = module_program_trailing
+          program_priority, program_trailing = doc_priority_from_trailing(program_trailing)
+
+          program_comment = COMMENTS_ARE_UPPER ? find_comments(pre_comment.join("\n")) + 
+            "\n" + program_trailing : program_trailing + "\n" + 
+            find_comments(program_code.sub(/^.*$\n/i, ''))
+
           progress "p"
-          program_comment = COMMENTS_ARE_UPPER ? 
-            find_comments(pre_comment.join("\n")) + "\n" + program_trailing : 
-              program_trailing + "\n" + find_comments(program_code.sub(/^.*$\n/i, ''))
-          program_comment = "\n\n= <i>Program</i> <tt>#{program_name}</tt>\n\n" \
-                            + program_comment
-          @top_level.comment << program_comment
+          @stats.num_methods += 1
+          f9x_mainprogram = AnyMethod.new("main_program", program_name)
+          f9x_mainprogram.singleton = false
+          f9x_mainprogram.comment = "<b><em> Main Program </em></b> :: <tt></tt>\n"
+          f9x_mainprogram.comment << program_comment
+          f9x_mainprogram.params = ""
+          f9x_mainprogram.set_priority(program_priority) if program_priority
+
+          # For output source code
+          f9x_mainprogram.start_collecting_tokens
+          f9x_mainprogram.add_token Token.new(1,1).set_text(program_code)
+
+          @top_level.add_method f9x_mainprogram
           parse_program_or_module(@top_level, program_code, :private)
+
+          namelist_comment = find_namelists(f9x_mainprogram, program_code)
+          f9x_mainprogram.comment << namelist_comment if namelist_comment
         end
 
         # next loop to search next block
@@ -347,6 +1142,9 @@
 
       # External subprograms and functions are parsed
       #
+      # Ã±°ì¤Î¥Õ¥¡¥¤¥ëÆâ¤Ë¤ª¤¤¤Æ program ¤ä module ¤Ë³ÊÇ¼¤µ¤ì¤Ê¤¤,
+      # ³°Éô¥µ¥Ö¥ë¡¼¥Á¥ó, ³°Éô´Ø¿ôÉôÊ¬¤Î²òÀÏ.
+      #
       parse_program_or_module(@top_level, remaining_lines.join("\n"),
                               :public, true)
 
@@ -365,28 +1163,11 @@
       #
       # Parse variables before "contains" in module
       #
-      level_depth = 0
-      before_contains_lines = []
-      before_contains_code = nil
-      before_contains_flag = nil
-      remaining_lines.each{ |line|
-        if !before_contains_flag
-          if line =~ /^\s*?module\s+\w+\s*?(!.*?)?$/i
-            before_contains_flag = true
-          end
-        else
-          break if line =~ /^\s*?contains\s*?(!.*?)?$/i
-          level_depth += 1 if block_start?(line)
-          level_depth -= 1 if block_end?(line)
-          break if level_depth < 0
-          before_contains_lines << line
-        end
-      }
-      before_contains_code = before_contains_lines.join("\n")
-      if before_contains_code
-        before_contains_code.gsub!(/^\s*?interface\s+.*?\s+end\s+interface.*?$/im, "")
-        before_contains_code.gsub!(/^\s*?type[\s\,]+.*?\s+end\s+type.*?$/im, "")
-      end
+      # namelist ÊÑ¿ô¤ÎÄêµÁ¤Ë»È¤ï¤ì¤¿¤ê, ¤³¤ì¼«ÂÎ¤¬Äê¿ô, ÊÑ¿ô
+      # Äó¶¡¤µ¤ì¤ë¤Î¤ËÍøÍÑ¤µ¤ì¤ë. (ÊÑ¿ô¤äÄê¿ô¤È¤·¤ÆÍøÍÑ¤µ¤ì¤ë¾ì¹ç,
+      # ¤³¤ì¤â¥á¥½¥Ã¥É¤È¤·¤ÆÄó¶¡¤¹¤ë.
+      #
+      before_contains_code = before_contains(remaining_code)
 
       #
       # Parse global "use"
@@ -399,8 +1180,8 @@
         used_mod_name = $1.strip.chomp
         used_list = $2 || ""
         used_trailing = $3 || ""
-        next if used_trailing =~ /!:nodoc:/
-        if !container.include_includes?(used_mod_name, @options.ignore_case)
+        next if used_trailing.sub(/^!/, '') =~ IGNORED_MARKER_REGEXP
+        if !container.include_includes?(used_mod_name, @options_ignore_case)
           progress "."
           container.add_include Include.new(used_mod_name, "")
         end
@@ -444,7 +1225,7 @@
             @@public_methods.collect!{ |pub_meth|
               if local == pub_meth["name"] ||
                   local.upcase == pub_meth["name"].upcase &&
-                  @options.ignore_case
+                  @options_ignore_case
                 pub_meth["name"] = org
                 pub_meth["local_name"] = local
               end
@@ -463,8 +1244,8 @@
         use_check_code << $~.post_match
         used_mod_name = $1.strip.chomp
         used_trailing = $3 || ""
-        next if used_trailing =~ /!:nodoc:/
-        if !container.include_includes?(used_mod_name, @options.ignore_case)
+        next if used_trailing.sub(/^!/, '') =~ IGNORED_MARKER_REGEXP
+        if !container.include_includes?(used_mod_name, @options_ignore_case)
           progress "."
           container.add_include Include.new(used_mod_name, "")
         end
@@ -473,10 +1254,10 @@
       container.each_includes{ |inc|
         TopLevel.all_files.each do |name, toplevel|
           indicated_mod = toplevel.find_symbol(inc.name,
-                                               nil, @options.ignore_case)
+                                               nil, @options_ignore_case)
           if indicated_mod
             indicated_name = indicated_mod.parent.file_relative_name
-            if !container.include_requires?(indicated_name, @options.ignore_case)
+            if !container.include_requires?(indicated_name, @options_ignore_case)
               container.add_require(Require.new(indicated_name, ""))
             end
             break
@@ -485,7 +1266,7 @@
       }
 
       #
-      # Parse derived-types definitions
+      # Parse derived types definitions
       #
       derived_types_comment = ""
       remaining_code = remaining_lines.join("\n")
@@ -501,10 +1282,12 @@
         type_elements = $5 || ""
         type_code = remove_empty_head_lines($&)
         type_trailing = find_comments($4)
-        next if type_trailing =~ /^:nodoc:/
         type_visibility = $1
+        pre_match = $~.pre_match
+        next if type_trailing =~ IGNORED_MARKER_REGEXP
+        type_priority, type_trailing = doc_priority_from_trailing(type_trailing)
         type_comment = COMMENTS_ARE_UPPER ? 
-          find_comments($~.pre_match) + "\n" + type_trailing :
+          find_comments(pre_match) + "\n" + type_trailing :
             type_trailing + "\n" + find_comments(type_code.sub(/^.*$\n/i, ''))
         type_element_visibility_public = true
         type_code.split("\n").each{ |line|
@@ -537,6 +1320,7 @@
         type.comment = "<b><em> Derived Type </em></b> :: <tt></tt>\n"
         type.comment << args_comment if args_comment
         type.comment << type_comment if type_comment
+        type.set_priority(type_priority) if type_priority
         progress "t"
         @stats.num_methods += 1
         container.add_method type
@@ -607,6 +1391,7 @@
           const_or_var_progress = "c"
         end
         const_or_var = AnyMethod.new(const_or_var_type, defitem.varname)
+        const_or_var.set_priority(defitem.doc_priority) if defitem.doc_priority
         const_or_var.singleton = false
         const_or_var.params = ""
         self_comment = find_arguments([defitem.varname], before_contains_code)
@@ -708,7 +1493,7 @@
         #
         procedure_code = block_searching_lines.join("\n")
         procedure_code = remove_empty_head_lines(procedure_code)
-        if procedure_trailing =~ /^!:nodoc:/
+        if procedure_trailing.sub(/^!/, '') =~ IGNORED_MARKER_REGEXP
           # next loop to search next block
           level_depth = 0
           block_searching_flag = nil
@@ -734,6 +1519,7 @@
           subroutine_params   = procedure_params
           subroutine_trailing = procedure_trailing
           subroutine_code     = procedure_code
+          subroutine_priority, subroutine_trailing = doc_priority_from_trailing(subroutine_trailing)
 
           subroutine_comment = COMMENTS_ARE_UPPER ? 
             pre_comment.join("\n") + "\n" + subroutine_trailing : 
@@ -742,11 +1528,16 @@
           parse_subprogram(subroutine, subroutine_params,
                            subroutine_comment, subroutine_code,
                            before_contains_code, nil, subroutine_prefix)
+          subroutine.set_priority(subroutine_priority) if subroutine_priority
           progress "s"
           @stats.num_methods += 1
           container.add_method subroutine
           subroutine_function = subroutine
 
+          namelist_comment = 
+            find_namelists(subroutine, subroutine_code, before_contains_code)
+          subroutine.comment << namelist_comment if namelist_comment
+
         elsif block_searching_flag == :function
           function_prefix     = procedure_prefix
           function_type       = procedure_type
@@ -755,6 +1546,7 @@
           function_result_arg = procedure_result_arg
           function_trailing   = procedure_trailing
           function_code_org   = procedure_code
+          function_priority, function_trailing = doc_priority_from_trailing(function_trailing)
 
           function_comment = COMMENTS_ARE_UPPER ?
             pre_comment.join("\n") + "\n" + function_trailing :
@@ -765,16 +1557,22 @@
             function_code << "\n" + function_type + " :: " + function_result_arg
           end
 
-          function_params =
-            function_params_org.sub(/^\(/, "\(#{function_result_arg}, ")
+          if function_params_org =~ /^\s*\(\s*\)\s*$/
+            function_params =
+              function_params_org.sub(/^\(/, "\(#{function_result_arg}")
+          else
+            function_params =
+              function_params_org.sub(/^\(/, "\(#{function_result_arg}, ")
+          end
 
           function = AnyMethod.new("function", function_name)
           parse_subprogram(function, function_params,
                            function_comment, function_code,
                            before_contains_code, true, function_prefix)
+          function.set_priority(function_priority) if function_priority
 
           # Specific modification due to function
-          function.params.sub!(/\(\s*?#{function_result_arg}\s*?,\s*?/, "\( ")
+          function.params.sub!(/\(\s*?#{function_result_arg}\s*?,?\s*?/, "\( ")
           function.params << " result(" + function_result_arg + ")"
           function.start_collecting_tokens
           function.add_token Token.new(1,1).set_text(function_code_org)
@@ -784,6 +1582,10 @@
           container.add_method function
           subroutine_function = function
 
+          namelist_comment = 
+            find_namelists(function, function_code, before_contains_code)
+          function.comment << namelist_comment if namelist_comment
+
         end
 
         # The visibility of procedure is specified
@@ -841,7 +1643,7 @@
           generic_name = $1 ? $1.strip.chomp : nil
           interface_trailing = $2 || "!"
           interface_scope = true
-          interface_scope = false if interface_trailing =~ /!:nodoc:/
+          interface_scope = false if interface_trailing.sub(/^!/, '') =~ IGNORED_MARKER_REGEXP
 #          if generic_name =~ /operator\s*?\((.*?)\)/i
 #            operator_name = $1
 #            if operator_name && !operator_name.empty?
@@ -863,12 +1665,14 @@
         if interface_scope && /^\s*?module\s+procedure\s+(.*?)(!.*?)?$/i =~ line
           procedures = $1.strip.chomp
           procedures_trailing = $2 || "!"
-          next if procedures_trailing =~ /!:nodoc:/
+          next if procedures_trailing.sub(/^!/, '') =~ IGNORED_MARKER_REGEXP
+          procedures_priority, procedures_trailing = doc_priority_from_trailing(procedures_trailing)
+
           procedures.split(",").each{ |proc|
             proc.strip!
             proc.chomp!
             next if generic_name == proc || !generic_name
-            old_meth = container.find_symbol(proc, nil, @options.ignore_case)
+            old_meth = container.find_symbol(proc, nil, @options_ignore_case)
             next if !old_meth
             nolink = old_meth.visibility == :private ? true : nil
             nolink = nil if @options.show_all
@@ -879,6 +1683,7 @@
                                           old_meth.clone.token_stream[0].text, 
                                           true, nolink)
             new_meth.singleton = old_meth.singleton
+            new_meth.set_priority(procedures_priority) if procedures_priority
 
             progress "i"
             @stats.num_methods += 1
@@ -902,7 +1707,7 @@
                            subroutine\s+(\w+)\s*?(\(.*?\))?\s*?(!.*?)?$
                      /ix
             proc = $2.chomp.strip
-            generic_name = proc unless generic_name
+            proc_name = generic_name || proc
             params = $3 || ""
             procedures_trailing = $4 || "!"
 
@@ -922,43 +1727,46 @@
                          (\(.*?\))?(\s+result\((.*?)\))?\s*?(!.*?)?$
                         /ix
             proc = $8.chomp.strip
-            generic_name = proc unless generic_name
+            proc_name = generic_name || proc
             params = $9 || ""
             procedures_trailing = $12 || "!"
           else
             next
           end
-          next if procedures_trailing =~ /!:nodoc:/
+          next if procedures_trailing.sub(/^!/, '') =~ IGNORED_MARKER_REGEXP
+          procedures_priority, procedures_trailing = doc_priority_from_trailing(procedures_trailing)
           indicated_method = nil
           indicated_file   = nil
           TopLevel.all_files.each do |name, toplevel|
-            indicated_method = toplevel.find_local_symbol(proc, @options.ignore_case)
+            indicated_method = toplevel.find_local_symbol(proc, @options_ignore_case)
             indicated_file = name
             break if indicated_method
           end
 
           if indicated_method
             external_method = 
-              initialize_external_method(generic_name, proc, 
+              initialize_external_method(proc_name, proc, 
                                          indicated_method.params, 
                                          indicated_file, 
                                          indicated_method.comment)
+            external_method.set_priority(procedures_priority) if procedures_priority
 
             progress "e"
             @stats.num_methods += 1
             container.add_method external_method
-            set_visibility(container, generic_name, visibility_default, @@public_methods)
-            if !container.include_requires?(indicated_file, @options.ignore_case)
+            set_visibility(container, proc_name, visibility_default, @@public_methods)
+            if !container.include_requires?(indicated_file, @options_ignore_case)
               container.add_require(Require.new(indicated_file, ""))
             end
             check_public_methods(external_method, container.name)
 
           else
             @@external_aliases << {
-              "new_name"  => generic_name,
+              "new_name"  => proc_name,
               "old_name"  => proc,
               "file_or_module" => container,
-              "visibility" => find_visibility(container, generic_name, @@public_methods) || visibility_default
+              "visibility" => find_visibility(container, proc_name, @@public_methods) || visibility_default,
+              "doc_priority" => procedures_priority
             }
           end
         end
@@ -969,6 +1777,9 @@
       # Already imported methods are removed from @@public_methods.
       # Remainders are assumed to be imported from other modules.
       #
+      # ´û¤Ë»²¾ÈºÑ¤ß¤Î¥á¥½¥Ã¥É¤Ï @@public_methods ¤«¤é¼è¤ê½ü¤¯.
+      # »Ä¤ê¤Ï³°Éô¥â¥¸¥å¡¼¥ë¤«¤é¤Î»²¾È¤È²¾Äê¤¹¤ë.
+      #
       @@public_methods.delete_if{ |method| method["entity_is_discovered"]}
 
       @@public_methods.each{ |pub_meth|
@@ -977,11 +1788,11 @@
           TopLevel.all_classes_and_modules.each{ |modules|
             if modules.name == used_mod ||
                 modules.name.upcase == used_mod.upcase &&
-                @options.ignore_case
+                @options_ignore_case
               modules.method_list.each{ |meth|
                 if meth.name == pub_meth["name"] ||
                     meth.name.upcase == pub_meth["name"].upcase &&
-                    @options.ignore_case
+                    @options_ignore_case
                   new_meth = initialize_public_method(meth,
                                                       modules.name)
                   if pub_meth["local_name"]
@@ -1014,7 +1825,6 @@
                        nil, nil, true)
       params_opt = "( " + params_opt + " ) " if params_opt
       subprogram.params = params_opt || ""
-      namelist_comment = find_namelists(code, before_contains)
 
       block_comment = find_comments comment
       if function
@@ -1024,7 +1834,6 @@
       end
       subprogram.comment << args_comment if args_comment
       subprogram.comment << block_comment if block_comment
-      subprogram.comment << namelist_comment if namelist_comment
 
       # For output source code
       subprogram.start_collecting_tokens
@@ -1033,6 +1842,54 @@
       subprogram
     end
 
+    def doc_priority_from_trailing(trailing)
+      prefix = ''
+      if trailing =~ /^(\s*!)(.*)$/
+        prefix = $1
+        trailing = $2
+      end
+      if trailing =~ DOC_PRIORITY_REGEXP
+        priority = $1.to_i
+        trailing.sub!(DOC_PRIORITY_REGEXP, '')
+      else
+        priority = false
+      end
+      trailing = prefix + trailing
+      return priority, trailing
+    end
+
+    #
+    # Return lines before "contains" statement in modules.
+    # "interface", "type" statements are removed.
+    #
+    def before_contains(code)
+      level_depth = 0
+      before_contains_lines = []
+      before_contains_code = nil
+      before_contains_flag = nil
+      code.split("\n").each{ |line|
+        if !before_contains_flag
+          if line =~ /^\s*?module\s+\w+\s*?(!.*?)?$/i
+            before_contains_flag = true
+          end
+        else
+          break if line =~ /^\s*?contains\s*?(!.*?)?$/i
+          level_depth += 1 if block_start?(line)
+          level_depth -= 1 if block_end?(line)
+          break if level_depth < 0
+          before_contains_lines << line
+        end
+
+      }
+      before_contains_code = before_contains_lines.join("\n")
+      if before_contains_code
+        before_contains_code.gsub!(/^\s*?interface\s+.*?\s+end\s+interface.*?$/im, "")
+        before_contains_code.gsub!(/^\s*?type[\s\,]+.*?\s+end\s+type.*?$/im, "")
+      end
+
+      before_contains_code
+    end
+
     #
     # Collect comment for file entity
     #
@@ -1065,7 +1922,7 @@
     #
     # If "all" argument is true, information of all arguments are returned.
     # If "modified_params" is true, list of arguments are decorated,
-    # for example, optional arguments are parenthetic as "[arg]".
+    # for exameple, optional arguments are parenthetic as "[arg]".
     #
     def find_arguments(args, text, all=nil, indent=nil, modified_params=nil)
       return unless args || all
@@ -1084,7 +1941,7 @@
           if arg == defitem.varname.strip.chomp || all
             args_rdocforms << <<-"EOF"
 
-#{indent}<tt><b>#{defitem.varname.chomp.strip}#{defitem.arraysuffix}</b> #{defitem.inivalue}</tt> :: 
+#{indent}<b><tt>#{defitem.varname.chomp.strip}#{defitem.arraysuffix}  </tt></b>  <tt> #{defitem.inivalue}</tt> :: 
 #{indent}   <tt>#{defitem.types.chomp.strip}</tt>
 EOF
             if !defitem.comment.chomp.strip.empty?
@@ -1118,33 +1975,94 @@
       end
     end
 
-    # Return comments of definitions of namelists
     #
-    def find_namelists(text, before_contains=nil)
+    # Add namelist information to Repository (dummy module of each
+    # @top_level) of NAMELIST statements.
+    # And return comments about namelist group names
+    #
+    def find_namelists(container, text, before_contains=nil)
       return nil if !text
-      result = ""
+      top_level = find_toplevel(container)
+
+      if text =~ /^\s*?namelist\s+\/\s*?(\w+)\s*?\/([\s\w\,]+)(!.*?)?$/i
+        if top_level.include_includes?(NAMELIST_REPOSITORY_NAME)
+          namelist_module = 
+            top_level.find_module_named(NAMELIST_REPOSITORY_NAME)
+        else
+          namelist_module = 
+            top_level.add_module NormalClass, NAMELIST_REPOSITORY_NAME
+          namelist_module.record_location top_level
+          namelist_module.comment = <<-"EOF"
+This is not a module but a repository of NAMELIST group names declared
+in all Fortran 90/95 files
+EOF
+        end
+      else
+        return ""
+      end
+
+      nml_group_name_lists = []
       lines = "#{text}"
       before_contains = "" if !before_contains
-      while lines =~ /^\s*?namelist\s+\/\s*?(\w+)\s*?\/([\s\w\,]+)$/i
+      while lines =~ /^\s*?namelist\s+\/\s*?(\w+)\s*?\/([\s\w\,]+)(!.*?)?$/i
         lines = $~.post_match
+        pre_match = $~.pre_match ; post_match = $~.post_match
+        nml_group_name = $1
+        trailing_comment = $3 || ""
+        nml_vars_list  = $2.split(",")
         nml_comment = COMMENTS_ARE_UPPER ? 
-            find_comments($~.pre_match) : find_comments($~.post_match)
-        nml_name = $1
-        nml_args = $2.split(",")
-        result << "\n\n=== NAMELIST <tt><b>" + nml_name + "</tt></b>\n\n"
-        result << nml_comment + "\n" if nml_comment
+            find_comments(pre_match.sub(/\n$/, '')) :
+            find_comments(trailing_comment + post_match)
         if lines.split("\n")[0] =~ /^\//i
           lines = "namelist " + lines
         end
-        result << find_arguments(nml_args, "#{text}" + "\n" + before_contains)
+
+        nml_meth = AnyMethod.new("NAMELIST", nml_group_name)
+        nml_meth.singleton = false
+        nml_meth.params    = "( " + nml_vars_list.join(", ") + " )"
+        nml_meth.comment   = "<b><em> NAMELIST </em></b> :: <tt></tt>\n"
+        nml_meth.comment   << find_arguments(nml_vars_list, "#{text}" + "\n" + before_contains)
+        nml_meth.comment   << "\n" + nml_comment if nml_comment
+        if container.parent.parent
+          parent_object = container.parent.name
+        else
+          parent_object = container.parent.file_relative_name
+        end
+        nml_meth.comment   << "\n\nThis namelist group name is input/output in "
+        nml_meth.comment   << parent_object + "#" + container.name
+
+        progress "n"
+        @stats.num_methods += 1
+        namelist_module.add_method nml_meth
+
+        nml_group_name_lists << NAMELIST_REPOSITORY_NAME + "#" + nml_group_name
+      end
+
+      if !nml_group_name_lists.empty?
+        comments_in_procedures = "\n\nThis procedure input/output "
+        comments_in_procedures << nml_group_name_lists.join(", ") + " . "
+      else
+        comments_in_procedures = ""
+      end
+
+      comments_in_procedures
+    end
+
+    #
+    # Return toplevel class of container
+    #
+    def find_toplevel(container)
+      top_level = container
+      while top_level.parent
+        top_level = top_level.parent
       end
-      return result
+      top_level
     end
 
     #
     # Comments just after module or subprogram, or arguments are
-    # returned. If "COMMENTS_ARE_UPPER" is true, comments just before
-    # modules or subprograms are returned
+    # returnd. If "COMMENTS_ARE_UPPER" is true, comments just before
+    # modules or subprograms are returnd
     #
     def find_comments text
       return "" unless text
@@ -1290,7 +2208,7 @@
       not_found = true
       visibility_info.collect!{ |info|
         if info["name"] == subname ||
-            @options.ignore_case && info["name"].upcase == subname.upcase
+            @options_ignore_case && info["name"].upcase == subname.upcase
           if info["file_or_module"].name == container.name
             container.set_visibility_for([subname], info["visibility"])
             info["entity_is_discovered"] = true
@@ -1313,7 +2231,7 @@
       return nil if !subname || !visibility_info
       visibility_info.each{ |info|
         if info["name"] == subname ||
-            @options.ignore_case && info["name"].upcase == subname.upcase
+            @options_ignore_case && info["name"].upcase == subname.upcase
           if info["parent"] == container.name
             return info["visibility"]
           end
@@ -1325,22 +2243,26 @@
     #
     # Check external aliases
     #
+    # subname ¤È¤¤¤¦¥µ¥Ö¥ë¡¼¥Á¥óÌ¾, ¤Þ¤¿¤Ï´Ø¿ôÌ¾¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤ò
+    # Ãµºº¤·, Â¸ºß¤¹¤ë¾ì¹ç¤Ë¤Ï¤½¤Î¥Õ¥¡¥¤¥ëÆâ¤Ø¥á¥½¥Ã¥É¤òÄÉ²Ã¤¹¤ë.
+    #
     def check_external_aliases(subname, params, comment, test=nil)
       @@external_aliases.each{ |alias_item|
         if subname == alias_item["old_name"] ||
                     subname.upcase == alias_item["old_name"].upcase &&
-                            @options.ignore_case
+                            @options_ignore_case
 
           new_meth = initialize_external_method(alias_item["new_name"], 
                                                 subname, params, @file_name, 
                                                 comment)
           new_meth.visibility = alias_item["visibility"]
+          new_meth.set_priority(alias_item["doc_priority"]) if alias_item["doc_priority"]
 
           progress "e"
           @stats.num_methods += 1
           alias_item["file_or_module"].add_method(new_meth)
 
-          if !alias_item["file_or_module"].include_requires?(@file_name, @options.ignore_case)
+          if !alias_item["file_or_module"].include_requires?(@file_name, @options_ignore_case)
             alias_item["file_or_module"].add_require(Require.new(@file_name, ""))
           end
         end
@@ -1350,6 +2272,11 @@
     #
     # Check public_methods
     #
+    # use ¤·¤¿¥â¥¸¥å¡¼¥ë¤«¤é¤½¤Î¤Þ¤Þ°ú¤­·Ñ¤¤¤Ç public ¤È¤·¤Æ
+    # ¸ø³«¤¹¤ë¾ì¹ç¤Î¥Á¥§¥Ã¥¯¤ò¹Ô¤¦. 
+    # subname ¤È¤¤¤¦¥µ¥Ö¥ë¡¼¥Á¥óÌ¾, ¤Þ¤¿¤Ï´Ø¿ôÌ¾¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤ò
+    # Ãµºº¤·, Â¸ºß¤¹¤ë¾ì¹ç¤Ë¤Ï¤½¤Î¥Õ¥¡¥¤¥ëÆâ¤Ø¥á¥½¥Ã¥É¤òÄÉ²Ã¤¹¤ë.
+    #
     def check_public_methods(method, parent)
       return if !method || !parent
       @@public_methods.each{ |alias_item|
@@ -1357,7 +2284,7 @@
         alias_item["used_modules"].each{ |used_module|
           if used_module == parent ||
               used_module.upcase == parent.upcase &&
-              @options.ignore_case
+              @options_ignore_case
             parent_is_used_module = true
           end
         }
@@ -1365,7 +2292,7 @@
 
         if method.name == alias_item["name"] ||
             method.name.upcase == alias_item["name"].upcase &&
-            @options.ignore_case
+            @options_ignore_case
 
           new_meth = initialize_public_method(method, parent)
           if alias_item["local_name"]
@@ -1383,19 +2310,31 @@
     # Continuous lines are united.
     #
     # Comments in continuous lines are removed.
+    # If delete_space=false, spaces around "&" are not deleted.
+    #
+    # Example
+    #
+    # before
     #
-    def united_to_one_line(f90src)
+    #    subroutine func(a, b, c, d, e, & ! ignored comments
+    #      &             f, g, h)         ! valid comments
+    #
+    # after
+    #
+    #    subroutine func(a, b, c, d, e, f, g, h)         ! valid comments
+    #
+    def united_to_one_line(f90src, delete_space=true)
       return "" unless f90src
       lines = f90src.split("\n")
       previous_continuing = false
       now_continuing = false
       body = ""
+      squote = false ; dquote = false
       lines.each{ |line|
         words = line.split("")
         next if words.empty? && previous_continuing
         commentout = false
         brank_flag = true ; brank_char = ""
-        squote = false    ; dquote = false
         ignore = false
         words.collect! { |char|
           if previous_continuing && brank_flag
@@ -1417,7 +2356,7 @@
           end
           ignore = false
 
-          if now_continuing
+          if now_continuing && !(squote) && !(dquote)
             next ""
           elsif !(squote) && !(dquote) && !(commentout)
             case char
@@ -1431,25 +2370,32 @@
             next char
           elsif squote
             case char
-            when "\'"; squote = false ; next char
+            when "\'"; squote = false ; now_continuing = false ; next char
+            when "&" ; now_continuing = true ; next ""
             else next char
             end
           elsif dquote
             case char
-            when "\""; dquote = false ; next char
+            when "\""; dquote = false ; now_continuing = false ; next char
+            when "&" ; now_continuing = true ; next ""
             else next char
             end
           end
         }
         if !ignore && !previous_continuing || !brank_flag
           if previous_continuing
-            body << words.join("")
+            if delete_space
+              joined_words = words.join("")
+              body = body.rstrip + " " + joined_words.lstrip
+            else
+              body << words.join("")
+            end
           else
             body << "\n" + words.join("")
           end
         end
-        previous_continuing = now_continuing ? true : nil
-        now_continuing = nil
+        previous_continuing = now_continuing ? true : false
+        now_continuing = false
       }
       return body
     end
@@ -1506,6 +2452,10 @@
       return "" unless text
       lines = text.split("\n")
       lines.collect!{ |line|
+        indent_space = ""
+        if line =~ /^(\s+)/
+          indent_space = $1
+        end
         words = line.split("")
         commentout = false
         squote = false ; dquote = false
@@ -1515,7 +2465,7 @@
             when "!" ; commentout = true ; next char
             when "\""; dquote = true     ; next char
             when "\'"; squote = true     ; next char
-            when ";" ;                     "\n"
+            when ";" ;                     "\n"+indent_space
             else next char
             end
           elsif commentout
@@ -1634,7 +2584,7 @@
     end
 
     def remove_private_comments(body)
-      body.gsub!(/^\s*!--\s*?$.*?^\s*!\+\+\s*?$/m, '')
+      body.gsub!(/^(\s*)!--\s*?$.*?^\s*!\+\+\s*?$/m, '\\1!')
       return body
     end
 
@@ -1646,36 +2596,48 @@
 
       # Name of variable
       #
+      # ÊÑ¿ôÌ¾
       attr_reader   :varname
 
       # Types of variable
       #
+      # ¥Ç¡¼¥¿·¿¾ðÊó
       attr_reader   :types
 
       # Initial Value
       #
+      # ½é´üÃÍ
       attr_reader   :inivalue
 
       # Suffix of array
       #
+      # ÇÛÎóÀÜÈø»ì
       attr_reader   :arraysuffix
 
       # Comments
       #
+      # ¹Ô¤ÎËöÈø¤Ë¤«¤«¤ì¤ë¥³¥á¥ó¥È
       attr_accessor   :comment
 
       # Flag of non documentation
       #
+      # ¥É¥­¥å¥á¥ó¥È½ÐÎÏ¤·¤Ê¤¤¥Õ¥é¥°
       attr_accessor   :nodoc
 
+      # Priority of documentation
+      #
+      # ¥É¥­¥å¥á¥ó¥È¤ÎÍ¥ÀèÅÙ
+      attr_accessor   :doc_priority
+
       def initialize(varname, types, inivalue, arraysuffix, comment,
-                     nodoc=false)
+                     nodoc=false, doc_priority=50)
         @varname = varname
         @types = types
         @inivalue = inivalue
         @arraysuffix = arraysuffix
         @comment = comment
         @nodoc = nodoc
+        @doc_priority = doc_priority
       end
 
       def to_s
@@ -1822,11 +2784,18 @@
           end
         }
         defs << Fortran95Definition.new(varname, type, inivalue, arraysuffix, comment)
-        if trailing_comment =~ /^:nodoc:/
+        if trailing_comment =~ IGNORED_MARKER_REGEXP
           defs[start_pos..-1].collect!{ |defitem|
             defitem.nodoc = true
           }
         end
+        if trailing_comment =~ DOC_PRIORITY_REGEXP
+          doc_priority = $1.to_i
+          defs[start_pos..-1].collect!{ |defitem|
+            defitem.doc_priority = doc_priority
+            defitem.comment.sub!(DOC_PRIORITY_REGEXP, '')
+          }
+        end
         varname = "" ; arraysuffix = "" ; inivalue = ""
         comment = ""
         under_comment_valid = true
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/parsers/parse_rb.rb ../rdoc-f95-20090109-1/parsers/parse_rb.rb
--- ruby-1.8.7-p72/lib/rdoc/parsers/parse_rb.rb	2008-06-29 17:24:56.000000000 +0900
+++ ../rdoc-f95-20090109-1/parsers/parse_rb.rb	2008-03-09 13:07:12.000000000 +0900
@@ -7,9 +7,9 @@
 
 # This file contains stuff stolen outright from:
 #
-#   rtags.rb - 
+#   rtags.rb -
 #   ruby-lex.rb - ruby lexcal analizer
-#   ruby-token.rb - ruby tokens 
+#   ruby-token.rb - ruby tokens
 #   	by Keiju ISHITSUKA (Nippon Rational Inc.)
 #
 
@@ -19,11 +19,11 @@
 require "rdoc/code_objects"
 require "rdoc/tokenstream"
 
-require "rdoc/markup/simple_markup/preprocess"
+require "rdoc/markup/preprocess"
 
 require "rdoc/parsers/parserfactory"
 
-$TOKEN_DEBUG = $DEBUG
+#$TOKEN_DEBUG = $DEBUG_RDOC
 
 # Definitions of all tokens involved in the lexical analysis
 
@@ -35,10 +35,10 @@
   EXPR_FNAME = :EXPR_FNAME
   EXPR_DOT   = :EXPR_DOT
   EXPR_CLASS = :EXPR_CLASS
-  
+
   class Token
     NO_TEXT = "??".freeze
-    attr :text
+    attr_accessor :text
 
     def initialize(line_no, char_no)
       @line_no = line_no
@@ -53,7 +53,7 @@
       self
     end
 
-    attr_reader :line_no, :char_no, :text
+    attr_reader :line_no, :char_no
   end
 
   class TkNode < Token
@@ -115,10 +115,10 @@
     when String, Symbol
       source = token.kind_of?(String) ? TkReading2Token : TkSymbol2Token
       if (tk = source[token]).nil?
-	IRB.fail TkReading2TokenNoKey, token
+        fail TkReading2TokenNoKey, token
       end
-      tk = Token(tk[0], value) 
-    else 
+      tk = Token(tk[0], value)
+    else
       tk = if (token.ancestors & [TkId, TkVal, TkOPASGN, TkUnknownChar]).empty?
              token.new(@prev_line_no, @prev_char_no)
            else
@@ -218,14 +218,14 @@
     [:TkASSOC,      TkOp,   "=>"],
     [:TkQUESTION,   TkOp,   "?"],	 #?
     [:TkCOLON,      TkOp,   ":"],        #:
-    
+
     [:TkfLPAREN],         # func( #
     [:TkfLBRACK],         # func[ #
     [:TkfLBRACE],         # func{ #
     [:TkSTAR],            # *arg
     [:TkAMPER],           # &arg #
     [:TkSYMBOL,     TkId],          # :SYMBOL
-    [:TkSYMBEG,     TkId], 
+    [:TkSYMBEG,     TkId],
     [:TkGT,	    TkOp,   ">"],
     [:TkLT,	    TkOp,   "<"],
     [:TkPLUS,	    TkOp,   "+"],
@@ -270,16 +270,16 @@
   def RubyToken.def_token(token_n, super_token = Token, reading = nil, *opts)
     token_n = token_n.id2name unless token_n.kind_of?(String)
     if RubyToken.const_defined?(token_n)
-      IRB.fail AlreadyDefinedToken, token_n
+      fail AlreadyDefinedToken, token_n
     end
 
     token_c =  Class.new super_token
     RubyToken.const_set token_n, token_c
 #    token_c.inspect
- 
+
     if reading
       if TkReading2Token[reading]
-	IRB.fail TkReading2TokenDuplicateError, token_n, reading
+        fail TkReading2TokenDuplicateError, token_n, reading
       end
       if opts.empty?
 	TkReading2Token[reading] = [token_c]
@@ -305,8 +305,6 @@
 
 end
 
-
-
 # Lexical analyzer for Ruby source
 
 class RubyLex
@@ -340,14 +338,16 @@
   # here document.  Once complete, it needs to read the rest of the
   # original line, but then skip the here document body.
   #
-  
+
   class BufferedReader
-    
+
     attr_reader :line_num
-    
-    def initialize(content)
+
+    def initialize(content, options)
+      @options = options
+
       if /\t/ =~ content
-        tab_width = Options.instance.tab_width
+        tab_width = @options.tab_width
         content = content.split(/\n/).map do |line|
           1 while line.gsub!(/\t+/) { ' ' * (tab_width*$&.length - $`.length % tab_width)}  && $~ #`
           line
@@ -363,34 +363,34 @@
       @last_newline = 0
       @newline_pending = false
     end
-    
+
     def column
       @offset - @last_newline
     end
-    
+
     def getc
       return nil if @offset >= @size
       ch = @content[@offset, 1]
-      
+
       @offset += 1
       @hwm = @offset if @hwm < @offset
-      
+
       if @newline_pending
         @line_num += 1
         @last_newline = @offset - 1
         @newline_pending = false
       end
-      
+
       if ch == "\n"
         @newline_pending = true
       end
       ch
     end
-    
+
     def getc_already_read
       getc
     end
-    
+
     def ungetc(ch)
       raise "unget past beginning of file" if @offset <= 0
       @offset -= 1
@@ -398,13 +398,13 @@
         @newline_pending = false
       end
     end
-    
+
     def get_read
       res = @content[@read_back_offset...@offset]
       @read_back_offset = @offset
       res
     end
-    
+
     def peek(at)
       pos = @offset + at
       if pos >= @size
@@ -413,11 +413,11 @@
         @content[pos, 1]
       end
     end
-    
+
     def peek_equal(str)
       @content[@offset, str.length] == str
     end
-    
+
     def divert_read_from(reserve)
       @content[@offset, 0] = reserve
       @size      = @content.size
@@ -430,12 +430,12 @@
   def_exception(:AlreadyDefinedToken, "Already defined token(%s)")
   def_exception(:TkReading2TokenNoKey, "key nothing(key='%s')")
   def_exception(:TkSymbol2TokenNoKey, "key nothing(key='%s')")
-  def_exception(:TkReading2TokenDuplicateError, 
+  def_exception(:TkReading2TokenDuplicateError,
 		"key duplicate(token_n='%s', key='%s')")
   def_exception(:SyntaxError, "%s")
-  
+
   include RubyToken
-  include IRB
+  include IRB if !(RUBY_VERSION.to_f < 1.9)
 
   attr_reader :continue
   attr_reader :lex_state
@@ -444,10 +444,12 @@
     false
   end
 
-  def initialize(content)
+  def initialize(content, options)
     lex_init
 
-    @reader = BufferedReader.new(content)
+    @options = options
+
+    @reader = BufferedReader.new content, @options
 
     @exp_line_no = @line_no = 1
     @base_char_no = 0
@@ -457,7 +459,7 @@
     @quoted = nil
     @lex_state = EXPR_BEG
     @space_seen = false
-    
+
     @continue = false
     @line = ""
 
@@ -466,11 +468,10 @@
     @exception_on_syntax_error = true
   end
 
-  attr :skip_space, true
-  attr :read_auto_clean_up, true
-  attr :exception_on_syntax_error, true
-
-  attr :indent
+  attr_accessor :skip_space
+  attr_accessor :read_auto_clean_up
+  attr_accessor :exception_on_syntax_error
+  attr_reader :indent
 
   # io functions
   def line_no
@@ -545,10 +546,9 @@
       get_read
     end
 #   throw :eof unless tk
-    p tk if $DEBUG
     tk
   end
-  
+
   ENINDENT_CLAUSE = [
     "case", "class", "def", "do", "for", "if",
     "module", "unless", "until", "while", "begin" #, "when"
@@ -563,7 +563,7 @@
     "r" => "/",
     "w" => "]"
   }
-  
+
   PERCENT_PAREN = {
     "{" => "}",
     "[" => "]",
@@ -587,7 +587,11 @@
   }
 
   def lex_init()
-    @OP = SLex.new
+    if RUBY_VERSION.to_f < 1.9
+      @OP = SLex.new
+    else
+      @OP = IRB::SLex.new
+    end
     @OP.def_rules("\0", "\004", "\032") do |chars, io|
       Token(TkEND_OF_SCRIPT).set_text(chars)
     end
@@ -646,10 +650,10 @@
       Token(TkNL).set_text("\n")
     end
 
-    @OP.def_rules("*", "**",	
+    @OP.def_rules("*", "**",
 		  "!", "!=", "!~",
-		  "=", "==", "===", 
-		  "=~", "<=>",	
+		  "=", "==", "===",
+		  "=~", "<=>",
 		  "<", "<=",
 		  ">", ">=", ">>") do
       |op, io|
@@ -716,8 +720,8 @@
       @lex_state = EXPR_BEG
       Token(op).set_text(op)
     end
-    
-    @OP.def_rules("+=", "-=", "*=", "**=", 
+
+    @OP.def_rules("+=", "-=", "*=", "**=",
 		  "&=", "|=", "^=", "<<=", ">>=", "||=", "&&=") do
       |op, io|
       @lex_state = EXPR_BEG
@@ -771,7 +775,7 @@
 
     lex_int2
   end
-  
+
   def lex_int2
     @OP.def_rules("]", "}", ")") do
       |op, io|
@@ -813,7 +817,7 @@
 	Token(TkOPASGN, :/).set_text("/=") #")
       elsif @lex_state == EXPR_ARG and @space_seen and peek(0) !~ /\s/
 	identify_string(op)
-      else 
+      else
 	@lex_state = EXPR_BEG
         Token("/").set_text(op)
       end
@@ -828,7 +832,7 @@
     # 	@lex_state = EXPR_BEG
     # 	Token(TkOPASGN, :^)
     #       end
-    
+
     @OP.def_rules(",", ";") do
       |op, io|
       @lex_state = EXPR_BEG
@@ -844,7 +848,7 @@
       @lex_state = EXPR_BEG
       Token("~").set_text("~@")
     end
-    
+
     @OP.def_rule("(") do
       @indent += 1
       if @lex_state == EXPR_BEG || @lex_state == EXPR_MID
@@ -894,15 +898,15 @@
     end
 
     @OP.def_rule('\\') do   #'
-      if getc == "\n" 
+      if getc == "\n"
 	@space_seen = true
 	@continue = true
 	Token(TkSPACE).set_text("\\\n")
-      else 
+      else
 	ungetc
 	Token("\\").set_text("\\")  #"
-      end 
-    end 
+      end
+    end
 
     @OP.def_rule('%') do
       |op, io|
@@ -932,7 +936,7 @@
       end
     end
 
-    #       @OP.def_rule("def", proc{|op, io| /\s/ =~ io.peek(0)}) do 
+    #       @OP.def_rule("def", proc{|op, io| /\s/ =~ io.peek(0)}) do
     # 	|op, io|
     # 	@indent += 1
     # 	@lex_state = EXPR_FNAME
@@ -957,10 +961,10 @@
       printf "MATCH: end %s: %s\n", op, io.inspect if RubyLex.debug?
       t
     end
-    
+
     p @OP if RubyLex.debug?
   end
-  
+
   def identify_gvar
     @lex_state = EXPR_END
     str = "$"
@@ -969,15 +973,15 @@
          when /[~_*$?!@\/\\;,=:<>".]/   #"
            str << ch
            Token(TkGVAR, str)
-           
+
          when "-"
            str << "-" << getc
            Token(TkGVAR, str)
-           
+
          when "&", "`", "'", "+"
            str << ch
            Token(TkBACK_REF, str)
-           
+
          when /[1-9]/
            str << ch
            while (ch = getc) =~ /[0-9]/
@@ -989,13 +993,13 @@
            ungetc
            ungetc
            return identify_identifier
-         else 
+         else
            ungetc
-           Token("$")     
+           Token("$")
          end
     tk.set_text(str)
   end
-  
+
   def identify_identifier
     token = ""
     token.concat getc if peek(0) =~ /[$@]/
@@ -1006,7 +1010,7 @@
       token.concat ch
     end
     ungetc
-    
+
     if ch == "!" or ch == "?"
       token.concat getc
     end
@@ -1021,7 +1025,7 @@
       @lex_state = EXPR_END
       return Token(TkIVAR, token).set_text(token)
     end
-    
+
     if @lex_state != EXPR_DOT
       print token, "\n" if RubyLex.debug?
 
@@ -1119,7 +1123,7 @@
     @lex_state = EXPR_END
     Token(Ltype2Token[lt], str).set_text(str.dump)
   end
-  
+
   def identify_quotation(initial_char)
     ch = getc
     if lt = PERCENT_LTYPE[ch]
@@ -1128,7 +1132,7 @@
     elsif ch =~ /\W/
       lt = "\""
     else
-      RubyLex.fail SyntaxError, "unknown type of %string ('#{ch}')"
+      fail SyntaxError, "unknown type of %string ('#{ch}')"
     end
 #     if ch !~ /\W/
 #       ungetc
@@ -1200,7 +1204,7 @@
     end
     Token(type).set_text(str)
   end
-  
+
   def identify_string(ltype, quoted = ltype, opener=nil, initial_char = nil)
     @ltype = ltype
     @quoted = quoted
@@ -1212,9 +1216,9 @@
 
     nest = 0
     begin
-      while ch = getc 
+      while ch = getc
 	str << ch
-	if @quoted == ch 
+	if @quoted == ch
           if nest == 0
             break
           else
@@ -1275,7 +1279,7 @@
         if ch == "\n"
           ch = " "
         else
-          comment << "\\" 
+          comment << "\\"
         end
       else
         if ch == "\n"
@@ -1288,7 +1292,7 @@
     end
     return Token(TkCOMMENT).set_text(comment)
   end
-  
+
   def read_escape
     res = ""
     case ch = getc
@@ -1305,7 +1309,7 @@
 	end
         res << ch
       end
-      
+
     when "x"
       res << ch
       2.times do
@@ -1354,500 +1358,482 @@
   end
 end
 
-
-
-# Extract code elements from a source file, returning a TopLevel
-# object containing the constituent file elements.
+##
+# Extract code elements from a source file, returning a TopLevel object
+# containing the constituent file elements.
 #
 # This file is based on rtags
 
-module RDoc
-
-  GENERAL_MODIFIERS = [ 'nodoc' ].freeze
-
-  CLASS_MODIFIERS = GENERAL_MODIFIERS
-
-  ATTR_MODIFIERS  = GENERAL_MODIFIERS
+class RDoc::RubyParser
 
-  CONSTANT_MODIFIERS = GENERAL_MODIFIERS
-
-  METHOD_MODIFIERS = GENERAL_MODIFIERS + 
-    [ 'arg', 'args', 'yield', 'yields', 'notnew', 'not-new', 'not_new', 'doc' ]
-
-
-  class RubyParser
-    include RubyToken
-    include TokenStream
+  include RubyToken
+  include RDoc::TokenStream
 
-    extend ParserFactory
+  extend RDoc::ParserFactory
 
-    parse_files_matching(/\.rbw?$/)
+  parse_files_matching(/\.rbw?$/)
 
+  def initialize(top_level, file_name, content, options, stats)
+    @options = options
+    @stats   = stats
+    @size = 0
+    @token_listeners = nil
+    @input_file_name = file_name
+    @scanner = RubyLex.new content, @options
+    @scanner.exception_on_syntax_error = false
+    @top_level = top_level
+    @progress = $stderr unless options.quiet
+  end
+
+  def scan
+    @tokens = []
+    @unget_read = []
+    @read = []
+    catch(:eof) do
+      catch(:enddoc) do
+        begin
+          parse_toplevel_statements(@top_level)
+        rescue Exception => e
+          $stderr.puts "\n\n"
+          $stderr.puts "RDoc failure in #@input_file_name at or around " +
+                       "line #{@scanner.line_no} column #{@scanner.char_no}"
+          $stderr.puts
+          $stderr.puts "Before reporting this, could you check that the file"
+          $stderr.puts "you're documenting compiles cleanly--RDoc is not a"
+          $stderr.puts "full Ruby parser, and gets confused easily if fed"
+          $stderr.puts "invalid programs."
+          $stderr.puts
+          $stderr.puts "The internal error was:\n\n"
 
-    def initialize(top_level, file_name, content, options, stats)
-      @options = options
-      @stats   = stats
-      @size = 0
-      @token_listeners = nil
-      @input_file_name = file_name
-      @scanner = RubyLex.new(content)
-      @scanner.exception_on_syntax_error = false
-      @top_level = top_level
-      @progress = $stderr unless options.quiet
-    end
-
-    def scan
-      @tokens = []
-      @unget_read = []
-      @read = []
-      catch(:eof) do
-        catch(:enddoc) do
-          begin
-            parse_toplevel_statements(@top_level)
-          rescue Exception => e
-            $stderr.puts "\n\n"
-            $stderr.puts "RDoc failure in #@input_file_name at or around " +
-                         "line #{@scanner.line_no} column #{@scanner.char_no}"
-            $stderr.puts 
-            $stderr.puts "Before reporting this, could you check that the file"
-            $stderr.puts "you're documenting compiles cleanly--RDoc is not a"
-            $stderr.puts "full Ruby parser, and gets confused easily if fed"
-            $stderr.puts "invalid programs."
-            $stderr.puts
-            $stderr.puts "The internal error was:\n\n"
-            
-            e.set_backtrace(e.backtrace[0,4])
-            raise
-          end
+          e.set_backtrace(e.backtrace[0,4])
+          raise
         end
       end
-      @top_level
     end
+    @top_level
+  end
 
-    private 
+  private
 
-    def make_message(msg)
-      prefix = "\n" + @input_file_name + ":"
-      if @scanner
-        prefix << "#{@scanner.line_no}:#{@scanner.char_no}: "
-      end
-      return prefix + msg
+  def make_message(msg)
+    prefix = "\n" + @input_file_name + ":"
+    if @scanner
+      prefix << "#{@scanner.line_no}:#{@scanner.char_no}: "
     end
+    return prefix + msg
+  end
 
-    def warn(msg)
-      return if @options.quiet
-      msg = make_message msg
-      $stderr.puts msg
-    end
+  def warn(msg)
+    return if @options.quiet
+    msg = make_message msg
+    $stderr.puts msg
+  end
 
-    def error(msg)
-      msg = make_message msg
-      $stderr.puts msg
-      exit(1)
-    end
+  def error(msg)
+    msg = make_message msg
+    $stderr.puts msg
+    exit(1)
+  end
 
-    def progress(char)
-      unless @options.quiet
-        @progress.print(char)
-	@progress.flush
-      end
+  def progress(char)
+    unless @options.quiet
+      @progress.print(char)
+      @progress.flush
     end
+  end
 
-    def add_token_listener(obj)
-      @token_listeners ||= []
-      @token_listeners << obj
-    end
+  def add_token_listener(obj)
+    @token_listeners ||= []
+    @token_listeners << obj
+  end
 
-    def remove_token_listener(obj)
-      @token_listeners.delete(obj)
-    end
+  def remove_token_listener(obj)
+    @token_listeners.delete(obj)
+  end
 
-    def get_tk
-      tk = nil
-      if @tokens.empty?
-	tk = @scanner.token
-	@read.push @scanner.get_read
-	puts "get_tk1 => #{tk.inspect}" if $TOKEN_DEBUG
-      else
-	@read.push @unget_read.shift
-	tk = @tokens.shift
-	puts "get_tk2 => #{tk.inspect}" if $TOKEN_DEBUG
-      end
+  def get_tk
+    tk = nil
+    if @tokens.empty?
+      tk = @scanner.token
+      @read.push @scanner.get_read
+      puts "get_tk1 => #{tk.inspect}" if $TOKEN_DEBUG
+    else
+      @read.push @unget_read.shift
+      tk = @tokens.shift
+      puts "get_tk2 => #{tk.inspect}" if $TOKEN_DEBUG
+    end
 
-      if tk.kind_of?(TkSYMBEG)
-        set_token_position(tk.line_no, tk.char_no)
-        tk1 = get_tk
-        if tk1.kind_of?(TkId) || tk1.kind_of?(TkOp)
+    if tk.kind_of?(TkSYMBEG)
+      set_token_position(tk.line_no, tk.char_no)
+      tk1 = get_tk
+      if tk1.kind_of?(TkId) || tk1.kind_of?(TkOp) || tk1.kind_of?(TkSTRING)
+        if tk1.respond_to?(:name)
           tk = Token(TkSYMBOL).set_text(":" + tk1.name)
-          # remove the identifier we just read (we're about to
-          # replace it with a symbol)
-          @token_listeners.each do |obj|
-            obj.pop_token
-          end if @token_listeners
         else
-          warn("':' not followed by identifier or operator")
-          tk = tk1
+          tk = Token(TkSYMBOL).set_text(":" + tk1.text)
         end
+        # remove the identifier we just read (we're about to
+        # replace it with a symbol)
+        @token_listeners.each do |obj|
+          obj.pop_token
+        end if @token_listeners
+      else
+        warn("':' not followed by identifier or operator")
+        tk = tk1
       end
+    end
 
-      # inform any listeners of our shiny new token
-      @token_listeners.each do |obj|
-        obj.add_token(tk)
-      end if @token_listeners
+    # inform any listeners of our shiny new token
+    @token_listeners.each do |obj|
+      obj.add_token(tk)
+    end if @token_listeners
 
-      tk
-    end
+    tk
+  end
 
-    def peek_tk
-      unget_tk(tk = get_tk)
-      tk
-    end
+  def peek_tk
+    unget_tk(tk = get_tk)
+    tk
+  end
 
-    def unget_tk(tk)
-      @tokens.unshift tk
-      @unget_read.unshift @read.pop
-
-      # Remove this token from any listeners
-      @token_listeners.each do |obj|
-        obj.pop_token
-      end if @token_listeners
-    end
+  def unget_tk(tk)
+    @tokens.unshift tk
+    @unget_read.unshift @read.pop
 
-    def skip_tkspace(skip_nl = true)
-      tokens = []
-      while ((tk = get_tk).kind_of?(TkSPACE) ||
-	     (skip_nl && tk.kind_of?(TkNL)))
-	tokens.push tk
-      end
-      unget_tk(tk)
-      tokens
-    end
+    # Remove this token from any listeners
+    @token_listeners.each do |obj|
+      obj.pop_token
+    end if @token_listeners
+  end
 
-    def get_tkread
-      read = @read.join("")
-      @read = []
-      read
+  def skip_tkspace(skip_nl = true)
+    tokens = []
+    while ((tk = get_tk).kind_of?(TkSPACE) ||
+     (skip_nl && tk.kind_of?(TkNL)))
+      tokens.push tk
     end
+    unget_tk(tk)
+    tokens
+  end
 
-    def peek_read
-      @read.join('')
-    end
+  def get_tkread
+    read = @read.join("")
+    @read = []
+    read
+  end
 
-    NORMAL = "::"
-    SINGLE = "<<"
+  def peek_read
+    @read.join('')
+  end
 
-    # Look for the first comment in a file that isn't
-    # a shebang line.
+  NORMAL = "::"
+  SINGLE = "<<"
 
-    def collect_first_comment
-      skip_tkspace
-      res = ''
-      first_line = true
+  ##
+  # Look for the first comment in a file that isn't a shebang line.
 
-      tk = get_tk
-      while tk.kind_of?(TkCOMMENT)
-        if first_line && /\A#!/ =~ tk.text
-          skip_tkspace
-          tk = get_tk
-        elsif first_line && /\A#\s*-\*-/ =~ tk.text
-          first_line = false
-          skip_tkspace
-          tk = get_tk
-        else
-          first_line = false
-          res << tk.text << "\n"
+  def collect_first_comment
+    skip_tkspace
+    res = ''
+    first_line = true
+
+    tk = get_tk
+    while tk.kind_of?(TkCOMMENT)
+      if first_line && tk.text[0,2] == "#!"
+        skip_tkspace
+        tk = get_tk
+      else
+        res << tk.text << "\n"
+        tk = get_tk
+        if tk.kind_of? TkNL
+          skip_tkspace(false)
           tk = get_tk
-          if tk.kind_of? TkNL
-            skip_tkspace(false)
-            tk = get_tk
-          end
         end
       end
-      unget_tk(tk)
-      res
+      first_line = false
     end
+    unget_tk(tk)
+    res
+  end
+
+  def parse_toplevel_statements(container)
+    comment = collect_first_comment
+    look_for_directives_in(container, comment)
+    container.comment = comment unless comment.empty?
+    parse_statements(container, NORMAL, nil, comment)
+  end
+
+  def parse_statements(container, single=NORMAL, current_method=nil, comment='')
+    nest = 1
+    save_visibility = container.visibility
 
-    def parse_toplevel_statements(container)
-      comment = collect_first_comment
-      look_for_directives_in(container, comment)
-      container.comment = comment unless comment.empty?
-      parse_statements(container, NORMAL, nil, comment)
-    end
-    
-    def parse_statements(container, single=NORMAL, current_method=nil, comment='')
-      nest = 1
-      save_visibility = container.visibility
-      
 #      if container.kind_of?(TopLevel)
 #      else
 #        comment = ''
 #      end
 
-      non_comment_seen = true
-      
-      while tk = get_tk
-        
-        keep_comment = false
-        
-        non_comment_seen = true unless tk.kind_of?(TkCOMMENT)
-        
-	case tk
+    non_comment_seen = true
 
-        when TkNL
-          skip_tkspace(true)   # Skip blanks and newlines
-          tk = get_tk
-          if tk.kind_of?(TkCOMMENT)
-            if non_comment_seen
-              comment = ''
-              non_comment_seen = false
-            end
-            while tk.kind_of?(TkCOMMENT)
-              comment << tk.text << "\n"
-              tk = get_tk          # this is the newline 
-              skip_tkspace(false)  # leading spaces
-              tk = get_tk
-            end
-            unless comment.empty?
-              look_for_directives_in(container, comment) 
-              if container.done_documenting
-                container.ongoing_visibility = save_visibility
-#                return
-              end
+    while tk = get_tk
+      keep_comment = false
+
+      non_comment_seen = true unless tk.kind_of?(TkCOMMENT)
+
+      case tk
+      when TkNL
+        skip_tkspace(true)   # Skip blanks and newlines
+        tk = get_tk
+        if tk.kind_of?(TkCOMMENT)
+          if non_comment_seen
+            comment = ''
+            non_comment_seen = false
+          end
+          while tk.kind_of?(TkCOMMENT)
+            comment << tk.text << "\n"
+            tk = get_tk          # this is the newline
+            skip_tkspace(false)  # leading spaces
+            tk = get_tk
+          end
+          unless comment.empty?
+            look_for_directives_in(container, comment)
+            if container.done_documenting
+              container.ongoing_visibility = save_visibility
+              #                return
             end
-            keep_comment = true
-          else
-            non_comment_seen = true
           end
-          unget_tk(tk)
           keep_comment = true
+        else
+          non_comment_seen = true
+        end
+        unget_tk(tk)
+        keep_comment = true
 
+      when TkCLASS
+        if container.document_children
+          parse_class(container, single, tk, comment)
+        else
+          nest += 1
+        end
 
-	when TkCLASS
-	  if container.document_children
-            parse_class(container, single, tk, comment)
-	  else
-	    nest += 1
-          end
-
-	when TkMODULE
-	  if container.document_children
-            parse_module(container, single, tk, comment)
-	  else
-	    nest += 1
-          end
+      when TkMODULE
+        if container.document_children
+          parse_module(container, single, tk, comment)
+        else
+          nest += 1
+        end
 
-	when TkDEF
-	  if container.document_self
-	    parse_method(container, single, tk, comment)
-	  else
-	    nest += 1
-          end
+      when TkDEF
+        if container.document_self
+          parse_method(container, single, tk, comment)
+        else
+          nest += 1
+        end
 
-        when TkCONSTANT
-          if container.document_self
-            parse_constant(container, single, tk, comment)
-          end
+      when TkCONSTANT
+        if container.document_self
+          parse_constant(container, single, tk, comment)
+        end
 
-	when TkALIAS
- 	  if container.document_self
-	    parse_alias(container, single, tk, comment)
-	  end
+      when TkALIAS
+        if container.document_self
+          parse_alias(container, single, tk, comment)
+        end
 
-        when TkYIELD
-          if current_method.nil?
-            warn("Warning: yield outside of method") if container.document_self
-          else
-            parse_yield(container, single, tk, current_method)
-          end
+      when TkYIELD
+        if current_method.nil?
+          warn("Warning: yield outside of method") if container.document_self
+        else
+          parse_yield(container, single, tk, current_method)
+        end
 
-          # Until and While can have a 'do', which shouldn't increas
-          # the nesting. We can't solve the general case, but we can
-          # handle most occurrences by ignoring a do at the end of a line
+        # Until and While can have a 'do', which shouldn't increas
+        # the nesting. We can't solve the general case, but we can
+        # handle most occurrences by ignoring a do at the end of a line
 
-        when  TkUNTIL, TkWHILE
-          nest += 1
-          puts "FOUND #{tk.class} in #{container.name}, nest = #{nest}, " +
-            "line #{tk.line_no}" if $DEBUG
-          skip_optional_do_after_expression
+      when  TkUNTIL, TkWHILE
+        nest += 1
+        puts "Found #{tk.class} in #{container.name}, nest = #{nest}, " +
+             "line #{tk.line_no}" if $DEBUG_RDOC
+        skip_optional_do_after_expression
 
           # 'for' is trickier
-        when TkFOR
-          nest += 1
-          puts "FOUND #{tk.class} in #{container.name}, nest = #{nest}, " +
-            "line #{tk.line_no}" if $DEBUG
-          skip_for_variable
-          skip_optional_do_after_expression
-
-	when TkCASE, TkDO, TkIF, TkUNLESS, TkBEGIN
-	  nest += 1
-          puts "Found #{tk.class} in #{container.name}, nest = #{nest}, " +
-            "line #{tk.line_no}" if $DEBUG
-
-	when TkIDENTIFIER
-          if nest == 1 and current_method.nil?
-            case tk.name
-            when "private", "protected", "public",
-                 "private_class_method", "public_class_method"
-              parse_visibility(container, single, tk)
-              keep_comment = true
-            when "attr"
-              parse_attr(container, single, tk, comment)
-            when /^attr_(reader|writer|accessor)$/, @options.extra_accessors
-              parse_attr_accessor(container, single, tk, comment)
-            when "alias_method"
-              if container.document_self
-	        parse_alias(container, single, tk, comment)
-	      end
-            end
-	  end
-	  
-	  case tk.name
-	  when "require"
-	    parse_require(container, comment)
-	  when "include"
-	    parse_include(container, comment)
-	  end
+      when TkFOR
+        nest += 1
+        puts "Found #{tk.class} in #{container.name}, nest = #{nest}, " +
+             "line #{tk.line_no}" if $DEBUG_RDOC
+        skip_for_variable
+        skip_optional_do_after_expression
 
+      when TkCASE, TkDO, TkIF, TkUNLESS, TkBEGIN
+        nest += 1
+        puts "Found #{tk.class} in #{container.name}, nest = #{nest}, " +
+             "line #{tk.line_no}" if $DEBUG_RDOC
 
-	when TkEND
-          nest -= 1
-          puts "Found 'end' in #{container.name}, nest = #{nest}, line #{tk.line_no}" if $DEBUG
-          puts "Method = #{current_method.name}" if $DEBUG and current_method
-	  if nest == 0
-            read_documentation_modifiers(container, CLASS_MODIFIERS)
-            container.ongoing_visibility = save_visibility
-            return
+      when TkIDENTIFIER
+        if nest == 1 and current_method.nil?
+          case tk.name
+          when "private", "protected", "public",
+               "private_class_method", "public_class_method"
+               parse_visibility(container, single, tk)
+            keep_comment = true
+          when "attr"
+            parse_attr(container, single, tk, comment)
+          when /^attr_(reader|writer|accessor)$/, @options.extra_accessors
+            parse_attr_accessor(container, single, tk, comment)
+          when "alias_method"
+            if container.document_self
+              parse_alias(container, single, tk, comment)
+            end
           end
+        end
 
-	end
+        case tk.name
+        when "require"
+          parse_require(container, comment)
+        when "include"
+          parse_include(container, comment)
+        end
 
-        comment = '' unless keep_comment
-	begin
-	  get_tkread
-	  skip_tkspace(false)
-	end while peek_tk == TkNL
+
+      when TkEND
+        nest -= 1
+        puts "Found 'end' in #{container.name}, nest = #{nest}, line #{tk.line_no}" if $DEBUG_RDOC
+        puts "Method = #{current_method.name}" if $DEBUG_RDOC and current_method
+        if nest == 0
+          read_documentation_modifiers container, RDoc::CLASS_MODIFIERS
+          container.ongoing_visibility = save_visibility
+          return
+        end
 
       end
+
+      comment = '' unless keep_comment
+
+      begin
+        get_tkread
+        skip_tkspace(false)
+      end while peek_tk == TkNL
     end
-    
-    def parse_class(container, single, tk, comment, &block)
-      progress("c")
+  end
 
-      @stats.num_classes += 1
+  def parse_class(container, single, tk, comment, &block)
+    progress("c")
 
-      container, name_t = get_class_or_module(container)
+    @stats.num_classes += 1
 
-      case name_t
-      when TkCONSTANT
-	name = name_t.name
-        superclass = "Object"
+    container, name_t = get_class_or_module(container)
 
-        if peek_tk.kind_of?(TkLT)
-          get_tk
-          skip_tkspace(true)
-          superclass = get_class_specification
-          superclass = "<unknown>" if superclass.empty?
-        end
+    case name_t
+    when TkCONSTANT
+      name = name_t.name
+      superclass = "Object"
 
-	if single == SINGLE
-	  cls_type = SingleClass
-	else
-	  cls_type = NormalClass
-	end
+      if peek_tk.kind_of?(TkLT)
+        get_tk
+        skip_tkspace(true)
+        superclass = get_class_specification
+        superclass = "<unknown>" if superclass.empty?
+      end
 
-        cls = container.add_class(cls_type, name, superclass)
-        read_documentation_modifiers(cls, CLASS_MODIFIERS)
-        cls.record_location(@top_level)
-	parse_statements(cls)
-        cls.comment = comment
-
-      when TkLSHFT
-	case name = get_class_specification
-	when "self", container.name
-	  parse_statements(container, SINGLE, &block)
-	else
-          other = TopLevel.find_class_named(name)
-          unless other
-#            other = @top_level.add_class(NormalClass, name, nil)
-#            other.record_location(@top_level)
-#            other.comment = comment
-            other = NormalClass.new("Dummy", nil)
-          end
-          read_documentation_modifiers(other, CLASS_MODIFIERS)
-          parse_statements(other, SINGLE, &block)
-	end
+      if single == SINGLE
+        cls_type = RDoc::SingleClass
+      else
+        cls_type = RDoc::NormalClass
+      end
+
+      cls = container.add_class cls_type, name, superclass
+      read_documentation_modifiers cls, RDoc::CLASS_MODIFIERS
+      cls.record_location(@top_level)
+      parse_statements(cls)
+      cls.comment = comment
 
+    when TkLSHFT
+      case name = get_class_specification
+      when "self", container.name
+        parse_statements(container, SINGLE, &block)
       else
-	warn("Expected class name or '<<'. Got #{name_t.class}: #{name_t.text.inspect}")
+        other = RDoc::TopLevel.find_class_named(name)
+        unless other
+          #            other = @top_level.add_class(NormalClass, name, nil)
+          #            other.record_location(@top_level)
+          #            other.comment = comment
+          other = RDoc::NormalClass.new "Dummy", nil
+        end
+        read_documentation_modifiers other, RDoc::CLASS_MODIFIERS
+        parse_statements(other, SINGLE, &block)
       end
-    end
 
-    def parse_module(container, single, tk, comment)
-      progress("m")
-      @stats.num_modules += 1
-      container, name_t  = get_class_or_module(container)
-#      skip_tkspace
-      name = name_t.name
-      mod = container.add_module(NormalModule, name)
-      mod.record_location(@top_level)
-      read_documentation_modifiers(mod, CLASS_MODIFIERS)
-      parse_statements(mod)
-      mod.comment = comment
+    else
+      warn("Expected class name or '<<'. Got #{name_t.class}: #{name_t.text.inspect}")
     end
+  end
 
-    # Look for the name of a class of module (optionally with a leading :: or
-    # with :: separated named) and return the ultimate name and container
+  def parse_module(container, single, tk, comment)
+    progress("m")
+    @stats.num_modules += 1
+    container, name_t  = get_class_or_module(container)
+#      skip_tkspace
+    name = name_t.name
+    mod = container.add_module RDoc::NormalModule, name
+    mod.record_location @top_level
+    read_documentation_modifiers mod, RDoc::CLASS_MODIFIERS
+    parse_statements(mod)
+    mod.comment = comment
+  end
+
+  # Look for the name of a class of module (optionally with a leading :: or
+  # with :: separated named) and return the ultimate name and container
+
+  def get_class_or_module(container)
+    skip_tkspace
+    name_t = get_tk
 
-    def get_class_or_module(container)
-      skip_tkspace
+    # class ::A -> A is in the top level
+    if name_t.kind_of?(TkCOLON2)
       name_t = get_tk
+      container = @top_level
+    end
 
-      # class ::A -> A is in the top level
-      if name_t.kind_of?(TkCOLON2)
-        name_t = get_tk
-        container = @top_level
-      end
-
-      skip_tkspace(false)
+    skip_tkspace(false)
 
-      while peek_tk.kind_of?(TkCOLON2)
-        prev_container = container
-        container = container.find_module_named(name_t.name)
-        if !container
+    while peek_tk.kind_of?(TkCOLON2)
+      prev_container = container
+      container = container.find_module_named(name_t.name)
+      if !container
 #          warn("Couldn't find module #{name_t.name}")
-          container = prev_container.add_module(NormalModule, name_t.name)
-        end
-        get_tk
-        name_t = get_tk
+        container = prev_container.add_module RDoc::NormalModule, name_t.name
       end
-      skip_tkspace(false)
-      return [container, name_t]
+      get_tk
+      name_t = get_tk
     end
+    skip_tkspace(false)
+    return [container, name_t]
+  end
 
-    def parse_constant(container, single, tk, comment)
-      name = tk.name
-      skip_tkspace(false)
-      eq_tk = get_tk
-
-      unless eq_tk.kind_of?(TkASSIGN)
-        unget_tk(eq_tk)
-        return
-      end
+  def parse_constant(container, single, tk, comment)
+    name = tk.name
+    skip_tkspace(false)
+    eq_tk = get_tk
+
+    unless eq_tk.kind_of?(TkASSIGN)
+      unget_tk(eq_tk)
+      return
+    end
 
 
-      nest = 0
-      get_tkread
+    nest = 0
+    get_tkread
 
-      tk = get_tk
-      if tk.kind_of? TkGT
-        unget_tk(tk)
-        unget_tk(eq_tk)
-        return
-      end
+    tk = get_tk
+    if tk.kind_of? TkGT
+      unget_tk(tk)
+      unget_tk(eq_tk)
+      return
+    end
 
-      loop do
-        puts("Param: #{tk}, #{@scanner.continue} " +
-          "#{@scanner.lex_state} #{nest}")  if $DEBUG
+    loop do
+      puts "Param: %p, %s %s %s" %
+        [tk.text, @scanner.continue, @scanner.lex_state, nest] if $DEBUG_RDOC
 
         case tk
         when TkSEMICOLON
@@ -1868,183 +1854,184 @@
           end
         end
         tk = get_tk
-      end
-
-      res = get_tkread.tr("\n", " ").strip
-      res = "" if res == ";"
-      con = Constant.new(name, res, comment)
-      read_documentation_modifiers(con, CONSTANT_MODIFIERS)
-      if con.document_self
-	container.add_constant(con)
-      end
     end
 
-    def parse_method(container, single, tk, comment)
-      progress(".")
-      @stats.num_methods += 1
-      line_no = tk.line_no
-      column  = tk.char_no
-      
-      start_collecting_tokens
-      add_token(tk)
-      add_token_listener(self)
-      
-      @scanner.instance_eval{@lex_state = EXPR_FNAME}
-      skip_tkspace(false)
-      name_t = get_tk
-      back_tk = skip_tkspace
-      meth = nil
-      added_container = false
-
-      dot = get_tk
-      if dot.kind_of?(TkDOT) or dot.kind_of?(TkCOLON2)
-	@scanner.instance_eval{@lex_state = EXPR_FNAME}
-	skip_tkspace
-	name_t2 = get_tk
-	case name_t
-	when TkSELF
-	  name = name_t2.name
-	when TkCONSTANT
-          name = name_t2.name
-          prev_container = container
-          container = container.find_module_named(name_t.name)
-          if !container
-            added_container = true
-            obj = name_t.name.split("::").inject(Object) do |state, item|
-              state.const_get(item)
-            end rescue nil
-
-            type = obj.class == Class ? NormalClass : NormalModule
-            if not [Class, Module].include?(obj.class)
-              warn("Couldn't find #{name_t.name}. Assuming it's a module")
-            end
-
-            if type == NormalClass then
-              container = prev_container.add_class(type, name_t.name, obj.superclass.name)
-            else
-              container = prev_container.add_module(type, name_t.name)
-            end
-          end
-	else
-	  # warn("Unexpected token '#{name_t2.inspect}'")
-	  # break
-          skip_method(container)
-          return
-	end
-	meth =  AnyMethod.new(get_tkread, name)
-        meth.singleton = true
-      else
-	unget_tk dot
-	back_tk.reverse_each do
-	  |tk|
-	  unget_tk tk
-	end
-	name = name_t.name
+    res = get_tkread.tr("\n", " ").strip
+    res = "" if res == ";"
 
-        meth =  AnyMethod.new(get_tkread, name)
-        meth.singleton = (single == SINGLE)
-      end
+    con = RDoc::Constant.new name, res, comment
+    read_documentation_modifiers con, RDoc::CONSTANT_MODIFIERS
 
-      remove_token_listener(self)
-
-      meth.start_collecting_tokens
-      indent = TkSPACE.new(1,1)
-      indent.set_text(" " * column)
+    if con.document_self
+      container.add_constant(con)
+    end
+  end
 
-      meth.add_tokens([TkCOMMENT.new(line_no,
-                                     1,
-                                     "# File #{@top_level.file_absolute_name}, line #{line_no}"),
-                        NEWLINE_TOKEN,
-                        indent])
+  def parse_method(container, single, tk, comment)
+    progress(".")
+    @stats.num_methods += 1
+    line_no = tk.line_no
+    column  = tk.char_no
 
-      meth.add_tokens(@token_stream)
+    start_collecting_tokens
+    add_token(tk)
+    add_token_listener(self)
 
-      add_token_listener(meth)
+    @scanner.instance_eval{@lex_state = EXPR_FNAME}
+    skip_tkspace(false)
+    name_t = get_tk
+    back_tk = skip_tkspace
+    meth = nil
+    added_container = false
 
-      @scanner.instance_eval{@continue = false}
-      parse_method_parameters(meth)
+    dot = get_tk
+    if dot.kind_of?(TkDOT) or dot.kind_of?(TkCOLON2)
+      @scanner.instance_eval{@lex_state = EXPR_FNAME}
+      skip_tkspace
+      name_t2 = get_tk
+      case name_t
+      when TkSELF
+        name = name_t2.name
+      when TkCONSTANT
+        name = name_t2.name
+        prev_container = container
+        container = container.find_module_named(name_t.name)
+        if !container
+          added_container = true
+          obj = name_t.name.split("::").inject(Object) do |state, item|
+            state.const_get(item)
+          end rescue nil
+
+          type = obj.class == Class ? RDoc::NormalClass : RDoc::NormalModule
+          if not [Class, Module].include?(obj.class)
+            warn("Couldn't find #{name_t.name}. Assuming it's a module")
+          end
 
-      if meth.document_self
-        container.add_method(meth)
-      elsif added_container
-        container.document_self = false
+          if type == RDoc::NormalClass then
+            container = prev_container.add_class(type, name_t.name, obj.superclass.name)
+          else
+            container = prev_container.add_module(type, name_t.name)
+          end
+        end
+      else
+        # warn("Unexpected token '#{name_t2.inspect}'")
+        # break
+        skip_method(container)
+        return
+      end
+      meth = RDoc::AnyMethod.new(get_tkread, name)
+      meth.singleton = true
+    else
+      unget_tk dot
+      back_tk.reverse_each do |token|
+        unget_tk token
       end
+      name = name_t.name
 
-      # Having now read the method parameters and documentation modifiers, we
-      # now know whether we have to rename #initialize to ::new
+      meth = RDoc::AnyMethod.new get_tkread, name
+      meth.singleton = (single == SINGLE)
+    end
 
-      if name == "initialize" && !meth.singleton
-        if meth.dont_rename_initialize
-          meth.visibility = :protected
-        else
-          meth.singleton = true
-          meth.name = "new"
-          meth.visibility = :public
-        end
-      end
-      
-      parse_statements(container, single, meth)
-      
-      remove_token_listener(meth)
-
-      # Look for a 'call-seq' in the comment, and override the
-      # normal parameter stuff
-
-      if comment.sub!(/:?call-seq:(.*?)^\s*\#?\s*$/m, '')
-        seq = $1
-        seq.gsub!(/^\s*\#\s*/, '')
-        meth.call_seq = seq
-      end
-      
-      meth.comment = comment
-
-    end
-    
-    def skip_method(container)
-      meth =  AnyMethod.new("", "anon")
-      parse_method_parameters(meth)
-      parse_statements(container, false, meth)
-    end
-    
-    # Capture the method's parameters. Along the way,
-    # look for a comment containing 
-    #
-    #    # yields: ....
-    #
-    # and add this as the block_params for the method
-
-    def parse_method_parameters(method)
-      res = parse_method_or_yield_parameters(method)
-      res = "(" + res + ")" unless res[0] == ?(
-      method.params = res unless method.params
-      if method.block_params.nil?
-          skip_tkspace(false)
-	  read_documentation_modifiers(method, METHOD_MODIFIERS)
+    remove_token_listener(self)
+
+    meth.start_collecting_tokens
+    indent = TkSPACE.new(1,1)
+    indent.set_text(" " * column)
+
+    meth.add_tokens([TkCOMMENT.new(line_no,
+                                   1,
+                                   "# File #{@top_level.file_absolute_name}, line #{line_no}"),
+                      NEWLINE_TOKEN,
+                      indent])
+
+    meth.add_tokens(@token_stream)
+
+    add_token_listener(meth)
+
+    @scanner.instance_eval{@continue = false}
+    parse_method_parameters(meth)
+
+    if meth.document_self
+      container.add_method(meth)
+    elsif added_container
+      container.document_self = false
+    end
+
+    # Having now read the method parameters and documentation modifiers, we
+    # now know whether we have to rename #initialize to ::new
+
+    if name == "initialize" && !meth.singleton
+      if meth.dont_rename_initialize
+        meth.visibility = :protected
+      else
+        meth.singleton = true
+        meth.name = "new"
+        meth.visibility = :public
       end
     end
 
-    def parse_method_or_yield_parameters(method=nil, modifiers=METHOD_MODIFIERS)
+    parse_statements(container, single, meth)
+
+    remove_token_listener(meth)
+
+    # Look for a 'call-seq' in the comment, and override the
+    # normal parameter stuff
+
+    if comment.sub!(/:?call-seq:(.*?)^\s*\#?\s*$/m, '')
+      seq = $1
+      seq.gsub!(/^\s*\#\s*/, '')
+      meth.call_seq = seq
+    end
+
+    meth.comment = comment
+  end
+
+  def skip_method(container)
+    meth = RDoc::AnyMethod.new "", "anon"
+    parse_method_parameters(meth)
+    parse_statements(container, false, meth)
+  end
+
+  # Capture the method's parameters. Along the way, look for a comment
+  # containing.
+  #
+  #    # yields: ....
+  #
+  # and add this as the block_params for the method
+
+  def parse_method_parameters(method)
+    res = parse_method_or_yield_parameters(method)
+    res = "(" + res + ")" unless res[0] == ?(
+    method.params = res unless method.params
+    if method.block_params.nil?
       skip_tkspace(false)
-      tk = get_tk
+      read_documentation_modifiers method, RDoc::METHOD_MODIFIERS
+    end
+  end
 
-      # Little hack going on here. In the statement
-      #  f = 2*(1+yield)
-      # We see the RPAREN as the next token, so we need
-      # to exit early. This still won't catch all cases
-      # (such as "a = yield + 1"
-      end_token = case tk
-                  when TkLPAREN, TkfLPAREN
-                    TkRPAREN
-                  when TkRPAREN
-                    return ""
-                  else
-                    TkNL
-                  end
-      nest = 0
+  def parse_method_or_yield_parameters(method = nil,
+                                       modifiers = RDoc::METHOD_MODIFIERS)
+    skip_tkspace(false)
+    tk = get_tk
 
-      loop do
-        puts("Param: #{tk.inspect}, #{@scanner.continue} " +
-          "#{@scanner.lex_state} #{nest}")  if $DEBUG
+    # Little hack going on here. In the statement
+    #  f = 2*(1+yield)
+    # We see the RPAREN as the next token, so we need
+    # to exit early. This still won't catch all cases
+    # (such as "a = yield + 1"
+    end_token = case tk
+                when TkLPAREN, TkfLPAREN
+                  TkRPAREN
+                when TkRPAREN
+                  return ""
+                else
+                  TkNL
+                end
+    nest = 0
+
+    loop do
+      puts "Param: %p, %s %s %s" %
+        [tk.text, @scanner.continue, @scanner.lex_state, nest] if $DEBUG_RDOC
         case tk
         when TkSEMICOLON
           break
@@ -2065,113 +2052,113 @@
             break unless @scanner.continue
           end
         when method && method.block_params.nil? && TkCOMMENT
-	  unget_tk(tk)
-	  read_documentation_modifiers(method, modifiers)
+          unget_tk(tk)
+          read_documentation_modifiers(method, modifiers)
         end
-        tk = get_tk
-      end
-      res = get_tkread.tr("\n", " ").strip
-      res = "" if res == ";"
-      res
+      tk = get_tk
     end
+    res = get_tkread.tr("\n", " ").strip
+    res = "" if res == ";"
+    res
+  end
 
-    # skip the var [in] part of a 'for' statement
-    def skip_for_variable
-      skip_tkspace(false)
-      tk = get_tk
-      skip_tkspace(false)
-      tk = get_tk
-      unget_tk(tk) unless tk.kind_of?(TkIN)
+  # skip the var [in] part of a 'for' statement
+  def skip_for_variable
+    skip_tkspace(false)
+    tk = get_tk
+    skip_tkspace(false)
+    tk = get_tk
+    unget_tk(tk) unless tk.kind_of?(TkIN)
+  end
+
+  # while, until, and for have an optional
+  def skip_optional_do_after_expression
+    skip_tkspace(false)
+    tk = get_tk
+    case tk
+    when TkLPAREN, TkfLPAREN
+      end_token = TkRPAREN
+    else
+      end_token = TkNL
     end
 
-    # while, until, and for have an optional 
-    def skip_optional_do_after_expression
-      skip_tkspace(false)
-      tk = get_tk
+    nest = 0
+    @scanner.instance_eval{@continue = false}
+
+    loop do
+      puts("\nWhile: #{tk.text.inspect}, #{@scanner.continue} " \
+           "#{@scanner.lex_state} #{nest}") if $DEBUG_RDOC
       case tk
+      when TkSEMICOLON
+        break
       when TkLPAREN, TkfLPAREN
-        end_token = TkRPAREN
-      else
-        end_token = TkNL
-      end
-
-      nest = 0
-      @scanner.instance_eval{@continue = false}
-
-      loop do
-        puts("\nWhile: #{tk}, #{@scanner.continue} " +
-          "#{@scanner.lex_state} #{nest}") if $DEBUG
-        case tk
-        when TkSEMICOLON
-          break
-        when TkLPAREN, TkfLPAREN
-          nest += 1
-        when TkDO
-          break if nest.zero?
-        when end_token
-          if end_token == TkRPAREN
-            nest -= 1
-            break if @scanner.lex_state == EXPR_END and nest.zero?
-          else
-            break unless @scanner.continue
-          end
+        nest += 1
+      when TkDO
+        break if nest.zero?
+      when end_token
+        if end_token == TkRPAREN
+          nest -= 1
+          break if @scanner.lex_state == EXPR_END and nest.zero?
+        else
+          break unless @scanner.continue
         end
-        tk = get_tk
-      end
-      skip_tkspace(false)
-      if peek_tk.kind_of? TkDO
-        get_tk
       end
+      tk = get_tk
     end
-    
-    # Return a superclass, which can be either a constant
-    # of an expression
+    skip_tkspace(false)
+    if peek_tk.kind_of? TkDO
+      get_tk
+    end
+  end
 
-    def get_class_specification
-      tk = get_tk
-      return "self" if tk.kind_of?(TkSELF)
-        
-      res = ""
-      while tk.kind_of?(TkCOLON2) ||
-          tk.kind_of?(TkCOLON3)   ||
-          tk.kind_of?(TkCONSTANT)   
-        
-        res += tk.text
-        tk = get_tk
-      end
+  # Return a superclass, which can be either a constant
+  # of an expression
 
-      unget_tk(tk)
-      skip_tkspace(false)
+  def get_class_specification
+    tk = get_tk
+    return "self" if tk.kind_of?(TkSELF)
 
-      get_tkread # empty out read buffer
+    res = ""
+    while tk.kind_of?(TkCOLON2) ||
+        tk.kind_of?(TkCOLON3)   ||
+        tk.kind_of?(TkCONSTANT)
 
+      res += tk.text
       tk = get_tk
+    end
 
-      case tk
-      when TkNL, TkCOMMENT, TkSEMICOLON
-        unget_tk(tk)
-        return res
-      end
+    unget_tk(tk)
+    skip_tkspace(false)
 
-      res += parse_call_parameters(tk)
-      res
+    get_tkread # empty out read buffer
+
+    tk = get_tk
+
+    case tk
+    when TkNL, TkCOMMENT, TkSEMICOLON
+      unget_tk(tk)
+      return res
     end
 
-    def parse_call_parameters(tk)
+    res += parse_call_parameters(tk)
+    res
+  end
 
-      end_token = case tk
-                  when TkLPAREN, TkfLPAREN
-                    TkRPAREN
-                  when TkRPAREN
-                    return ""
-                  else
-                    TkNL
-                  end
-      nest = 0
+  def parse_call_parameters(tk)
 
-      loop do
-        puts("Call param: #{tk}, #{@scanner.continue} " +
-          "#{@scanner.lex_state} #{nest}") if $DEBUG
+    end_token = case tk
+                when TkLPAREN, TkfLPAREN
+                  TkRPAREN
+                when TkRPAREN
+                  return ""
+                else
+                  TkNL
+                end
+    nest = 0
+
+    loop do
+      puts("Call param: #{tk}, #{@scanner.continue} " +
+        "#{@scanner.lex_state} #{nest}") if $DEBUG_RDOC
         case tk
         when TkSEMICOLON
           break
@@ -2185,216 +2172,209 @@
             break unless @scanner.continue
           end
         when TkCOMMENT
-	  unget_tk(tk)
-	  break
+          unget_tk(tk)
+          break
         end
         tk = get_tk
-      end
-      res = get_tkread.tr("\n", " ").strip
-      res = "" if res == ";"
-      res
     end
+    res = get_tkread.tr("\n", " ").strip
+    res = "" if res == ";"
+    res
+  end
 
+  # Parse a constant, which might be qualified by
+  # one or more class or module names
+
+  def get_constant
+    res = ""
+    skip_tkspace(false)
+    tk = get_tk
 
-    # Parse a constant, which might be qualified by
-    # one or more class or module names
+    while tk.kind_of?(TkCOLON2) ||
+        tk.kind_of?(TkCOLON3)   ||
+        tk.kind_of?(TkCONSTANT)
 
-    def get_constant
-      res = ""
-      skip_tkspace(false)
+      res += tk.text
       tk = get_tk
-
-      while tk.kind_of?(TkCOLON2) ||
-          tk.kind_of?(TkCOLON3)   ||
-          tk.kind_of?(TkCONSTANT)          
-        
-        res += tk.text
-        tk = get_tk
-      end
+    end
 
 #      if res.empty?
 #        warn("Unexpected token #{tk} in constant")
-#      end 
-      unget_tk(tk)
-      res
-    end
-
-    # Get a constant that may be surrounded by parens
-    
-    def get_constant_with_optional_parens
-      skip_tkspace(false)
-      nest = 0
-      while (tk = peek_tk).kind_of?(TkLPAREN)  || tk.kind_of?(TkfLPAREN)
-        get_tk
-        skip_tkspace(true)
-        nest += 1
-      end
+#      end
+    unget_tk(tk)
+    res
+  end
 
-      name = get_constant
+  # Get a constant that may be surrounded by parens
 
-      while nest > 0
-        skip_tkspace(true)
-        tk = get_tk
-        nest -= 1 if tk.kind_of?(TkRPAREN)
-      end
-      name
+  def get_constant_with_optional_parens
+    skip_tkspace(false)
+    nest = 0
+    while (tk = peek_tk).kind_of?(TkLPAREN)  || tk.kind_of?(TkfLPAREN)
+      get_tk
+      skip_tkspace(true)
+      nest += 1
     end
 
-    # Directives are modifier comments that can appear after class, module,
-    # or method names. For example
-    #
-    #   def fred    # :yields:  a, b
-    #
-    # or
-    #
-    #   class SM  # :nodoc:
-    #
-    # we return the directive name and any parameters as a two element array
-    
-    def read_directive(allowed)
+    name = get_constant
+
+    while nest > 0
+      skip_tkspace(true)
       tk = get_tk
-      puts "directive: #{tk.inspect}" if $DEBUG
-      result = nil
-      if tk.kind_of?(TkCOMMENT) 
-        if tk.text =~ /\s*:?(\w+):\s*(.*)/
-          directive = $1.downcase
-          if allowed.include?(directive)
-            result = [directive, $2]
-          end
+      nest -= 1 if tk.kind_of?(TkRPAREN)
+    end
+    name
+  end
+
+  # Directives are modifier comments that can appear after class, module,
+  # or method names. For example:
+  #
+  #   def fred # :yields:  a, b
+  #
+  # or:
+  #
+  #   class MyClass # :nodoc:
+  #
+  # We return the directive name and any parameters as a two element array
+
+  def read_directive(allowed)
+    tk = get_tk
+    puts "directive: #{tk.text.inspect}" if $DEBUG_RDOC
+    result = nil
+    if tk.kind_of?(TkCOMMENT)
+      if tk.text =~ /\s*:?(\w+):\s*(.*)/
+        directive = $1.downcase
+        if allowed.include?(directive)
+          result = [directive, $2]
         end
-      else
-        unget_tk(tk)
       end
-      result
+    else
+      unget_tk(tk)
     end
+    result
+  end
 
-    
-    def read_documentation_modifiers(context, allow)
-      dir = read_directive(allow)
+  def read_documentation_modifiers(context, allow)
+    dir = read_directive(allow)
 
-      case dir[0]
+    case dir[0]
 
-      when "notnew", "not_new", "not-new"
-        context.dont_rename_initialize = true
+    when "notnew", "not_new", "not-new"
+      context.dont_rename_initialize = true
 
-      when "nodoc"
-        context.document_self = false
-	if dir[1].downcase == "all"
-	  context.document_children = false
-	end
+    when "nodoc"
+      context.document_self = false
+      if dir[1].downcase == "all"
+        context.document_children = false
+      end
 
-      when "doc"
-        context.document_self = true
-        context.force_documentation = true
+    when "doc"
+      context.document_self = true
+      context.force_documentation = true
 
-      when "yield", "yields"
-        unless context.params.nil?
-          context.params.sub!(/(,|)\s*&\w+/,'') # remove parameter &proc
-        end
-	context.block_params = dir[1]
-
-      when "arg", "args"
-        context.params = dir[1]
-      end if dir
-    end
-
-    
-    # Look for directives in a normal comment block:
-    #
-    #   #--       - don't display comment from this point forward
-    #  
-    #
-    # This routine modifies it's parameter
-
-    def look_for_directives_in(context, comment)
-
-      preprocess = SM::PreProcess.new(@input_file_name,
-                                      @options.rdoc_include)
-
-      preprocess.handle(comment) do |directive, param|
-        case directive
-        when "stopdoc"
-          context.stop_doc
-          ""
-        when "startdoc"
-          context.start_doc
-          context.force_documentation = true
-          ""
-
-        when "enddoc"
-          #context.done_documenting = true
-          #""
-          throw :enddoc
-
-        when "main"
-          options = Options.instance
-          options.main_page = param
-	  ""
-
-        when "title"
-          options = Options.instance
-          options.title = param
-          ""
-
-        when "section"
-          context.set_current_section(param, comment)
-          comment.replace("") # 1.8 doesn't support #clear
-          break 
-        else
-          warn "Unrecognized directive '#{directive}'"
-          break
-        end
+    when "yield", "yields"
+      unless context.params.nil?
+        context.params.sub!(/(,|)\s*&\w+/,'') # remove parameter &proc
       end
+    context.block_params = dir[1]
 
-      remove_private_comments(comment)
-    end
+    when "arg", "args"
+      context.params = dir[1]
+    end if dir
+  end
 
-    def remove_private_comments(comment)
-      comment.gsub!(/^#--.*?^#\+\+/m, '')
-      comment.sub!(/^#--.*/m, '')
-    end
+  ##
+  # Look for directives in a normal comment block:
+  #
+  #   #--       - don't display comment from this point forward
+  #
+  # This routine modifies it's parameter
+
+  def look_for_directives_in(context, comment)
+    preprocess = RDoc::Markup::PreProcess.new(@input_file_name,
+                                              @options.rdoc_include)
+
+    preprocess.handle(comment) do |directive, param|
+      case directive
+      when "stopdoc"
+        context.stop_doc
+        ""
+      when "startdoc"
+        context.start_doc
+        context.force_documentation = true
+        ""
 
+      when "enddoc"
+        #context.done_documenting = true
+        #""
+        throw :enddoc
 
+      when "main"
+        @options.main_page = param
+        ""
+
+      when "title"
+        @options.title = param
+        ""
+
+      when "section"
+        context.set_current_section(param, comment)
+        comment = ''
+        break
 
-    def get_symbol_or_name
-      tk = get_tk
-      case tk
-      when  TkSYMBOL
-        tk.text.sub(/^:/, '')
-      when TkId, TkOp
-        tk.name
-      when TkSTRING
-        tk.text
       else
-        raise "Name or symbol expected (got #{tk})"
+        warn "Unrecognized directive '#{directive}'"
+        break
       end
     end
-    
-    def parse_alias(context, single, tk, comment)
+
+    remove_private_comments(comment)
+  end
+
+  def remove_private_comments(comment)
+    comment.gsub!(/^#--.*?^#\+\+/m, '')
+    comment.sub!(/^#--.*/m, '')
+  end
+
+  def get_symbol_or_name
+    tk = get_tk
+    case tk
+    when  TkSYMBOL
+      tk.text.sub(/^:/, '')
+    when TkId, TkOp
+      tk.name
+    when TkSTRING
+      tk.text
+    else
+      raise "Name or symbol expected (got #{tk})"
+    end
+  end
+
+  def parse_alias(context, single, tk, comment)
+    skip_tkspace
+    if (peek_tk.kind_of? TkLPAREN)
+      get_tk
       skip_tkspace
-      if (peek_tk.kind_of? TkLPAREN)
-        get_tk
-        skip_tkspace
-      end
-      new_name = get_symbol_or_name
-      @scanner.instance_eval{@lex_state = EXPR_FNAME}
+    end
+    new_name = get_symbol_or_name
+    @scanner.instance_eval{@lex_state = EXPR_FNAME}
+    skip_tkspace
+    if (peek_tk.kind_of? TkCOMMA)
+      get_tk
       skip_tkspace
-      if (peek_tk.kind_of? TkCOMMA)
-        get_tk
-        skip_tkspace
-      end
-      old_name = get_symbol_or_name
-
-      al = Alias.new(get_tkread, old_name, new_name, comment)
-      read_documentation_modifiers(al, ATTR_MODIFIERS)
-      if al.document_self
-	context.add_alias(al)
-      end
     end
+    old_name = get_symbol_or_name
 
-    def parse_yield_parameters
-      parse_method_or_yield_parameters
+    al = RDoc::Alias.new get_tkread, old_name, new_name, comment
+    read_documentation_modifiers al, RDoc::ATTR_MODIFIERS
+    if al.document_self
+      context.add_alias(al)
     end
+  end
+
+  def parse_yield_parameters
+    parse_method_or_yield_parameters
+  end
 
   def parse_yield(context, single, tk, method)
     if method.block_params.nil?
@@ -2416,15 +2396,15 @@
     case tk
     when TkSTRING
       name = tk.text
-#    when TkCONSTANT, TkIDENTIFIER, TkIVAR, TkGVAR
-#      name = tk.name
+      #    when TkCONSTANT, TkIDENTIFIER, TkIVAR, TkGVAR
+      #      name = tk.name
     when TkDSTRING
       warn "Skipping require of dynamic string: #{tk.text}"
- #   else
- #     warn "'require' used as variable"
+      #   else
+      #     warn "'require' used as variable"
     end
     if name
-      context.add_require(Require.new(name, comment))
+      context.add_require(RDoc::Require.new(name, comment))
     else
       unget_tk(tk)
     end
@@ -2435,175 +2415,173 @@
       skip_tkspace_comment
       name = get_constant_with_optional_parens
       unless name.empty?
-        context.add_include(Include.new(name, comment))
+        context.add_include RDoc::Include.new(name, comment)
       end
       return unless peek_tk.kind_of?(TkCOMMA)
       get_tk
     end
   end
 
-    def get_bool
-      skip_tkspace
+  def get_bool
+    skip_tkspace
+    tk = get_tk
+    case tk
+    when TkTRUE
+      true
+    when TkFALSE, TkNIL
+      false
+    else
+      unget_tk tk
+      true
+    end
+  end
+
+  def parse_attr(context, single, tk, comment)
+    args = parse_symbol_arg(1)
+    if args.size > 0
+      name = args[0]
+      rw = "R"
+      skip_tkspace(false)
       tk = get_tk
-      case tk
-      when TkTRUE
-        true
-      when TkFALSE, TkNIL
-        false
+      if tk.kind_of? TkCOMMA
+        rw = "RW" if get_bool
       else
         unget_tk tk
-        true
       end
+      att = RDoc::Attr.new get_tkread, name, rw, comment
+      read_documentation_modifiers att, RDoc::ATTR_MODIFIERS
+      if att.document_self
+        context.add_attribute(att)
+      end
+    else
+      warn("'attr' ignored - looks like a variable")
     end
+  end
 
-    def parse_attr(context, single, tk, comment)
-      args = parse_symbol_arg(1)
-      if args.size > 0
-	name = args[0]
-        rw = "R"
-        skip_tkspace(false)
-        tk = get_tk
-        if tk.kind_of? TkCOMMA
-          rw = "RW" if get_bool
-        else
-          unget_tk tk
-        end
-	att = Attr.new(get_tkread, name, rw, comment)
-	read_documentation_modifiers(att, ATTR_MODIFIERS)
-	if att.document_self
-	  context.add_attribute(att)
-	end
-      else
-	warn("'attr' ignored - looks like a variable")
-      end    
+  def parse_visibility(container, single, tk)
+    singleton = (single == SINGLE)
+    vis = case tk.name
+          when "private"   then :private
+          when "protected" then :protected
+          when "public"    then :public
+          when "private_class_method"
+            singleton = true
+            :private
+          when "public_class_method"
+            singleton = true
+            :public
+          else raise "Invalid visibility: #{tk.name}"
+          end
 
+    skip_tkspace_comment(false)
+    case peek_tk
+      # Ryan Davis suggested the extension to ignore modifiers, because he
+      # often writes
+      #
+      #   protected unless $TESTING
+      #
+    when TkNL, TkUNLESS_MOD, TkIF_MOD
+      #        error("Missing argument") if singleton
+      container.ongoing_visibility = vis
+    else
+      args = parse_symbol_arg
+      container.set_visibility_for(args, vis, singleton)
     end
+  end
 
-    def parse_visibility(container, single, tk)
-      singleton = (single == SINGLE)
-      vis = case tk.name
-            when "private"   then :private
-            when "protected" then :protected
-            when "public"    then :public
-            when "private_class_method"
-              singleton = true
-              :private
-            when "public_class_method"
-              singleton = true
-              :public
-            else raise "Invalid visibility: #{tk.name}"
-            end
-            
-      skip_tkspace_comment(false)
-      case peek_tk
-        # Ryan Davis suggested the extension to ignore modifiers, because he
-        # often writes
-        #
-        #   protected unless $TESTING
-        #
-      when TkNL, TkUNLESS_MOD, TkIF_MOD
-#        error("Missing argument") if singleton        
-        container.ongoing_visibility = vis
-      else
-        args = parse_symbol_arg
-        container.set_visibility_for(args, vis, singleton)
-      end
-    end
+  def parse_attr_accessor(context, single, tk, comment)
+    args = parse_symbol_arg
+    read = get_tkread
+    rw = "?"
 
-    def parse_attr_accessor(context, single, tk, comment)
-      args = parse_symbol_arg
-      read = get_tkread
-      rw = "?"
+    # If nodoc is given, don't document any of them
 
-      # If nodoc is given, don't document any of them
+    tmp = RDoc::CodeObject.new
+    read_documentation_modifiers tmp, RDoc::ATTR_MODIFIERS
+    return unless tmp.document_self
 
-      tmp = CodeObject.new
-      read_documentation_modifiers(tmp, ATTR_MODIFIERS)
-      return unless tmp.document_self
+    case tk.name
+    when "attr_reader"   then rw = "R"
+    when "attr_writer"   then rw = "W"
+    when "attr_accessor" then rw = "RW"
+    else
+      rw = @options.extra_accessor_flags[tk.name]
+    end
 
-      case tk.name
-      when "attr_reader"   then rw = "R"
-      when "attr_writer"   then rw = "W"
-      when "attr_accessor" then rw = "RW"
-      else
-        rw = @options.extra_accessor_flags[tk.name]
-      end
-      
-      for name in args
-	att = Attr.new(get_tkread, name, rw, comment)
-        context.add_attribute(att)
-      end    
+    for name in args
+      att = RDoc::Attr.new get_tkread, name, rw, comment
+      context.add_attribute att
+    end
+  end
+
+  def skip_tkspace_comment(skip_nl = true)
+    loop do
+      skip_tkspace(skip_nl)
+      return unless peek_tk.kind_of? TkCOMMENT
+      get_tk
     end
+  end
 
-    def skip_tkspace_comment(skip_nl = true)
+  def parse_symbol_arg(no = nil)
+    args = []
+    skip_tkspace_comment
+    case tk = get_tk
+    when TkLPAREN
       loop do
-        skip_tkspace(skip_nl)
-        return unless peek_tk.kind_of? TkCOMMENT
-        get_tk
+        skip_tkspace_comment
+        if tk1 = parse_symbol_in_arg
+          args.push tk1
+          break if no and args.size >= no
+        end
+
+        skip_tkspace_comment
+        case tk2 = get_tk
+        when TkRPAREN
+          break
+        when TkCOMMA
+        else
+          warn("unexpected token: '#{tk2.inspect}'") if $DEBUG_RDOC
+          break
+        end
+      end
+    else
+      unget_tk tk
+      if tk = parse_symbol_in_arg
+        args.push tk
+        return args if no and args.size >= no
       end
-    end
 
-    def parse_symbol_arg(no = nil)
+      loop do
+        #	  skip_tkspace_comment(false)
+        skip_tkspace(false)
 
-      args = []
-      skip_tkspace_comment
-      case tk = get_tk
-      when TkLPAREN
-	loop do
-	  skip_tkspace_comment
-	  if tk1 = parse_symbol_in_arg
-	    args.push tk1
-	    break if no and args.size >= no
-	  end
-	  
-	  skip_tkspace_comment
-	  case tk2 = get_tk
-	  when TkRPAREN
-	    break
-	  when TkCOMMA
-	  else
-           warn("unexpected token: '#{tk2.inspect}'") if $DEBUG
-	    break
-	  end
-	end
-      else
-	unget_tk tk
-	if tk = parse_symbol_in_arg
-	  args.push tk
-	  return args if no and args.size >= no
-	end
+        tk1 = get_tk
+        unless tk1.kind_of?(TkCOMMA)
+          unget_tk tk1
+          break
+        end
 
-	loop do
-#	  skip_tkspace_comment(false)
-	  skip_tkspace(false)
-
-	  tk1 = get_tk
-	  unless tk1.kind_of?(TkCOMMA) 
-	    unget_tk tk1
-	    break
-	  end
-	  
-	  skip_tkspace_comment
-	  if tk = parse_symbol_in_arg
-	    args.push tk
-	    break if no and args.size >= no
-	  end
-	end
+        skip_tkspace_comment
+        if tk = parse_symbol_in_arg
+          args.push tk
+          break if no and args.size >= no
+        end
       end
-      args
     end
+    args
+  end
 
-    def parse_symbol_in_arg
-      case tk = get_tk
-      when TkSYMBOL
-        tk.text.sub(/^:/, '')
-      when TkSTRING
-	eval @read[-1]
-      else
-	warn("Expected symbol or string, got #{tk.inspect}") if $DEBUG
-	nil
-      end
+  def parse_symbol_in_arg
+    case tk = get_tk
+    when TkSYMBOL
+      tk.text.sub(/^:/, '')
+    when TkSTRING
+      eval @read[-1]
+    else
+      warn("Expected symbol or string, got #{tk.inspect}") if $DEBUG_RDOC
+      nil
     end
   end
 
 end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/parsers/parse_simple.rb ../rdoc-f95-20090109-1/parsers/parse_simple.rb
--- ruby-1.8.7-p72/lib/rdoc/parsers/parse_simple.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/parsers/parse_simple.rb	2008-03-09 03:44:02.000000000 +0900
@@ -1,41 +1,39 @@
-# Parse a non-source file. We basically take the whole thing 
-# as one big comment. If the first character in the file
-# is '#', we strip leading pound signs.
-
-
-require "rdoc/code_objects"
-require "rdoc/markup/simple_markup/preprocess"
-
-module RDoc
-  # See rdoc/parsers/parse_c.rb
-
-  class SimpleParser
-    
-    # prepare to parse a plain file
-    def initialize(top_level, file_name, body, options, stats)
-      
-      preprocess = SM::PreProcess.new(file_name, options.rdoc_include)
-      
-      preprocess.handle(body) do |directive, param|
-        $stderr.puts "Unrecognized directive '#{directive}' in #{file_name}"
-      end
-      
-      @body = body
-      @options = options
-      @top_level = top_level
-    end
-    
-    # Extract the file contents and attach them to the toplevel as a
-    # comment
-    
-    def scan
-      #    @body.gsub(/^(\s\n)+/, '')
-      @top_level.comment = remove_private_comments(@body)
-      @top_level
-    end
+require 'rdoc/code_objects'
+require 'rdoc/markup/preprocess'
+
+##
+# Parse a non-source file. We basically take the whole thing as one big
+# comment. If the first character in the file is '#', we strip leading pound
+# signs.
+
+class RDoc::SimpleParser
 
-    def remove_private_comments(comment)
-      comment.gsub(/^--.*?^\+\+/m, '').sub(/^--.*/m, '')
+  ##
+  # Prepare to parse a plain file
+
+  def initialize(top_level, file_name, body, options, stats)
+    preprocess = RDoc::Markup::PreProcess.new(file_name, options.rdoc_include)
+
+    preprocess.handle(body) do |directive, param|
+      warn "Unrecognized directive '#{directive}' in #{file_name}"
     end
+
+    @body = body
+    @options = options
+    @top_level = top_level
   end
+
+  ##
+  # Extract the file contents and attach them to the toplevel as a comment
+
+  def scan
+    @top_level.comment = remove_private_comments(@body)
+    @top_level
+  end
+
+  def remove_private_comments(comment)
+    comment.gsub(/^--[^-].*?^\+\+/m, '').sub(/^--.*/m, '')
+  end
+
 end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/rdoc ../rdoc-f95-20090109-1/rdoc
--- ruby-1.8.7-p72/lib/rdoc/rdoc	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/rdoc	2008-03-09 03:43:55.000000000 +0900
@@ -0,0 +1,70 @@
+#!/usr/bin/env ruby
+#
+#  RDoc: Documentation tool for source code
+#        (see lib/rdoc/rdoc.rb for more information)
+#
+#  Copyright (c) 2003 Dave Thomas
+#  Released under the same terms as Ruby
+#
+#  $Revision: 1.2 $
+
+## Transitional Hack ####
+#
+#  RDoc was initially distributed independently, and installed
+#  itself into <prefix>/lib/ruby/site_ruby/<ver>/rdoc...
+#
+#  Now that RDoc is part of the distribution, it's installed into
+#  <prefix>/lib/ruby/<ver>, which unfortunately appears later in the
+#  search path. This means that if you have previously installed RDoc,
+#  and then install from ruby-lang, you'll pick up the old one by
+#  default. This hack checks for the condition, and readjusts the
+#  search path if necessary.
+
+#def adjust_for_existing_rdoc(path)
+#  
+#  $stderr.puts %{
+#  It seems as if you have a previously-installed RDoc in
+#  the directory #{path}.
+#
+#  Because this is now out-of-date, you might want to consider
+#  removing the directories:
+#
+#    #{File.join(path, "rdoc")}
+#
+#  and
+#
+#    #{File.join(path, "markup")}
+#
+#  }
+#
+#  # Move all the site_ruby directories to the end
+#  p $:
+#  $:.replace($:.partition {|path| /site_ruby/ !~ path}.flatten)
+#  p $:
+#end
+#
+# $:.each do |path|
+#  if /site_ruby/ =~ path 
+#    rdoc_path = File.join(path, 'rdoc', 'rdoc.rb')
+#    if File.exists?(rdoc_path)
+#      adjust_for_existing_rdoc(path)
+#      break
+#    end
+#  end
+#end
+
+## End of Transitional Hack ##
+
+
+require 'rdoc/rdoc'
+
+begin
+  r = RDoc::RDoc.new
+  r.document ARGV
+rescue Interrupt
+  $stderr.puts
+  $stderr.puts "Interrupted"
+rescue RDoc::Error => e
+  $stderr.puts e.message
+  exit 1
+end
¥Ð¥¤¥Ê¥ê¡¼¡¦¥Õ¥¡¥¤¥ëruby-1.8.7-p72/lib/rdoc/rdoc-f95-mailto-13.png¤È../rdoc-f95-20090109-1/rdoc-f95-mailto-13.png¤Ï°ã¤¤¤Þ¤¹
¥Ð¥¤¥Ê¥ê¡¼¡¦¥Õ¥¡¥¤¥ëruby-1.8.7-p72/lib/rdoc/rdoc-f95-mailto.png¤È../rdoc-f95-20090109-1/rdoc-f95-mailto.png¤Ï°ã¤¤¤Þ¤¹
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/rdoc.rb ../rdoc-f95-20090109-1/rdoc.rb
--- ruby-1.8.7-p72/lib/rdoc/rdoc.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/rdoc.rb	2009-01-09 16:23:30.000000000 +0900
@@ -2,58 +2,51 @@
 #
  
 
-VERSION_STRING = %{RDoc V1.0.1 - 20041108}
-
-
 require 'rdoc/parsers/parse_rb.rb'
 require 'rdoc/parsers/parse_c.rb'
 require 'rdoc/parsers/parse_f95.rb'
-
 require 'rdoc/parsers/parse_simple.rb'
+
+require 'rdoc/stats'
 require 'rdoc/options'
 
 require 'rdoc/diagram'
 
 require 'find'
-require 'ftools'
+require 'fileutils'
 require 'time'
 
-# We put rdoc stuff in the RDoc module to avoid namespace
-# clutter.
-#
-# ToDo: This isn't universally true.
-#
-# :include: README
-
 module RDoc
 
-  # Name of the dotfile that contains the description of files to be
-  # processed in the current directory
+  ##
+  # RDoc version you are using
+
+  VERSION = <<-"EOF"
+RDoc modified by GFD Dennou Club: Version $Name: rdoc-f95-20090109-1 $
+     See http://www.gfd-dennou.org/library/dcmodel
+EOF
+
+  ##
+  # Exception thrown by any rdoc error.
+
+  class Error < RuntimeError; end
+
+  RDocError = Error # :nodoc:
+
   DOT_DOC_FILENAME = ".document"
 
-  # Simple stats collector
-  class Stats
-    attr_accessor :num_files, :num_classes, :num_modules, :num_methods
-    def initialize
-      @num_files = @num_classes = @num_modules = @num_methods = 0
-      @start = Time.now
-    end
-    def print
-      puts "Files:   #@num_files"
-      puts "Classes: #@num_classes"
-      puts "Modules: #@num_modules"
-      puts "Methods: #@num_methods"
-      puts "Elapsed: " + sprintf("%0.3fs", Time.now - @start)
-    end
-  end
+  GENERAL_MODIFIERS = %w[nodoc].freeze
 
+  CLASS_MODIFIERS = GENERAL_MODIFIERS
 
-  # Exception thrown by any rdoc error. Only the #message part is
-  # of use externally.
+  ATTR_MODIFIERS  = GENERAL_MODIFIERS
 
-  class RDocError < Exception
-  end
+  CONSTANT_MODIFIERS = GENERAL_MODIFIERS
 
+  METHOD_MODIFIERS = GENERAL_MODIFIERS +
+    %w[arg args yield yields notnew not-new not_new doc]
+
+  ##
   # Encapsulate the production of rdoc documentation. Basically
   # you can use this as you would invoke rdoc from the command
   # line:
@@ -62,56 +55,55 @@
   #    rdoc.document(args)
   #
   # where _args_ is an array of strings, each corresponding to
-  # an argument you'd give rdoc on the command line. See rdoc/rdoc.rb 
+  # an argument you'd give rdoc on the command line. See rdoc/rdoc.rb
   # for details.
-  
+
   class RDoc
 
-    ##
-    # This is the list of output generators that we
-    # support
-    
     Generator = Struct.new(:file_name, :class_name, :key)
-    
+
+    ##
+    # This is the list of output generator that we support
+
     GENERATORS = {}
-    $:.collect {|d|
-      File::expand_path(d)
-    }.find_all {|d|
-      File::directory?("#{d}/rdoc/generators")
-    }.each {|dir|
-      Dir::entries("#{dir}/rdoc/generators").each {|gen|
-        next unless /(\w+)_generator.rb$/ =~ gen
+
+    $LOAD_PATH.collect do |d|
+      File.expand_path d
+    end.find_all do |d|
+      File.directory? "#{d}/rdoc/generator"
+    end.each do |dir|
+      Dir.entries("#{dir}/rdoc/generator").each do |gen|
+        next unless /(\w+)\.rb$/ =~ gen
         type = $1
         unless GENERATORS.has_key? type
-          GENERATORS[type] = Generator.new("rdoc/generators/#{gen}",
-                                           "#{type.upcase}Generator".intern,
+          GENERATORS[type] = Generator.new("rdoc/generator/#{gen}",
+                                           "#{type.upcase}".intern,
                                            type)
         end
-      }
-    }                                                    
+      end
+    end
 
-    #######
-    private
-    #######
+    def initialize
+      @stats = Stats.new
+    end
 
     ##
     # Report an error message and exit
-    
+
     def error(msg)
-      raise RDocError.new(msg)
+      raise ::RDoc::Error, msg
     end
-    
+
     ##
-    # Create an output dir if it doesn't exist. If it does
-    # exist, but doesn't contain the flag file <tt>created.rid</tt>
-    # then we refuse to use it, as we may clobber some
-    # manually generated documentation
-    
+    # Create an output dir if it doesn't exist. If it does exist, but doesn't
+    # contain the flag file <tt>created.rid</tt> then we refuse to use it, as
+    # we may clobber some manually generated documentation
+
     def setup_output_dir(op_dir, force)
       flag_file = output_flag_file(op_dir)
       if File.exist?(op_dir)
         unless File.directory?(op_dir)
-          error "'#{op_dir}' exists, and is not a directory" 
+          error "'#{op_dir}' exists, and is not a directory"
         end
         begin
           created = File.read(flag_file)
@@ -125,24 +117,30 @@
           last = (Time.parse(created) unless force rescue nil)
         end
       else
-        File.makedirs(op_dir)
+        FileUtils.mkdir_p(op_dir)
       end
       last
     end
 
+    ##
     # Update the flag file in an output directory.
+
     def update_output_dir(op_dir, time)
       File.open(output_flag_file(op_dir), "w") {|f| f.puts time.rfc2822 }
     end
 
+    ##
     # Return the path name of the flag file in an output directory.
+
     def output_flag_file(op_dir)
       File.join(op_dir, "created.rid")
     end
 
-    # The .document file contains a list of file and directory name
-    # patterns, representing candidates for documentation. It may
-    # also contain comments (starting with '#')
+    ##
+    # The .document file contains a list of file and directory name patterns,
+    # representing candidates for documentation. It may also contain comments
+    # (starting with '#')
+
     def parse_dot_doc_file(in_dir, filename, options)
       # read and strip comments
       patterns = File.read(filename).gsub(/#.*/, '')
@@ -156,20 +154,20 @@
       result
     end
 
-
-    # Given a list of files and directories, create a list
-    # of all the Ruby files they contain. 
-    #
-    # If +force_doc+ is true, we always add the given files.
-    # If false, only add files that we guarantee we can parse
-    # It is true when looking at files given on the command line,
-    # false when recursing through subdirectories. 
+    ##
+    # Given a list of files and directories, create a list of all the Ruby
+    # files they contain.
     #
-    # The effect of this is that if you want a file with a non-
-    # standard extension parsed, you must name it explicity.
+    # If +force_doc+ is true we always add the given files, if false, only
+    # add files that we guarantee we can parse.  It is true when looking at
+    # files given on the command line, false when recursing through
+    # subdirectories.
     #
+    # The effect of this is that if you want a file with a non-standard
+    # extension parsed, you must name it explicity.
 
-    def normalized_file_list(options, relative_files, force_doc = false, exclude_pattern=nil)
+    def normalized_file_list(options, relative_files, force_doc = false,
+                             exclude_pattern = nil)
       file_list = []
 
       relative_files.each do |rel_file_name|
@@ -188,38 +186,53 @@
             file_list.concat(list_files_in_directory(rel_file_name, options))
           end
         else
-          raise RDocError.new("I can't deal with a #{type} #{rel_file_name}")
+          raise RDoc::Error, "I can't deal with a #{type} #{rel_file_name}"
         end
       end
+
       file_list
     end
 
-    # Return a list of the files to be processed in
-    # a directory. We know that this directory doesn't have
-    # a .document file, so we're looking for real files. However
-    # we may well contain subdirectories which must
-    # be tested for .document files
+    ##
+    # Return a list of the files to be processed in a directory. We know that
+    # this directory doesn't have a .document file, so we're looking for real
+    # files. However we may well contain subdirectories which must be tested
+    # for .document files.
+
     def list_files_in_directory(dir, options)
-      normalized_file_list(options, Dir.glob(File.join(dir, "*")), false, options.exclude)
-    end
+      files = Dir.glob File.join(dir, "*")
 
+      normalized_file_list options, files, false, options.exclude
+    end
 
-    # Parse each file on the command line, recursively entering
-    # directories
+    ##
+    # Parse each file on the command line, recursively entering directories.
 
     def parse_files(options)
- 
-      file_info = []
-
       files = options.files
       files = ["."] if files.empty?
 
       file_list = normalized_file_list(options, files, true)
 
+      return [] if file_list.empty?
+
+      file_info = []
+      width = file_list.map { |name| name.length }.max + 1
+
       file_list.each do |fn|
-        $stderr.printf("\n%35s: ", File.basename(fn)) unless options.quiet
-        
-        content = File.open(fn, "r") {|f| f.read}
+        $stderr.printf("\n%*s: ", width, fn) unless options.quiet
+
+        content = if RUBY_VERSION >= '1.9' then
+                    File.open(fn, "r:ascii-8bit") { |f| f.read }
+                  else
+                    File.read fn
+                  end
+
+        if /coding:\s*(\S+)/ =~ content[/\A(?:.*\n){0,2}/]
+          if enc = Encoding.find($1)
+            content.force_encoding(enc)
+          end
+        end
 
         top_level = TopLevel.new(fn)
         parser = ParserFactory.parser_for(top_level, fn, content, options, @stats)
@@ -230,69 +243,67 @@
       file_info
     end
 
-
-    public
-
-    ###################################################################
-    #
+    ##
     # Format up one or more files according to the given arguments.
-    # For simplicity, _argv_ is an array of strings, equivalent to the
-    # strings that would be passed on the command line. (This isn't a
-    # coincidence, as we _do_ pass in ARGV when running
-    # interactively). For a list of options, see rdoc/rdoc.rb. By
-    # default, output will be stored in a directory called +doc+ below
-    # the current directory, so make sure you're somewhere writable
-    # before invoking.
     #
-    # Throws: RDocError on error
+    # For simplicity, _argv_ is an array of strings, equivalent to the strings
+    # that would be passed on the command line. (This isn't a coincidence, as
+    # we _do_ pass in ARGV when running interactively). For a list of options,
+    # see rdoc/rdoc.rb. By default, output will be stored in a directory
+    # called +doc+ below the current directory, so make sure you're somewhere
+    # writable before invoking.
+    #
+    # Throws: RDoc::Error on error
 
     def document(argv)
-
       TopLevel::reset
 
-      @stats = Stats.new
-
-      options = Options.instance
-      options.parse(argv, GENERATORS)
+      @options = Options.new GENERATORS
+      @options.parse argv
 
       @last_created = nil
-      unless options.all_one_file
-        @last_created = setup_output_dir(options.op_dir, options.force_update)
+
+      unless @options.all_one_file
+        @last_created = setup_output_dir(@options.op_dir, @options.force_update)
       end
+
       start_time = Time.now
 
-      file_info = parse_files(options)
+      file_info = parse_files @options
+
+      @options.title = "RDoc Documentation"
 
       if file_info.empty?
-        $stderr.puts "\nNo newer files." unless options.quiet
+        $stderr.puts "\nNo newer files." unless @options.quiet
       else
-        gen = options.generator
+        @gen = @options.generator
 
-        $stderr.puts "\nGenerating #{gen.key.upcase}..." unless options.quiet
+        $stderr.puts "\nGenerating #{@gen.key.upcase}..." unless @options.quiet
 
-        require gen.file_name
+        require @gen.file_name
 
-        gen_class = Generators.const_get(gen.class_name)
-        gen = gen_class.for(options)
+        gen_class = ::RDoc::Generator.const_get @gen.class_name
+        @gen = gen_class.for @options
 
         pwd = Dir.pwd
 
-        Dir.chdir(options.op_dir)  unless options.all_one_file
+        Dir.chdir(@options.op_dir)  unless @options.all_one_file
 
         begin
-          Diagram.new(file_info, options).draw if options.diagram
-          gen.generate(file_info)
+          Diagram.new(file_info, @options).draw if @options.diagram
+          @gen.generate(file_info)
           update_output_dir(".", start_time)
         ensure
           Dir.chdir(pwd)
         end
       end
 
-      unless options.quiet
+      unless @options.quiet
         puts
         @stats.print
       end
     end
   end
+
 end
 
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/cache.rb ../rdoc-f95-20090109-1/ri/cache.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/cache.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/cache.rb	2008-03-09 01:37:54.000000000 +0900
@@ -0,0 +1,188 @@
+require 'rdoc/ri'
+
+class RDoc::RI::ClassEntry
+
+  attr_reader :name
+  attr_reader :path_names
+
+  def initialize(path_name, name, in_class)
+    @path_names = [ path_name ]
+    @name = name
+    @in_class = in_class
+    @class_methods    = []
+    @instance_methods = []
+    @inferior_classes = []
+  end
+
+  # We found this class in more tha one place, so add
+  # in the name from there.
+  def add_path(path)
+    @path_names << path
+  end
+
+  # read in our methods and any classes
+  # and modules in our namespace. Methods are
+  # stored in files called name-c|i.yaml,
+  # where the 'name' portion is the external
+  # form of the method name and the c|i is a class|instance
+  # flag
+
+  def load_from(dir)
+    Dir.foreach(dir) do |name|
+      next if name =~ /^\./
+
+      # convert from external to internal form, and
+      # extract the instance/class flag
+
+      if name =~ /^(.*?)-(c|i).yaml$/
+        external_name = $1
+        is_class_method = $2 == "c"
+        internal_name = RiWriter.external_to_internal(external_name)
+        list = is_class_method ? @class_methods : @instance_methods
+        path = File.join(dir, name)
+        list << MethodEntry.new(path, internal_name, is_class_method, self)
+      else
+        full_name = File.join(dir, name)
+        if File.directory?(full_name)
+          inf_class = @inferior_classes.find {|c| c.name == name }
+          if inf_class
+            inf_class.add_path(full_name)
+          else
+            inf_class = ClassEntry.new(full_name, name, self)
+            @inferior_classes << inf_class
+          end
+          inf_class.load_from(full_name)
+        end
+      end
+    end
+  end
+
+  # Return a list of any classes or modules that we contain
+  # that match a given string
+
+  def contained_modules_matching(name)
+    @inferior_classes.find_all {|c| c.name[name]}
+  end
+
+  def classes_and_modules
+    @inferior_classes
+  end
+
+  # Return an exact match to a particular name
+  def contained_class_named(name)
+    @inferior_classes.find {|c| c.name == name}
+  end
+
+  # return the list of local methods matching name
+  # We're split into two because we need distinct behavior
+  # when called from the _toplevel_
+  def methods_matching(name, is_class_method)
+    local_methods_matching(name, is_class_method)
+  end
+
+  # Find methods matching 'name' in ourselves and in
+  # any classes we contain
+  def recursively_find_methods_matching(name, is_class_method)
+    res = local_methods_matching(name, is_class_method)
+    @inferior_classes.each do |c|
+      res.concat(c.recursively_find_methods_matching(name, is_class_method))
+    end
+    res
+  end
+
+
+  # Return our full name
+  def full_name
+    res = @in_class.full_name
+    res << "::" unless res.empty?
+    res << @name
+  end
+
+  # Return a list of all out method names
+  def all_method_names
+    res = @class_methods.map {|m| m.full_name }
+    @instance_methods.each {|m| res << m.full_name}
+    res
+  end
+
+  private
+
+  # Return a list of all our methods matching a given string.
+  # Is +is_class_methods+ if 'nil', we don't care if the method
+  # is a class method or not, otherwise we only return
+  # those methods that match
+  def local_methods_matching(name, is_class_method)
+
+    list = case is_class_method
+           when nil then  @class_methods + @instance_methods
+           when true then @class_methods
+           when false then @instance_methods
+           else fail "Unknown is_class_method: #{is_class_method.inspect}"
+           end
+
+    list.find_all {|m| m.name;  m.name[name]}
+  end
+end
+
+##
+# A TopLevelEntry is like a class entry, but when asked to search for methods
+# searches all classes, not just itself
+
+class RDoc::RI::TopLevelEntry < RDoc::RI::ClassEntry
+  def methods_matching(name, is_class_method)
+    res = recursively_find_methods_matching(name, is_class_method)
+  end
+
+  def full_name
+      ""
+  end
+
+  def module_named(name)
+
+  end
+
+end
+
+class RDoc::RI::MethodEntry
+  attr_reader :name
+  attr_reader :path_name
+
+  def initialize(path_name, name, is_class_method, in_class)
+    @path_name = path_name
+    @name = name
+    @is_class_method = is_class_method
+    @in_class = in_class
+  end
+
+  def full_name
+    res = @in_class.full_name
+    unless res.empty?
+      if @is_class_method
+        res << "::"
+      else
+        res << "#"
+      end
+    end
+    res << @name
+  end
+end
+
+##
+# We represent everything know about all 'ri' files accessible to this program
+
+class RDoc::RI::Cache
+
+  attr_reader :toplevel
+
+  def initialize(dirs)
+    # At the top level we have a dummy module holding the
+    # overall namespace
+    @toplevel = RDoc::RI::TopLevelEntry.new('', '::', nil)
+
+    dirs.each do |dir|
+      @toplevel.load_from(dir)
+    end
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/descriptions.rb ../rdoc-f95-20090109-1/ri/descriptions.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/descriptions.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/descriptions.rb	2008-03-09 01:37:54.000000000 +0900
@@ -0,0 +1,147 @@
+require 'yaml'
+require 'rdoc/markup/fragments'
+require 'rdoc/ri'
+
+#--
+# Descriptions are created by RDoc (in ri_generator) and written out in
+# serialized form into the documentation tree. ri then reads these to generate
+# the documentation
+#++
+
+class RDoc::RI::RDoc::RI::NamedThing
+  attr_reader :name
+  def initialize(name)
+    @name = name
+  end
+  def <=>(other)
+    @name <=> other.name
+  end
+
+  def hash
+    @name.hash
+  end
+
+  def eql?(other)
+    @name.eql?(other)
+  end
+end
+
+class RDoc::RI::AliasName < RDoc::RI::RDoc::RI::NamedThing; end
+
+class RDoc::RI::Attribute < RDoc::RI::RDoc::RI::NamedThing
+  attr_reader :rw, :comment
+  def initialize(name, rw, comment)
+    super(name)
+    @rw = rw
+    @comment = comment
+  end
+end
+
+class RDoc::RI::Constant < RDoc::RI::NamedThing
+  attr_reader :value, :comment
+  def initialize(name, value, comment)
+    super(name)
+    @value = value
+    @comment = comment
+  end
+end
+
+class RDoc::RI::IncludedModule < RDoc::RI::NamedThing; end
+
+class RDoc::RI::MethodSummary < RDoc::RI::NamedThing
+  def initialize(name="")
+    super
+  end
+end
+
+class RDoc::RI::Description
+  attr_accessor :name
+  attr_accessor :full_name
+  attr_accessor :comment
+
+  def serialize
+    self.to_yaml
+  end
+
+  def self.deserialize(from)
+    YAML.load(from)
+  end
+
+  def <=>(other)
+    @name <=> other.name
+  end
+end
+
+class RDoc::RI::ModuleDescription < RDoc::RI::Description
+
+  attr_accessor :class_methods
+  attr_accessor :instance_methods
+  attr_accessor :attributes
+  attr_accessor :constants
+  attr_accessor :includes
+
+  # merge in another class desscription into this one
+  def merge_in(old)
+    merge(@class_methods, old.class_methods)
+    merge(@instance_methods, old.instance_methods)
+    merge(@attributes, old.attributes)
+    merge(@constants, old.constants)
+    merge(@includes, old.includes)
+    if @comment.nil? || @comment.empty?
+      @comment = old.comment
+    else
+      unless old.comment.nil? or old.comment.empty? then
+        @comment << RDoc::Markup::Flow::RULE.new
+        @comment.concat old.comment
+      end
+    end
+  end
+
+  def display_name
+      "Module"
+  end
+
+  # the 'ClassDescription' subclass overrides this
+  # to format up the name of a parent
+  def superclass_string
+    nil
+  end
+
+  private
+
+  def merge(into, from)
+    names = {}
+    into.each {|i| names[i.name] = i }
+    from.each {|i| names[i.name] = i }
+    into.replace(names.keys.sort.map {|n| names[n]})
+  end
+end
+
+class RDoc::RI::ClassDescription < RDoc::RI::ModuleDescription
+  attr_accessor :superclass
+
+  def display_name
+      "Class"
+  end
+
+  def superclass_string
+    if @superclass && @superclass != "Object"
+      @superclass
+    else
+      nil
+    end
+  end
+end
+
+class RDoc::RI::MethodDescription < RDoc::RI::Description
+
+  attr_accessor :is_class_method
+  attr_accessor :visibility
+  attr_accessor :block_params
+  attr_accessor :is_singleton
+  attr_accessor :aliases
+  attr_accessor :is_alias_for
+  attr_accessor :params
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/display.rb ../rdoc-f95-20090109-1/ri/display.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/display.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/display.rb	2008-03-09 01:37:54.000000000 +0900
@@ -0,0 +1,244 @@
+require 'rdoc/ri'
+
+##
+# This is a kind of 'flag' module. If you want to write your own 'ri' display
+# module (perhaps because you'r writing an IDE or somesuch beast), you simply
+# write a class which implements the various 'display' methods in
+# 'DefaultDisplay', and include the 'RiDisplay' module in that class.
+#
+# To access your class from the command line, you can do
+#
+#    ruby -r <your source file>  ../ri ....
+
+module RDoc::RI::Display
+
+  @@display_class = nil
+
+  def self.append_features(display_class)
+    @@display_class = display_class
+  end
+
+  def self.new(*args)
+    @@display_class.new(*args)
+  end
+
+end
+
+##
+# A paging display module. Uses the RDoc::RI::Formatter class to do the actual
+# presentation.
+
+class RDoc::RI::DefaultDisplay
+
+  include RDoc::RI::Display
+
+  def initialize(formatter, width, use_stdout)
+    @use_stdout = use_stdout
+    @formatter = formatter.new $stdout, width, "     "
+  end
+
+  def display_method_info(method)
+    page do
+      @formatter.draw_line(method.full_name)
+      display_params(method)
+      @formatter.draw_line
+      display_flow(method.comment)
+      if method.aliases && !method.aliases.empty?
+        @formatter.blankline
+        aka = "(also known as "
+        aka << method.aliases.map {|a| a.name }.join(", ")
+        aka << ")"
+        @formatter.wrap(aka)
+      end
+    end
+  end
+
+  def display_class_info(klass, ri_reader)
+    page do
+      superclass = klass.superclass_string
+
+      if superclass
+        superclass = " < " + superclass
+      else
+        superclass = ""
+      end
+
+      @formatter.draw_line(klass.display_name + ": " +
+                           klass.full_name + superclass)
+
+      display_flow(klass.comment)
+      @formatter.draw_line
+
+      unless klass.includes.empty?
+        @formatter.blankline
+        @formatter.display_heading("Includes:", 2, "")
+        incs = []
+        klass.includes.each do |inc|
+          inc_desc = ri_reader.find_class_by_name(inc.name)
+          if inc_desc
+            str = inc.name + "("
+            str << inc_desc.instance_methods.map{|m| m.name}.join(", ")
+            str << ")"
+            incs << str
+          else
+            incs << inc.name
+          end
+      end
+        @formatter.wrap(incs.sort.join(', '))
+      end
+
+      unless klass.constants.empty?
+        @formatter.blankline
+        @formatter.display_heading("Constants:", 2, "")
+        len = 0
+        klass.constants.each { |c| len = c.name.length if c.name.length > len }
+        len += 2
+        klass.constants.each do |c|
+          @formatter.wrap(c.value,
+                          @formatter.indent+((c.name+":").ljust(len)))
+        end
+      end
+
+      unless klass.class_methods.empty?
+        @formatter.blankline
+        @formatter.display_heading("Class methods:", 2, "")
+        @formatter.wrap(klass.class_methods.map{|m| m.name}.sort.join(', '))
+      end
+
+      unless klass.class_method_extensions.empty?
+        @formatter.blankline
+        @formatter.display_heading("Class Method Extensions:", 2, "")
+        @formatter.wrap(klass.class_method_extensions.map{|m| m.name}.sort.join(', '))
+      end
+
+      unless klass.instance_methods.empty?
+        @formatter.blankline
+        @formatter.display_heading("Instance methods:", 2, "")
+        @formatter.wrap(klass.instance_methods.map{|m| m.name}.sort.join(', '))
+      end
+
+      unless klass.instance_method_extensions.empty?
+        @formatter.blankline
+        @formatter.display_heading("Instance Method Extensions:", 2, "")
+        @formatter.wrap(klass.instance_method_extensions.map{|m| m.name}.sort.join(', '))
+      end
+
+      unless klass.attributes.empty?
+        @formatter.blankline
+        @formatter.wrap("Attributes:", "")
+        @formatter.wrap(klass.attributes.map{|a| a.name}.sort.join(', '))
+      end
+    end
+  end
+
+  ##
+  # Display a list of method names
+
+  def display_method_list(methods)
+    page do
+      @formatter.raw_print_line("More than one method matched your request. You can refine")
+      @formatter.raw_print_line("your search by asking for information on one of:\n\n")
+      @formatter.wrap(methods.map {|m| m.full_name} .join(", "))
+    end
+  end
+
+  def display_class_list(namespaces)
+    page do
+      @formatter.raw_print_line("More than one class or module matched your request. You can refine")
+      @formatter.raw_print_line("your search by asking for information on one of:\n\n")
+      @formatter.wrap(namespaces.map {|m| m.full_name}.join(", "))
+    end
+  end
+
+  def list_known_classes(classes)
+    if classes.empty?
+      warn_no_database
+    else
+      page do
+        @formatter.draw_line("Known classes and modules")
+        @formatter.blankline
+        @formatter.wrap(classes.sort.join(", "))
+      end
+    end
+  end
+
+  def list_known_names(names)
+    if names.empty?
+      warn_no_database
+    else
+      page do
+        names.each {|n| @formatter.raw_print_line(n)}
+      end
+    end
+  end
+
+  private
+
+  def page
+    if pager = setup_pager then
+      begin
+        orig_output = @formatter.output
+        @formatter.output = pager
+        yield
+      ensure
+        @formatter.output = orig_output
+        pager.close
+      end
+    else
+      yield
+    end
+  rescue Errno::EPIPE
+  end
+
+  def setup_pager
+    unless @use_stdout then
+      for pager in [ ENV['PAGER'], "less", "more", 'pager' ].compact.uniq
+        return IO.popen(pager, "w") rescue nil
+      end
+      @use_stdout = true
+      nil
+    end
+  end
+
+  def display_params(method)
+    params = method.params
+
+    if params[0,1] == "("
+      if method.is_singleton
+        params = method.full_name + params
+      else
+        params = method.name + params
+      end
+    end
+    params.split(/\n/).each do |p|
+      @formatter.wrap(p)
+      @formatter.break_to_newline
+    end
+    if method.source_path then
+      @formatter.blankline
+      @formatter.wrap("Extension from #{method.source_path}")
+    end
+  end
+
+  def display_flow(flow)
+    if !flow || flow.empty?
+      @formatter.wrap("(no description...)")
+    else
+      @formatter.display_flow(flow)
+    end
+  end
+
+  def warn_no_database
+    puts "No ri data found"
+    puts
+    puts "If you've installed Ruby yourself, you need to generate documentation using:"
+    puts
+    puts "  make install-doc"
+    puts
+    puts "from the same place you ran `make` to build ruby."
+    puts
+    puts "If you installed Ruby from a packaging system, then you may need to"
+    puts "install an additional package, or ask the packager to enable ri generation."
+  end
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/driver.rb ../rdoc-f95-20090109-1/ri/driver.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/driver.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/driver.rb	2008-03-09 01:37:54.000000000 +0900
@@ -0,0 +1,435 @@
+require 'optparse'
+require 'yaml'
+
+require 'rdoc/ri'
+require 'rdoc/ri/paths'
+require 'rdoc/ri/formatter'
+require 'rdoc/ri/display'
+require 'fileutils'
+require 'rdoc/markup'
+require 'rdoc/markup/to_flow'
+
+class RDoc::RI::Driver
+
+  def self.process_args(argv)
+    options = {}
+    options[:use_stdout] = !$stdout.tty?
+    options[:width] = 72
+    options[:formatter] = RDoc::RI::Formatter.for 'plain'
+    options[:list_classes] = false
+    options[:list_names] = false
+
+    # By default all paths are used.  If any of these are true, only those
+    # directories are used.
+    use_system = false
+    use_site = false
+    use_home = false
+    use_gems = false
+    doc_dirs = []
+
+    opts = OptionParser.new do |opt|
+      opt.program_name = File.basename $0
+      opt.version = RDoc::VERSION
+      opt.summary_indent = ' ' * 4
+
+      directories = [
+        RDoc::RI::Paths::SYSDIR,
+        RDoc::RI::Paths::SITEDIR,
+        RDoc::RI::Paths::HOMEDIR
+      ]
+
+      if RDoc::RI::Paths::GEMDIRS then
+        Gem.path.each do |dir|
+          directories << "#{dir}/doc/*/ri"
+        end
+      end
+
+      opt.banner = <<-EOT
+Usage: #{opt.program_name} [options] [names...]
+
+Where name can be:
+
+  Class | Class::method | Class#method | Class.method | method
+
+All class names may be abbreviated to their minimum unambiguous form. If a name
+is ambiguous, all valid options will be listed.
+
+The form '.' method matches either class or instance methods, while #method
+matches only instance and ::method matches only class methods.
+
+For example:
+
+    #{opt.program_name} Fil
+    #{opt.program_name} File
+    #{opt.program_name} File.new
+    #{opt.program_name} zip
+
+Note that shell quoting may be required for method names containing
+punctuation:
+
+    #{opt.program_name} 'Array.[]'
+    #{opt.program_name} compact\\!
+
+By default ri searches for documentation in the following directories:
+
+    #{directories.join "\n    "}
+
+Specifying the --system, --site, --home, --gems or --doc-dir options will
+limit ri to searching only the specified directories.
+
+Options may also be set in the 'RI' environment variable.
+      EOT
+
+      opt.separator nil
+      opt.separator "Options:"
+      opt.separator nil
+
+      opt.on("--classes", "-c",
+             "Display the names of classes and modules we",
+             "know about.") do |value|
+        options[:list_classes] = value
+      end
+
+      opt.separator nil
+
+      opt.on("--doc-dir=DIRNAME", "-d", Array,
+             "List of directories to search for",
+             "documentation. If not specified, we search",
+             "the standard rdoc/ri directories. May be",
+             "repeated.") do |value|
+        value.each do |dir|
+          unless File.directory? dir then
+            raise OptionParser::InvalidArgument, "#{dir} is not a directory"
+          end
+        end
+
+        doc_dirs.concat value
+      end
+
+      opt.separator nil
+
+      opt.on("--fmt=FORMAT", "--format=FORMAT", "-f",
+             RDoc::RI::Formatter::FORMATTERS.keys,
+             "Format to use when displaying output:",
+             "   #{RDoc::RI::Formatter.list}",
+             "Use 'bs' (backspace) with most pager",
+             "programs. To use ANSI, either disable the",
+             "pager or tell the pager to allow control",
+             "characters.") do |value|
+        options[:formatter] = RDoc::RI::Formatter.for value
+      end
+
+      opt.separator nil
+
+      unless RDoc::RI::Paths::GEMDIRS.empty? then
+        opt.on("--[no-]gems",
+               "Include documentation from RubyGems.") do |value|
+          use_gems = value
+        end
+      end
+
+      opt.separator nil
+
+      opt.on("--[no-]home",
+             "Include documentation stored in ~/.rdoc.") do |value|
+        use_home = value
+      end
+
+      opt.separator nil
+
+      opt.on("--[no-]list-names", "-l",
+             "List all the names known to RDoc, one per",
+             "line.") do |value|
+        options[:list_names] = value
+      end
+
+      opt.separator nil
+
+      opt.on("--no-pager", "-T",
+             "Send output directly to stdout.") do |value|
+        options[:use_stdout] = !value
+      end
+
+      opt.separator nil
+
+      opt.on("--[no-]site",
+             "Include documentation from libraries",
+             "installed in site_lib.") do |value|
+        use_site = value
+      end
+
+      opt.separator nil
+
+      opt.on("--[no-]system",
+             "Include documentation from Ruby's standard",
+             "library.") do |value|
+        use_system = value
+      end
+
+      opt.separator nil
+
+      opt.on("--width=WIDTH", "-w", OptionParser::DecimalInteger,
+             "Set the width of the output.") do |value|
+        options[:width] = value
+      end
+    end
+
+    argv = ENV['RI'].to_s.split.concat argv
+
+    opts.parse! argv
+
+    options[:names] = argv
+
+    options[:path] = RDoc::RI::Paths.path(use_system, use_site, use_home,
+                                          use_gems, *doc_dirs)
+    options[:raw_path] = RDoc::RI::Paths.raw_path(use_system, use_site,
+                                                  use_home, use_gems, *doc_dirs)
+
+    options
+
+  rescue OptionParser::InvalidArgument, OptionParser::InvalidOption => e
+    puts opts
+    puts
+    puts e
+    exit 1
+  end
+
+  def self.run(argv = ARGV)
+    options = process_args argv
+    ri = new options
+    ri.run
+  end
+
+  def initialize(options)
+    @names = options[:names]
+
+    @class_cache_name = 'classes'
+    @all_dirs = RDoc::RI::Paths.path(true, true, true, true)
+    @homepath = RDoc::RI::Paths.raw_path(false, false, true, false).first
+    @homepath = @homepath.sub(/\.rdoc/, '.ri')
+    @sys_dirs = RDoc::RI::Paths.raw_path(true, false, false, false)
+
+    FileUtils.mkdir_p cache_file_path unless File.directory? cache_file_path
+
+    @class_cache = nil
+
+    @display = RDoc::RI::DefaultDisplay.new(options[:formatter],
+                                            options[:width],
+                                            options[:use_stdout])
+  end
+
+  def class_cache
+    return @class_cache if @class_cache
+
+    newest = map_dirs('created.rid', :all) do |f|
+      File.mtime f if test ?f, f
+    end.max
+
+    up_to_date = (File.exist?(class_cache_file_path) and
+                  newest < File.mtime(class_cache_file_path))
+
+    @class_cache = if up_to_date then
+                     load_cache_for @class_cache_name
+                   else
+                     class_cache = {}
+
+                     classes = map_dirs('**/cdesc*.yaml', :sys) { |f| Dir[f] }
+                     populate_class_cache class_cache, classes
+
+                     classes = map_dirs('**/cdesc*.yaml') { |f| Dir[f] }
+                     warn "Updating class cache with #{classes.size} classes..."
+
+                     populate_class_cache class_cache, classes, true
+                     write_cache class_cache, class_cache_file_path
+                   end
+  end
+
+  def class_cache_file_path
+    File.join cache_file_path, @class_cache_name
+  end
+
+  def cache_file_for(klassname)
+    File.join cache_file_path, klassname.gsub(/:+/, "-")
+  end
+
+  def cache_file_path
+    File.join @homepath, 'cache'
+  end
+
+  def display_class(name)
+    klass = class_cache[name]
+    @display.display_class_info klass, class_cache
+  end
+
+  def load_cache_for(klassname)
+    path = cache_file_for klassname
+
+    if File.exist? path and
+       File.mtime(path) >= File.mtime(class_cache_file_path) then
+      File.open path, 'rb' do |fp|
+        Marshal.load fp.read
+      end
+    else
+      class_cache = nil
+
+      File.open class_cache_file_path, 'rb' do |fp|
+        class_cache = Marshal.load fp.read
+      end
+
+      klass = class_cache[klassname]
+      return nil unless klass
+
+      method_files = klass["sources"]
+      cache = {}
+
+      sys_dir = @sys_dirs.first
+      method_files.each do |f|
+        system_file = f.index(sys_dir) == 0
+        Dir[File.join(File.dirname(f), "*")].each do |yaml|
+          next unless yaml =~ /yaml$/
+          next if yaml =~ /cdesc-[^\/]+yaml$/
+          method = read_yaml yaml
+          name = method["full_name"]
+          ext_path = f
+          ext_path = "gem #{$1}" if f =~ %r%gems/[\d.]+/doc/([^/]+)%
+          method["source_path"] = ext_path unless system_file
+          cache[name] = method
+        end
+      end
+
+      write_cache cache, path
+    end
+  end
+
+  def map_dirs(file_name, system=false)
+    dirs = if system == :all then
+             @all_dirs
+           else
+             if system then
+               @sys_dirs
+             else
+               @all_dirs - @sys_dirs
+             end
+           end
+
+    dirs.map { |dir| yield File.join(dir, file_name) }.flatten.compact
+  end
+
+  def populate_class_cache(class_cache, classes, extension = false)
+    classes.each do |cdesc|
+      desc = read_yaml cdesc
+      klassname = desc["full_name"]
+
+      unless class_cache.has_key? klassname then
+        desc["display_name"] = "Class"
+        desc["sources"] = [cdesc]
+        desc["instance_method_extensions"] = []
+        desc["class_method_extensions"] = []
+        class_cache[klassname] = desc
+      else
+        klass = class_cache[klassname]
+
+        if extension then
+          desc["instance_method_extensions"] = desc.delete "instance_methods"
+          desc["class_method_extensions"] = desc.delete "class_methods"
+        end
+
+        klass.merge_enums desc
+        klass["sources"] << cdesc
+      end
+    end
+  end
+
+  def read_yaml(path)
+    YAML.load File.read(path).gsub(/ \!ruby\/(object|struct):(RDoc::RI|RI|SM).*/, '')
+  end
+
+  def run
+    if @names.empty? then
+      @display.list_known_classes class_cache.keys.sort
+    else
+      @names.each do |name|
+        case name
+        when /::|\#|\./ then
+          if class_cache.key? name then
+            display_class name
+          else
+            meth = nil
+
+            parts = name.split(/::|\#|\./)
+            meth = parts.pop unless parts.last =~ /^[A-Z]/
+            klass = parts.join '::'
+
+            cache = load_cache_for klass
+            # HACK Does not support F.n
+            abort "Nothing known about #{name}" unless cache
+            method = cache[name.gsub(/\./, '#')]
+            abort "Nothing known about #{name}" unless method
+            @display.display_method_info method
+          end
+        else
+          if class_cache.key? name then
+            display_class name
+          else
+            methods = select_methods(/^#{name}/)
+            if methods.size == 0
+              abort "Nothing known about #{name}"
+            elsif methods.size == 1
+              @display.display_method_info methods.first
+            else
+              @display.display_method_list methods
+            end
+          end
+        end
+      end
+    end
+  end
+
+  def select_methods(pattern)
+    methods = []
+    class_cache.keys.sort.each do |klass|
+      class_cache[klass]["instance_methods"].map{|h|h["name"]}.grep(pattern) do |name|
+        method = load_cache_for(klass)[klass+'#'+name]
+        methods << method if method
+      end
+      class_cache[klass]["class_methods"].map{|h|h["name"]}.grep(pattern) do |name|
+        method = load_cache_for(klass)[klass+'::'+name]
+        methods << method if method
+      end
+    end
+    methods
+  end
+
+  def write_cache(cache, path)
+    File.open path, "wb" do |cache_file|
+      Marshal.dump cache, cache_file
+    end
+
+    cache
+  end
+
+end
+
+class Hash
+  def method_missing method, *args
+    self[method.to_s]
+  end
+
+  def merge_enums(other)
+    other.each do |k,v|
+      if self[k] then
+        case v
+        when Array then
+          self[k] += v
+        when Hash then
+          self[k].merge! v
+        else
+          # do nothing
+        end
+      else
+        self[k] = v
+      end
+    end
+  end
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/formatter.rb ../rdoc-f95-20090109-1/ri/formatter.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/formatter.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/formatter.rb	2008-03-09 01:37:55.000000000 +0900
@@ -0,0 +1,603 @@
+require 'rdoc/ri'
+require 'rdoc/markup'
+
+class RDoc::RI::Formatter
+
+  attr_reader :indent
+  attr_accessor :output
+
+  FORMATTERS = { }
+
+  def self.for(name)
+    FORMATTERS[name.downcase]
+  end
+
+  def self.list
+    FORMATTERS.keys.sort.join ", "
+  end
+
+  def initialize(output, width, indent)
+    @output = output
+    @width  = width
+    @indent = indent
+  end
+
+  def draw_line(label=nil)
+    len = @width
+    len -= (label.size + 1) if label
+
+    if len > 0 then
+      @output.print '-' * len
+      if label
+        @output.print ' '
+        bold_print label
+      end
+
+      @output.puts
+    else
+      @output.print '-' * @width
+      @output.puts
+
+      @output.puts label
+    end
+  end
+
+  def wrap(txt, prefix=@indent, linelen=@width)
+    return unless txt && !txt.empty?
+
+    work = conv_markup(txt)
+    textLen = linelen - prefix.length
+    patt = Regexp.new("^(.{0,#{textLen}})[ \n]")
+    next_prefix = prefix.tr("^ ", " ")
+
+    res = []
+
+    while work.length > textLen
+      if work =~ patt
+        res << $1
+        work.slice!(0, $&.length)
+      else
+        res << work.slice!(0, textLen)
+      end
+    end
+    res << work if work.length.nonzero?
+    @output.puts(prefix + res.join("\n" + next_prefix))
+  end
+
+  def blankline
+    @output.puts
+  end
+
+  ##
+  # Called when we want to ensure a new 'wrap' starts on a newline.  Only
+  # needed for HtmlFormatter, because the rest do their own line breaking.
+
+  def break_to_newline
+  end
+
+  def bold_print(txt)
+    @output.print txt
+  end
+
+  def raw_print_line(txt)
+    @output.puts txt
+  end
+
+  ##
+  # Convert HTML entities back to ASCII
+
+  def conv_html(txt)
+    txt = txt.gsub(/&gt;/, '>')
+    txt.gsub!(/&lt;/, '<')
+    txt.gsub!(/&quot;/, '"')
+    txt.gsub!(/&amp;/, '&')
+    txt
+  end
+
+  ##
+  # Convert markup into display form
+
+  def conv_markup(txt)
+    txt = txt.gsub(%r{<tt>(.*?)</tt>}, '+\1+')
+    txt.gsub!(%r{<code>(.*?)</code>}, '+\1+')
+    txt.gsub!(%r{<b>(.*?)</b>}, '*\1*')
+    txt.gsub!(%r{<em>(.*?)</em>}, '_\1_') 
+    txt
+  end
+
+  def display_list(list)
+    case list.type
+    when :BULLET
+      prefixer = proc { |ignored| @indent + "*   " }
+
+    when :NUMBER, :UPPERALPHA, :LOWERALPHA then
+      start = case list.type
+              when :NUMBER     then 1
+              when :UPPERALPHA then 'A'
+              when :LOWERALPHA then 'a'
+              end
+
+      prefixer = proc do |ignored|
+        res = @indent + "#{start}.".ljust(4)
+        start = start.succ
+        res
+      end
+
+    when :LABELED, :NOTE then
+      longest = 0
+
+      list.contents.each do |item|
+        if RDoc::Markup::Flow::LI === item and item.label.length > longest then
+          longest = item.label.length
+        end
+      end
+
+      longest += 1
+
+      prefixer = proc { |li| @indent + li.label.ljust(longest) }
+
+    else
+      raise ArgumentError, "unknown list type #{list.type}"
+    end
+
+    list.contents.each do |item|
+      if RDoc::Markup::Flow::LI === item then
+        prefix = prefixer.call item
+        display_flow_item item, prefix
+      else
+        display_flow_item item
+      end
+    end
+  end
+
+  def display_flow_item(item, prefix = @indent)
+    case item
+    when RDoc::Markup::Flow::P, RDoc::Markup::Flow::LI
+      wrap(conv_html(item.body), prefix)
+      blankline
+
+    when RDoc::Markup::Flow::LIST
+      display_list(item)
+
+    when RDoc::Markup::Flow::VERB
+      display_verbatim_flow_item(item, @indent)
+
+    when RDoc::Markup::Flow::H
+      display_heading(conv_html(item.text), item.level, @indent)
+
+    when RDoc::Markup::Flow::RULE
+      draw_line
+
+    else
+      raise RDoc::Error, "Unknown flow element: #{item.class}"
+    end
+  end
+
+  def display_verbatim_flow_item(item, prefix=@indent)
+    item.body.split(/\n/).each do |line|
+      @output.print @indent, conv_html(line), "\n"
+    end
+    blankline
+  end
+
+  def display_heading(text, level, indent)
+    text = strip_attributes text
+
+    case level
+    when 1 then
+      ul = "=" * text.length
+      @output.puts
+      @output.puts text.upcase
+      @output.puts ul
+
+    when 2 then
+      ul = "-" * text.length
+      @output.puts
+      @output.puts text
+      @output.puts ul
+    else
+      @output.print indent, text, "\n"
+    end
+
+    @output.puts
+  end
+
+  def display_flow(flow)
+    flow.each do |f|
+      display_flow_item(f)
+    end
+  end
+
+  def strip_attributes(text)
+    text.gsub(/(<\/?(?:b|code|em|i|tt)>)/, '')
+  end
+
+end
+
+##
+# Handle text with attributes. We're a base class: there are different
+# presentation classes (one, for example, uses overstrikes to handle bold and
+# underlining, while another using ANSI escape sequences.
+
+class RDoc::RI::AttributeFormatter < RDoc::RI::Formatter
+
+  BOLD      = 1
+  ITALIC    = 2
+  CODE      = 4
+
+  ATTR_MAP = {
+    "b"    => BOLD,
+    "code" => CODE,
+    "em"   => ITALIC,
+    "i"    => ITALIC,
+    "tt"   => CODE
+  }
+
+  AttrChar = Struct.new :char, :attr
+
+  class AttributeString
+    attr_reader :txt
+
+    def initialize
+      @txt = []
+      @optr = 0
+    end
+
+    def <<(char)
+      @txt << char
+    end
+
+    def empty?
+      @optr >= @txt.length
+    end
+
+    # accept non space, then all following spaces
+    def next_word
+      start = @optr
+      len = @txt.length
+
+      while @optr < len && @txt[@optr].char != " "
+        @optr += 1
+      end
+
+      while @optr < len && @txt[@optr].char == " "
+        @optr += 1
+      end
+
+      @txt[start...@optr]
+    end
+  end
+
+  ##
+  # Overrides base class.  Looks for <tt>...</tt> etc sequences and generates
+  # an array of AttrChars.  This array is then used as the basis for the
+  # split.
+
+  def wrap(txt, prefix=@indent, linelen=@width)
+    return unless txt && !txt.empty?
+
+    txt = add_attributes_to(txt)
+    next_prefix = prefix.tr("^ ", " ")
+    linelen -= prefix.size
+
+    line = []
+
+    until txt.empty?
+      word = txt.next_word
+      if word.size + line.size > linelen
+        write_attribute_text(prefix, line)
+        prefix = next_prefix
+        line = []
+      end
+      line.concat(word)
+    end
+
+    write_attribute_text(prefix, line) if line.length > 0
+  end
+
+  protected
+
+  def write_attribute_text(prefix, line)
+    @output.print prefix
+    line.each do |achar|
+      @output.print achar.char
+    end
+    @output.puts
+  end
+
+  def bold_print(txt)
+    @output.print txt
+  end
+
+  private
+
+  def add_attributes_to(txt)
+    tokens = txt.split(%r{(</?(?:b|code|em|i|tt)>)})
+    text = AttributeString.new
+    attributes = 0
+    tokens.each do |tok|
+      case tok
+      when %r{^</(\w+)>$} then attributes &= ~(ATTR_MAP[$1]||0)
+      when %r{^<(\w+)>$}  then attributes  |= (ATTR_MAP[$1]||0)
+      else
+        tok.split(//).each {|ch| text << AttrChar.new(ch, attributes)}
+      end
+    end
+    text
+  end
+
+end
+
+##
+# This formatter generates overstrike-style formatting, which works with
+# pagers such as man and less.
+
+class RDoc::RI::OverstrikeFormatter < RDoc::RI::AttributeFormatter
+
+  BS = "\C-h"
+
+  def write_attribute_text(prefix, line)
+    @output.print prefix
+
+    line.each do |achar|
+      attr = achar.attr
+      @output.print "_", BS if (attr & (ITALIC + CODE)) != 0
+      @output.print achar.char, BS if (attr & BOLD) != 0
+      @output.print achar.char
+    end
+
+    @output.puts
+  end
+
+  ##
+  # Draw a string in bold
+
+  def bold_print(text)
+    text.split(//).each do |ch|
+      @output.print ch, BS, ch
+    end
+  end
+
+end
+
+##
+# This formatter uses ANSI escape sequences to colorize stuff works with
+# pagers such as man and less.
+
+class RDoc::RI::AnsiFormatter < RDoc::RI::AttributeFormatter
+
+  def initialize(*args)
+    super
+    @output.print "\033[0m"
+  end
+
+  def write_attribute_text(prefix, line)
+    @output.print prefix
+    curr_attr = 0
+    line.each do |achar|
+      attr = achar.attr
+      if achar.attr != curr_attr
+        update_attributes(achar.attr)
+        curr_attr = achar.attr
+      end
+      @output.print achar.char
+    end
+    update_attributes(0) unless curr_attr.zero?
+    @output.puts
+  end
+
+  def bold_print(txt)
+    @output.print "\033[1m#{txt}\033[m"
+  end
+
+  HEADINGS = {
+    1 => ["\033[1;32m", "\033[m"],
+    2 => ["\033[4;32m", "\033[m"],
+    3 => ["\033[32m",   "\033[m"],
+  }
+
+  def display_heading(text, level, indent)
+    level = 3 if level > 3
+    heading = HEADINGS[level]
+    @output.print indent
+    @output.print heading[0]
+    @output.print strip_attributes(text)
+    @output.puts heading[1]
+  end
+
+  private
+
+  ATTR_MAP = {
+    BOLD   => "1",
+    ITALIC => "33",
+    CODE   => "36"
+  }
+
+  def update_attributes(attr)
+    str = "\033["
+    for quality in [ BOLD, ITALIC, CODE]
+      unless (attr & quality).zero?
+        str << ATTR_MAP[quality]
+      end
+    end
+    @output.print str, "m"
+  end
+
+end
+
+##
+# This formatter uses HTML.
+
+class RDoc::RI::HtmlFormatter < RDoc::RI::AttributeFormatter
+
+  def write_attribute_text(prefix, line)
+    curr_attr = 0
+    line.each do |achar|
+      attr = achar.attr
+      if achar.attr != curr_attr
+        update_attributes(curr_attr, achar.attr)
+        curr_attr = achar.attr
+      end
+      @output.print(escape(achar.char))
+    end
+    update_attributes(curr_attr, 0) unless curr_attr.zero?
+  end
+
+  def draw_line(label=nil)
+    if label != nil
+      bold_print(label)
+    end
+    @output.puts("<hr>")
+  end
+
+  def bold_print(txt)
+    tag("b") { txt }
+  end
+
+  def blankline()
+    @output.puts("<p>")
+  end
+
+  def break_to_newline
+    @output.puts("<br>")
+  end
+
+  def display_heading(text, level, indent)
+    level = 4 if level > 4
+    tag("h#{level}") { text }
+    @output.puts
+  end
+
+  def display_list(list)
+    case list.type
+    when :BULLET then
+      list_type = "ul"
+      prefixer = proc { |ignored| "<li>" }
+
+    when :NUMBER, :UPPERALPHA, :LOWERALPHA then
+      list_type = "ol"
+      prefixer = proc { |ignored| "<li>" }
+
+    when :LABELED then
+      list_type = "dl"
+      prefixer = proc do |li|
+          "<dt><b>" + escape(li.label) + "</b><dd>"
+      end
+
+    when :NOTE then
+      list_type = "table"
+      prefixer = proc do |li|
+          %{<tr valign="top"><td>#{li.label.gsub(/ /, '&nbsp;')}</td><td>}
+      end
+    else
+      fail "unknown list type"
+    end
+
+    @output.print "<#{list_type}>"
+    list.contents.each do |item|
+      if item.kind_of? RDoc::Markup::Flow::LI
+        prefix = prefixer.call(item)
+        @output.print prefix
+        display_flow_item(item, prefix)
+      else
+        display_flow_item(item)
+      end
+    end
+    @output.print "</#{list_type}>"
+  end
+
+  def display_verbatim_flow_item(item, prefix=@indent)
+    @output.print("<pre>")
+    item.body.split(/\n/).each do |line|
+      @output.puts conv_html(line)
+    end
+    @output.puts("</pre>")
+  end
+
+  private
+
+  ATTR_MAP = {
+    BOLD   => "b>",
+    ITALIC => "i>",
+    CODE   => "tt>"
+  }
+
+  def update_attributes(current, wanted)
+    str = ""
+    # first turn off unwanted ones
+    off = current & ~wanted
+    for quality in [ BOLD, ITALIC, CODE]
+      if (off & quality) > 0
+        str << "</" + ATTR_MAP[quality]
+      end
+    end
+
+    # now turn on wanted
+    for quality in [ BOLD, ITALIC, CODE]
+      unless (wanted & quality).zero?
+        str << "<" << ATTR_MAP[quality]
+      end
+    end
+    @output.print str
+  end
+
+  def tag(code)
+    @output.print("<#{code}>")
+    @output.print(yield)
+    @output.print("</#{code}>")
+  end
+
+  def escape(str)
+    str = str.gsub(/&/n, '&amp;')
+    str.gsub!(/\"/n, '&quot;')
+    str.gsub!(/>/n, '&gt;')
+    str.gsub!(/</n, '&lt;')
+    str
+  end
+
+end
+
+##
+# This formatter reduces extra lines for a simpler output.  It improves way
+# output looks for tools like IRC bots.
+
+class RDoc::RI::SimpleFormatter < RDoc::RI::Formatter
+
+  ##
+  # No extra blank lines
+
+  def blankline
+  end
+
+  ##
+  # Display labels only, no lines
+
+  def draw_line(label=nil)
+    unless label.nil? then
+      bold_print(label)
+      @output.puts
+    end
+  end
+
+  ##
+  # Place heading level indicators inline with heading.
+
+  def display_heading(text, level, indent)
+    text = strip_attributes(text)
+    case level
+    when 1
+      @output.puts "= " + text.upcase
+    when 2
+      @output.puts "-- " + text
+    else
+      @output.print indent, text, "\n"
+    end
+  end
+
+end
+
+RDoc::RI::Formatter::FORMATTERS['plain']  = RDoc::RI::Formatter
+RDoc::RI::Formatter::FORMATTERS['simple'] = RDoc::RI::SimpleFormatter
+RDoc::RI::Formatter::FORMATTERS['bs']     = RDoc::RI::OverstrikeFormatter
+RDoc::RI::Formatter::FORMATTERS['ansi']   = RDoc::RI::AnsiFormatter
+RDoc::RI::Formatter::FORMATTERS['html']   = RDoc::RI::HtmlFormatter
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/paths.rb ../rdoc-f95-20090109-1/ri/paths.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/paths.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/paths.rb	2008-03-09 03:44:03.000000000 +0900
@@ -0,0 +1,105 @@
+require 'rdoc/ri'
+
+##
+# Encapsulate all the strangeness to do with finding out where to find RDoc
+# files
+#
+# We basically deal with three directories:
+#
+# 1. The 'system' documentation directory, which holds the documentation
+#    distributed with Ruby, and which is managed by the Ruby install process
+# 2. The 'site' directory, which contains site-wide documentation added
+#    locally.
+# 3. The 'user' documentation directory, stored under the user's own home
+#    directory.
+#
+# There's contention about all this, but for now:
+#
+# system:: $datadir/ri/<ver>/system/...
+# site::   $datadir/ri/<ver>/site/...
+# user::   ~/.rdoc
+
+module RDoc::RI::Paths
+
+  #:stopdoc:
+  require 'rbconfig'
+
+  DOC_DIR  = "doc/rdoc"
+
+  version = Config::CONFIG['ruby_version']
+#  version = RbConfig::CONFIG['ruby_version']  # RbConfig is invalid in Ruby 1.8.2
+
+  base    = File.join(Config::CONFIG['datadir'], "ri", version)
+#  base    = File.join(RbConfig::CONFIG['datadir'], "ri", version)  # RbConfig is invalid in Ruby 1.8.2
+
+  SYSDIR  = File.join(base, "system")
+  SITEDIR = File.join(base, "site")
+  homedir = ENV['HOME'] || ENV['USERPROFILE'] || ENV['HOMEPATH']
+
+  if homedir then
+    HOMEDIR = File.join(homedir, ".rdoc")
+  else
+    HOMEDIR = nil
+  end
+
+  # This is the search path for 'ri'
+  PATH = [ SYSDIR, SITEDIR, HOMEDIR ].find_all {|p| p && File.directory?(p)}
+
+  begin
+    require 'rubygems' unless defined?(Gem) and defined?(Gem::Enable) and
+                              Gem::Enable
+
+    # HACK dup'd from Gem.latest_partials and friends
+    all_paths = []
+
+    all_paths = Gem.path.map do |dir|
+      Dir[File.join(dir, 'doc', '*', 'ri')]
+    end.flatten
+
+    ri_paths = {}
+
+    all_paths.each do |dir|
+      base = File.basename File.dirname(dir)
+      if base =~ /(.*)-((\d+\.)*\d+)/ then
+        name, version = $1, $2
+        ver = Gem::Version.new version
+        if ri_paths[name].nil? or ver > ri_paths[name][0] then
+          ri_paths[name] = [ver, dir]
+        end
+      end
+    end
+
+    GEMDIRS = ri_paths.map { |k,v| v.last }.sort
+    GEMDIRS.each { |dir| PATH << dir }
+  rescue LoadError
+    GEMDIRS = []
+  end
+
+  # Returns the selected documentation directories as an Array, or PATH if no
+  # overriding directories were given.
+
+  def self.path(use_system, use_site, use_home, use_gems, *extra_dirs)
+    path = raw_path(use_system, use_site, use_home, use_gems, *extra_dirs)
+    return path.select { |directory| File.directory? directory }
+  end
+
+  # Returns the selected documentation directories including nonexistent
+  # directories.  Used to print out what paths were searched if no ri was
+  # found.
+
+  def self.raw_path(use_system, use_site, use_home, use_gems, *extra_dirs)
+    return PATH unless use_system or use_site or use_home or use_gems or
+                       not extra_dirs.empty?
+
+    path = []
+    path << extra_dirs unless extra_dirs.empty?
+    path << SYSDIR if use_system
+    path << SITEDIR if use_site
+    path << HOMEDIR if use_home
+    path << GEMDIRS if use_gems
+
+    return path.flatten.compact
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/reader.rb ../rdoc-f95-20090109-1/ri/reader.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/reader.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/reader.rb	2008-03-09 01:37:55.000000000 +0900
@@ -0,0 +1,106 @@
+require 'rdoc/ri'
+require 'rdoc/ri/descriptions'
+require 'rdoc/ri/writer'
+require 'rdoc/markup/to_flow'
+
+class RDoc::RI::Reader
+
+  def initialize(ri_cache)
+    @cache = ri_cache
+  end
+
+  def top_level_namespace
+    [ @cache.toplevel ]
+  end
+
+  def lookup_namespace_in(target, namespaces)
+    result = []
+    for n in namespaces
+      result.concat(n.contained_modules_matching(target))
+    end
+    result
+  end
+
+  def find_class_by_name(full_name)
+    names = full_name.split(/::/)
+    ns = @cache.toplevel
+    for name in names
+      ns = ns.contained_class_named(name)
+      return nil if ns.nil?
+    end
+    get_class(ns)
+  end
+
+  def find_methods(name, is_class_method, namespaces)
+    result = []
+    namespaces.each do |ns|
+      result.concat ns.methods_matching(name, is_class_method)
+    end
+    result
+  end
+
+  ##
+  # Return the MethodDescription for a given MethodEntry by deserializing the
+  # YAML
+
+  def get_method(method_entry)
+    path = method_entry.path_name
+    File.open(path) { |f| RI::Description.deserialize(f) }
+  end
+
+  ##
+  # Return a class description
+
+  def get_class(class_entry)
+    result = nil
+    for path in class_entry.path_names
+      path = RiWriter.class_desc_path(path, class_entry)
+      desc = File.open(path) {|f| RI::Description.deserialize(f) }
+      if result
+        result.merge_in(desc)
+      else
+        result = desc
+      end
+    end
+    result
+  end
+
+  ##
+  # Return the names of all classes and modules
+
+  def full_class_names
+    res = []
+    find_classes_in(res, @cache.toplevel)
+  end
+
+  ##
+  # Return a list of all classes, modules, and methods
+
+  def all_names
+    res = []
+    find_names_in(res, @cache.toplevel)
+  end
+
+  private
+
+  def find_classes_in(res, klass)
+    classes = klass.classes_and_modules
+    for c in classes
+      res << c.full_name
+      find_classes_in(res, c)
+    end
+    res
+  end
+
+  def find_names_in(res, klass)
+    classes = klass.classes_and_modules
+    for c in classes
+      res << c.full_name
+      res.concat c.all_method_names
+      find_names_in(res, c)
+    end
+    res
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/ri_cache.rb ../rdoc-f95-20090109-1/ri/ri_cache.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/ri_cache.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/ri_cache.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,187 +0,0 @@
-module RI
-
-  class ClassEntry
-
-    attr_reader :name
-    attr_reader :path_names
-    
-    def initialize(path_name, name, in_class)
-      @path_names = [ path_name ]
-      @name = name
-      @in_class = in_class
-      @class_methods    = []
-      @instance_methods = []
-      @inferior_classes = []
-    end
-
-    # We found this class in more tha one place, so add
-    # in the name from there.
-    def add_path(path)
-      @path_names << path
-    end
-
-    # read in our methods and any classes
-    # and modules in our namespace. Methods are
-    # stored in files called name-c|i.yaml,
-    # where the 'name' portion is the external
-    # form of the method name and the c|i is a class|instance
-    # flag
-
-    def load_from(dir)
-      Dir.foreach(dir) do |name|
-        next if name =~ /^\./
-
-        # convert from external to internal form, and
-        # extract the instance/class flag
-
-        if name =~ /^(.*?)-(c|i).yaml$/
-          external_name = $1
-          is_class_method = $2 == "c"
-          internal_name = RiWriter.external_to_internal(external_name)
-          list = is_class_method ? @class_methods : @instance_methods
-          path = File.join(dir, name)
-          list << MethodEntry.new(path, internal_name, is_class_method, self)
-        else
-          full_name = File.join(dir, name)
-          if File.directory?(full_name)
-            inf_class = @inferior_classes.find {|c| c.name == name }
-            if inf_class
-              inf_class.add_path(full_name)
-            else
-              inf_class = ClassEntry.new(full_name, name, self)
-              @inferior_classes << inf_class
-            end
-            inf_class.load_from(full_name)
-          end
-        end
-      end
-    end
-
-    # Return a list of any classes or modules that we contain
-    # that match a given string
-
-    def contained_modules_matching(name)
-      @inferior_classes.find_all {|c| c.name[name]}
-    end
-
-    def classes_and_modules
-      @inferior_classes
-    end
-
-    # Return an exact match to a particular name
-    def contained_class_named(name)
-      @inferior_classes.find {|c| c.name == name}
-    end
-
-    # return the list of local methods matching name
-    # We're split into two because we need distinct behavior
-    # when called from the _toplevel_
-    def methods_matching(name, is_class_method)
-      local_methods_matching(name, is_class_method)
-    end
-
-    # Find methods matching 'name' in ourselves and in
-    # any classes we contain
-    def recursively_find_methods_matching(name, is_class_method)
-      res = local_methods_matching(name, is_class_method)
-      @inferior_classes.each do |c|
-        res.concat(c.recursively_find_methods_matching(name, is_class_method))
-      end
-      res
-    end
-
-
-    # Return our full name
-    def full_name
-      res = @in_class.full_name
-      res << "::" unless res.empty?
-      res << @name
-    end
-
-    # Return a list of all out method names
-    def all_method_names
-      res = @class_methods.map {|m| m.full_name }
-      @instance_methods.each {|m| res << m.full_name}
-      res
-    end
-
-    private
-
-    # Return a list of all our methods matching a given string.
-    # Is +is_class_methods+ if 'nil', we don't care if the method
-    # is a class method or not, otherwise we only return
-    # those methods that match
-    def local_methods_matching(name, is_class_method)
-
-      list = case is_class_method
-             when nil then  @class_methods + @instance_methods
-             when true then @class_methods
-             when false then @instance_methods
-             else fail "Unknown is_class_method: #{is_class_method.inspect}"
-             end
-
-      list.find_all {|m| m.name;  m.name[name]}
-    end
-  end
-
-  # A TopLevelEntry is like a class entry, but when asked to search
-  # for methods searches all classes, not just itself
-
-  class TopLevelEntry < ClassEntry
-    def methods_matching(name, is_class_method)
-      res = recursively_find_methods_matching(name, is_class_method)
-    end
-
-    def full_name
-      ""
-    end
-
-    def module_named(name)
-      
-    end
-
-  end
-
-  class MethodEntry
-    attr_reader :name
-    attr_reader :path_name
-
-    def initialize(path_name, name, is_class_method, in_class)
-      @path_name = path_name
-      @name = name
-      @is_class_method = is_class_method
-      @in_class = in_class
-    end
-
-    def full_name
-      res = @in_class.full_name
-      unless res.empty?
-        if @is_class_method
-          res << "::"
-        else
-          res << "#"
-        end
-      end
-      res << @name
-    end
-  end
-
-  # We represent everything know about all 'ri' files
-  # accessible to this program
-
-  class RiCache
-
-    attr_reader :toplevel
-
-    def initialize(dirs)
-      # At the top level we have a dummy module holding the
-      # overall namespace
-      @toplevel = TopLevelEntry.new('', '::', nil)
-
-      dirs.each do |dir|
-        @toplevel.load_from(dir)
-      end
-    end
-
-  end
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/ri_descriptions.rb ../rdoc-f95-20090109-1/ri/ri_descriptions.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/ri_descriptions.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/ri_descriptions.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,154 +0,0 @@
-require 'yaml'
-require 'rdoc/markup/simple_markup/fragments'
-
-# Descriptions are created by RDoc (in ri_generator) and
-# written out in serialized form into the documentation
-# tree. ri then reads these to generate the documentation
-
-module RI
-  class NamedThing
-    attr_reader :name
-    def initialize(name)
-      @name = name
-    end
-    def <=>(other)
-      @name <=> other.name
-    end
-
-    def hash
-      @name.hash
-    end
-
-    def eql?(other)
-      @name.eql?(other)
-    end
-  end
-
-#  Alias          = Struct.new(:old_name, :new_name)
-
-  class AliasName < NamedThing
-  end
-
-  class Attribute < NamedThing
-    attr_reader :rw, :comment
-    def initialize(name, rw, comment)
-      super(name)
-      @rw = rw
-      @comment = comment
-    end
-  end
-
-  class Constant < NamedThing
-    attr_reader :value, :comment
-    def initialize(name, value, comment)
-      super(name)
-      @value = value
-      @comment = comment
-    end
-  end
-
-  class IncludedModule < NamedThing
-  end
-
-
-  class MethodSummary < NamedThing
-    def initialize(name="")
-      super
-    end
-  end
-
-
-
-  class Description
-    attr_accessor :name
-    attr_accessor :full_name
-    attr_accessor :comment
-
-    def serialize
-      self.to_yaml
-    end
-
-    def Description.deserialize(from)
-      YAML.load(from)
-    end
-
-    def <=>(other)
-      @name <=> other.name
-    end
-  end
-  
-  class ModuleDescription < Description
-    
-    attr_accessor :class_methods
-    attr_accessor :instance_methods
-    attr_accessor :attributes
-    attr_accessor :constants
-    attr_accessor :includes
-
-    # merge in another class desscription into this one
-    def merge_in(old)
-      merge(@class_methods, old.class_methods)
-      merge(@instance_methods, old.instance_methods)
-      merge(@attributes, old.attributes)
-      merge(@constants, old.constants)
-      merge(@includes, old.includes)
-      if @comment.nil? || @comment.empty?
-        @comment = old.comment
-      else
-        unless old.comment.nil? or old.comment.empty? then
-          @comment << SM::Flow::RULE.new
-          @comment.concat old.comment
-        end
-      end
-    end
-
-    def display_name
-      "Module"
-    end
-
-    # the 'ClassDescription' subclass overrides this
-    # to format up the name of a parent
-    def superclass_string
-      nil
-    end
-
-    private
-
-    def merge(into, from)
-      names = {}
-      into.each {|i| names[i.name] = i }
-      from.each {|i| names[i.name] = i }
-      into.replace(names.keys.sort.map {|n| names[n]})
-    end
-  end
-  
-  class ClassDescription < ModuleDescription
-    attr_accessor :superclass
-
-    def display_name
-      "Class"
-    end
-
-    def superclass_string
-      if @superclass && @superclass != "Object"
-        @superclass
-      else
-        nil
-      end
-    end
-  end
-
-
-  class MethodDescription < Description
-    
-    attr_accessor :is_class_method
-    attr_accessor :visibility
-    attr_accessor :block_params
-    attr_accessor :is_singleton
-    attr_accessor :aliases
-    attr_accessor :is_alias_for
-    attr_accessor :params
-
-  end
-  
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/ri_display.rb ../rdoc-f95-20090109-1/ri/ri_display.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/ri_display.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/ri_display.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,255 +0,0 @@
-require 'rdoc/ri/ri_util'
-require 'rdoc/ri/ri_formatter'
-require 'rdoc/ri/ri_options'
-
-
-# This is a kind of 'flag' module. If you want to write your
-# own 'ri' display module (perhaps because you'r writing
-# an IDE or somesuch beast), you simply write a class
-# which implements the various 'display' methods in 'DefaultDisplay',
-# and include the 'RiDisplay' module in that class. 
-#
-# To access your class from the command line, you can do
-#
-#    ruby -r <your source file>  ../ri ....
-#
-# If folks _really_ want to do this from the command line,
-# I'll build an option in
-
-module RiDisplay
-  @@display_class = nil
-
-  def RiDisplay.append_features(display_class)
-    @@display_class = display_class
-  end
-
-  def RiDisplay.new(*args)
-    @@display_class.new(*args)
-  end
-end
-
-######################################################################
-#
-# A paging display module. Uses the ri_formatter class to do the
-# actual presentation
-#
-
-class  DefaultDisplay
-
-  include RiDisplay
-
-  def initialize(options)
-    @options = options
-    @formatter = @options.formatter.new(@options, "     ")
-  end    
-  
-  
-  ######################################################################
-  
-  def display_usage
-    page do
-      RI::Options::OptionList.usage(short_form=true)
-    end
-  end
-
-
-  ######################################################################
-  
-  def display_method_info(method)
-    page do
-      @formatter.draw_line(method.full_name)
-      display_params(method)
-      @formatter.draw_line
-      display_flow(method.comment)
-      if method.aliases && !method.aliases.empty?
-        @formatter.blankline
-        aka = "(also known as "
-        aka << method.aliases.map {|a| a.name }.join(", ") 
-        aka << ")"
-        @formatter.wrap(aka)
-      end
-    end
-  end
-  
-  ######################################################################
-  
-  def display_class_info(klass, ri_reader)
-    page do 
-      superclass = klass.superclass_string
-      
-      if superclass
-        superclass = " < " + superclass
-      else
-        superclass = ""
-      end
-      
-      @formatter.draw_line(klass.display_name + ": " +
-                           klass.full_name + superclass)
-      
-      display_flow(klass.comment)
-      @formatter.draw_line 
-    
-      unless klass.includes.empty?
-        @formatter.blankline
-        @formatter.display_heading("Includes:", 2, "")
-        incs = []
-        klass.includes.each do |inc|
-          inc_desc = ri_reader.find_class_by_name(inc.name)
-          if inc_desc
-            str = inc.name + "("
-            str << inc_desc.instance_methods.map{|m| m.name}.join(", ")
-            str << ")"
-            incs << str
-          else
-            incs << inc.name
-          end
-      end
-        @formatter.wrap(incs.sort.join(', '))
-      end
-      
-      unless klass.constants.empty?
-        @formatter.blankline
-        @formatter.display_heading("Constants:", 2, "")
-        len = 0
-        klass.constants.each { |c| len = c.name.length if c.name.length > len }
-        len += 2
-        klass.constants.each do |c|
-          @formatter.wrap(c.value, 
-                          @formatter.indent+((c.name+":").ljust(len)))
-        end 
-      end
-      
-      unless klass.class_methods.empty?
-        @formatter.blankline
-        @formatter.display_heading("Class methods:", 2, "")
-        @formatter.wrap(klass.class_methods.map{|m| m.name}.sort.join(', '))
-      end
-      
-      unless klass.instance_methods.empty?
-        @formatter.blankline
-        @formatter.display_heading("Instance methods:", 2, "")
-        @formatter.wrap(klass.instance_methods.map{|m| m.name}.sort.join(', '))
-      end
-      
-      unless klass.attributes.empty?
-        @formatter.blankline
-        @formatter.wrap("Attributes:", "")
-        @formatter.wrap(klass.attributes.map{|a| a.name}.sort.join(', '))
-      end
-    end
-  end
-  
-  ######################################################################
-  
-  # Display a list of method names
-  
-  def display_method_list(methods)
-    page do
-      puts "More than one method matched your request. You can refine"
-      puts "your search by asking for information on one of:\n\n"
-      @formatter.wrap(methods.map {|m| m.full_name} .join(", "))
-    end
-  end
-  
-  ######################################################################
-  
-  def display_class_list(namespaces)
-    page do
-      puts "More than one class or module matched your request. You can refine"
-      puts "your search by asking for information on one of:\n\n"
-      @formatter.wrap(namespaces.map {|m| m.full_name}.join(", "))
-    end
-  end
-  
-  ######################################################################
-
-  def list_known_classes(classes)
-    if classes.empty?
-      warn_no_database
-    else
-      page do 
-        @formatter.draw_line("Known classes and modules")
-        @formatter.blankline
-        @formatter.wrap(classes.sort.join(", "))
-      end
-    end
-  end
-
-  ######################################################################
-
-  def list_known_names(names)
-    if names.empty?
-      warn_no_database
-    else
-      page do 
-        names.each {|n| @formatter.raw_print_line(n)}
-      end
-    end
-  end
-
-  ######################################################################
-
-  private
-
-  ######################################################################
-
-  def page
-    return yield unless pager = setup_pager
-    begin
-      save_stdout = STDOUT.clone
-      STDOUT.reopen(pager)
-      yield
-    ensure
-      STDOUT.reopen(save_stdout)
-      save_stdout.close
-      pager.close
-    end
-  end
-
-  ######################################################################
-
-  def setup_pager
-    unless @options.use_stdout
-      for pager in [ ENV['PAGER'], "less", "more", 'pager' ].compact.uniq
-        return IO.popen(pager, "w") rescue nil
-      end
-      @options.use_stdout = true
-      nil
-    end
-  end
-
-  ######################################################################
-  
-  def display_params(method)
-
-    params = method.params
-
-    if params[0,1] == "("
-      if method.is_singleton
-        params = method.full_name + params
-      else
-        params = method.name + params
-      end
-    end
-    params.split(/\n/).each do |p|
-      @formatter.wrap(p) 
-      @formatter.break_to_newline
-    end
-  end
-  ######################################################################
-  
-  def display_flow(flow)
-    if !flow || flow.empty?
-      @formatter.wrap("(no description...)")
-    else
-      @formatter.display_flow(flow)
-    end
-  end
-
-  ######################################################################
-  
-  def warn_no_database
-    puts "Before using ri, you need to generate documentation"
-    puts "using 'rdoc' with the --ri option"
-  end
-end  # class RiDisplay
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/ri_driver.rb ../rdoc-f95-20090109-1/ri/ri_driver.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/ri_driver.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/ri_driver.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,143 +0,0 @@
-require 'rdoc/ri/ri_paths'
-require 'rdoc/usage'
-require 'rdoc/ri/ri_cache'
-require 'rdoc/ri/ri_util'
-require 'rdoc/ri/ri_reader'
-require 'rdoc/ri/ri_formatter'
-require 'rdoc/ri/ri_options'
-
-
-######################################################################
-
-class  RiDriver
-
-  def initialize
-    @options = RI::Options.instance
-
-    args = ARGV
-    if ENV["RI"]
-      args = ENV["RI"].split.concat(ARGV)
-    end
-
-    @options.parse(args)
-
-    path = @options.path
-    report_missing_documentation @options.raw_path if path.empty?
-
-    @ri_reader = RI::RiReader.new(RI::RiCache.new(path))
-    @display   = @options.displayer
-  end
-  
-  # Couldn't find documentation in +path+, so tell the user what to do
-
-  def report_missing_documentation(path)
-    STDERR.puts "No ri documentation found in:"
-    path.each do |d|
-      STDERR.puts "     #{d}"
-    end
-    STDERR.puts "\nWas rdoc run to create documentation?\n\n"
-    RDoc::usage("Installing Documentation")
-  end
-  
-  ######################################################################
-  
-  # If the list of matching methods contains exactly one entry, or
-  # if it contains an entry that exactly matches the requested method,
-  # then display that entry, otherwise display the list of
-  # matching method names
-  
-  def report_method_stuff(requested_method_name, methods)
-    if methods.size == 1
-      method = @ri_reader.get_method(methods[0])
-      @display.display_method_info(method)
-    else
-      entries = methods.find_all {|m| m.name == requested_method_name}
-      if entries.size == 1
-        method = @ri_reader.get_method(entries[0])
-        @display.display_method_info(method)
-      else
-        @display.display_method_list(methods)
-      end
-    end
-  end
-  
-  ######################################################################
-  
-  def report_class_stuff(namespaces)
-    if namespaces.size == 1
-      klass = @ri_reader.get_class(namespaces[0])
-      @display.display_class_info(klass, @ri_reader)
-    else 
-#      entries = namespaces.find_all {|m| m.full_name == requested_class_name}
-#      if entries.size == 1
-#        klass = @ri_reader.get_class(entries[0])
-#        @display.display_class_info(klass, @ri_reader)
-#      else
-        @display.display_class_list(namespaces)
-#      end
-    end
-  end
-  
-  ######################################################################
-  
-  
-  def get_info_for(arg)
-    desc = NameDescriptor.new(arg)
-
-    namespaces = @ri_reader.top_level_namespace
-    
-    for class_name in desc.class_names
-      namespaces = @ri_reader.lookup_namespace_in(class_name, namespaces)
-      if namespaces.empty?
-        raise RiError.new("Nothing known about #{arg}")
-      end
-    end
-
-    # at this point, if we have multiple possible namespaces, but one
-    # is an exact match for our requested class, prune down to just it
-
-    full_class_name = desc.full_class_name
-    entries = namespaces.find_all {|m| m.full_name == full_class_name}
-    namespaces = entries if entries.size == 1
-
-    if desc.method_name.nil?
-      report_class_stuff(namespaces)
-    else
-      methods = @ri_reader.find_methods(desc.method_name, 
-                                        desc.is_class_method,
-                                        namespaces)
-
-      if methods.empty?
-        raise RiError.new("Nothing known about #{arg}")
-      else
-        report_method_stuff(desc.method_name, methods)
-      end
-    end
-  end
-
-  ######################################################################
-
-  def process_args
-    if @options.list_classes
-      classes = @ri_reader.full_class_names
-      @display.list_known_classes(classes)
-    elsif @options.list_names
-      names = @ri_reader.all_names
-      @display.list_known_names(names)
-    else
-      if ARGV.size.zero?
-        @display.display_usage
-      else
-        begin
-          ARGV.each do |arg|
-            get_info_for(arg)
-          end
-        rescue RiError => e
-          STDERR.puts(e.message)
-          exit(1)
-        end
-      end
-    end
-  end
-
-end  # class RiDriver
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/ri_formatter.rb ../rdoc-f95-20090109-1/ri/ri_formatter.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/ri_formatter.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/ri_formatter.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,672 +0,0 @@
-module RI
-  class TextFormatter
-
-    attr_reader :indent
-    
-    def initialize(options, indent)
-      @options = options
-      @width   = options.width
-      @indent  = indent
-    end
-    
-    
-    ######################################################################
-    
-    def draw_line(label=nil)
-      len = @width
-      len -= (label.size+1) if label
-      print "-"*len
-      if label
-        print(" ")
-        bold_print(label) 
-      end
-      puts
-    end
-    
-    ######################################################################
-    
-    def wrap(txt,  prefix=@indent, linelen=@width)
-      return unless txt && !txt.empty?
-      work = conv_markup(txt)
-      textLen = linelen - prefix.length
-      patt = Regexp.new("^(.{0,#{textLen}})[ \n]")
-      next_prefix = prefix.tr("^ ", " ")
-
-      res = []
-
-      while work.length > textLen
-        if work =~ patt
-          res << $1
-          work.slice!(0, $&.length)
-        else
-          res << work.slice!(0, textLen)
-        end
-      end
-      res << work if work.length.nonzero?
-      puts(prefix + res.join("\n" + next_prefix))
-    end
-
-    ######################################################################
-
-    def blankline
-      puts
-    end
-    
-    ######################################################################
-
-    # called when we want to ensure a nbew 'wrap' starts on a newline
-    # Only needed for HtmlFormatter, because the rest do their
-    # own line breaking
-
-    def break_to_newline
-    end
-    
-    ######################################################################
-
-    def bold_print(txt)
-      print txt
-    end
-
-    ######################################################################
-
-    def raw_print_line(txt)
-      puts txt
-    end
-
-    ######################################################################
-
-    # convert HTML entities back to ASCII
-    def conv_html(txt)
-      txt.
-          gsub(/&gt;/, '>').
-          gsub(/&lt;/, '<').
-          gsub(/&quot;/, '"').
-          gsub(/&amp;/, '&')
-          
-    end
-
-    # convert markup into display form
-    def conv_markup(txt)
-      txt.
-          gsub(%r{<tt>(.*?)</tt>}) { "+#$1+" } .
-          gsub(%r{<code>(.*?)</code>}) { "+#$1+" } .
-          gsub(%r{<b>(.*?)</b>}) { "*#$1*" } .
-          gsub(%r{<em>(.*?)</em>}) { "_#$1_" }
-    end
-
-    ######################################################################
-
-    def display_list(list)
-      case list.type
-
-      when SM::ListBase::BULLET 
-        prefixer = proc { |ignored| @indent + "*   " }
-
-      when SM::ListBase::NUMBER,
-      SM::ListBase::UPPERALPHA,
-      SM::ListBase::LOWERALPHA
-
-        start = case list.type
-                when SM::ListBase::NUMBER      then 1
-                when  SM::ListBase::UPPERALPHA then 'A'
-                when SM::ListBase::LOWERALPHA  then 'a'
-                end
-        prefixer = proc do |ignored|
-          res = @indent + "#{start}.".ljust(4)
-          start = start.succ
-          res
-        end
-        
-      when SM::ListBase::LABELED
-        prefixer = proc do |li|
-          li.label
-        end
-
-      when SM::ListBase::NOTE
-        longest = 0
-        list.contents.each do |item|
-          if item.kind_of?(SM::Flow::LI) && item.label.length > longest
-            longest = item.label.length
-          end
-        end
-
-        prefixer = proc do |li|
-          @indent + li.label.ljust(longest+1)
-        end
-
-      else
-        fail "unknown list type"
-
-      end
-
-      list.contents.each do |item|
-        if item.kind_of? SM::Flow::LI
-          prefix = prefixer.call(item)
-          display_flow_item(item, prefix)
-        else
-          display_flow_item(item)
-        end
-       end
-    end
-
-    ######################################################################
-
-    def display_flow_item(item, prefix=@indent)
-      case item
-      when SM::Flow::P, SM::Flow::LI
-        wrap(conv_html(item.body), prefix)
-        blankline
-        
-      when SM::Flow::LIST
-        display_list(item)
-
-      when SM::Flow::VERB
-        display_verbatim_flow_item(item, @indent)
-
-      when SM::Flow::H
-        display_heading(conv_html(item.text), item.level, @indent)
-
-      when SM::Flow::RULE
-        draw_line
-
-      else
-        fail "Unknown flow element: #{item.class}"
-      end
-    end
-
-    ######################################################################
-
-    def display_verbatim_flow_item(item, prefix=@indent)
-        item.body.split(/\n/).each do |line|
-          print @indent, conv_html(line), "\n"
-        end
-        blankline
-    end
-
-    ######################################################################
-
-    def display_heading(text, level, indent)
-      text = strip_attributes(text)
-      case level
-      when 1
-        ul = "=" * text.length
-        puts
-        puts text.upcase
-        puts ul
-#        puts
-        
-      when 2
-        ul = "-" * text.length
-        puts
-        puts text
-        puts ul
-#        puts
-      else
-        print indent, text, "\n"
-      end
-    end
-
-
-    def display_flow(flow)
-      flow.each do |f|
-        display_flow_item(f)
-      end
-    end
-
-    def strip_attributes(txt)
-      tokens = txt.split(%r{(</?(?:b|code|em|i|tt)>)})
-      text = [] 
-      attributes = 0
-      tokens.each do |tok|
-        case tok
-        when %r{^</(\w+)>$}, %r{^<(\w+)>$}
-          ;
-        else
-          text << tok
-        end
-      end
-      text.join
-    end
-
-
-  end
-  
-  
-  ######################################################################
-  # Handle text with attributes. We're a base class: there are
-  # different presentation classes (one, for example, uses overstrikes
-  # to handle bold and underlining, while another using ANSI escape
-  # sequences
-  
-  class AttributeFormatter < TextFormatter
-    
-    BOLD      = 1
-    ITALIC    = 2
-    CODE      = 4
-
-    ATTR_MAP = {
-      "b"    => BOLD,
-      "code" => CODE,
-      "em"   => ITALIC,
-      "i"    => ITALIC,
-      "tt"   => CODE
-    }
-
-    # TODO: struct?
-    class AttrChar
-      attr_reader :char
-      attr_reader :attr
-
-      def initialize(char, attr)
-        @char = char
-        @attr = attr
-      end
-    end
-
-    
-    class AttributeString
-      attr_reader :txt
-
-      def initialize
-        @txt = []
-        @optr = 0
-      end
-
-      def <<(char)
-        @txt << char
-      end
-
-      def empty?
-        @optr >= @txt.length
-      end
-
-      # accept non space, then all following spaces
-      def next_word
-        start = @optr
-        len = @txt.length
-
-        while @optr < len && @txt[@optr].char != " "
-          @optr += 1
-        end
-
-        while @optr < len && @txt[@optr].char == " "
-          @optr += 1
-        end
-
-        @txt[start...@optr]
-      end
-    end
-
-    ######################################################################
-    # overrides base class. Looks for <tt>...</tt> etc sequences
-    # and generates an array of AttrChars. This array is then used
-    # as the basis for the split
-
-    def wrap(txt,  prefix=@indent, linelen=@width)
-      return unless txt && !txt.empty?
-
-      txt = add_attributes_to(txt)
-      next_prefix = prefix.tr("^ ", " ")
-      linelen -= prefix.size
-
-      line = []
-
-      until txt.empty?
-        word = txt.next_word
-        if word.size + line.size > linelen
-          write_attribute_text(prefix, line)
-          prefix = next_prefix
-          line = []
-        end
-        line.concat(word)
-      end
-
-      write_attribute_text(prefix, line) if line.length > 0
-    end
-
-    protected
-
-    # overridden in specific formatters
-
-    def write_attribute_text(prefix, line)
-      print prefix
-      line.each do |achar|
-        print achar.char
-      end
-      puts
-    end
-
-    # again, overridden
-
-    def bold_print(txt)
-      print txt
-    end
-
-    private
-
-    def add_attributes_to(txt)
-      tokens = txt.split(%r{(</?(?:b|code|em|i|tt)>)})
-      text = AttributeString.new
-      attributes = 0
-      tokens.each do |tok|
-        case tok
-        when %r{^</(\w+)>$} then attributes &= ~(ATTR_MAP[$1]||0)
-        when %r{^<(\w+)>$}  then attributes  |= (ATTR_MAP[$1]||0)
-        else
-          tok.split(//).each {|ch| text << AttrChar.new(ch, attributes)}
-        end
-      end
-      text
-    end
-
-  end
-
-
-  ##################################################
-  
-  # This formatter generates overstrike-style formatting, which
-  # works with pagers such as man and less.
-
-  class OverstrikeFormatter < AttributeFormatter
-
-    BS = "\C-h"
-
-    def write_attribute_text(prefix, line)
-      print prefix
-      line.each do |achar|
-        attr = achar.attr
-        if (attr & (ITALIC+CODE)) != 0
-          print "_", BS
-        end
-        if (attr & BOLD) != 0
-          print achar.char, BS
-        end
-        print achar.char
-      end
-      puts
-    end
-
-    # draw a string in bold
-    def bold_print(text)
-      text.split(//).each do |ch|
-        print ch, BS, ch
-      end
-    end
-  end
-
-  ##################################################
-  
-  # This formatter uses ANSI escape sequences
-  # to colorize stuff
-  # works with pages such as man and less.
-
-  class AnsiFormatter < AttributeFormatter
-
-    def initialize(*args)
-      print "\033[0m"
-      super
-    end
-
-    def write_attribute_text(prefix, line)
-      print prefix
-      curr_attr = 0
-      line.each do |achar|
-        attr = achar.attr
-        if achar.attr != curr_attr
-          update_attributes(achar.attr)
-          curr_attr = achar.attr
-        end
-        print achar.char
-      end
-      update_attributes(0) unless curr_attr.zero?
-      puts
-    end
-
-
-    def bold_print(txt)
-      print "\033[1m#{txt}\033[m"
-    end
-
-    HEADINGS = {
-      1 => [ "\033[1;32m", "\033[m" ] ,
-      2 => ["\033[4;32m", "\033[m" ],
-      3 => ["\033[32m", "\033[m" ]
-    }
-
-    def display_heading(text, level, indent)
-      level = 3 if level > 3
-      heading = HEADINGS[level]
-      print indent
-      print heading[0]
-      print strip_attributes(text)
-      puts heading[1]
-    end
-    
-    private
-
-    ATTR_MAP = {
-      BOLD   => "1",
-      ITALIC => "33",
-      CODE   => "36"
-    }
-
-    def update_attributes(attr)
-      str = "\033["
-      for quality in [ BOLD, ITALIC, CODE]
-        unless (attr & quality).zero?
-          str << ATTR_MAP[quality]
-        end
-      end
-      print str, "m"
-    end
-  end
-
-  ##################################################
-  
-  # This formatter uses HTML.
-
-  class HtmlFormatter < AttributeFormatter
-
-    def initialize(*args)
-      super
-    end
-
-    def write_attribute_text(prefix, line)
-      curr_attr = 0
-      line.each do |achar|
-        attr = achar.attr
-        if achar.attr != curr_attr
-          update_attributes(curr_attr, achar.attr)
-          curr_attr = achar.attr
-        end
-        print(escape(achar.char))
-      end
-      update_attributes(curr_attr, 0) unless curr_attr.zero?
-    end
-
-    def draw_line(label=nil)
-      if label != nil
-        bold_print(label)
-      end
-      puts("<hr>")
-    end
-
-    def bold_print(txt)
-      tag("b") { txt }
-    end
-
-    def blankline()
-      puts("<p>")
-    end
-
-    def break_to_newline
-      puts("<br>")
-    end
-
-    def display_heading(text, level, indent)
-      level = 4 if level > 4
-      tag("h#{level}") { text }
-      puts
-    end
-    
-    ######################################################################
-
-    def display_list(list)
-
-      case list.type
-      when SM::ListBase::BULLET 
-        list_type = "ul"
-        prefixer = proc { |ignored| "<li>" }
-
-      when SM::ListBase::NUMBER,
-      SM::ListBase::UPPERALPHA,
-      SM::ListBase::LOWERALPHA
-        list_type = "ol"
-        prefixer = proc { |ignored| "<li>" }
-        
-      when SM::ListBase::LABELED
-        list_type = "dl"
-        prefixer = proc do |li|
-          "<dt><b>" + escape(li.label) + "</b><dd>"
-        end
-
-      when SM::ListBase::NOTE
-        list_type = "table"
-        prefixer = proc do |li|
-          %{<tr valign="top"><td>#{li.label.gsub(/ /, '&nbsp;')}</td><td>}
-        end
-      else
-        fail "unknown list type"
-      end
-
-      print "<#{list_type}>"
-      list.contents.each do |item|
-        if item.kind_of? SM::Flow::LI
-          prefix = prefixer.call(item)
-          print prefix
-          display_flow_item(item, prefix)
-        else
-          display_flow_item(item)
-        end
-      end
-      print "</#{list_type}>"
-    end
-
-    def display_verbatim_flow_item(item, prefix=@indent)
-        print("<pre>")
-        puts item.body
-        puts("</pre>")
-    end
-
-    private
-
-    ATTR_MAP = {
-      BOLD   => "b>",
-      ITALIC => "i>",
-      CODE   => "tt>"
-    }
-
-    def update_attributes(current, wanted)
-      str = ""
-      # first turn off unwanted ones
-      off = current & ~wanted
-      for quality in [ BOLD, ITALIC, CODE]
-        if (off & quality) > 0
-          str << "</" + ATTR_MAP[quality]
-        end
-      end
-
-      # now turn on wanted
-      for quality in [ BOLD, ITALIC, CODE]
-        unless (wanted & quality).zero?
-          str << "<" << ATTR_MAP[quality]
-        end
-      end
-      print str
-    end
-
-    def tag(code)
-        print("<#{code}>")
-        print(yield)
-        print("</#{code}>")
-    end
-
-    def escape(str)
-      str.
-          gsub(/&/n, '&amp;').
-          gsub(/\"/n, '&quot;').
-          gsub(/>/n, '&gt;').
-          gsub(/</n, '&lt;')
-    end
-
-  end
-
-  ##################################################
-  
-  # This formatter reduces extra lines for a simpler output.
-  # It improves way output looks for tools like IRC bots.
-
-  class SimpleFormatter < TextFormatter
-
-    ######################################################################
-
-    # No extra blank lines
-
-    def blankline
-    end
-
-    ######################################################################
-
-    # Display labels only, no lines
-
-    def draw_line(label=nil)
-      unless label.nil? then
-        bold_print(label) 
-        puts
-      end
-    end
-
-    ######################################################################
-
-    # Place heading level indicators inline with heading.
-
-    def display_heading(text, level, indent)
-      text = strip_attributes(text)
-      case level
-      when 1
-        puts "= " + text.upcase
-      when 2
-        puts "-- " + text
-      else
-        print indent, text, "\n"
-      end
-    end
-
-  end
-
-
-  # Finally, fill in the list of known formatters
-
-  class TextFormatter
-
-    FORMATTERS = {
-      "ansi"   => AnsiFormatter,
-      "bs"     => OverstrikeFormatter,
-      "html"   => HtmlFormatter,
-      "plain"  => TextFormatter,
-      "simple" => SimpleFormatter,
-    }
-      
-    def TextFormatter.list
-      FORMATTERS.keys.sort.join(", ")
-    end
-
-    def TextFormatter.for(name)
-      FORMATTERS[name.downcase]
-    end
-
-  end
-
-end
-
-
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/ri_options.rb ../rdoc-f95-20090109-1/ri/ri_options.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/ri_options.rb	2007-12-24 16:22:01.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/ri_options.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,319 +0,0 @@
-# We handle the parsing of options, and subsequently as a singleton
-# object to be queried for option values
-
-module RI
-
-  require 'rdoc/ri/ri_paths'
-  require 'rdoc/ri/ri_display'
-
-  VERSION_STRING = "ri v1.0.1 - 20041108"
-
-  class Options
-    
-    require 'singleton'
-    require 'getoptlong'
-    
-    include Singleton
-
-    # No not use a pager. Writable, because ri sets it if it
-    # can't find a pager
-    attr_accessor :use_stdout
-
-    # should we just display a class list and exit
-    attr_reader :list_classes
-
-    # should we display a list of all names
-    attr_reader :list_names
-
-    # The width of the output line
-    attr_reader :width
-
-    # the formatting we apply to the output
-    attr_reader :formatter
-
-    # the directory we search for original documentation
-    attr_reader :doc_dir
-
-    module OptionList
-      
-      OPTION_LIST = [
-        [ "--help",          "-h",   nil,
-          "you're looking at it" ],
-
-        [ "--classes",      "-c",   nil,
-          "Display the names of classes and modules we\n" +
-          "know about"],
-
-        [ "--doc-dir",      "-d",   "<dirname>",
-          "A directory to search for documentation. If not\n" +
-          "specified, we search the standard rdoc/ri directories.\n" +
-          "May be repeated."],
-
-        [ "--system",       nil,    nil,
-          "Include documentation from Ruby's standard library:\n  " +
-          RI::Paths::SYSDIR ],
-
-        [ "--site",         nil,    nil,
-          "Include documentation from libraries installed in site_lib:\n  " +
-          RI::Paths::SITEDIR ],
-
-        [ "--home",         nil,    nil,
-          "Include documentation stored in ~/.rdoc:\n  " +
-          (RI::Paths::HOMEDIR || "No ~/.rdoc found") ],
-
-        [ "--gems",         nil,    nil,
-          "Include documentation from RubyGems:\n" +
-          (RI::Paths::GEMDIRS ?
-           Gem.path.map { |dir| "  #{dir}/doc/*/ri" }.join("\n") :
-           "No Rubygems ri found.") ],
-
-        [ "--format",       "-f",   "<name>",
-          "Format to use when displaying output:\n" +
-          "   " + RI::TextFormatter.list + "\n" +
-          "Use 'bs' (backspace) with most pager programs.\n" +
-          "To use ANSI, either also use the -T option, or\n" +
-          "tell your pager to allow control characters\n" +
-          "(for example using the -R option to less)"],
-
-        [ "--list-names",    "-l",   nil,
-          "List all the names known to RDoc, one per line"
-        ],
-
-        [ "--no-pager",      "-T",   nil,
-          "Send output directly to stdout." 
-        ],
-
-        [ "--width",         "-w",   "output width",
-        "Set the width of the output" ],
-
-        [ "--version",       "-v",   nil,
-         "Display the version of ri"
-        ],
-
-      ]
-
-      def OptionList.options
-        OPTION_LIST.map do |long, short, arg,|
-          option = []
-          option << long
-          option << short unless short.nil?
-          option << (arg ? GetoptLong::REQUIRED_ARGUMENT :
-                           GetoptLong::NO_ARGUMENT)
-          option
-        end
-      end
-
-
-      def OptionList.strip_output(text)
-        text =~ /^\s+/
-        leading_spaces = $&
-        text.gsub!(/^#{leading_spaces}/, '')
-        $stdout.puts text
-      end
-      
-      
-      # Show an error and exit
-      
-      def OptionList.error(msg)
-        $stderr.puts
-        $stderr.puts msg
-        name = File.basename $PROGRAM_NAME
-        $stderr.puts "\nFor help on options, try '#{name} --help'\n\n"
-        exit 1
-      end
-      
-      # Show usage and exit
-      
-      def OptionList.usage(short_form=false)
-        
-        puts
-        puts(RI::VERSION_STRING)
-        puts
-        
-        name = File.basename($0)
-
-        directories = [
-          RI::Paths::SYSDIR,
-          RI::Paths::SITEDIR,
-          RI::Paths::HOMEDIR
-        ]
-
-        if RI::Paths::GEMDIRS then
-          Gem.path.each do |dir|
-            directories << "#{dir}/doc/*/ri"
-          end
-        end
-
-        directories = directories.join("\n    ")
-
-        OptionList.strip_output(<<-EOT)
-          Usage:
-
-            #{name} [options]  [names...]
-
-          Display information on Ruby classes, modules, and methods.
-          Give the names of classes or methods to see their documentation.
-          Partial names may be given: if the names match more than
-          one entity, a list will be shown, otherwise details on
-          that entity will be displayed.
-
-          Nested classes and modules can be specified using the normal
-          Name::Name notation, and instance methods can be distinguished
-          from class methods using "." (or "#") instead of "::".
-
-          For example:
-
-              #{name}  File
-              #{name}  File.new
-              #{name}  F.n
-              #{name}  zip
-
-          Note that shell quoting may be required for method names
-          containing punctuation:
-
-              #{name} 'Array.[]'
-              #{name} compact\\!
-
-          By default ri searches for documentation in the following
-          directories:
-
-              #{directories}
-
-          Specifying the --system, --site, --home, --gems or --doc-dir
-          options will limit ri to searching only the specified
-          directories.
-
-        EOT
-
-        if short_form
-          puts "For help on options, type '#{name} -h'"
-          puts "For a list of classes I know about, type '#{name} -c'"
-        else
-          puts "Options:\n\n"
-          OPTION_LIST.each do|long, short, arg, desc|
-            opt = ''
-            opt << (short ? sprintf("%15s", "#{long}, #{short}") :
-                            sprintf("%15s", long))
-            if arg
-              opt << " " << arg
-            end
-            print opt
-            desc = desc.split("\n")
-            if opt.size < 17
-              print " "*(18-opt.size)
-              puts desc.shift
-            else
-              puts
-            end
-            desc.each do |line|
-              puts(" "*18 + line)
-            end
-            puts
-          end
-          puts "Options may also be passed in the 'RI' environment variable"
-          exit 0
-        end
-      end
-    end
-
-    # Show the version and exit
-    def show_version
-      puts VERSION_STRING
-      exit(0)
-    end
-
-    def initialize
-      @use_stdout   = !STDOUT.tty?
-      @width        = 72
-      @formatter    = RI::TextFormatter.for("plain") 
-      @list_classes = false
-      @list_names   = false
-
-      # By default all paths are used.  If any of these are true, only those
-      # directories are used.
-      @use_system = false
-      @use_site = false
-      @use_home = false
-      @use_gems = false
-      @doc_dirs = []
-    end
-
-    # Parse command line options.
-
-    def parse(args)
-    
-      old_argv = ARGV.dup
-
-      ARGV.replace(args)
-
-      begin
-
-        go = GetoptLong.new(*OptionList.options)
-        go.quiet = true
-
-        go.each do |opt, arg|
-          case opt
-          when "--help"       then OptionList.usage
-          when "--version"    then show_version
-          when "--list-names" then @list_names = true
-          when "--no-pager"   then @use_stdout = true
-          when "--classes"    then @list_classes = true
-
-          when "--system"     then @use_system = true
-          when "--site"       then @use_site = true
-          when "--home"       then @use_home = true
-          when "--gems"       then @use_gems = true
-
-          when "--doc-dir"
-            if File.directory?(arg)
-              @doc_dirs << arg
-            else
-              $stderr.puts "Invalid directory: #{arg}"
-              exit 1
-            end
-
-          when "--format"
-            @formatter = RI::TextFormatter.for(arg)
-            unless @formatter
-              $stderr.print "Invalid formatter (should be one of "
-              $stderr.puts RI::TextFormatter.list + ")"
-              exit 1
-            end
-          when "--width"
-            begin
-              @width = Integer(arg)
-            rescue 
-              $stderr.puts "Invalid width: '#{arg}'"
-              exit 1
-            end
-          end
-        end
-
-      rescue GetoptLong::InvalidOption, GetoptLong::MissingArgument => error
-        OptionList.error(error.message)
-
-      end
-    end
-
-    # Return the selected documentation directories.
-
-    def path
-      RI::Paths.path(@use_system, @use_site, @use_home, @use_gems, *@doc_dirs)
-    end
-
-    def raw_path
-      RI::Paths.raw_path(@use_system, @use_site, @use_home, @use_gems,
-                         *@doc_dirs)
-    end
-
-    # Return an instance of the displayer (the thing that actually writes
-    # the information). This allows us to load in new displayer classes
-    # at runtime (for example to help with IDE integration)
-    
-    def displayer
-      ::RiDisplay.new(self)
-    end
-  end
-
-end
-
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/ri_paths.rb ../rdoc-f95-20090109-1/ri/ri_paths.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/ri_paths.rb	2007-12-24 16:22:01.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/ri_paths.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,101 +0,0 @@
-module RI
-
-  # Encapsulate all the strangeness to do with finding out
-  # where to find RDoc files
-  #
-  # We basically deal with three directories:
-  #
-  # 1. The 'system' documentation directory, which holds
-  #    the documentation distributed with Ruby, and which
-  #    is managed by the Ruby install process
-  # 2. The 'site' directory, which contains site-wide
-  #    documentation added locally.
-  # 3. The 'user' documentation directory, stored under the
-  #    user's own home directory.
-  #
-  # There's contention about all this, but for now:
-  #
-  # system:: $datadir/ri/<ver>/system/...
-  # site::   $datadir/ri/<ver>/site/...
-  # user::   ~/.rdoc
-
-  module Paths
-
-    #:stopdoc:
-    require 'rbconfig'
-    
-    DOC_DIR  = "doc/rdoc"
-
-    version = Config::CONFIG['ruby_version']
-
-    base    = File.join(Config::CONFIG['datadir'], "ri", version)
-    SYSDIR  = File.join(base, "system")
-    SITEDIR = File.join(base, "site")
-    homedir = ENV['HOME'] || ENV['USERPROFILE'] || ENV['HOMEPATH']
-
-    if homedir
-      HOMEDIR = File.join(homedir, ".rdoc")
-    else
-      HOMEDIR = nil
-    end
-
-    # This is the search path for 'ri'
-    PATH = [ SYSDIR, SITEDIR, HOMEDIR ].find_all {|p| p && File.directory?(p)}
-
-    begin
-      require 'rubygems'
-
-      # HACK dup'd from Gem.latest_partials and friends
-      all_paths = []
-
-      all_paths = Gem.path.map do |dir|
-        Dir[File.join(dir, 'doc', '*', 'ri')]
-      end.flatten
-
-      ri_paths = {}
-
-      all_paths.each do |dir|
-        base = File.basename File.dirname(dir)
-        if base =~ /(.*)-((\d+\.)*\d+)/ then
-          name, version = $1, $2
-          ver = Gem::Version.new version
-          if ri_paths[name].nil? or ver > ri_paths[name][0] then
-            ri_paths[name] = [ver, dir]
-          end
-        end
-      end
-
-      GEMDIRS = ri_paths.map { |k,v| v.last }.sort
-      GEMDIRS.each { |dir| RI::Paths::PATH << dir }
-    rescue LoadError
-      GEMDIRS = nil
-    end
-
-    # Returns the selected documentation directories as an Array, or PATH if no
-    # overriding directories were given.
-
-    def self.path(use_system, use_site, use_home, use_gems, *extra_dirs)
-      path = raw_path(use_system, use_site, use_home, use_gems, *extra_dirs)
-      return path.select { |directory| File.directory? directory }
-    end
-
-    # Returns the selected documentation directories including nonexistent
-    # directories.  Used to print out what paths were searched if no ri was
-    # found.
-
-    def self.raw_path(use_system, use_site, use_home, use_gems, *extra_dirs)
-      return PATH unless use_system or use_site or use_home or use_gems or
-                         not extra_dirs.empty?
-
-      path = []
-      path << extra_dirs unless extra_dirs.empty?
-      path << RI::Paths::SYSDIR if use_system
-      path << RI::Paths::SITEDIR if use_site
-      path << RI::Paths::HOMEDIR if use_home
-      path << RI::Paths::GEMDIRS if use_gems
-
-      return path.flatten.compact
-    end
-
-  end
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/ri_reader.rb ../rdoc-f95-20090109-1/ri/ri_reader.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/ri_reader.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/ri_reader.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,100 +0,0 @@
-require 'rdoc/ri/ri_descriptions'
-require 'rdoc/ri/ri_writer'
-require 'rdoc/markup/simple_markup/to_flow'
-
-module RI
-  class RiReader
-
-    def initialize(ri_cache)
-      @cache = ri_cache
-    end
-
-    def top_level_namespace
-      [ @cache.toplevel ]
-    end
-
-    def lookup_namespace_in(target, namespaces)
-      result = []
-      for n in namespaces
-        result.concat(n.contained_modules_matching(target))
-      end
-      result
-    end
-
-    def find_class_by_name(full_name)
-      names = full_name.split(/::/)
-      ns = @cache.toplevel
-      for name in names
-        ns = ns.contained_class_named(name)
-        return nil if ns.nil?
-      end
-      get_class(ns)
-    end
-
-    def find_methods(name, is_class_method, namespaces)
-      result = []
-      namespaces.each do |ns|
-        result.concat ns.methods_matching(name, is_class_method)
-      end
-      result
-    end
-
-    # return the MethodDescription for a given MethodEntry
-    # by deserializing the YAML
-    def get_method(method_entry)
-      path = method_entry.path_name
-      File.open(path) { |f| RI::Description.deserialize(f) }
-    end
-
-    # Return a class description
-    def get_class(class_entry)
-      result = nil
-      for path in class_entry.path_names
-        path = RiWriter.class_desc_path(path, class_entry)
-        desc = File.open(path) {|f| RI::Description.deserialize(f) }
-        if result
-          result.merge_in(desc)
-        else
-          result = desc
-        end
-      end
-      result
-    end
-
-    # return the names of all classes and modules
-    def full_class_names
-      res = []
-      find_classes_in(res, @cache.toplevel)
-    end
-
-    # return a list of all classes, modules, and methods
-    def all_names
-      res = []
-      find_names_in(res, @cache.toplevel)
-    end
-
-    # ----
-    private
-    # ----
-
-    def find_classes_in(res, klass)
-      classes = klass.classes_and_modules
-      for c in classes
-        res << c.full_name
-        find_classes_in(res, c)
-      end
-      res
-    end
-
-    def find_names_in(res, klass)
-      classes = klass.classes_and_modules
-      for c in classes
-        res << c.full_name
-        res.concat c.all_method_names
-        find_names_in(res, c)
-      end
-      res
-    end
-
-  end
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/ri_util.rb ../rdoc-f95-20090109-1/ri/ri_util.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/ri_util.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/ri_util.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,75 +0,0 @@
-######################################################################
-
-class RiError < Exception; end
-#
-# Break argument into its constituent class or module names, an
-# optional method type, and a method name
-
-class NameDescriptor
-
-  attr_reader :class_names
-  attr_reader :method_name
-
-  # true and false have the obvious meaning. nil means we don't care
-  attr_reader :is_class_method
-
-  # arg may be
-  # 1. a class or module name (optionally qualified with other class
-  #    or module names (Kernel, File::Stat etc)
-  # 2. a method name
-  # 3. a method name qualified by a optionally fully qualified class
-  #    or module name
-  #
-  # We're fairly casual about delimiters: folks can say Kernel::puts,
-  # Kernel.puts, or Kernel\#puts for example. There's one exception:
-  # if you say IO::read, we look for a class method, but if you
-  # say IO.read, we look for an instance method
-
-  def initialize(arg)
-    @class_names = []
-    separator = nil
-
-    tokens = arg.split(/(\.|::|#)/)
-
-    # Skip leading '::', '#' or '.', but remember it might
-    # be a method name qualifier
-    separator = tokens.shift if tokens[0] =~ /^(\.|::|#)/
-
-    # Skip leading '::', but remember we potentially have an inst
-
-    # leading stuff must be class names
-    
-    while tokens[0] =~ /^[A-Z]/
-      @class_names << tokens.shift
-      unless tokens.empty?
-        separator = tokens.shift
-        break unless separator == "::"
-      end
-    end
-    
-    # Now must have a single token, the method name, or an empty
-    # array
-    unless tokens.empty?
-      @method_name = tokens.shift
-      # We may now have a trailing !, ?, or = to roll into
-      # the method name
-      if !tokens.empty? && tokens[0] =~ /^[!?=]$/
-        @method_name << tokens.shift
-      end
-
-      if @method_name =~ /::|\.|#/ or !tokens.empty?
-        raise RiError.new("Bad argument: #{arg}") 
-      end
-      if separator && separator != '.'
-        @is_class_method = separator == "::"
-      end
-    end
-  end
-
-  # Return the full class name (with '::' between the components)
-  # or "" if there's no class name
-
-  def full_class_name
-    @class_names.join("::")
-  end
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/ri_writer.rb ../rdoc-f95-20090109-1/ri/ri_writer.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/ri_writer.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/ri_writer.rb	1970-01-01 09:00:00.000000000 +0900
@@ -1,62 +0,0 @@
-require 'fileutils'
-
-module RI
-  class RiWriter
-
-    def RiWriter.class_desc_path(dir, class_desc)
-      File.join(dir, "cdesc-" + class_desc.name + ".yaml")
-    end
-
-    
-    # Convert a name from internal form (containing punctuation)
-    # to an external form (where punctuation is replaced
-    # by %xx)
-
-    def RiWriter.internal_to_external(name)
-      name.gsub(/\W/) { sprintf("%%%02x", $&[0]) }
-    end
-
-    # And the reverse operation
-    def RiWriter.external_to_internal(name)
-      name.gsub(/%([0-9a-f]{2,2})/) { $1.to_i(16).chr }
-    end
-
-    def initialize(base_dir)
-      @base_dir = base_dir
-    end
-
-    def remove_class(class_desc)
-      FileUtils.rm_rf(path_to_dir(class_desc.full_name))
-    end
-
-    def add_class(class_desc)
-      dir = path_to_dir(class_desc.full_name)
-      FileUtils.mkdir_p(dir)
-      class_file_name = RiWriter.class_desc_path(dir, class_desc)
-      File.open(class_file_name, "w") do |f|
-        f.write(class_desc.serialize)
-      end
-    end
-
-    def add_method(class_desc, method_desc)
-      dir = path_to_dir(class_desc.full_name)
-      file_name = RiWriter.internal_to_external(method_desc.name)
-      meth_file_name = File.join(dir, file_name)
-      if method_desc.is_singleton
-        meth_file_name += "-c.yaml"
-      else
-        meth_file_name += "-i.yaml"
-      end
-
-      File.open(meth_file_name, "w") do |f|
-        f.write(method_desc.serialize)
-      end
-    end
-
-    private
-
-    def path_to_dir(class_name)
-      File.join(@base_dir, *class_name.split('::'))
-    end
-  end
-end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/util.rb ../rdoc-f95-20090109-1/ri/util.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/util.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/util.rb	2008-03-09 01:37:55.000000000 +0900
@@ -0,0 +1,81 @@
+require 'rdoc/ri'
+
+class RDoc::RI::Error < RuntimeError; end
+
+##
+# Break argument into its constituent class or module names, an
+# optional method type, and a method name
+
+class RDoc::RI::NameDescriptor
+
+  attr_reader :class_names
+  attr_reader :method_name
+
+  ##
+  # true and false have the obvious meaning. nil means we don't care
+
+  attr_reader :is_class_method
+
+  ##
+  # +arg+ may be
+  #
+  # 1. A class or module name (optionally qualified with other class or module
+  #    names (Kernel, File::Stat etc)
+  # 2. A method name
+  # 3. A method name qualified by a optionally fully qualified class or module
+  #    name
+  #
+  # We're fairly casual about delimiters: folks can say Kernel::puts,
+  # Kernel.puts, or Kernel\#puts for example. There's one exception: if you
+  # say IO::read, we look for a class method, but if you say IO.read, we look
+  # for an instance method
+
+  def initialize(arg)
+    @class_names = []
+    separator = nil
+
+    tokens = arg.split(/(\.|::|#)/)
+
+    # Skip leading '::', '#' or '.', but remember it might
+    # be a method name qualifier
+    separator = tokens.shift if tokens[0] =~ /^(\.|::|#)/
+
+    # Skip leading '::', but remember we potentially have an inst
+
+    # leading stuff must be class names
+
+    while tokens[0] =~ /^[A-Z]/
+      @class_names << tokens.shift
+      unless tokens.empty?
+        separator = tokens.shift
+        break unless separator == "::"
+      end
+    end
+
+    # Now must have a single token, the method name, or an empty array
+    unless tokens.empty?
+      @method_name = tokens.shift
+      # We may now have a trailing !, ?, or = to roll into
+      # the method name
+      if !tokens.empty? && tokens[0] =~ /^[!?=]$/
+        @method_name << tokens.shift
+      end
+
+      if @method_name =~ /::|\.|#/ or !tokens.empty?
+        raise RiError.new("Bad argument: #{arg}") 
+      end
+      if separator && separator != '.'
+        @is_class_method = separator == "::"
+      end
+    end
+  end
+
+  # Return the full class name (with '::' between the components) or "" if
+  # there's no class name
+
+  def full_class_name
+    @class_names.join("::")
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri/writer.rb ../rdoc-f95-20090109-1/ri/writer.rb
--- ruby-1.8.7-p72/lib/rdoc/ri/writer.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri/writer.rb	2008-03-09 01:37:55.000000000 +0900
@@ -0,0 +1,64 @@
+require 'fileutils'
+require 'rdoc/ri'
+
+class RDoc::RI::Writer
+
+  def self.class_desc_path(dir, class_desc)
+    File.join(dir, "cdesc-" + class_desc.name + ".yaml")
+  end
+
+  ##
+  # Convert a name from internal form (containing punctuation) to an external
+  # form (where punctuation is replaced by %xx)
+
+  def self.internal_to_external(name)
+    name.gsub(/\W/) { "%%%02x" % $&[0].ord }
+  end
+
+  ##
+  # And the reverse operation
+
+  def self.external_to_internal(name)
+    name.gsub(/%([0-9a-f]{2,2})/) { $1.to_i(16).chr }
+  end
+
+  def initialize(base_dir)
+    @base_dir = base_dir
+  end
+
+  def remove_class(class_desc)
+    FileUtils.rm_rf(path_to_dir(class_desc.full_name))
+  end
+
+  def add_class(class_desc)
+    dir = path_to_dir(class_desc.full_name)
+    FileUtils.mkdir_p(dir)
+    class_file_name = self.class.class_desc_path(dir, class_desc)
+    File.open(class_file_name, "w") do |f|
+      f.write(class_desc.serialize)
+    end
+  end
+
+  def add_method(class_desc, method_desc)
+    dir = path_to_dir(class_desc.full_name)
+    file_name = self.class.internal_to_external(method_desc.name)
+    meth_file_name = File.join(dir, file_name)
+    if method_desc.is_singleton
+      meth_file_name += "-c.yaml"
+    else
+      meth_file_name += "-i.yaml"
+    end
+
+    File.open(meth_file_name, "w") do |f|
+      f.write(method_desc.serialize)
+    end
+  end
+
+  private
+
+  def path_to_dir(class_name)
+    File.join(@base_dir, *class_name.split('::'))
+  end
+
+end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/ri.rb ../rdoc-f95-20090109-1/ri.rb
--- ruby-1.8.7-p72/lib/rdoc/ri.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/ri.rb	2008-03-09 02:14:19.000000000 +0900
@@ -0,0 +1,2 @@
+module RDoc::RI; end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/stats.rb ../rdoc-f95-20090109-1/stats.rb
--- ruby-1.8.7-p72/lib/rdoc/stats.rb	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20090109-1/stats.rb	2008-03-09 03:43:55.000000000 +0900
@@ -0,0 +1,23 @@
+##
+# Simple stats collector
+
+class RDoc::Stats
+
+  attr_accessor :num_files, :num_classes, :num_modules, :num_methods
+
+  def initialize
+    @num_files = @num_classes = @num_modules = @num_methods = 0
+    @start = Time.now
+  end
+
+  def print
+    puts "Files:   #@num_files"
+    puts "Classes: #@num_classes"
+    puts "Modules: #@num_modules"
+    puts "Methods: #@num_methods"
+    puts "Elapsed: " + sprintf("%0.3fs", Time.now - @start)
+  end
+
+end
+
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/template.rb ../rdoc-f95-20090109-1/template.rb
--- ruby-1.8.7-p72/lib/rdoc/template.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/template.rb	2008-03-08 16:56:01.000000000 +0900
@@ -1,233 +1,63 @@
-# Cheap-n-cheerful HTML page template system. You create a 
-# template containing:
-#
-# * variable names between percent signs (<tt>%fred%</tt>)
-# * blocks of repeating stuff:
-#
-#     START:key
-#       ... stuff
-#     END:key
-#
-# You feed the code a hash. For simple variables, the values
-# are resolved directly from the hash. For blocks, the hash entry
-# corresponding to +key+ will be an array of hashes. The block will
-# be generated once for each entry. Blocks can be nested arbitrarily
-# deeply.
-#
-# The template may also contain
-#
-#   IF:key
-#     ... stuff
-#   ENDIF:key
+require 'erb'
+
+##
+# An ERB wrapper.
 #
-# _stuff_ will only be included in the output if the corresponding
-# key is set in the value hash.
+# This TemplatePage operates similarly to RDoc 1.x's TemplatePage, but uses
+# ERB instead of a custom template language.
 #
-# Usage:  Given a set of templates <tt>T1, T2,</tt> etc
+# Converting from a RDoc 1.x template to an RDoc 2.x template is fairly easy.
 #
-#            values = { "name" => "Dave", state => "TX" }
+# * %blah% becomes <%= values["blah"] %>
+# * !INCLUDE! becomes <%= template_include %>
+# * HREF:aref:name becomes <%= href values["aref"], values["name"] %>
+# * IF:blah becomes <% if values["blah"] then %>
+# * IFNOT:blah becomes <% unless values["blah"] then %>
+# * ENDIF:blah becomes <% end %>
+# * START:blah becomes <% values["blah"].each do |blah| %>
+# * END:blah becomes <% end %>
 #
-#            t = TemplatePage.new(T1, T2, T3)
-#            File.open(name, "w") {|f| t.write_html_on(f, values)}
-#         or
-#            res = ''
-#            t.write_html_on(res, values)
+# To make nested loops easier to convert, start by converting START statements
+# to:
 #
+#   <% values["blah"].each do |blah| $stderr.puts blah.keys %>
 #
+# So you can see what is being used inside which loop.
 
-class TemplatePage
-
-  ##########
-  # A context holds a stack of key/value pairs (like a symbol
-  # table). When asked to resolve a key, it first searches the top of
-  # the stack, then the next level, and so on until it finds a match
-  # (or runs out of entries)
-
-  class Context
-    def initialize
-      @stack = []
-    end
-
-    def push(hash)
-      @stack.push(hash)
-    end
-
-    def pop
-      @stack.pop
-    end
-
-    # Find a scalar value, throwing an exception if not found. This
-    # method is used when substituting the %xxx% constructs
-
-    def find_scalar(key)
-      @stack.reverse_each do |level|
-        if val = level[key]
-          return val unless val.kind_of? Array
-        end
-      end
-      raise "Template error: can't find variable '#{key}'"
-    end
-
-    # Lookup any key in the stack of hashes
-
-    def lookup(key)
-      @stack.reverse_each do |level|
-        val = level[key]
-        return val if val
-      end
-      nil
-    end
-  end
-
-  #########
-  # Simple class to read lines out of a string
-
-  class LineReader
-    # we're initialized with an array of lines
-    def initialize(lines)
-      @lines = lines
-    end
-
-    # read the next line 
-    def read
-      @lines.shift
-    end
+module RDoc
+end
+class RDoc::TemplatePage
 
-    # Return a list of lines up to the line that matches
-    # a pattern. That last line is discarded.
-    def read_up_to(pattern)
-      res = []
-      while line = read
-        if pattern.match(line)
-          return LineReader.new(res) 
-        else
-          res << line
-        end
-      end
-      raise "Missing end tag in template: #{pattern.source}"
-    end
+  ##
+  # Create a new TemplatePage that will use +templates+.
 
-    # Return a copy of ourselves that can be modified without
-    # affecting us
-    def dup
-      LineReader.new(@lines.dup)
-    end
+  def initialize(*templates)
+    @templates = templates
   end
 
+  ##
+  # Returns "<a href=\"#{ref}\">#{name}</a>"
 
-
-  # +templates+ is an array of strings containing the templates.
-  # We start at the first, and substitute in subsequent ones
-  # where the string <tt>!INCLUDE!</tt> occurs. For example,
-  # we could have the overall page template containing
-  #
-  #   <html><body>
-  #     <h1>Master</h1>
-  #     !INCLUDE!
-  #   </bost></html>
-  #
-  # and substitute subpages in to it by passing [master, sub_page].
-  # This gives us a cheap way of framing pages
-
-  def initialize(*templates)
-    result = "!INCLUDE!"
-    templates.each do |content|
-      result.sub!(/!INCLUDE!/, content)
+  def href(ref, name)
+    if ref then
+      "<a href=\"#{ref}\">#{name}</a>"
+    else
+      name
     end
-    @lines = LineReader.new(result.split($/))
   end
 
-  # Render the templates into HTML, storing the result on +op+ 
-  # using the method <tt><<</tt>. The <tt>value_hash</tt> contains
-  # key/value pairs used to drive the substitution (as described above)
-
-  def write_html_on(op, value_hash)
-    @context = Context.new
-    op << substitute_into(@lines, value_hash).tr("\000", '\\')
-  end
+  ##
+  # Process the template using +values+, writing the result to +io+.
 
+  def write_html_on(io, values)
+    b = binding
+    template_include = ""
 
-  # Substitute a set of key/value pairs into the given template. 
-  # Keys with scalar values have them substituted directly into
-  # the page. Those with array values invoke <tt>substitute_array</tt>
-  # (below), which examples a block of the template once for each 
-  # row in the array.
-  #
-  # This routine also copes with the <tt>IF:</tt>_key_ directive,
-  # removing chunks of the template if the corresponding key
-  # does not appear in the hash, and the START: directive, which
-  # loops its contents for each value in an array
-
-  def substitute_into(lines, values)
-    @context.push(values)
-    skip_to = nil
-    result = []
-
-    while line = lines.read
-
-      case line
-
-      when /^IF:(\w+)/
-        lines.read_up_to(/^ENDIF:#$1/) unless @context.lookup($1)
-
-    when /^IFNOT:(\w+)/
-        lines.read_up_to(/^ENDIF:#$1/) if @context.lookup($1)
-
-      when /^ENDIF:/
-        ;
-
-      when /^START:(\w+)/
-        tag = $1
-        body = lines.read_up_to(/^END:#{tag}/)
-        inner_values = @context.lookup(tag)
-        raise "unknown tag: #{tag}" unless inner_values
-        raise "not array: #{tag}"   unless inner_values.kind_of?(Array)
-        inner_values.each do |vals|
-          result << substitute_into(body.dup, vals)
-        end
-      else
-        result << expand_line(line.dup)
-      end
+    @templates.reverse_each do |template|
+      template_include = ERB.new(template).result b
     end
 
-    @context.pop
-
-    result.join("\n")
-  end
-
-  # Given an individual line, we look for %xxx% constructs and 
-  # HREF:ref:name: constructs, substituting for each.
-
-  def expand_line(line)
-    # Generate a cross reference if a reference is given,
-    # otherwise just fill in the name part
-
-    line.gsub!(/HREF:(\w+?):(\w+?):/) {
-      ref = @context.lookup($1)
-      name = @context.find_scalar($2)
-
-      if ref and !ref.kind_of?(Array)
-	"<a href=\"#{ref}\">#{name}</a>"
-      else
-	name
-      end
-    }
-
-    # Substitute in values for %xxx% constructs.  This is made complex
-    # because the replacement string may contain characters that are
-    # meaningful to the regexp (like \1)
-
-    line = line.gsub(/%([a-zA-Z]\w*)%/) {
-      val = @context.find_scalar($1) 
-      val.tr('\\', "\000")
-    }
-
-
-    line
-  rescue Exception => e
-    $stderr.puts "Error in template: #{e}"
-    $stderr.puts "Original line: #{line}"
-    exit
+    io.write template_include
   end
 
 end
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/tokenstream.rb ../rdoc-f95-20090109-1/tokenstream.rb
--- ruby-1.8.7-p72/lib/rdoc/tokenstream.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/tokenstream.rb	2008-03-08 16:56:01.000000000 +0900
@@ -1,11 +1,14 @@
-# A TokenStream is a list of tokens, gathered during the parse
-# of some entity (say a method). Entities populate these streams
-# by being registered with the lexer. Any class can collect tokens
-# by including TokenStream. From the outside, you use such an object
-# by calling the start_collecting_tokens method, followed by calls
-# to add_token and pop_token
+module RDoc; end
+
+##
+# A TokenStream is a list of tokens, gathered during the parse of some entity
+# (say a method). Entities populate these streams by being registered with the
+# lexer. Any class can collect tokens by including TokenStream. From the
+# outside, you use such an object by calling the start_collecting_tokens
+# method, followed by calls to add_token and pop_token.
+
+module RDoc::TokenStream
 
-module TokenStream
   def token_stream
     @token_stream
   end
@@ -13,13 +16,18 @@
   def start_collecting_tokens
     @token_stream = []
   end
+
   def add_token(tk)
     @token_stream << tk
   end
+
   def add_tokens(tks)
     tks.each  {|tk| add_token(tk)}
   end
+
   def pop_token
     @token_stream.pop
   end
+
 end
+
diff -Nur --exclude=doc ruby-1.8.7-p72/lib/rdoc/usage.rb ../rdoc-f95-20090109-1/usage.rb
--- ruby-1.8.7-p72/lib/rdoc/usage.rb	2007-02-13 08:01:19.000000000 +0900
+++ ../rdoc-f95-20090109-1/usage.rb	2005-09-22 16:49:18.000000000 +0900
@@ -96,7 +96,7 @@
 
   # Display usage
   def RDoc.usage_no_exit(*args)
-    main_program_file = caller[-1].sub(/:\d+$/, '')
+    main_program_file, = caller[-1].split(/:\d+/, 2)
     comment = File.open(main_program_file) do |file|
       find_comment(file)
     end
