00001 /*-*- Mode: C++ -*-*/ 00002 00003 /* 00004 libmootm : moocow's morphology library: 00005 Copyright (C) 2004-2005 by Bryan Jurish <moocow@ling.uni-potsdam.de> 00006 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Lesser General Public 00009 License as published by the Free Software Foundation; either 00010 version 2.1 of the License, or (at your option) any later version. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public 00018 License along with this library; if not, write to the Free Software 00019 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 */ 00021 00022 /*---------------------------------------------------------------------- 00023 * Name: mootFSMBase.h 00024 * Author: Bryan Jurish <moocow@ling.uni-potsdam.de> 00025 * Description: 00026 * + moot FSMs: abstract base class 00027 *----------------------------------------------------------------------*/ 00034 #ifndef _moot_FSM_BASE_H 00035 #define _moot_FSM_BASE_H 00036 00037 #ifdef HAVE_CONFIG_H 00038 # include <mootmUnConfig.h> 00039 # include <mootmConfig.h> 00040 #endif 00041 00042 #ifdef USE_FSM_POTSDAM 00043 /* use hash<std::string> from libFSM */ 00044 # define MOOT_HAVE_HASH_STRING 00045 #endif 00046 00047 #include <mootmUnConfig.h> 00048 00049 00050 #include <string> 00051 #include <mootToken.h> 00052 00053 namespace mootm { 00054 using namespace std; 00055 using namespace moot; 00056 00061 class mootFSMBase { 00062 public: 00063 /*------------------------------------------------------------ 00064 * public methods 00065 */ 00067 mootFSMBase(void) {}; 00068 00070 virtual ~mootFSMBase(void) {}; 00071 00073 virtual bool load(const string &fstfile, const string &symfile="") 00074 { dummy("load"); return false; }; 00075 00077 virtual bool valid(void) const 00078 { return false; }; 00079 00081 virtual mootToken& analyze_token(mootToken &tok, bool want_avm=true, bool want_warnings=true) 00082 { dummy("analyze_token"); return tok; } 00083 00084 public: 00085 /*------------------------------------------------------------ 00086 * dummy methods, low-level 00087 */ 00088 void dummy(const char *name="?") 00089 { 00090 this->carp("mootFSM::%s(): dummy method called -- exiting.\n", name); 00091 abort(); 00092 }; 00093 00095 void carp(char *fmt, ...) const; 00096 }; // class mootFSMBase 00097 00098 00099 }; // namespace mootm 00100 00101 #endif /* _moot_FSM_BASE_H */