ionflux.org | Impressum

TokenTypeMap.hpp

Go to the documentation of this file.
00001 #ifndef IONFLUX_TOOLS_TOKENTYPEMAP
00002 #define IONFLUX_TOOLS_TOKENTYPEMAP
00003 /* ==========================================================================
00004  * Ionflux Tools
00005  * Copyright (c) 2004 Joern P. Meier
00006  * mail@ionflux.org
00007  * --------------------------------------------------------------------------
00008  * TokenTypeMap.hpp                    Token type lookup map.
00009  * ==========================================================================
00010  * 
00011  * This file is part of Ionflux Tools.
00012  * 
00013  * Ionflux Tools is free software; you can redistribute it and/or modify it 
00014  * under the terms of the GNU General Public License as published by the Free
00015  * Software Foundation; either version 2 of the License, or (at  your option)
00016  * any later version.
00017  * 
00018  * Ionflux Tools is distributed in the hope that it will be useful, but 
00019  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00020  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00021  * for more details.
00022  * 
00023  * You should have received a copy of the GNU General Public License
00024  * along with Ionflux Tools; if not, write to the Free Software Foundation, 
00025  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00026  * 
00027  * ========================================================================== */
00028 
00029 #include <string>
00030 #include <iostream>
00031 #include <sstream>
00032 #include <vector>
00033 #include "ionflux/Tokenizer.hpp"
00034 
00035 namespace Ionflux
00036 {
00037 
00038 namespace Tools
00039 {
00040 
00041 struct TokenType;
00042 
00048 class TokenTypeMap
00049 {
00050     protected:
00052         TokenType** typeMap;
00054         std::vector<TokenType *> types;
00055         
00056     public:
00058         static const unsigned int TYPE_MAP_SIZE;
00059         
00064         TokenTypeMap();
00065         
00070         virtual ~TokenTypeMap();
00071         
00078         virtual void addTokenType(const TokenType& newTokenType);
00079         
00086         virtual void removeTokenType(const TokenType& removeTokenType);
00087         
00098         virtual TokenType getTokenType(unsigned char testChar) const;
00099         
00115         virtual void addTokenTypeAnything(const TokenType& newTokenType);
00116         
00121         virtual void clear();
00122         
00127         virtual unsigned int getNumTokenTypes() const;
00128 };
00129 
00135 class CharTypeMap
00136 : public TokenTypeMap
00137 {
00138     protected:
00139         
00140     public:
00145         CharTypeMap();
00146         
00151         virtual ~CharTypeMap();
00152 };
00153 
00154 }
00155 
00156 }
00157 
00161 #endif

Generated on Tue Mar 14 20:58:30 2006 for Ionflux Tools Class Library (iftools) by  doxygen 1.4.6