wisi is an Emacs package providing utilities for indentation and navigation of source code files in Emacs. Currently, it is used for the Ada and gpr languages; other people are considering using it for other languages.
The source language to be indented is described by a grammar file in a bnf-like form, very similar to the bison grammar file. That is processed by the wisi-generate tool, to produce an elisp source file defining the parse tables for a generalized LALR parser. The parser is implemented in elisp.
This works quite well, except that it can be noticably slow on very large files (~ 1.2 second for 7000 lines of Ada on my machine).
The semantic information produced by the parser is stored in text properties; they are used by the indentation and navigation engine. This makes it possible to provide very detailed indentation and navigation for a complex language like Ada.
This means the indentation engine fails if the parser fails, such as for illegal syntax. Unfortunately, illegal syntax happens often when you are editing code, which is when you want indentation to work. The current approach to dealing with this problem is twofold:
This takes a little getting used to, but I find it an acceptable tradeoff for the ease of maintenance of the Ada mode indentation engine, compared to other approaches. Some users of Ada mode have other opinions.
A better solution to this problem is robust error handling in the parser.
wisi-generate is written in Ada 2012, using the OpenToken parser library. See the Opentoken website for download and build information.
Discussion about wisi and wisi-generate takes place on the Emacs ada-mode mailing list.
The ada-france monotone repository has up-to-date code.
Subscribe to the Emacs ada-mode mailing list archive
Please report bugs both to the mailing list and to the Emacs bug tracker, or to me directly. Put Package: emacs, wisi as the first line of the Emacs bug tracker message.
my home page Author : Stephen Leake Last modified: Sun Feb 17 07:02:04 EST 2013