code: def generate(self, api):
          
          # Create a file for each namespace.
          for namespace in api.namespaces.values():
              with self.output_to_relative_path('%s.stone' % namespace.name):
                  # Output a namespace header.
                  self.emit('namespace %s' % namespace.name)
                  # Output all data type (struct and union) definitions.
                  for data_type in namespace.linearize_data_types():
                      self.generate_data_type(data_type)
                  # Output all route definitions.
                  for route in namespace.routes:
                      self.generate_route(route)
docs: Main code generator entry point.