def ClauseD(self, rule,tokens, _parent=None):
        _context = self.Context(_parent, self._scanner, 'ClauseD', [rule,tokens])
        _token = self._peek('STR', 'ID', 'LP', 'LB', 'STMT', context=_context)
        if _token == 'STR':
            STR = self._scan('STR', context=_context)
            t = (STR, eval(STR,{},{}))
            if t not in tokens: tokens.insert( 0, t )
            return parsetree.Terminal(rule, STR)
        elif _token == 'ID':
            ID = self._scan('ID', context=_context)
            OptParam = self.OptParam(_context)
            return resolve_name(rule,tokens, ID, OptParam)
        elif _token == 'LP':
            LP = self._scan('LP', context=_context)
            ClauseA = self.ClauseA(rule,tokens, _context)
            RP = self._scan('RP', context=_context)
            return ClauseA
        elif _token == 'LB':
            LB = self._scan('LB', context=_context)
            ClauseA = self.ClauseA(rule,tokens, _context)
            RB = self._scan('RB', context=_context)
            return parsetree.Option(rule, ClauseA)
        else: # == 'STMT'
            STMT = self._scan('STMT', context=_context)
            return parsetree.Eval(rule, STMT[2:-2])
dataset/ETHPy150Open smurfix/yapps/yapps/grammar.py/ParserDescription.ClauseD/original