def _getTokenPatterns(parsercls):
    tokensDict={}
    for name, obj in parsercls.__dict__.items() :
        # print "class %s has attribute %s" % (parsercls.__name__, m)
        if name.startswith('t_') and name != 't_error' :
            # strip off 't_'
            k = name[2:]
            if isinstance(obj, basestring) :
                v = obj
            elif inspect.isfunction(obj) or inspect.ismethod(obj) :
                v = obj.__doc__
            else :
                raise SyntaxError, "Token definition %s defines neither a string nor a function, unable to parse" % name
            k = name[2:]
            if k in tokensDict :
                warnings.warn((k, parser) % "Token %s redefined in Parser %s", UserWarning)
            tokensDict[k] = v
    return tokensDict

# do it
#_addedTokenClasses =_createTokenClasses(debug=verbose())

# Build a dict of all existing Parser and Parsed classes in this module
#class Parsed.classes(dict) :
#    __metaclass__ =  metaStatic


#def parsedClasses(module):
#    return dict(inspect.getmembers(module, isParsedClass))
## Stores it at import so that the inspect method isn't recalled at each query
#Parsed.classes(Parsed.classes)

#class Parser.classes(dict) :
#    __metaclass__ =  metaStatic
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.5/pymel/util/objectParser.py/_getTokenPatterns/swapped operands of `%`