[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

O2 Source to HTML Converter



[Looks like the first mail didn't make it. Discard any duplicates :-]
I've put a new tool on the OOC web server at
http://www.uni-kl.de/OOC/files/apps/oocn-980402.tar.gz
Here is the README:

This is the first version of the OOC Code Navigator toolbox, or
`oocn' for short.  Currently the "toolbox" contains just one tool to
convert Oberon-2 source code into a fully hyperlinked HTML documents.
As I pointed out in previous postings on the OOC mailing list it is
very easy to add further functions to this program.

The source code is moderately well documented, and the file THISDIR
is an overview of the existing modules.  Any volunteers to extend
oocn?  We _do_ need an interface browser, you know.

Currently oocn is distributed as a separate program.  Since it is
rather tightly integrated with oo2c's configuration it is necessary
to have an unpacked and configured directory with a recent oo2c
distribution (e.g.  oo2c_32-1.3.2.tar.gz) around.  For details refer
to file INSTALL.

-- Michael van Acken <acken@informatik.uni-kl.de>


#####################################################################


Usage: oocn <mode> [options] <module>...
Mode:
  --help,-h     Writes this text to stdout.
  --html,-H     Translates listed modules into HTML code.
Options:
  --closure,-C  Operate on all modules imported by set of root
modules.
  -o <dir>      Changes output directory for generated files.

oocn also understands the command line options --config,
--include-config, --options, and --pragmas.

Module names are resolved by the same mechanism that is used by the
compiler.  If e.g. you do `oo2c -M Foo' to built an executable, then
typing `oocn -HC Foo' in the same directory will give you HTML files
in directory html/ for all modules contributing to the executable.



Generating HTML Text
====================

Calling oocn with the option `--html' (or `-H') will convert a set of
modules into HTML text.  If the option `--closure' (or `-C') is
activated, all modules imported by the ones given on the command line
will be converted.  Otherwise only the modules listed there will be
converted.

For every converted module `Foo' a file `<output-dir>/Foo.html' will
be created.  The output directory can be adjusted with the option `-o
<dir>'.  It defaults to ./html/.  

The generated HTML'ized source text has different colours for
keywords, comments, strings, and procedure declarations.  Identifiers
of exported declaration are set in bold.  Links are inserted
  o from an import clause the imported module
  o from a qualified identifier to the place of the corresponding
    declaration 
  o from a field selector in a designator to the declaration of the
    field in the corresponding record type
  o from a call to a type-bound procedure to the (statically)
    corresponding procedure declaration; super calls are handled as 
    well
  o to a procedure's super/base definition if a type-bound procedure
    is a redefinition of an existing procedure
  o from a procedure's forward declaration to its actual definition

In short: almost every using occurence of an identifier is turned
into
a hyperlink to the corresponding declaration.  It is a good idea to
disable underlining of links when inspecting source code.

Note that links to all record fields and type-bound procedures can
only be inserted if the HTML'izer was called with the option
"--closure".