String s = null;
int i;
while ((i = tf.nextToken()) != StreamTokenizer.TT_EOF) {
switch(i) {
case StreamTokenizer.TT_EOF:
System.out.println("End of file");
break;
case StreamTokenizer.TT_EOL:
System.out.println("End of line");
break;
case StreamTokenizer.TT_NUMBER:
System.out.println("Number " + tf.nval);
break;
case StreamTokenizer.TT_WORD:
System.out.println("Word, length " + tf.sval.length() + "->" + tf.sval);
break;
default:
System.out.println("What is it? i = " + i);
}
}