'Parse the current contents of the textwidget buffer, to create
a list of productions.'

def _parse_productions(self):

    productions = []
    text = self._textwidget.get('1.0', 'end')
    text = re.sub(self.ARROW, '->', text)
    text = re.sub(' DCTB ', '    ', text)
    lines = text.split('\n')
    for line in lines:
        line = line.strip()
        if (line == ''):
            continue
        productions += _read_cfg_production(line)
    return productions
