Exemple #1
0
 def single_jump(self, addr: Addr, relation: Value) -> Set[Addr]:
     if relation not in self.relations:
         raise RelationUnknownToCanvas(
             canvas=self, addr=addr, relation=relation
         )
     i = addr.index_as_int()
     try:
         return {replace(addr, index=self.jump_table[(i, relation)])}
     except KeyError:
         return set()
Exemple #2
0
 def __setitem__(self, addr: Addr, v: Value) -> None:
     i = addr.index_as_int()
     if i < 1 or i > len(self._cells):
         raise NotImplementedError  # TODO raise specific exception
     self._cells[i - 1].set_contents(v)
Exemple #3
0
 def __getitem__(self, addr: Addr) -> CellContents:
     i = addr.index_as_int()
     if i < 1 or i > len(self._cells):
         raise NotImplementedError  # TODO raise specific exception
     return self._cells[i - 1].contents