Save This Page
Home » apache-log4j-1.2.15 » examples » awk » [javadoc | source]
examples.awk
public final class: prefixExample [javadoc | source]
java.lang.Object
   examples.awk.prefixExample
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.
Field Summary
public static final  int REAL     
public static final  int INTEGER     
public static final  int STRING     
public static final  String[] types     
public static final  String whitespace     
public static final  String[] tokens     
Method from examples.awk.prefixExample Summary:
main
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from examples.awk.prefixExample Detail:
 public static final  void main(String[] args)