Otags III: Emacs and vi Tag Generation for OCaml
Otags generates TAGS files suitable for emacs and vi/vim from OCaml sources. Otags III relies
on the standard OCaml parser from the compiler-libs library (in contrast to previous otags
reloaded versions that employed camlp4).
Recent Changes
- 2017-08-26: otags 4.05.1 released
-
- Update for OCaml 4.05.
- Enable tagging of attributes and methods in class signature,
now that the OCaml parsetree contains the necessary location info.
- Support pre-processed files with line directives again: For
this, all files are read twice now, because the standard OCaml
parser does not tell if it found a line directive, see also OCaml PR 823.
- 2017-01-05: otags 4.04.1 released
-
- Update for OCaml 4.04
- Improved future compatibility: Otags can now be compiled with
future OCaml versions as long as they only add constructors in the
abstract syntax tree.
- 2016-09-22: otags 4.03.1 released
-
- Switch to OCaml standard parser from the compiler-libs
library and drop the dependency on camlp4. All options
controlling the camlp4 engine (-pa, -extern, ...) are gone.
- Restrict input to what ocamlc accepts: no syntax extensions
or toplevel directives. Additionally, files with line directives
(from ocamlyacc, ocamllex or cppo) are not supported.
- Fix file descriptor leakage for option -r.
See also the
complete list of changes.
Download
Latest version:
[otags-4.05.1.tar.gz].
Previous versions:
4.04.1,
4.03.1,
4.02.2,
4.02.1,
4.01.1,
4.00.2,
4.00.1,
3.12.5,
3.12.4,
3.12.3,
3.12.2,
3.12.1,
3.11.3,
3.11.2,
3.11.1
Installation
- ./configure
Optionally use --prefix, --bindir or --mandir if you don't like
the default installation directories.
- make
- make install
You might need to become superuser before make install.
Bleeding edge OCaml users may use the configure option
--no-version-check to compile otags for an unsupported
version of OCaml.
Usage
Do
otags -r .
to generate an Emacs TAGS table for all .ml and
.mli files in the current directory tree. For
more details consult
the man page.
Compatibility and Otags version numbers
For tagging source files otags uses a recursive function that
traverses the abstract syntax tree that comes out of the OCaml
parser. It is therefore quite unlikely that a given otags version
works well for more than one major OCaml version. For this reason
otags version numbers simply follow the OCaml version numbers.
For instance otags version 4.03.1 is the 1. otags release for
OCaml 4.03.xx. In general, an otags version X.YY.Z will only
compile with OCaml X.YY.*
History
Cuihtlauac
Alvarado and Jean-Francois
Monin wrote the first versions of otags based on camlp4.
Some old otags version can still be
found on their websites.
Around 2005 I released a few versions for OCaml 3.09. All these
old otags versions require the original camlp4 from Daniel de Rauglaudre,
which is now available as camlp5. My
latest release for the old camlp4 was otags 3.09.3.3 for OCaml
3.09.3. The debian maintainers developed some patches to make
this version compile with later OCaml versions and camlp5.
For 3.11 I rewrote otags from scratch for the new camlp4 and released
several versions under the name otags reloaded. The modular
structure of camlp4 made it possible to switch the parsing engine at
runtime between files and to parse all syntax supported by camlp4 at
full native speed without external camlp4 processes. However, the
increasing incompatibility between camlp4 and OCaml and camlp4's
sloppiness on parsing locations created more and more difficulties.
For instance, otags 4.02 failed on the OCaml standard library because
camlp4 was unable to digest the attribute annotations in there.
Starting from 4.03, otags is based on the standard OCaml parser from
the compiler-libs library and has been renamed to otags III.
last changed on
22 Sep 2016
by Hendrik