def model_from_str(self, model_str, debug=None,
                       pre_ref_resolution_callback=None):
        """
        Instantiates model from the given string.
        :param pre_ref_resolution_callback: called before references are
               resolved. This can be useful to manage models distributed
               across files (scoping)
        """

        if type(model_str) is not text:
            raise TextXError("textX accepts only unicode strings.")

        model = self._parser_blueprint.clone().get_model_from_str(
            model_str, debug=debug,
            pre_ref_resolution_callback=pre_ref_resolution_callback)
        for p in self._model_processors:
            p(model, self)
        return model
Instantiates model from the given string.
        :param pre_ref_resolution_callback: called before references are
               resolved. This can be useful to manage models distributed
               across files (scoping)