Files
OSACA/osaca/parser/__init__.py
2023-12-16 16:00:37 +01:00

29 lines
668 B
Python

"""
Collection of parsers supported by OSACA.
Only the parser below will be exported, so please add new parsers to __all__.
"""
from .base_parser import BaseParser
from .parser_x86att import ParserX86ATT
from .parser_AArch64 import ParserAArch64
from .instruction_form import instructionForm
from .operand import Operand
__all__ = [
"Operand",
"instructionForm",
"BaseParser",
"ParserX86ATT",
"ParserAArch64",
"get_parser",
]
def get_parser(isa):
if isa.lower() == "x86":
return ParserX86ATT()
elif isa.lower() == "aarch64":
return ParserAArch64()
else:
raise ValueError("Unknown ISA {!r}.".format(isa))