Files
OSACA/osaca/parser/condition.py
Metehan Dundar 1ceac6e9f3 Refactor: RISC-V parser, code formatting, and flake8 compliance
- Enhanced RISC-V parser to support reloc_type and symbol in ImmediateOperand.
- Added missing attributes (reloc_type, symbol) to ImmediateOperand and updated __eq__ for backward compatibility.
- Fixed all flake8 (E501, E265, F401, F841) and Black formatting issues across the codebase.
- Improved docstrings and split long lines for better readability.
- Fixed test failures related to ImmediateOperand instantiation and attribute errors.
- Ensured all tests pass, including edge cases for RISC-V, x86, and AArch64.
- Updated .gitignore and documentation as needed.
- Renamed example files for consistency (rv6 -> rv64).
2025-07-04 23:21:06 +02:00

32 lines
644 B
Python

#!/usr/bin/env python3
from osaca.parser.operand import Operand
class ConditionOperand(Operand):
def __init__(
self,
ccode=None,
source=False,
destination=False,
):
super().__init__(source, destination)
self._ccode = ccode
@property
def ccode(self):
return self._ccode
@ccode.setter
def ccode(self, ccode):
self._ccode = ccode
def __str__(self):
return (
f"Condition(ccode={self._ccode}, source={self._source}, "
f"destination={self._destination})"
)
def __repr__(self):
return self.__str__()