| This is a test program demonstrating an application of the matchesPrefix()
methods. This example program shows how you might tokenize a stream of
input using whitespace as a token separator. Don't forget to use quotes
around the input on the command line, e.g.
java prefixExample "Test to see if 1.0 is real and 2 is an integer"
If you don't need the power of a full blown lexer generator, you can
easily use regular expressions to create your own tokenization and
simple parsing classes using similar approaches. This example is
rather sloppy. If you look at the equivalent example in the OROMatcher
distribution, you'll see how to Perl's zero-width look ahead assertion
makes correctness easier to achieve.
version: @version@ |