Initial commit

This commit is contained in:
2020-01-30 22:31:36 +01:00
commit d4b4be940c
23 changed files with 1694 additions and 0 deletions

21
pjvm/exceptions.py Normal file
View File

@@ -0,0 +1,21 @@
from .opcodes import INSTRUCTIONS
class PJVMException(ValueError):
pass
class PJVMUnknownOpcode(PJVMException):
def __init__(self, opcode: int):
super(PJVMUnknownOpcode, self).__init__(f"OPCODE {opcode} -> {INSTRUCTIONS[opcode]['name']} not implemented")
class PJVMNotImplemented(PJVMException):
pass
class PJVMTypeError(PJVMException):
pass
__all__ = ['PJVMException', 'PJVMUnknownOpcode', 'PJVMNotImplemented', 'PJVMTypeError']