protected function parseNextRecord(AbstractDataProvider $dataProvider, array $dataSubmitters = NULL, $attempt = 0) {
        $line = $dataProvider->readLine();
        if ($line === FALSE) {
            return NULL;
        }

        $record = NULL;

        $delimiterSize = strlen($this->delimiter);

        // the following flag is used to support lines where first column value is empty string
        $isDelimiterExpected = FALSE;

        // preparing line properties
        $index = 0;
        $lineLength = strlen($line);

        // parsing the line
        while ($index < $lineLength) {
            // to resolve the following issues: <,  "...."  ,>
            if ($line{$index} == ' ') {
                $index++;
                continue;
            }

            if ($isDelimiterExpected) {
                if (substr($line, $index, $delimiterSize) == $this->delimiter) {
                    $index += $delimiterSize;
                }
                else {
                    // reached end of line
                }
            }

            if (($index < $lineLength) && ($line{$index} == '"')) {
                $originalLineNumber = NULL;
                $originalLinePosition = $index + 1;

                $value = '';

                $index++;
                while (TRUE) {
                    do {
                        $i = strpos($line, '"', $index);
                        if ($i === FALSE) {
                            if (!isset($originalLineNumber)) {
                                $originalLineNumber = $dataProvider->getCurrentLineNumber();
                            }

                            // it is possible that the record spreads across several lines
                            $s = $dataProvider->readLine();
                            if ($s === FALSE) {
                                LogHelper::log_debug($record);
                                $e = new DataParserException(t(
                                    'Inconsistent file structure. Could not find second " in row column value [line: %lineNumber; position: %linePosition]',
                                    array('%lineNumber' => $originalLineNumber, '%linePosition' => $originalLinePosition)));
                                throw $e;
                            }
                            $line .= ' ' . $s;
                            $lineLength += strlen($s) + 1; // + 1 is for space
                        }
                    }
                    while ($i === FALSE);

                    if (($attempt == self::$PARSING_METHOD__SUPPORT_BACKSLASH) && ($line{$i - 1} == '\\')) {
                        // support for nested " which is marked as '\"'
                        $value .= substr($line, $index, $i - $index - 1) . '"';
                        $index = $i + 1;
                    }
                    elseif ((($i + 1) < $lineLength) && ($line{$i + 1} == '"')) {
                        // support for nested " which is marked as '""'
                        $value .= substr($line, $index, $i - $index + 1);
                        $index = $i + 2;
                    }
                    else {
                        $value .= substr($line, $index, $i - $index);
                        $index = $i + 1;
                        break;
                    }
                }
            }
            else {
                $indexEnd = strpos($line, $this->delimiter, $index);
                if ($indexEnd === FALSE) {
                    $indexEnd = $lineLength;
                }

                $value = ($index < $indexEnd) ? substr($line, $index, $indexEnd - $index) : '';

                $index = $indexEnd;
            }

            // post-converting value
            $value = trim($value);

            $record[] = $value;

            $isDelimiterExpected = TRUE;
        }

        // when empty line is passed to this method it means we have one column with empty value
        if (!isset($record)) {
            $record[] = '';
        }

        $this->executeAfterLineParsed($dataSubmitters, $record);

        return $record;
    }