ddg_exceptions.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2009 by Touati Sid                                      *
00003  *   Sid-nospam.Touati-nospam@univ-cotedazur.fr                                      *
00004  *   Copyright  INRIA and the University of Versailles                     *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU Library General Public     *
00016  *   License along with this program (LGPL); if not, write to the          *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  *   Exception : this software requires a licence  of the LEDA libary.     *
00020  *   If you are from academia, you can get a free leda binary licence 
00021  *   allowing you to use freely our DDG library.                           *
00022  *   Otherwise, you can buy a LEDA licence from algorithmic-solutions      *
00023  *   http://www.algorithmic-solutions.com                                  *
00024  *   LEDA binaries and source codes are excluded from this LGPL.           *
00025  *   Obtaining a LEDA licence is not mandatory to use our GPL software     *
00026  *   If the user wants, he can  create a free source-compatible replacement*
00027  *   for LEDA, and he is allowed to use our software under LGPL.           *
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 /* Exceptions */
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

January 2009, by Sid Touati (Copyright INRIA and University of Versailles)