def exitStore(self, ctx): # type: (QuilParser.StoreContext) -> None if ctx.number(): right = _number(ctx.number()) else: right = _addr(ctx.addr(1)) self.result.append(ClassicalStore(ctx.IDENTIFIER(), _addr(ctx.addr(0)), right))
def STORE(region_name, offset_reg, source): """ Produce a STORE instruction. :param region_name: Named region of memory to store to. :param offset_reg: Offset into memory region. Must be a MemoryReference. :param source: Source data. Can be either a MemoryReference or a constant. :return: A ClassicalStore instance. """ return ClassicalStore(region_name, unpack_classical_reg(offset_reg), source)
def STORE(region_name: str, offset_reg: MemoryReferenceDesignator, source: Union[MemoryReferenceDesignator, int, float]) -> ClassicalStore: """ Produce a STORE instruction. :param region_name: Named region of memory to store to. :param offset_reg: Offset into memory region. Must be a MemoryReference. :param source: Source data. Can be either a MemoryReference or a constant. :return: A ClassicalStore instance. """ if not isinstance(source, int) and not isinstance(source, float): source = unpack_classical_reg(source) return ClassicalStore(region_name, unpack_classical_reg(offset_reg), source)
def store(self, left, subscript, right): return ClassicalStore(left, subscript, right)