@classmethod
def compile(cls, pattern):
    """ Check whether we've parsed this pattern before, and if so,
            re-use the result """
    if pattern in cls._pattern_cache:
        return cls._pattern_cache[pattern]
    cp = cls._pattern_cache[pattern] = cls(pattern)
    return cp
