# 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
# coding=utf-8


_IDENTIFIER_RE_PART = r'[a-z_\-$&%*][\w_\-$&%*]*'
CONSTANT_RE = re.compile(r'^(?P<type>bool|int|string|float)@(?P<value>.*)$', re.IGNORECASE)
VARIABLE_RE = re.compile(r'^(?P<frame>[GLT]F)@(?P<name>{})$'.format(_IDENTIFIER_RE_PART), re.IGNORECASE)
TYPE_RE = re.compile(r'^(?P<type>int|string|bool|float)$', re.IGNORECASE)
LABEL_RE = re.compile(r'^{}$'.format(_IDENTIFIER_RE_PART), re.IGNORECASE)

float_ = float


def float(value):
    # sorry, Python builtin

# 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

# coding=utf-8


_IDENTIFIER_RE_PART = r'[a-z_\-$&%*][\w_\-$&%*]*'
CONSTANT_RE = re.compile(r'^(?P<type>bool|int|string|float)@(?P<value>.*)$', re.IGNORECASE)
VARIABLE_RE = re.compile(r'^(?P<frame>[GLT]F)@(?P<name>{})$'.format(_IDENTIFIER_RE_PART), re.IGNORECASE)
TYPE_RE = re.compile(r'^(?P<type>int|string|bool|float)$', re.IGNORECASE)
LABEL_RE = re.compile(r'^{}$'.format(_IDENTIFIER_RE_PART), re.IGNORECASE)

float_ = float


def float(value):
    # sorry, Python builtin

    try: