mirror of
https://github.com/RRZE-HPC/OSACA.git
synced 2025-12-16 09:00:05 +01:00
29 lines
668 B
Python
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))
|