00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef __ddg_exceptions_H
00031 #define __ddg_exceptions_H
00032
00033 #include <iostream>
00034 #include <fstream>
00035
00040 using namespace std;
00041 namespace DDG{
00042
00043
00044 class IllegalAccessNode{
00045 public:
00046 IllegalAccessNode(int i){
00047 cerr<<"DDG runtime exception. Illegal node access: the node with id " << i <<" doesn't exists"<<endl;
00048 }
00049 IllegalAccessNode();
00050 };
00051
00052 class InvalidISADesc{
00053 public:
00054 InvalidISADesc(){
00055 cerr<<"DDG exception. Invalid ISA description.\n";
00056 }
00057 };
00058 class BadIODDG{
00059 public:
00060 BadIODDG(){
00061 cerr<<"DDG exception. Bad Input DDG.\n";
00062 }
00063 };
00064
00065 class BadRegType{
00066 public:
00067 BadRegType(){
00068 cerr<<"DDG exception. Bad register type.\n";
00069 }
00070 };
00071 class BadInstructionType{
00072 public:
00073 BadInstructionType(){
00074 cerr<<"DDG exception. Bad instruction type.\n";
00075 }
00076 BadInstructionType(int id){
00077 cerr<<"DDG exception. Bad instruction type id "<<id<<endl;
00078 }
00079
00080 };
00081
00082 class NonUniqueRegisterType{
00083 public:
00084 NonUniqueRegisterType(){
00085 cerr<<"DDG exception. Non unique register type.\n";
00086 }
00087 };
00088
00089 class IllegalDependance{
00090 public:
00091 IllegalDependance(){
00092 cerr<<"DDG exception. Illegal Dependance type.\n";
00093 }
00094 };
00095
00096 class NonUniqueNodeID{
00097 public:
00098 NonUniqueNodeID(int u){
00099
00100 cerr<<"DDG exception (new node insertion) : a node with id " << u <<" already exists"<<endl;
00101 }
00102 NonUniqueNodeID(){
00103 cerr<<"DDG exception (new node insertion) : a node already exists.\n";
00104 }
00105
00106 };
00107
00108 }
00109
00110 #endif