def pre(self, formatter): formatter.write(""" std::remove_cv<{t}>::type {u}; unbuild(vm, {oz}, {u}); {cc} = &{u}; """.format( t=to_cc(self._type.get_pointee()), u=unique_str(), oz=self.oz_in_name, cc=self.cc_prefix ))
def pre(self, formatter): in_creator = In() in_creator._type = self._type.get_pointee() in_creator._name = unique_str() in_creator._with_declaration = True in_creator._context = self._context formatter.write('auto &' + in_creator.oz_in_name + ' = ' + self.oz_in_name + ';') in_creator.pre(formatter) formatter.write(self.cc_prefix + ' = &' + in_creator.cc_name + ';')
def pre(self, formatter): in_creator = InStatementsCreator() in_creator._type = self._type.get_pointee() in_creator._name = unique_str() in_creator._with_declaration = True in_creator._context = self._context formatter.write('auto &' + in_creator.oz_in_name + ' = ' + self.oz_in_name + ';') in_creator.pre(formatter) formatter.write(self.cc_prefix + ' = &' + in_creator.cc_name + ';')
def pre(self, formatter): formatter.write(""" std::remove_cv<%(t)s>::type %(u)s; unbuild(vm, %(oz)s, %(u)s); %(cc)s = &%(u)s; """ % { 't': to_cc(self._type.get_pointee()), 'u': unique_str(), 'cc': self.cc_prefix, 'oz': self.oz_in_name, })
def pre(self, formatter): formatter.write( """ std::remove_cv<%(t)s>::type %(u)s; unbuild(vm, %(oz)s, %(u)s); %(cc)s = &%(u)s; """ % { 't': to_cc(self._type.get_pointee()), 'u': unique_str(), 'cc': self.cc_prefix, 'oz': self.oz_in_name, })
def pre(self, formatter): formatter.write(""" std::vector<std::remove_cv<{t}>::type> {u}; ozListForEach(vm, {oz}, [vm, &{u}](UnstableNode& node) {{ std::remove_cv<{t}>::type content; unbuild(vm, node, content); {u}.push_back(std::move(content)); }}, MOZART_STR("{t}")); {cc} = {u}.data(); auto {l} = {u}.size(); """.format( u=unique_str(), t=to_cc(self._type.get_pointee()), oz=self.oz_in_name, cc=self.cc_prefix, l=cc_name_of(self._context) ))
def pre(self, formatter): formatter.write(""" std::vector<std::remove_cv<%(t)s>::type> %(u)s; ozListForEach(vm, %(oz)s, [vm, &%(u)s](UnstableNode& node) { std::remove_cv<%(t)s>::type content; unbuild(vm, node, content); %(u)s.push_back(std::move(content)); }, MOZART_STR("%(t)s")); %(cc)s = %(u)s.data(); auto %(len)s = %(u)s.size(); """ % { 'u': unique_str(), 't': to_cc(self._type.get_pointee()), 'oz': self.oz_in_name, 'cc': self.cc_prefix, 'len': cc_name_of(self._context), })
def pre(self, formatter): formatter.write( """ std::vector<std::remove_cv<%(t)s>::type> %(u)s; ozListForEach(vm, %(oz)s, [vm, &%(u)s](UnstableNode& node) { std::remove_cv<%(t)s>::type content; unbuild(vm, node, content); %(u)s.push_back(std::move(content)); }, MOZART_STR("%(t)s")); %(cc)s = %(u)s.data(); auto %(len)s = %(u)s.size(); """ % { 'u': unique_str(), 't': to_cc(self._type.get_pointee()), 'oz': self.oz_in_name, 'cc': self.cc_prefix, 'len': cc_name_of(self._context), })
def pre(self, formatter): cc_complete_name = unique_str() cc_decl = to_cc(self._type.get_pointee(), cc_complete_name) formatter.write(cc_decl + ' {};') formatter.write(self.cc_prefix + ' = &' + cc_complete_name + ';')
def __init__(self): super().__init__() self._cc_array_length_name = unique_str()