CrystalSpace

Public API Reference

cstool/tokenlist.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2003 by Jorrit Tyberghein
00003               (C) 2003 by Frank Richter
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library 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 GNU
00013     Library 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 library; if not, write to the Free
00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 
00024 /* ATTENTION: Do! Not! #Include! Anything!
00025  * Read below on how this header is intended to be used, and you'll see why
00026  * including something is a really bad idea.
00027  */
00028 
00108 #ifndef CS_TOKEN_LIST_TOKEN_PREFIX
00109 #define CS_TOKEN_LIST_TOKEN_PREFIX_DEFAULT
00110 
00114 #define CS_TOKEN_LIST_TOKEN_PREFIX XMLTOKEN_
00115 #endif
00116 
00117 #ifndef CS_TOKEN_LIST_TOKEN_LAST
00118 #define CS_TOKEN_LIST_TOKEN_LAST_DEFAULT
00119 
00123 #define CS_TOKEN_LIST_TOKEN_LAST TOKEN_COUNT
00124 #endif
00125 
00126 #undef CS_TOKEN_LIST_PASTE
00127 #undef CS_TOKEN_LIST_PASTE1
00128 #undef CS_TOKEN_LIST_TOKEN
00129 #undef CS_TOKEN_LIST_TOKEN_FINAL
00130 #define CS_TOKEN_LIST_PASTE(X,Y) CS_TOKEN_LIST_PASTE1(X,Y)
00131 #define CS_TOKEN_LIST_PASTE1(X,Y) X ## Y
00132 #define CS_TOKEN_LIST_TOKEN(X) \
00133   CS_TOKEN_LIST_PASTE(CS_TOKEN_LIST_TOKEN_PREFIX,X),
00134 #define CS_TOKEN_LIST_TOKEN_FINAL(X) \
00135   CS_TOKEN_LIST_PASTE(CS_TOKEN_LIST_TOKEN_PREFIX,X)
00136 
00137 enum {
00138 #include CS_TOKEN_ITEM_FILE
00139   CS_TOKEN_LIST_TOKEN_FINAL(CS_TOKEN_LIST_TOKEN_LAST)
00140 };
00141 
00142 #ifdef CS_TOKEN_LIST_TOKEN_LAST_DEFAULT
00143 #undef CS_TOKEN_LIST_TOKEN_LAST_DEFAULT
00144 #undef CS_TOKEN_LIST_TOKEN_LAST
00145 #endif
00146 
00147 #undef CS_TOKEN_LIST_TOKEN
00148 
00151 #define CS_TOKEN_LIST_TOKEN(X) s = #X; s.Downcase(); \
00152   t.Register(s, CS_TOKEN_LIST_PASTE(CS_TOKEN_LIST_TOKEN_PREFIX,X));
00153 
00154 #ifndef CS_INIT_TOKEN_TABLE_NAME
00155 #define CS_INIT_TOKEN_TABLE_NAME_DEFAULT
00156 
00160 #define CS_INIT_TOKEN_TABLE_NAME InitTokenTable
00161 #endif
00162   
00163 static void CS_INIT_TOKEN_TABLE_NAME(csStringHash& t)
00164 {
00165   csString s;
00166 #include CS_TOKEN_ITEM_FILE
00167 }
00168 #undef CS_TOKEN_LIST_TOKEN
00169 
00170 #ifdef CS_INIT_TOKEN_TABLE_NAME_DEFAULT
00171 #undef CS_INIT_TOKEN_TABLE_NAME
00172 #undef CS_INIT_TOKEN_TABLE_NAME_DEFAULT
00173 #endif
00174 
00175 #ifdef CS_TOKEN_LIST_TOKEN_PREFIX_DEFAULT
00176 #undef CS_TOKEN_LIST_TOKEN_PREFIX_DEFAULT
00177 #undef CS_TOKEN_LIST_TOKEN_PREFIX
00178 #endif
00179 

Generated for Crystal Space by doxygen 1.4.7