# Path: lib/robot/parsing/comments.py
# class CommentCache(object):
# 
#     def __init__(self):
#         self._comments = []
# 
#     def add(self, comment):
#         self._comments.append(comment)
# 
#     def consume_with(self, function):
#         map(function, self._comments)
#         self.__init__()
# 
# class Comments(object):
# 
#     def __init__(self):
#         self._comments = []
# 
#     def add(self, row):
#         if row.comments:
#             self._comments.extend(c.strip() for c in row.comments if c.strip())
# 
#     @property
#     def value(self):
#         return self._comments
# 
# Path: lib/robot/parsing/settings.py
# class Documentation(Setting):
# 
#     def _set_initial_value(self):
#         self.value = ''
# 
#     def _populate(self, value):
#         self.value = self._concat_string_with_value(self.value, value)
# 
#     def _string_value(self, value):
#         return value if isinstance(value, basestring) else ''.join(value)
# 
#     def _data_as_list(self):
#         return [self.setting_name, self.value]
# 
# class MetadataList(_DataList):
# 
#     def populate(self, name, value, comment):
#         self._add(Metadata(self._parent, name, value, comment, joined=True))


import re
from .comments import CommentCache, Comments
from .settings import Documentation, MetadataList



class Populator(object):
    """Explicit interface for all populators."""

    def add(self, row):
        raise NotImplementedError

    def populate(self):
        raise NotImplementedError


class NullPopulator(Populator):

    def add(self, row):
        pass

    def populate(self):
        pass

    def __nonzero__(self):
        return False


class _TablePopulator(Populator):

    def __init__(self, table):
        self._table = table
        self._populator = NullPopulator()

# Path: lib/robot/parsing/comments.py
# class CommentCache(object):
# 
#     def __init__(self):
#         self._comments = []
# 
#     def add(self, comment):
#         self._comments.append(comment)
# 
#     def consume_with(self, function):
#         map(function, self._comments)
#         self.__init__()
# 
# class Comments(object):
# 
#     def __init__(self):
#         self._comments = []
# 
#     def add(self, row):
#         if row.comments:
#             self._comments.extend(c.strip() for c in row.comments if c.strip())
# 
#     @property
#     def value(self):
#         return self._comments
# 
# Path: lib/robot/parsing/settings.py
# class Documentation(Setting):
# 
#     def _set_initial_value(self):
#         self.value = ''
# 
#     def _populate(self, value):
#         self.value = self._concat_string_with_value(self.value, value)
# 
#     def _string_value(self, value):
#         return value if isinstance(value, basestring) else ''.join(value)
# 
#     def _data_as_list(self):
#         return [self.setting_name, self.value]
# 
# class MetadataList(_DataList):
# 
#     def populate(self, name, value, comment):
#         self._add(Metadata(self._parent, name, value, comment, joined=True))


# Path: lib/robot/parsing/tablepopulators.py
import re
from .comments import CommentCache, Comments
from .settings import Documentation, MetadataList




class Populator(object):
    """Explicit interface for all populators."""

    def add(self, row):
        raise NotImplementedError

    def populate(self):
        raise NotImplementedError


class NullPopulator(Populator):

    def add(self, row):
        pass

    def populate(self):
        pass

    def __nonzero__(self):
        return False


class _TablePopulator(Populator):

    def __init__(self, table):
        self._table = table
        self._populator = NullPopulator()

        self._comment_cache = CommentCache()