'@todo: docstring'

def processList(self, rules, row, col, matrix, action='rows'):

    startcol = col
    startrow = row
    endcol = col
    endrow = row
    for element in rules:
        if (action == 'rows'):
            row = startrow
            col = endcol
        elif (action == 'columns'):
            row = endrow
            col = startcol
        if isinstance(element, list):
            (endrow, endcol) = self.processList(element, row, col, matrix, action)
        elif isinstance(element, dict):
            (endrow, endcol) = self.processDict(element, rules, row, col, matrix, action)
        else:
            (endrow, endcol) = self.addMethod(self, element, row, col)
        if (endrow > self.nextrow):
            self.nextrow = endrow
        if (endcol > self.nextcol):
            self.nextcol = endcol
    self.addToLayout(startrow, startcol)
    return (self.nextrow, self.nextcol)
