diff --git a/src/python/src/gbasm/arguments/ArgumentType.py b/src/python/src/gbasm/arguments/ArgumentParser.py similarity index 82% rename from src/python/src/gbasm/arguments/ArgumentType.py rename to src/python/src/gbasm/arguments/ArgumentParser.py index 5e1671f..02760bb 100644 --- a/src/python/src/gbasm/arguments/ArgumentType.py +++ b/src/python/src/gbasm/arguments/ArgumentParser.py @@ -1,4 +1,4 @@ -class ArgumentType(object): +class ArgumentParser(object): def can_parse(token: str) -> bool: raise NotImplementedError() diff --git a/src/python/src/gbasm/arguments/ArgumentTypes.py b/src/python/src/gbasm/arguments/ArgumentParsers.py similarity index 91% rename from src/python/src/gbasm/arguments/ArgumentTypes.py rename to src/python/src/gbasm/arguments/ArgumentParsers.py index bd300d0..c3ca2a3 100644 --- a/src/python/src/gbasm/arguments/ArgumentTypes.py +++ b/src/python/src/gbasm/arguments/ArgumentParsers.py @@ -1,8 +1,8 @@ -from .ArgumentType import ArgumentType +from .ArgumentParser import ArgumentParser from . import Arguments -class Address(ArgumentType): +class Address(ArgumentParser): NAME = "Address" @@ -20,7 +20,7 @@ class Address(ArgumentType): return Address.NAME -class Label(ArgumentType): +class Label(ArgumentParser): NAME = "Label" @@ -39,7 +39,7 @@ class Label(ArgumentType): return Label.NAME -class Register8(ArgumentType): +class Register8(ArgumentParser): NAME = "Register8" @@ -63,7 +63,7 @@ class Register8(ArgumentType): return Register8.NAME -class Register16(ArgumentType): +class Register16(ArgumentParser): NAME = "Immediate8" @@ -83,7 +83,7 @@ class Register16(ArgumentType): return Register16.NAME -class Immediate8(ArgumentType): +class Immediate8(ArgumentParser): NAME = "Immediate8" @@ -100,7 +100,7 @@ class Immediate8(ArgumentType): def get_name(self) -> str: return Immediate8.NAME -class Immediate16(ArgumentType): +class Immediate16(ArgumentParser): NAME = "Immediate16" @@ -121,7 +121,7 @@ class Immediate16(ArgumentType): return Immediate16.NAME -class Flag(ArgumentType): +class Flag(ArgumentParser): NAME = "Flag" diff --git a/src/python/src/gbasm/arguments/__init__.py b/src/python/src/gbasm/arguments/__init__.py index dad3be8..2205054 100644 --- a/src/python/src/gbasm/arguments/__init__.py +++ b/src/python/src/gbasm/arguments/__init__.py @@ -1,3 +1,3 @@ -from .ArgumentType import ArgumentType -from .ArgumentTypes import Label, Address, Immediate8, Immediate16, Register8, Register16 +from .ArgumentParser import ArgumentParser +from .ArgumentParsers import Label, Address, Immediate8, Immediate16, Register8, Register16 from .Arguments import Argument diff --git a/src/python/src/gbasm/gbasm.py b/src/python/src/gbasm/gbasm.py index a014430..9bc0758 100755 --- a/src/python/src/gbasm/gbasm.py +++ b/src/python/src/gbasm/gbasm.py @@ -11,7 +11,7 @@ from .instructions.nop import Nop from .instructions.stop import Stop from .instructions.jr import Jr from .instructions.ld import Ld -from .arguments import ArgumentType, Argument +from .arguments import ArgumentParser, Argument from typing import Callable, Dict, List, Optional @@ -36,7 +36,7 @@ def build_instruction_map() -> Dict[str, Instruction]: return d def try_parse_arguments(args: List[str], - arg_types: List[ArgumentType]) -> Optional[List[Argument]]: + arg_types: List[ArgumentParser]) -> Optional[List[Argument]]: if len(args) != len(arg_types): return None diff --git a/src/python/src/gbasm/instructions/Instruction.py b/src/python/src/gbasm/instructions/Instruction.py index c70af79..8219c5e 100644 --- a/src/python/src/gbasm/instructions/Instruction.py +++ b/src/python/src/gbasm/instructions/Instruction.py @@ -1,9 +1,9 @@ from typing import Callable, List -from ..arguments import Argument, ArgumentType +from ..arguments import Argument, ArgumentParser class Instruction(object): - def __init__(self, token: str, argument_specs: List[List[ArgumentType]]): + def __init__(self, token: str, argument_specs: List[List[ArgumentParser]]): self.token = token self.argument_specs = argument_specs diff --git a/src/python/src/gbasm/instructions/dec.py b/src/python/src/gbasm/instructions/dec.py index 08f8d18..deded01 100644 --- a/src/python/src/gbasm/instructions/dec.py +++ b/src/python/src/gbasm/instructions/dec.py @@ -1,5 +1,5 @@ from .Instruction import Instruction -from ..arguments.ArgumentTypes import Register8, Register16 +from ..arguments.ArgumentParsers import Register8, Register16 from ..arguments import Argument from typing import Callable, List diff --git a/src/python/src/gbasm/instructions/inc.py b/src/python/src/gbasm/instructions/inc.py index 0c23815..f04db68 100644 --- a/src/python/src/gbasm/instructions/inc.py +++ b/src/python/src/gbasm/instructions/inc.py @@ -1,5 +1,5 @@ from .Instruction import Instruction -from ..arguments.ArgumentTypes import Register8, Register16 +from ..arguments.ArgumentParsers import Register8, Register16 from ..arguments import Argument from typing import Callable, List diff --git a/src/python/src/gbasm/instructions/jr.py b/src/python/src/gbasm/instructions/jr.py index 1927b02..c638e8d 100644 --- a/src/python/src/gbasm/instructions/jr.py +++ b/src/python/src/gbasm/instructions/jr.py @@ -1,5 +1,5 @@ from .Instruction import Instruction -from ..arguments.ArgumentTypes import Flag, Label +from ..arguments.ArgumentParsers import Flag, Label from ..arguments import Argument from typing import Callable, List diff --git a/src/python/src/gbasm/instructions/ld.py b/src/python/src/gbasm/instructions/ld.py index b91f7fb..469072c 100644 --- a/src/python/src/gbasm/instructions/ld.py +++ b/src/python/src/gbasm/instructions/ld.py @@ -1,5 +1,5 @@ from .Instruction import Instruction -from ..arguments.ArgumentTypes import Register16, Immediate16 +from ..arguments.ArgumentParsers import Register16, Immediate16 from ..arguments import Argument from typing import Callable, List