Skip to content

fnl/libfsmg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libfsmg

Synopsis

A generic finite state machine library.

Overview

This library provides two means of pattern matching: Knuth-Morris-Pratt (KMP; for the Iterator interface) and Boyer-Moore (BM; for the List interface) algorithm-based exact matchers (i.e., two DFAs) and a weighted backtracking-based pattern matcher using dynamic programming that provides Kleene closures (*, +, and ?) and capture groups (( ... )) for the matched patterns (i.e., a NFA). The entire library is implemented using generics (i.e., requires Java 1.5 and beyond), so that any sequence of types may be used (arrays, Lists and any sequence that provides the Iterator protocol). The APIs are implemented as close as possible to Java's own Pattern and Matcher APIs in util.regex.

Usage

See the Java API index page of this library for general information, or the specific notes on using an ExactMatcher (a BM List matcher), the ExactScanner (a KMP Iterator scanner), and on implementing the NFA Pattern matcher. For an example of using the pattern matcher, refer to the txtfnnl project to find examples of the Transition interface , the Pattern implementation , and an actual CFG pattern compiler .

Installation

Clone from github ( git clone git://github.com/fnl/libfsmg.git ), and run mvn install in the newly created libfsmg directory.

libfsmg is free, open source software provided via a Apache 2.0 License -see LICENSE.txt in this directory for details.

Copyright 2012, 2013 - Florian Leitner (fnl). All rights reserved.

About

A finite state machine library for pattern matching on generic types in Java sequence containers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages