protected function isBlockEnd($line, $blockName = null)
    {
        $line = trim($line);
        $pattern = '/^\<\/';
        $pattern .= ($blockName) ? $blockName : '[^\s\>]+';
        $pattern .= '\>$/';
        return (preg_match($pattern, $line) > 0);
    }