.TH ADABROWSE 1 "14 FEB 2004" "GNU Ada Tools" "AdaBrowse User Manual" .SH NAME adabrowse \- Generate fully cross\-referenced HTML rendering of Ada 95 specs .SH SYNOPSIS \fBadabrowse\fR [options] \-f \fIfile\fR .SH DESCRIPTION \fBadabrowse\fR produces a fully cross\-referenced HTML rendering of Ada 95 specs (no bodies) similar to what javadoc does for Java sources. \fBadabrowse\fR is a command\-line utility; it has no graphical user interface. \fBadabrowse\fR is highly configurable through command\-line options, style sheets, and configuration files. \fBadabrowse\fR completely takes apart the source code and produces a HTML documentation containing: .PD 0 .IP \(bu 4 All context clauses .IP \(bu 4 Unit header .IP \(bu 4 If the unit is a package: .RS .IP \(em 4 All exceptions (including renames) .IP \(em 4 All constants .IP \(em 4 All variables .IP \(em 4 A type index containing all types and their primitive operations (the latter only for (tagged) record types, private types, and types derived from those). The primitive operations list is fully cross\-referenced and ordered by newly defined, overridden, and inherited operations. .IP \(em 4 Any other items .RE .PD .SH USAGE There are two ways to use \fBadabrowse\fR: .IP 1. 4 Call \fBadabrowse\fR for your spec: \fBadabrowse \-f\fR \fIfile\fR (and any other options as needed, in particular \fB\-I\fR if the file is not in the current directory or depends on other units whose sources are not in the current directory!) If no tree file for the given unit exists, \fBadabrowse\fR will try to generate one. or .IP 1. 4 Generate the tree files for the specs you want to process by calling \fBgnatgcc \-c \-gnatc \-gnatt\fR \fIfile\fR (with the appropriate \fB\-I\fR options, if needed.) .IP 2. 4 Call \fBadabrowse\fR for these specs: \fBadabrowse \-f\fR \fIfile\fR (and any other options, as needed [look in particular at \fB\-T\fR!]). .PP \fBadabrowse\fR generates HTML files by default in the current directory. \fBadabrowse\fR doesn't care whether the tree files have been produced from specs or bodies: since the tree file of a body always also contains the information on the spec, it can work with either. .SH OPTIONS .IP \fB\-h\fR,\ \fB\-?\fR,\ \fB\-help\fR,\ \fB\-\-help\fR Writes a comprehensive help text. .IP \fB\-a\fR,\ \fB\-all\fR,\ \fB\-\-all\fR Generate HTML not only for the unit given in the \-f option, but also for all application units on which it depends semantically (transitive closure of "with"es and parent units). .IP Note that this option processes only the application units in the transitive closure even if the "\-g" option is also given; it does not process any "with"ed standard library unit. This also means that if the unit given is a standard library unit, the "\-all" option has no effect. This behavior is intentional: you'll normally generate HTML for the standard library once by processing all standard library units explicitly, and you don't want to re\-generate HTML for these units each time one of your application unit "with"es a standard library unit. .IP \fB\-c\fR\ \fIfile\fR Defines a configuration file for the HTML generator. Multiple \fB\-c\fR options may be given; the files are processed in the given order and may overwrite earlier config settings. .IP \fB\-f\fR\ \fIfile\fR Gives the filename (*.ads) of the spec to process. This filename may contain a path! See below for more comments. Only one \fB\-f\fR option may be given. .IP \fB\-g\fR If set, \fBadabrowse\fR also generates cross\-references to items from library units in the standard and run\-time packages, except for items from the implict package "Standard". Note: This can also be set by a configuration file key "Refs_To_Standard". The latter definition wins. .IP \fB\-G\fR\ \fIoutput_formats...\fR Specify the output formats \fBadabrowse\fR shall generate. The \fB\-G\fR option must be followed by one or more output format names, given as separate arguments. Recognized output format names are \fBhtml\fR and \fBxml\fR (case insensitive). .IP \fB\-i\fR\ [\fIfile\fR] If set, \fBadabrowse\fR will generate a package index if it runs in "file input mode" (see below) or the \fB\-all\fR option is set and the output does not go to stdout. If a filename is given, the index is written to that file (or to stdout, if the filename is "\-"). .IP \fB\-is\ [\fIfile\fR] Same as \-i, but generates an index using indentation for child units. .IP \fB\-l\fR Make \fBadabrowse\fR generate cross\-references in HTML output using only the line number. This is what earlier versions of \fBadabrowse\fR (up to and including V2.13) always did. As of V3.0, cross\-references are constructed taking into account both line and column number of an item. You should use this option only if you have HTML documentation generated by earlier \fBadabrowse\fR versions and somehow cannot re\-generate that documentation. However, the recommended usage is never to use this option and to regenerate possibly already existing HTML documentation. Note that HTML generated with \fB\-l\fR is not compatible with HTML generated without \fB\-l\fR! Also, HTML generated by \fBadabrowse\fR 3.0 and beyond is compatible with HTML generated by \fBadabrowse\fR 2.13 and earlier only if the \fB\-l\fR option is given. Usage of this option generates a warning message on stderr. .IP \fB\-o\fR\ [\fIfile\fR] Define the output file name. If not set, the output goes to a file with the name of the input and suffix \fB.html\fR. If \fIfile\fR specifies a directory (i.e., ends in a "\\" on Windows or a "/" on Unix), all generated HTML files will be put into that directory. If the filename is "\-", output is written to stdout. Only one \fB\-o\fR option may be given. A dash as the filename ("\-") is allowed only if there is exactly one output format specified. If there are multiple output formats specified (e.g. both XML and HTML), output is not allowed to go to stdout. .IP \fB\-p\fR\ [\fIfile\fR] As \fB\-i\fR, but generates a subprogram index over all units processed. .IP \fB\-private\fR,\ \fB\-\-private\fR If given, \fBadabrowse\fR will also process the private parts of packages and task or protected declarations. (By default, it doesn't do so but replaces the private parts by a comment saying "Implementation defined".) .IP \fB\-q\fR Quiet mode: do not issue warning or info messages. Synonym to \fB\-w0\fR. .IP \fB\-s\fR\ \fIURL\fR Defines the URL to the style sheet the generated HTML file shall use. This URL should be relative to the final place where you will put the HTML files! Note that a \fB\-s\fR option can be overwritten by a later \fB\-c\fR option, if the configuration file defines the key "Style_Sheet". .IP \fB\-t\fR\ [\fIfile\fR] As \fB\-i\fR, but generates a global type index over all units processed. .IP \fB\-version\fR,\ \fB\-\-version\fR Print version information of \fBadabrowse\fR to stderr. .IP \fB\-w\fR\fIi\fR Sets the warning level of \fBadabrowse\fR. \fIi\fR may be one of the following: .PD 0 .RS 4 .IP 0,\ or\ e 16 print only error messages. .IP 1,\ or\ w 16 print warnings and errors. .IP 2,\ or\ i,\ or\ a 16 print all messages. .RE .PD .IP \fB\-x\fR If set, \fBadabrowse\fR never overwrites existing HTML files. (May be useful in conjunction with the \fB\-a\fR option.) .IP \fB\-X\fB\ \fIname\fR\fB=\fR\fIvalue\fR Define an environment variable \fIname\fR with value \fIvalue\fR. The value supersedes any possibly already existing definition of \fIname\fR in the system's environment for this call to \fBadabrowse\fR. The new definition affects any configuration file processed subsequently and also the project file (if any). The \fIname\fR must not contain white space; if \fIvalue\fR contains white space, quote the whole definition as in \-X"user=John Doe". There may or may not be white space between the \fB\-X\fR and the variable definition. .IP \fB\-I\fR\ \fIdirectory\fR Define source paths for ASIS. Same semantics as for GNAT. Multiple \fB\-I\fR options may be given. .IP \fB\-T\fR\ \fIdirectory\fR Define paths for ASIS to search for tree files (*.adt). Multiple \fB\-T\fR options may be given. Note that if you give a filename to the \fB\-i\fR option that starts with the letter "s", you must have a white space between the option and the filename, otherwise it will be recognized as a \fB\-is\fR option. Also, if the filename starts with "\-", there mustn't be any whitespace between the option and the filename, for if there is, \fBadabrowse\fR will assume the filename to be the next option and handle it as such (options all start with "\-"), and not as a filename. The same caveat also applies to the \fB\-p\fR option, if you want the subprogram index to go to a file named "rivate": there must be a blank, otherwise, the whole thing will be recognized as the \fB\-private\fR option. (Admittedly this is a rather pathological case, but it's mentioned here for completeness.) .SH "THE \-f OPTION" The \fB\-f\fR option has three different formats: .IP 1. 4 If the filename is "\-" or "@\-", \fBadabrowse\fR reads the unit specs of the units to process from stdin, one unit per line, until EOF is encountered. Empty lines are skipped. (If you try this interactively, you'll have to signal EOF yourself. Otherwise, this may be useful if the input comes from a pipe, like in "ls \-1 *.ads | adabrowse \-f\- ...") .IP 2. 4 If the filename starts with "@", \fBadabrowse\fR doesn't consider it a unit spec, but as the name of a text file from which to read the unit names, one unit per line. Empty lines in the file are ignored. .IP 3. 4 If neither applies, \fBadabrowse\fR uses the given filename as the unit spec. .PP The first two cases are called the "file input mode" of \fBadabrowse\fR. The file may contain empty lines and comments (starting with the first "#" on a line and extending up to the end of the line), which are ignored. Note that contrary to configuration files, string handling for finding comment starts is not done, and line continuations also are not allowed. In all three cases, a unit spec is a filename that may contain a path; a possible suffix is ignored. Note that a unit spec is a file name; in other words, you give \fBtest\-gen\fR, or \fBtest\-gen.ads\fR, and not \fBTest.Gen\fR. The reason is simply that for most shell scripting languages, it is easier to work with filenames than to massage them into unit names (e.g. by replacing dashes by dots). Also, if you have krunched file names, there is no simple connection between the file name and the unit name. If a unit spec contains a path, the HTML file for that unit is placed into that directory unless overridden by a \fB\-o\fR option. Note that if the unit spec contains a path, you'll most probably also have to set a \fB\-T\fR or \fB\-I\fR option, unless you do happen to have the ASIS information available directly (i.e., a tree file for the unit in the current directory; but that's not exactly typical). In file input mode, the \fB\-o\fR option (if given at all) may either be "\-" (in which case all output goes to stdout) or specify a directory, but must not specify a file. \fBadabrowse\fR assumes a GNAT\-like naming scheme for source and HTML files. It also assumes that there is one library unit per file. As of V1.4, \fBadabrowse\fR can handle krunched file names in the \fB\-f\fR option, provided it can find a source file, and it has the extension \fB.ads\fR. If so, \fBadabrowse\fR opens and parses the source file to extract the unit name, instead of deriving it directly from the file name. Note that generated files always have names based on the unit name, not the original file name: i.e., output file names will never be krunched. Generated HTML files always have the suffix ".html" (not ".htm"). .SH "INDEX GENERATION" Index generation is active when \fBadabrowse\fR is told to process several units, and the output does not go to stdout (when the \fB\-o\-\fR option has been given). There are several options controlling index generation: .PD 0 16 .IP \fB\-i\fR\ or\ \fB\-is\fR 16 Switches on generation of a unit index. .IP \fB\-p\fR 16 Switches on generation of a subprogram index. .IP \fB\-t\fR 16 Switches on generation of a type index. .PD .PP All these options take an optional filename as a parameter. If a filename follows, the index will be written to that file (or to stdout, if the filename happens to be "\-"). If no filename is given, some default name is chosen. All these options are actually maintained only for backwards compatibility reasons. As of V4.0, indices are defined primarily through configuration file entries, not on the command line. In order not to break existing scripts using command line options of earlier \fBadabrowse\fR versions, these options are still available. \fBadabrowse\fR assumes it will process several units in the following cases: .PD 0 .IP \(bu 4 In file input mode (\fB\-f @\fR\fIfile_name\fR or \fB\-f\-\fR). .IP \(bu 4 When using a project file (\fB\-P\fR \fIproject_file_name\fR). This option is disabled in Debian. .IP \(bu 4 When the \fB\-all\fR option is given. .PD .PP If no filename is given, or it doesn't contain a path, it depends upon the setting of other options where the index will be placed: .PD 0 .IP \(bu 4 In file input mode, if a \fB\-o\fR option is given, it must specify a directory. All HTML files, including the index, will be put into that directory. .IP \(bu 4 If no \fB\-o\fR option is given, but the first unit spec contains a path, the index is put into the directory designated by that path. .IP \(bu 4 If not in file input mode, but the \-all option has been given, the \fB\-o\fR option may specify a file name. The index is put into the directory designated by the path part of that file name (the current directory, if the filename doesn't contain a path). .IP \(bu 4 If using a project file, the indices are written into the ADABROWSE_OUTPUT directory. .IP \(bu 4 Otherwise, this index is put in the current directory. .PD .PP If a filename containing a path is given, the index will be placed into that file in the given directory. If the filename contains only a path, \fBadabrowse\fR will use that path and create an index named "index.html" in the designated directory. If a \fB\-x\fR option is given (inhibiting overwriting of existing HTML files) and a file exists already in the place where \fBadabrowse\fR wants to put the index, no index will be generated and \fBadabrowse\fR will issue a warning. It'll also warn if it cannot generate an index for any other reasons, but will otherwise continue processing. .SH "SEE ALSO" .BR gnatgcc (1), .BR gnatkr (1) The full user's guide in /usr/share/doc/adabrowse. .SH BUGS The Debian package of \fBadabrowse\fR does not have the Project Manager feature; the command\-line option \fB\-P\fR \fIproject_file\fR is therefore disabled. .SH AUTHOR \fBadabrowse\fR and the accompanying documentation was written by Thomas Wolf . Ludovic Brenta merely turned part of the user's guide into this manual page for the Debian project.