Tom Manual

Jean-Christophe Bach 1 Emilie Balland 1 Paul Brauner 1 Radu Kopetz 1 Pierre-Etienne Moreau 1 Antoine Reilles 1
1 PAREO - Formal islands: foundations and applications
INRIA Lorraine, LORIA - Laboratoire Lorrain de Recherche en Informatique et ses Applications
Abstract : This manual contains information for Tom version 2.7. Tom is a language extension which adds new matching primitives to languages like C, Java, and Caml. Although rich and complex, Tom is not a stand-alone language: like a preprocessor, it strongly relies on the underlying language (C, Java, or Caml), called host-language in the following. To this language, Tom adds several constructs. The main construct, %match, is similar to the match primitive found in functional languages: given an object (called subject) and a list of patterns-actions, the match primitive selects the first pattern that matches the subject and performs the associated action. The sub ject against which we match can be any object, but in practice, this ob ject is usually a tree-based data-structure, also called term in the algebraic programming community. The match construct may be seen as an extension of the classical switch/case construct. The main difference is that the discrimination occurs on a term and not on atomic values like characters or integers: the patterns are used to discriminate and retrieve information from an algebraic data structure. There- fore, Tom is a good language for programming by pattern matching, and it is particularly well-suited for programming various transformations on trees/terms or Xml data-structures.
Type de document :
[Technical Report] 2009, pp.155
Liste complète des métadonnées
Contributeur : Pierre-Etienne Moreau <>
Soumis le : mercredi 25 novembre 2009 - 10:53:24
Dernière modification le : mardi 12 juin 2018 - 09:54:02
Document(s) archivé(s) le : samedi 26 novembre 2016 - 15:36:07


Fichiers produits par l'(les) auteur(s)


  • HAL Id : inria-00121885, version 4



Jean-Christophe Bach, Emilie Balland, Paul Brauner, Radu Kopetz, Pierre-Etienne Moreau, et al.. Tom Manual. [Technical Report] 2009, pp.155. 〈inria-00121885v4〉



Consultations de la notice


Téléchargements de fichiers