MatchO - Matching Objects
What is MatchO?
MatchO provides support for matching objects within Java in the form of a Pattern interface which has various implementations for various types of objects. The underlying ideas are explained in the paper:
MatchO currently sports the following features:
Pattern matching on lists and arrays.
Pattern matching on various tree representations:
Antlr's abstract syntax trees (antlr.collections.AST).
Maximally shared annotated terms of the ATerm Library (aterm.ATerm).
JJTraveler's visitables (jjtraveler.Visitable).
Non-linear pattern matching.
Generic pattern-matching (covering all types mentioned above).
Mixing of patterns and visitors (for matching at arbitrary depths and for 'active patterns').
MatchO can be used in combination with parser generators like Antlr or JJForester to perform pattern matching on parse trees.
To learn how to use the library, see the paper.
Since the full
library provides matching behaviour for a range of tree representations, you might be interested in only downloading a sub-set that fits your needs. The following jars are available:
The following documentation is available:
Joost Visser, Matching Objects Without Language Extension. Accepted for publication in the Dec/Nov 2006 issue of the Journal of Object Technology. Draft version: pdf.
API documentation html
If you visited this page before November 2005, you found here previous snapshots of MatchO which is now obsolete. If you have questions about such previous versions, please contact