1 import java
.io
.IOException
;
2 import java
.io
.StreamTokenizer
;
3 import java
.io
.StringReader
;
6 public static void test(String str
) throws IOException
{
7 StringReader reader
= new StringReader(str
);
8 StreamTokenizer st
= new StreamTokenizer(reader
);
15 case StreamTokenizer
.TT_WORD
:
16 System
.out
.println("[TT_WORD]: " + st
.sval
);
18 case StreamTokenizer
.TT_NUMBER
:
19 System
.out
.println("[TT_NUMBER]: " + st
.nval
);
21 case StreamTokenizer
.TT_EOL
:
22 System
.out
.println("[TT_EOL]");
24 case StreamTokenizer
.TT_EOF
:
25 System
.out
.println("[TT_EOF]");
28 System
.out
.println((char)t
);
31 } while (t
!= StreamTokenizer
.TT_EOF
);
34 public static void main(String
[] args
) {
37 } catch (Throwable t
) {