Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ebnf_node_algo.hh

Go to the documentation of this file.
00001 /*
00002  *  File:       ebnf_node_algo.hh
00003  *              $Id: ebnf_node_algo.hh,v 1.6 2002/05/27 03:00:12 alec Exp $
00004  *
00005  *  Author:     Alec Panovici (alecu@email.com)
00006  * 
00007  *  Comments:
00008  *
00009  *  Revision history:
00010  *
00011  *  $Log: ebnf_node_algo.hh,v $
00012  *  Revision 1.6  2002/05/27 03:00:12  alec
00013  *  doc update
00014  *
00015  *  Revision 1.5  2002/05/16 21:34:55  alec
00016  *  parser generation done
00017  *
00018  *  Revision 1.4  2002/05/10 18:08:14  alec
00019  *  *** empty log message ***
00020  *
00021  *  Revision 1.3  2002/04/29 09:34:10  alec
00022  *  scanner ptree building compiles
00023  *
00024  */
00025 
00026 
00027 /*
00028   Copyright (C) 2002 Alexandru Panoviciu (alecu@email.com)
00029 
00030   This program is free software; you can redistribute it and/or modify
00031   it under the terms of the GNU General Public License as published by
00032   the Free Software Foundation; either version 2 of the License, or
00033   (at your option) any later version.
00034 
00035   This program is distributed in the hope that it will be useful,
00036   but WITHOUT ANY WARRANTY; without even the implied warranty of
00037   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00038   GNU General Public License for more details.
00039 
00040   You should have received a copy of the GNU General Public License
00041   along with this program; if not, write to the Free Software
00042   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00043 
00044  */
00045 
00046 #ifndef __EBNF_NODE_ALGO__
00047 #define __EBNF_NODE_ALGO__
00048 
00049 #include <stdexcept>
00050 
00051 class EbnfNode;
00052 
00053 class EbnfNodeAlgoException
00054 {
00055   public:
00056 
00057   EbnfNodeAlgoException (const string &message_) :
00058     message(message_),
00059     pos()
00060   {}
00061   
00062   EbnfNodeAlgoException () :
00063     message("Bad option"),
00064     pos()
00065   {}
00066 
00067   EbnfNodeAlgoException (const Position &pos_, const string &message_) :
00068     message(message_),
00069     pos(pos_)
00070   {}
00071 
00072   virtual const char* what() const throw()
00073   {
00074     return message.c_str();
00075   }
00076 
00077   virtual operator string() const
00078   {
00079     return message;
00080   }
00081 
00082   const Position& where() const
00083   {
00084     return pos;
00085   }
00086   
00087 protected:
00088   
00089   string message;
00090   Position pos;
00091 
00092 };
00093 
00100 class EbnfNodeAlgo
00101 {
00102 public:
00103 
00107   virtual bool operator() (EbnfNode &n) throw (EbnfNodeAlgoException) = 0;
00108 };
00109 
00110 #endif /* #ifndef __EBNF_NODE_ALGO__ */

Generated at Tue Jul 9 21:05:44 2002 for CppCC by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001