Code example for StreamTokenizer

Methods: toString

0
    /** 
     * Formats a detailed description of tokenizer status: current token, 
     * current line number, etc. 
     */ 
    protected String composeStatus(StreamTokenizer st) {
        return st.toString();
    } 
 
    /** 
     * Throws InvalidFormatException with detailed diagnostics. 
     * 
     * @param st 
     *            a tokenizer holding the erroneous token 
     * @param message 
     *            a user-friendly comment, probably explaining expected syntax. 
     *            Should not be <code>null</code>- use the overloaded 
     *            single-parameter method instead. 
     */ 
    protected final void handleUnexpectedToken(StreamTokenizer st, String message)
            throws InvalidFormatException { 
        throw new InvalidFormatException("Unexpected token encountered: " +