summaryrefslogtreecommitdiff
path: root/src/virtualmachine/Exceptions.h
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2013-10-20 14:33:06 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2013-10-20 14:33:06 (GMT)
commite8c53dc3e8d293ef750f3780b999783ae3537ba9 (patch)
treed9158731234905b36cae9991f49bbe99f82cd56a /src/virtualmachine/Exceptions.h
parenteea006ad6f63083782a3decda51b6bf80caa47af (diff)
downloadpowder-e8c53dc3e8d293ef750f3780b999783ae3537ba9.zip
powder-e8c53dc3e8d293ef750f3780b999783ae3537ba9.tar.gz
Remove old unfinished virtual machine and Lua bindings for it
Diffstat (limited to 'src/virtualmachine/Exceptions.h')
-rw-r--r--src/virtualmachine/Exceptions.h100
1 files changed, 0 insertions, 100 deletions
diff --git a/src/virtualmachine/Exceptions.h b/src/virtualmachine/Exceptions.h
deleted file mode 100644
index 3a25e87..0000000
--- a/src/virtualmachine/Exceptions.h
+++ /dev/null
@@ -1,100 +0,0 @@
-#pragma once
-#include <stdexcept>
-#include <cstring>
-#include "Format.h"
-
-namespace vm
-{
- class RuntimeException: public std::exception
- {
- char * error;
- public:
- RuntimeException() : error(NULL) {}
- RuntimeException(char * message) : error(strdup(message)) {}
- const char * what() const throw()
- {
- if(error)
- return error;
- else
- return "VirtualMachine runtime exception";
- }
- ~RuntimeException() throw() {};
- };
-
- class StackOverflowException: public RuntimeException
- {
- public:
- StackOverflowException() {}
- const char * what() const throw()
- {
- return "VirtualMachine Stack overflow";
- }
- ~StackOverflowException() throw() {};
- };
-
- class StackUnderflowException: public RuntimeException
- {
- public:
- StackUnderflowException() {}
- const char * what() const throw()
- {
- return "VirtualMachine Stack underflow";
- }
- ~StackUnderflowException() throw() {};
- };
-
- class AccessViolationException: public RuntimeException
- {
- int address;
- char * _what;
- public:
- AccessViolationException(int address = 0) : address(address)
- {
- _what = strdup(std::string("VirtualMachine Access violation at "+format::NumberToString<int>(address)).c_str());
- }
- const char * what() const throw()
- {
- if(address)
- return _what;
- return "VirtualMachine Access violation";
- }
- ~AccessViolationException() throw() {};
- };
-
- class JITException: public RuntimeException
- {
- char * _what;
- public:
- JITException(const char * what2)
- {
- _what = strdup(what2);
- }
- const char * what() const throw()
- {
- return _what;
- }
- ~JITException() throw() {};
- };
-
- class OutOfMemoryException: public RuntimeException
- {
- public:
- OutOfMemoryException() {}
- const char * what() const throw()
- {
- return "VirtualMachine Out of memory";
- }
- ~OutOfMemoryException() throw() {};
- };
-
- class InvalidProgramException: public RuntimeException
- {
- public:
- InvalidProgramException() {}
- const char * what() const throw()
- {
- return "Could not load program";
- }
- ~InvalidProgramException() throw() {};
- };
-}