def METHOD_NAME(self, pattern_str: str):
    pattern = InputStream(pattern_str)
    parseErrListener = STIXPatternErrorListener()
    lexer = lexer_v20(pattern)
    lexer.removeErrorListeners()
    stream = CommonTokenStream(lexer)
    parser = parser_v20(stream)
    parser.removeErrorListeners()
    parser.addErrorListener(parseErrListener)
    for i, lit_name in enumerate(parser.literalNames):
        if lit_name == u"<INVALID>":
            parser.literalNames[i] = parser.symbolicNames[i]
    tree = parser.pattern()
    inspection_listener = inspector_v20()
    if len(parseErrListener.err_strings) == 0:
        ParseTreeWalker.DEFAULT.walk(inspection_listener, tree)
        pattern_data = inspection_listener.pattern_data()
        obj_validator_results = validator_v20.verify_object(pattern_data)
        if obj_validator_results:
            parseErrListener.err_strings.extend(obj_validator_results)
        else:
            self.__set_pattern_data(pattern_data)
    self.__valid = self.__parse_err_listener(parseErrListener.err_strings)