private Token read(Token token) throws ScriptException {
        while (line != null) {
            char ch = charAt(index);
            index++;
            if (Character.isDigit(ch))
                return readInteger(token.append(ch));
            if (ch == '\0')
                return token;
            if (isOperator(token, ch))
                return readOperator(token.append(ch));
            if (!Character.isWhitespace(ch))
                throw error(ch);
            if (index >= line.length())
                readNextLine();
        }
        return null;
    }