Skip to content
Martijn Schrage edited this page Mar 2, 2017 · 4 revisions

To build an editor, we need to provide a number of sheets, two modules Main and Settings, and a Proxima.cabal file and the Makefile, which can be copied from any of the example instantiations. The Main module does not need to be modified, but in Settings we can define the name of the editor, the HTTP port it should use, and a number of other settings. The src directory of the instantiation should also contain the proxima project directory from Subversion (in the example instantiations, this is done automatically by using the Subversion externals mechanism). The sheets may be created from scratch, but when building an editor, it is probably wise to copy the declarationForm instance (which contains four editors), and modify the sheets to get the desired editor.

Before attempting to build an editor, it is wise to read the SBLP paper on parsing graphical presentations in Proxima (pdf), as it explains the different ways of parsing and presenting used in Proxima.

The editors document type and behavior is defined with the following:

  • Document-type Definition: A datatype declaration of the document type and the enriched document type. The formalism is similar to a monomorphic Haskell data type, with support for lists.
  • Presentation Sheet: An attribute grammar that specifies for each language construct how it is presented. Simple computations, such as section counters, or static checks on the document (e.g. whether a reference is defined or not) can be implemented here as well.
  • Scanner Sheet: A set of regular expressions for the tokens in the textual parts of the presentation.
  • Parsing Sheet: A module that contains the parsers for each part of the presentation that is presented textually.

For most editors, the computations can be specified in the presentation sheet. However, for more complex editors, two extra sheets can be provided to deal with derived structures and values: the Evaluation and reduction sheets.

The evaluation and reduction sheets are plain Haskell, the presentation sheet is an attribute grammar for the uuagc system, the parser sheet is written with uulib parsing combinators, and the scanner uses Alex.

Documents about Proxima instantiations

A small manual that describes what needs to be done to build an editor with Proxima was written by Joost Verhoog as part of the course Editing Structured Documents and XML: Proxima Extension Manual

Other sources of information are the master's thesis of Gerbo Engels (pdf) about building a Haskell editor with Proxima, and a colloquium report by Gideon Smeding (pdf) that discusses the construction of a slide-show editor.

-- Main.MartijnSchrage - 25 Feb 2010

Clone this wiki locally