# Path: ifj2017/interpreter/exceptions.py
# class InvalidCodeException(ValueError):
#     UNKNOWN_INSTRUCTION = 0
#     INVALID_OPERAND = 1
#     INVALID_OPERAND_COUNT = 2
#     MISSING_HEADER = 3
# 
#     def __init__(self, type_, line_index=None, line=None):
#         self._type = type_
#         self.line_index = line_index
#         self.line = line
# 
#     def __str__(self):
#         messages = {
#             self.UNKNOWN_INSTRUCTION: 'Unknown instruction on line {self.line_index}: {self.line}.',
#             self.INVALID_OPERAND: 'Invalid operand on line {self.line_index}: {self.line}.',
#             self.INVALID_OPERAND_COUNT: 'Invalid count of operands on line {self.line_index}: {self.line}.',
#             self.MISSING_HEADER: 'Missing .IFJcode17 header on line {self.line_index}.'
#         }
#         return messages.get(
#             self._type,
#             'Invalid line {self.line_index}: {self.line}.'
#         ).format(self=self)


import re
from enum import IntEnum
from typing import Match
from .exceptions import InvalidCodeException
        'int': int,
        'float': float,
        'string': str,
    }

    CONSTANT_MAPPING_REVERSE = {k: v for v, k in CONSTANT_MAPPING.items()}

    BOOL_LITERAL_MAPPING = {'true': True, 'false': False}

    def __init__(self, value):
        # type: (str) -> None
        constant_match = CONSTANT_RE.match(value)
        if constant_match:
            self._resolve_constant(constant_match)
            return
        variable_match = VARIABLE_RE.match(value)
        if variable_match:
            self._resolve_variable(variable_match)
            return
        type_match = TYPE_RE.match(value)
        if type_match:
            self._resolve_type(type_match)
            return
        label_match = LABEL_RE.match(value)
        if label_match:
            # is label
            self.label = value
            self.type = TypeOperand.LABEL
            return


# Path: ifj2017/interpreter/exceptions.py
# class InvalidCodeException(ValueError):
#     UNKNOWN_INSTRUCTION = 0
#     INVALID_OPERAND = 1
#     INVALID_OPERAND_COUNT = 2
#     MISSING_HEADER = 3
# 
#     def __init__(self, type_, line_index=None, line=None):
#         self._type = type_
#         self.line_index = line_index
#         self.line = line
# 
#     def __str__(self):
#         messages = {
#             self.UNKNOWN_INSTRUCTION: 'Unknown instruction on line {self.line_index}: {self.line}.',
#             self.INVALID_OPERAND: 'Invalid operand on line {self.line_index}: {self.line}.',
#             self.INVALID_OPERAND_COUNT: 'Invalid count of operands on line {self.line_index}: {self.line}.',
#             self.MISSING_HEADER: 'Missing .IFJcode17 header on line {self.line_index}.'
#         }
#         return messages.get(
#             self._type,
#             'Invalid line {self.line_index}: {self.line}.'
#         ).format(self=self)


# Path: ifj2017/interpreter/operand.py
import re
from enum import IntEnum
from typing import Match
from .exceptions import InvalidCodeException

        'int': int,
        'float': float,
        'string': str,
    }

    CONSTANT_MAPPING_REVERSE = {k: v for v, k in CONSTANT_MAPPING.items()}

    BOOL_LITERAL_MAPPING = {'true': True, 'false': False}

    def __init__(self, value):
        # type: (str) -> None
        constant_match = CONSTANT_RE.match(value)
        if constant_match:
            self._resolve_constant(constant_match)
            return
        variable_match = VARIABLE_RE.match(value)
        if variable_match:
            self._resolve_variable(variable_match)
            return
        type_match = TYPE_RE.match(value)
        if type_match:
            self._resolve_type(type_match)
            return
        label_match = LABEL_RE.match(value)
        if label_match:
            # is label
            self.label = value
            self.type = TypeOperand.LABEL
            return


        raise InvalidCodeException(InvalidCodeException.INVALID_OPERAND)