Пример #1
0
    def _build_contexts(self):
        """ """
        host_instructions_context = InstructionsContext(self.host)
        host_instructions_list = []

        host_context_added = False
        for i in self.host.instructions_list:

            if isinstance(i, Process):
                process = i

                if len(process.instructions_list) > 0:
                    process_context = InstructionsContext(self.host)
                    self.contexts.append(process_context)

                    process_context.add_instructions_list(
                        process.instructions_list, process)
            else:
                host_instructions_list.append(i)
                if not host_context_added:
                    self.contexts.append(host_instructions_context)
                    host_context_added = True

        if len(host_instructions_list) > 0:
            host_instructions_context.add_instructions_list(
                InstructionsList(host_instructions_list))
Пример #2
0
 def _build_context(self):
     """ """
     context = InstructionsContext(self.host)
     context.add_instructions_list(self.host.instructions_list)
     return context