    public void setScriptToTokenize(String script) {
        _queries.clear();
        String MULTI_LINE_COMMENT_END = "*/";
        String MULTI_LINE_COMMENT_BEGIN = "/*";
        script = script.replace('\r', ' ');
        StringBuffer curQuery = new StringBuffer();
        boolean isInLiteral = false;
        boolean isInMultiLineComment = false;
        boolean isInLineComment = false;
        int literalSepCount = 0;
        for (int i = 0; i < script.length(); ++i)
        {
            char c = script.charAt(i);
            if(false == isInLiteral)
            {
                if(isInLineComment && script.startsWith("\n", i - "\n".length()))
                {
                    isInLineComment = false;
                }
                if(isInMultiLineComment && script.startsWith(MULTI_LINE_COMMENT_END, i - MULTI_LINE_COMMENT_END.length()))
                {
                    isInMultiLineComment = false;
                }
                if(false == isInLineComment && false == isInMultiLineComment)
                {
                    isInMultiLineComment = script.startsWith(MULTI_LINE_COMMENT_BEGIN, i);
                    isInLineComment = script.startsWith(_lineCommentBegin, i);
                    if(isInMultiLineComment && _removeMultiLineComment)
                    {
                        i+=MULTI_LINE_COMMENT_BEGIN.length()+1;
                    }
                }
                if((isInMultiLineComment && _removeMultiLineComment) || isInLineComment)
                {
                    continue;
                }
            }
            curQuery.append(c);
            if ('\'' == c)
            {
                if(false == isInLiteral)
                {
                    isInLiteral = true;
                }
                else
                {
                    ++literalSepCount;
                }
            }
            else
            {
                if(0 != literalSepCount % 2)
                {
                    isInLiteral = false;
                }
                literalSepCount = 0;
            }
            int querySepLen = 
                getLenOfQuerySepIfAtLastCharOfQuerySep(script, i, _querySep, isInLiteral);
            if(-1 < querySepLen)
            {
                int newLength = curQuery.length() - querySepLen;
                if(-1 < newLength && curQuery.length() > newLength)
                {
                    curQuery.setLength(newLength);
                    String newQuery = curQuery.toString().trim();
                    if(0 < newQuery.length())
                    {
                        _queries.add(curQuery.toString().trim());
                    }
                }
                curQuery.setLength(0);
            }
        }
        String lastQuery = curQuery.toString().trim();
        if(0 < lastQuery.length())
        {
            _queries.add(lastQuery.trim());
        }
        _queryIterator = _queries.iterator();
    }

    public void setScriptToTokenize(String script) {
        _queries.clear();
        String MULTI_LINE_COMMENT_END = "*/";
        String MULTI_LINE_COMMENT_BEGIN = "/*";
        script = script.replace('\r', ' ');
        StringBuffer curQuery = new StringBuffer();
        boolean isInLiteral = false;
        boolean isInMultiLineComment = false;
        boolean isInLineComment = false;
        int literalSepCount = 0;
        for (int i = 0; i < script.length(); ++i)
        {
            char c = script.charAt(i);
            if(false == isInLiteral)
            {
                if(isInLineComment && script.startsWith("\n", i - "\n".length()))
                {
                    isInLineComment = false;
                }
                if(isInMultiLineComment && script.startsWith(MULTI_LINE_COMMENT_END, i - MULTI_LINE_COMMENT_END.length()))
                {
                    isInMultiLineComment = false;
                }
                if(false == isInLineComment && false == isInMultiLineComment)
                {
                    isInMultiLineComment = script.startsWith(MULTI_LINE_COMMENT_BEGIN, i);
                    isInLineComment = script.startsWith(_lineCommentBegin, i);
                    if(isInMultiLineComment && _removeMultiLineComment)
                    {
                        i+=MULTI_LINE_COMMENT_BEGIN.length()+1;
                    }
                }
                if((isInMultiLineComment && _removeMultiLineComment) || isInLineComment)
                {
                    continue;
                }
            }
            curQuery.append(c);
            if ('\'' == c)
            {
                if(false == isInLiteral)
                {
                    isInLiteral = true;
                }
                else
                {
                    ++literalSepCount;
                }
            }
            else
            {
                if(0 != literalSepCount % 2)
                {
                    isInLiteral = false;
                }
                literalSepCount = 0;
            }
            int querySepLen = 
                getLenOfQuerySepIfAtLastCharOfQuerySep(script, i, _querySep, isInLiteral);
            if(-1 < querySepLen && !isInMultiLineComment)
            {
                int newLength = curQuery.length() - querySepLen;
                if(-1 < newLength && curQuery.length() > newLength)
                {
                    curQuery.setLength(newLength);
                    String newQuery = curQuery.toString().trim();
                    if(0 < newQuery.length())
                    {
                        _queries.add(curQuery.toString().trim());
                    }
                }
                curQuery.setLength(0);
            }
        }
        String lastQuery = curQuery.toString().trim();
        if(0 < lastQuery.length())
        {
            _queries.add(lastQuery.trim());
        }
        _queryIterator = _queries.iterator();
    }
