added Executable.__repr__ and added return self to ExecutableParser.parse
This commit is contained in:
parent
93ff8d7186
commit
9710ed9b8b
@ -4,11 +4,11 @@ from .Exceptions import *
|
||||
from .helpers import parse_numeric_argument, align_addr
|
||||
|
||||
import typing
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
from .Tokenizer import RiscVInstructionToken
|
||||
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class MemoryFlags:
|
||||
read_only: bool
|
||||
@ -60,6 +60,15 @@ class Executable:
|
||||
symbols: Dict[str, Tuple[str, int]]
|
||||
stack_pref: Optional[int]
|
||||
|
||||
def __repr__(self):
|
||||
return "{}(sections = {}, symbols = {}, stack = {}, run_ptr = {})".format(
|
||||
self.__class__.__name__,
|
||||
" ".join(self.sections.keys()),
|
||||
" ".join(self.symbols.keys()),
|
||||
self.stack_pref,
|
||||
self.run_ptr
|
||||
)
|
||||
|
||||
|
||||
### LOADING CODE
|
||||
|
||||
|
@ -27,6 +27,7 @@ class ExecutableParser:
|
||||
self.handle_symbol(token)
|
||||
elif isinstance(token, RiscVPseudoOpToken):
|
||||
self.handle_pseudo_op(token)
|
||||
return self
|
||||
|
||||
def get_execuable(self):
|
||||
start_ptr = ('text', 0)
|
||||
|
Loading…
Reference in New Issue
Block a user