-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.1
-
x86
-
windows_95
Name: mc57594 Date: 02/17/97
import java.io.*;
public class Test2
{
public static void main( String[] args)
throws Exception
{
StreamTokenizer tokens = new StreamTokenizer( System.in);
tokens.resetSyntax();
tokens.wordChars( 'a', 'z');
tokens.wordChars( 'A', 'Z');
tokens.wordChars( '0', '9');
tokens.wordChars( '_', '_');
tokens.wordChars( '-', '-');
tokens.wordChars( '.', '.');
tokens.wordChars( '\\', '\\');
tokens.wordChars( '/', '/');
tokens.wordChars( '*', '*');
tokens.wordChars( ':', ':');
tokens.whitespaceChars( ' ', ' ');
tokens.whitespaceChars( '\t', '\t');
tokens.eolIsSignificant( true);
for( ; ;)
{
int ttype = tokens.nextToken();
switch( ttype)
{
case tokens.TT_WORD:
System.out.print( "Word :");
System.out.println( tokens.sval);
if( tokens.sval.equals( "exit"))
return;
break;
case tokens.TT_NUMBER:
System.out.println( tokens.nval);
break;
case tokens.TT_EOL:
System.out.println( "New line");
break;
case tokens.TT_EOF:
System.out.println( "End of file");
return;
default:
System.out.print( "Token received ");
System.out.println( ttype);
break;
}
}
}
}
company - , email - ###@###.###
======================================================================