

def _create_opt_rule(self, rulename):
    ' Given a rule name, creates an optional ply.yacc rule\n            for it. The name of the optional rule is\n            <rulename>_opt\n        '
    optname = (rulename + '_opt')

    def optrule(self, p):
        p[0] = p[1]
    optrule.__doc__ = ('%s : empty\n| %s' % (optname, rulename))
    optrule.__name__ = ('p_%s' % optname)
    setattr(rulename.__class__, optrule.__name__, optrule)

dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/pycparser-2.14/pycparser/plyparser.py PLYParser._create_opt_rule/VarMisuse@70/161 `self`->`rulename`