Doxygen-like source browsing for arbitrary languages
doxygen, among other things, creates an on-line
documentation browser in HTML for source code. It supports C++, C,
Java, IDL and to some extent Objective-C, PHP, C# and D, but this is
largely due to the similarity of these languages' syntax.
haddock provides most of the functionality of
doxygen for the Haskell language, however it does not
generate hyper-linked source code listings. A tool that subsumes the
functionality of both and allows generation of documents for arbitrary
languages would therefore be of great utility to the wider programming
community.
This would require the creation of a meta-language for describing the
manner in which declarations (be they functions, types, classes etc)
are linked to their uses. A typical invocation of the tool would take
as inputs a specification written in the aforementioned meta-language
and the source code and generate documents accordingly.
Naturally, the tool will need to understand the
meta-language. Traditionally, one would implement a lexer, parser and
various analysis phases in order to glean meaning from specifications
written in the meta-language. However, we suggest embedding
the language in Haskell and loading the specifications using Donald
Stewart's hsplugin tool.
Expectations
-
Core requirements for successful completion:
-
Develop a language for the specification of relationships between
definition and uses in arbitrary source languages.
-
Implement a tool that can read specifications written in this
language and generate documents from source files. To show the
validity of this approach it would only be necessary to produce the
hyper-linked source code listings of
doxygen
-
Extra tasks for the ambitious:
-
Provide the ability to annotate source code with documentation
directives. Since these directives must interact with the
commenting mechanism of the language for which
you wish to generate documents for a mechanism should be provided in
the meta-language for user-definition of the structure of such
annotations. Demonstrate implementation by running the tool on C and
Haskell source files readable by
doxygen and
haddock respectively.
-
Implement other features of
doxygen such as the
generation of class diagrams. Better yet, extend the meta-language
to handle arbitrary generation of documents based on the grammatical
structure of the source language.
References
-
doxygen: a tool for
automatically generating documentation from annotated C++, C, Java
and IDL code.
-
doxygen manual
-
haddock: a tool for automatically generating documentation from annotated Haskell source code.
-
lxr: Another tool for the cross
referencing of identifiers in C code. Used on the linux kernel.
-
An example of a hyper-linked source code listing produce with
doxygen
-
hs-plugins: Compiler and tool support for compiling and loading
Haskell source files as plugins into a Haskell application at
runtime. The library provides a convenient interface to GHC's
runtime loader and linker, letting you load compiled Haskell code.
Last modified : Mon Feb 16 2004