JPlex - lexical analyzer generator
JPlex is a generator of fast DFA-based lexical analyzers. It has a few unusual features:
- It generates push-driven lexers instead of the more common pull-based ones.
- It's an ideal front end for hand-written parsers. Instead of calling a single parser method that must switch on the token type, rules call methods on a listener interface. You just implement the interface (or extend the adapter) and add your implementation as a listener.
- It supports multiple rule sets ("states"). Rules can push, pop, or jump to other states. This makes it easy to recognize patterns like nested block comments.
- States can be "strict" (require matching of all input) or not, as desired.
- It pre-compiles and serializes its DFAs, so startup is fast even with a large, complex rule set.
I've used it to write a hybrid Telnet/VT-series/ANSI terminal emulation. It was quick and easy to write.
JPlex / Code / [r2] /trunk