Code example for StreamTokenizer

Methods: ordinaryChar, slashSlashComments

0
		this(new FileReader(fileName));
	} 
 
	/** Construct from an existing Reader */ 
	public SimpleCalcStreamTok(Reader rdr) throws IOException {
		tf = new StreamTokenizer(rdr);
		// Control the input character set: 
		tf.slashSlashComments(true);	// treat "//" as comments
		tf.ordinaryChar('-');		// used for subtraction
		tf.ordinaryChar('/');	// used for division
 
		s = new Stack();
	} 
 
	/** Construct from a Reader and a PrintWriter 
	 */ 
	public SimpleCalcStreamTok(Reader in, PrintWriter out) throws IOException {
		this(in);
		setOutput(out);
	}