def allocateTempVariable(self, temp_scope, name): if temp_scope is not None: full_name = "%s__%s" % ( temp_scope, name ) else: assert name != "result" full_name = name del name assert full_name not in self.temp_variables, full_name result = Variables.TempVariable( owner = self, variable_name = full_name ) self.temp_variables[full_name] = result addVariableUsage(result, self) return result
def getTempVariable(self, name): assert name not in self.temp_variables, name result = Variables.TempVariable(owner=self, variable_name=name) self.temp_variables[name] = result return result
def createTempVariable(self, temp_name): if temp_name in self.temp_variables: return self.temp_variables[temp_name] result = Variables.TempVariable(owner=self, variable_name=temp_name) self.temp_variables[temp_name] = result return result