Chapter

Practical Aspects of Declarative Languages

Volume 4902 of the series Lecture Notes in Computer Science pp 150-166

Matchete: Paths through the Pattern Matching Jungle

  • Martin HirzelAffiliated withIBM Watson Research Center, 19 Skyline Drive, Hawthorne, NY 10532
  • , Nathaniel NystromAffiliated withIBM Watson Research Center, 19 Skyline Drive, Hawthorne, NY 10532
  • , Bard BloomAffiliated withIBM Watson Research Center, 19 Skyline Drive, Hawthorne, NY 10532
  • , Jan VitekAffiliated withIBM Watson Research Center, 19 Skyline Drive, Hawthorne, NY 10532Dpt. of Computer Science, Purdue University

* Final gross prices may vary according to local VAT.

Get Access

Abstract

Pattern matching is a programming language feature for selecting a handler based on the structure of data while binding names to sub-structures. By combining selection and binding, pattern matching facilitates many common tasks such as date normalization, red-black tree manipulation, conversion of XML documents, or decoding TCP/IP packets. Matchete is a language extension to Java that unifies different approaches to pattern matching: regular expressions, structured term patterns, XPath, and bit-level patterns. Matchete naturally allows nesting of these different patterns to form composite patterns. We present the Matchete syntax and describe a prototype implementation.

Keywords

Pattern matching regular expressions XPath binary data formats Java