# Path: nolang/opcodes.py
# class Opcode(object):
#     def __init__(self, name, numargs, stack_effect, description):
#     def __repr__(self):
# def setup():
# 
# Path: nolang/error.py
# class AppError(Exception):
#     def __init__(self, w_exception):
#         self.w_exception = w_exception
#         self.traceback = None
# 
#     def record_position(self, frame, bytecode, index):
#         self.traceback = TracebackElem(frame, index, bytecode, self.traceback)
# 
#     def match(self, space, w_expected):
#         return space.issubclass(space.type(self.w_exception), w_expected)
# 
#     def __repr__(self):
#         return '<AppError %r>' % (self.w_exception,)
#     __str__ = __repr__
# 
# Path: nolang/builtins/exception.py
# class W_Exception(W_UserObject):
#     def __init__(self, w_tp, message):
#         W_UserObject.__init__(self, w_tp)
#         self.message = message
# 
#     def get_message(self, space):
#         return space.newtext(self.message)
# 
#     def __repr__(self):
#         return '<%s %s>' % (self.w_type.name, self.message)


from rpython.rlib.rstring import StringBuilder
from nolang import opcodes
from nolang.error import AppError
from nolang.builtins.exception import W_Exception
""" This is the main interpreter file that contains bytecode
dispatch loop.
"""



class InvalidOpcode(Exception):
    def __init__(self, opcode):
        self.opcode = opcode

    def __str__(self):
        try:

# Path: nolang/opcodes.py
# class Opcode(object):
#     def __init__(self, name, numargs, stack_effect, description):
#     def __repr__(self):
# def setup():
# 
# Path: nolang/error.py
# class AppError(Exception):
#     def __init__(self, w_exception):
#         self.w_exception = w_exception
#         self.traceback = None
# 
#     def record_position(self, frame, bytecode, index):
#         self.traceback = TracebackElem(frame, index, bytecode, self.traceback)
# 
#     def match(self, space, w_expected):
#         return space.issubclass(space.type(self.w_exception), w_expected)
# 
#     def __repr__(self):
#         return '<AppError %r>' % (self.w_exception,)
#     __str__ = __repr__
# 
# Path: nolang/builtins/exception.py
# class W_Exception(W_UserObject):
#     def __init__(self, w_tp, message):
#         W_UserObject.__init__(self, w_tp)
#         self.message = message
# 
#     def get_message(self, space):
#         return space.newtext(self.message)
# 
#     def __repr__(self):
#         return '<%s %s>' % (self.w_type.name, self.message)


# Path: nolang/interpreter.py
from rpython.rlib.rstring import StringBuilder
from nolang import opcodes
from nolang.error import AppError
from nolang.builtins.exception import W_Exception

""" This is the main interpreter file that contains bytecode
dispatch loop.
"""



class InvalidOpcode(Exception):
    def __init__(self, opcode):
        self.opcode = opcode

    def __str__(self):
        try:

            return "<UnimplementedOpcode %s>" % opcodes.opcodes[self.opcode].name