-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherrors.py
36 lines (27 loc) · 1.01 KB
/
errors.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
class LabelAlreadyFoundException(BaseException):
def __init__(self, name):
self.name = name
def __str__(self):
return 'Label \'{}\' already found!'.format(self.name)
class MainLabelNotFoundException(BaseException):
def __str__(self):
return 'Label \'main\' not found!'
class LabelNotFoundException(BaseException):
def __init__(self, name):
self.name = name
def __str__(self):
return 'Label \'{}\' not found!'.format(self.name)
class InstructionNotFoundException(BaseException):
def __init__(self, name):
self.name = name
def __str__(self):
return 'Instruction \'{}\' not found!'.format(self.name)
class UnexpectedHaltException(BaseException):
def __str__(self):
return 'Program halted unexpectedly!'
class OperandStackEmptyException(BaseException):
def __str__(self):
return 'Operand stack is empty!'
class CallStackEmptyException(BaseException):
def __str__(self):
return 'Call stack is empty!'