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 00101 #ifndef CS_TOKEN_LIST_TOKEN_PREFIX 00102 #define CS_TOKEN_LIST_TOKEN_PREFIX_DEFAULT 00103 00107 #define CS_TOKEN_LIST_TOKEN_PREFIX XMLTOKEN_ 00108 #endif 00109 00110 #ifndef CS_TOKEN_LIST_TOKEN_LAST 00111 #define CS_TOKEN_LIST_TOKEN_LAST_DEFAULT 00112 00116 #define CS_TOKEN_LIST_TOKEN_LAST TOKEN_COUNT 00117 #endif 00118 00119 #undef CS_TOKEN_LIST_PASTE 00120 #undef CS_TOKEN_LIST_PASTE1 00121 #undef CS_TOKEN_LIST_TOKEN 00122 #undef CS_TOKEN_LIST_TOKEN_FINAL 00123 #define CS_TOKEN_LIST_PASTE(X,Y) CS_TOKEN_LIST_PASTE1(X,Y) 00124 #define CS_TOKEN_LIST_PASTE1(X,Y) X ## Y 00125 #define CS_TOKEN_LIST_TOKEN(X) \ 00126 CS_TOKEN_LIST_PASTE(CS_TOKEN_LIST_TOKEN_PREFIX,X), 00127 #define CS_TOKEN_LIST_TOKEN_FINAL(X) \ 00128 CS_TOKEN_LIST_PASTE(CS_TOKEN_LIST_TOKEN_PREFIX,X) 00129 00130 enum { 00131 #include CS_TOKEN_ITEM_FILE 00132 CS_TOKEN_LIST_TOKEN_FINAL(CS_TOKEN_LIST_TOKEN_LAST) 00133 }; 00134 00135 #ifdef CS_TOKEN_LIST_TOKEN_LAST_DEFAULT 00136 #undef CS_TOKEN_LIST_TOKEN_LAST_DEFAULT 00137 #undef CS_TOKEN_LIST_TOKEN_LAST 00138 #endif 00139 00140 #undef CS_TOKEN_LIST_TOKEN 00141 00144 #define CS_TOKEN_LIST_TOKEN(X) s = #X; s.Downcase(); \ 00145 t.Register(s, CS_TOKEN_LIST_PASTE(CS_TOKEN_LIST_TOKEN_PREFIX,X)); 00146 00147 #ifndef CS_INIT_TOKEN_TABLE_NAME 00148 #define CS_INIT_TOKEN_TABLE_NAME_DEFAULT 00149 00153 #define CS_INIT_TOKEN_TABLE_NAME InitTokenTable 00154 #endif 00155 00156 static void CS_INIT_TOKEN_TABLE_NAME(csStringHash& t) 00157 { 00158 csString s; 00159 #include CS_TOKEN_ITEM_FILE 00160 } 00161 #undef CS_TOKEN_LIST_TOKEN 00162 00163 #ifdef CS_INIT_TOKEN_TABLE_NAME_DEFAULT 00164 #undef CS_INIT_TOKEN_TABLE_NAME 00165 #undef CS_INIT_TOKEN_TABLE_NAME_DEFAULT 00166 #endif 00167 00168 #ifdef CS_TOKEN_LIST_TOKEN_PREFIX_DEFAULT 00169 #undef CS_TOKEN_LIST_TOKEN_PREFIX_DEFAULT 00170 #undef CS_TOKEN_LIST_TOKEN_PREFIX 00171 #endif 00172
Generated for Crystal Space by doxygen 1.4.6