| 1 | /* | 
|---|
| 2 | * Action_impl.hpp | 
|---|
| 3 | * | 
|---|
| 4 | *  Created on: Aug 25, 2010 | 
|---|
| 5 | *      Author: heber | 
|---|
| 6 | */ | 
|---|
| 7 |  | 
|---|
| 8 | /** These macros define the following functions, necessary but repetitive for | 
|---|
| 9 | * every Action: | 
|---|
| 10 | *  -# Dialog* fillDialog() | 
|---|
| 11 | *  -# action command (e.g. AnalysisMolecularVolume() ) | 
|---|
| 12 | *  -# void getParametersfromValuStorage() | 
|---|
| 13 | *  -# struct Action...Parameters | 
|---|
| 14 | * | 
|---|
| 15 | *  For this, the user has the define the following values, each with | 
|---|
| 16 | *  parenthesis, for the values/parameters the action needs | 
|---|
| 17 | *  -# paramtypes, e.g. (int)(double) | 
|---|
| 18 | *  -# paramtokens, e.g. ("Z")("length") | 
|---|
| 19 | *  -# paramreferences, e.g. (Z)(length) | 
|---|
| 20 | *  and for additional values/parameters to save in the state | 
|---|
| 21 | *  -# statetypes, e.g. (int)(double) | 
|---|
| 22 | *  -# statereferences, e.g. (Z)(length) | 
|---|
| 23 | *  and the name and category of the action | 
|---|
| 24 | *  -# CATEGORY, e.g. Analysis | 
|---|
| 25 | *  -# ACTIONNAME, e.g. MolecularVolume | 
|---|
| 26 | */ | 
|---|
| 27 |  | 
|---|
| 28 | // include config.h | 
|---|
| 29 | #ifdef HAVE_CONFIG_H | 
|---|
| 30 | #include <config.h> | 
|---|
| 31 | #endif | 
|---|
| 32 |  | 
|---|
| 33 | #include "CodePatterns/Chronos.hpp" | 
|---|
| 34 |  | 
|---|
| 35 | #include <boost/preprocessor/cat.hpp> | 
|---|
| 36 | #include <boost/preprocessor/expand.hpp> | 
|---|
| 37 | #include <boost/preprocessor/comparison/equal.hpp> | 
|---|
| 38 | #include <boost/preprocessor/comparison/not_equal.hpp> | 
|---|
| 39 | #include <boost/preprocessor/control/expr_if.hpp> | 
|---|
| 40 | #include <boost/preprocessor/control/if.hpp> | 
|---|
| 41 | #include <boost/preprocessor/debug/assert.hpp> | 
|---|
| 42 | #include <boost/preprocessor/iteration/local.hpp> | 
|---|
| 43 | #include <boost/preprocessor/list/adt.hpp> | 
|---|
| 44 | #include <boost/preprocessor/punctuation/comma_if.hpp> | 
|---|
| 45 | #include <boost/preprocessor/repetition/repeat.hpp> | 
|---|
| 46 | #include <boost/preprocessor/seq/elem.hpp> | 
|---|
| 47 | #include <boost/preprocessor/seq/push_back.hpp> | 
|---|
| 48 | #include <boost/preprocessor/seq/seq.hpp> | 
|---|
| 49 | #include <boost/preprocessor/seq/size.hpp> | 
|---|
| 50 | #include <boost/preprocessor/seq/transform.hpp> | 
|---|
| 51 |  | 
|---|
| 52 | #include "Parameters/Parameter.hpp" | 
|---|
| 53 |  | 
|---|
| 54 |  | 
|---|
| 55 | // some derived names: if CATEGORY is not given, we don't prefix with it | 
|---|
| 56 | #ifdef CATEGORY | 
|---|
| 57 | #define ACTION BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, Action)) | 
|---|
| 58 | #define COMMAND BOOST_PP_CAT(CATEGORY, ACTIONNAME) | 
|---|
| 59 | #define STATE BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, State)) | 
|---|
| 60 | #define PARAMS BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, Parameters)) | 
|---|
| 61 | #else | 
|---|
| 62 | #define ACTION BOOST_PP_CAT(ACTIONNAME, Action) | 
|---|
| 63 | #define COMMAND ACTIONNAME | 
|---|
| 64 | #define STATE BOOST_PP_CAT(ACTIONNAME, State) | 
|---|
| 65 | #define PARAMS BOOST_PP_CAT(ACTIONNAME, Parameters) | 
|---|
| 66 | #endif | 
|---|
| 67 | #define INSTANCE BOOST_PP_CAT(this_, BOOST_PP_CAT(ACTIONNAME, _instance)) | 
|---|
| 68 |  | 
|---|
| 69 | // check if no lists given | 
|---|
| 70 | #ifndef paramtypes | 
|---|
| 71 | #define MAXPARAMTYPES 0 | 
|---|
| 72 | #else | 
|---|
| 73 | #define MAXPARAMTYPES BOOST_PP_SEQ_SIZE(paramtypes) | 
|---|
| 74 | #endif | 
|---|
| 75 | #ifndef statetypes | 
|---|
| 76 | #define MAXSTATETYPES 0 | 
|---|
| 77 | #else | 
|---|
| 78 | #define MAXSTATETYPES BOOST_PP_SEQ_SIZE(statetypes) | 
|---|
| 79 | #endif | 
|---|
| 80 | #ifndef paramdefaults | 
|---|
| 81 | #define MAXPARAMDEFAULTS 0 | 
|---|
| 82 | // this is required for valid_print "else part" | 
|---|
| 83 | #define sequencer(z,n,data) \ | 
|---|
| 84 | BOOST_PP_SEQ_PUSH_BACK( data, NOPARAM_DEFAULT) | 
|---|
| 85 | #define paramdefaults BOOST_PP_REPEAT( MAXPARAMTYPES, sequencer, BOOST_PP_SEQ_NIL ) | 
|---|
| 86 | #else | 
|---|
| 87 | #define MAXPARAMDEFAULTS BOOST_PP_SEQ_SIZE(paramdefaults) | 
|---|
| 88 | #endif | 
|---|
| 89 | #define PARAM_DEFAULT(x) \ | 
|---|
| 90 | (x, BOOST_PP_NIL) | 
|---|
| 91 |  | 
|---|
| 92 | // check user has given name and category | 
|---|
| 93 | #ifndef ACTIONNAME | 
|---|
| 94 | ERROR: No "ACTIONNAME" defined in: __FILE__ | 
|---|
| 95 | #endif | 
|---|
| 96 |  | 
|---|
| 97 | // calculate numbers and check whether all have same size | 
|---|
| 98 | #ifdef paramtokens | 
|---|
| 99 | BOOST_PP_ASSERT_MSG(BOOST_PP_EQUAL(MAXPARAMTYPES, BOOST_PP_SEQ_SIZE(paramtokens)),\ | 
|---|
| 100 | ERROR: There are not the same number of "paramtokens" and "paramtypes" in: __FILE__ \ | 
|---|
| 101 | ) | 
|---|
| 102 | #endif | 
|---|
| 103 | #ifdef paramreferences | 
|---|
| 104 | BOOST_PP_ASSERT_MSG(BOOST_PP_EQUAL(MAXPARAMTYPES, BOOST_PP_SEQ_SIZE(paramreferences)),\ | 
|---|
| 105 | ERROR: There are not the same number of "paramtokens" and "paramreferences" in: __FILE__ \ | 
|---|
| 106 | ) | 
|---|
| 107 | #endif | 
|---|
| 108 |  | 
|---|
| 109 | #ifdef statetypes | 
|---|
| 110 | BOOST_PP_ASSERT_MSG(BOOST_PP_EQUAL(MAXSTATETYPES, BOOST_PP_SEQ_SIZE(statereferences)),\ | 
|---|
| 111 | ERROR: There are not the same number of "statetypes" and "statereferences" in: __FILE__ \ | 
|---|
| 112 | ) | 
|---|
| 113 | #endif | 
|---|
| 114 |  | 
|---|
| 115 | // print a list of type ref followed by a separator, i.e. "int i;" | 
|---|
| 116 | #define initialiser_print(z,n,initialiserlist) \ | 
|---|
| 117 | BOOST_PP_SEQ_ELEM(n, initialiserlist) \ | 
|---|
| 118 | (BOOST_PP_CAT(_, BOOST_PP_SEQ_ELEM(n, initialiserlist))), | 
|---|
| 119 |  | 
|---|
| 120 | // print a list of ref(_ref) followed by a separator, i.e. "id(_id)," | 
|---|
| 121 | #define type_print(z,n,TYPELIST, VARLIST, separator) \ | 
|---|
| 122 | BOOST_PP_SEQ_ELEM(n, TYPELIST) \ | 
|---|
| 123 | BOOST_PP_SEQ_ELEM(n, VARLIST)\ | 
|---|
| 124 | separator | 
|---|
| 125 |  | 
|---|
| 126 | // print a list of type ref followed, i.e. "int i, double position" | 
|---|
| 127 | #define type_list(z,n,TYPELIST,VARLIST) \ | 
|---|
| 128 | BOOST_PP_COMMA_IF(n)\ | 
|---|
| 129 | BOOST_PP_SEQ_ELEM(n, TYPELIST) \ | 
|---|
| 130 | BOOST_PP_SEQ_ELEM(n, VARLIST) | 
|---|
| 131 |  | 
|---|
| 132 | // prints dialog->query calls for paramtypes with tokens | 
|---|
| 133 | #define dialog_print(z,n,unused) \ | 
|---|
| 134 | dialog->query<\ | 
|---|
| 135 | BOOST_PP_SEQ_ELEM(n, paramtypes)\ | 
|---|
| 136 | >( params. \ | 
|---|
| 137 | BOOST_PP_SEQ_ELEM(n, paramreferences)\ | 
|---|
| 138 | ,\ | 
|---|
| 139 | BOOST_PP_SEQ_ELEM(n, paramtokens)\ | 
|---|
| 140 | , Traits.getDescription()\ | 
|---|
| 141 | ); | 
|---|
| 142 |  | 
|---|
| 143 | // print an initialiser list, i.e. "var( token, valid (,default) )(,)" | 
|---|
| 144 | #define valid_print(z,n,TOKENLIST, VARLIST, VALIDLIST, DEFAULTLIST) \ | 
|---|
| 145 | BOOST_PP_COMMA_IF(n) \ | 
|---|
| 146 | BOOST_PP_SEQ_ELEM(n, VARLIST) \ | 
|---|
| 147 | ( \ | 
|---|
| 148 | BOOST_PP_SEQ_ELEM(n, TOKENLIST) \ | 
|---|
| 149 | , \ | 
|---|
| 150 | BOOST_PP_SEQ_ELEM(n, VALIDLIST) \ | 
|---|
| 151 | BOOST_PP_COMMA_IF( BOOST_PP_NOT( BOOST_PP_LIST_IS_NIL( BOOST_PP_SEQ_ELEM(n, DEFAULTLIST) ) ) ) \ | 
|---|
| 152 | BOOST_PP_EXPR_IF( \ | 
|---|
| 153 | BOOST_PP_NOT( BOOST_PP_LIST_IS_NIL( BOOST_PP_SEQ_ELEM(n, DEFAULTLIST) ) ), \ | 
|---|
| 154 | BOOST_PP_LIST_FIRST( BOOST_PP_SEQ_ELEM(n, DEFAULTLIST) )) \ | 
|---|
| 155 | ) | 
|---|
| 156 |  | 
|---|
| 157 | // print an initialiser list, i.e. "var( valid . var )(,)" | 
|---|
| 158 | #define validcopy_print(z,n,TOKENLIST, VARLIST, VALID) \ | 
|---|
| 159 | BOOST_PP_COMMA_IF(n) \ | 
|---|
| 160 | BOOST_PP_SEQ_ELEM(n, VARLIST) \ | 
|---|
| 161 | ( \ | 
|---|
| 162 | VALID . \ | 
|---|
| 163 | BOOST_PP_SEQ_ELEM(n, VARLIST) \ | 
|---|
| 164 | ) | 
|---|
| 165 |  | 
|---|
| 166 | // prints set/queryCurrentValue (command) for paramreferences and paramtokens | 
|---|
| 167 | #define value_print(z, n, container, prefix) \ | 
|---|
| 168 | prefix \ | 
|---|
| 169 | BOOST_PP_SEQ_ELEM(n, container)\ | 
|---|
| 170 | .set(\ | 
|---|
| 171 | BOOST_PP_SEQ_ELEM(n, container)\ | 
|---|
| 172 | ); | 
|---|
| 173 |  | 
|---|
| 174 | // prints set/queryCurrentValue (command) for paramreferences and paramtokens | 
|---|
| 175 | #define valuetype_print(z,n,container, types, prefix) \ | 
|---|
| 176 | prefix \ | 
|---|
| 177 | BOOST_PP_SEQ_ELEM(n, container) \ | 
|---|
| 178 | .setAsString( \ | 
|---|
| 179 | BOOST_PP_SEQ_ELEM(n, container) \ | 
|---|
| 180 | ); | 
|---|
| 181 |  | 
|---|
| 182 | #define stringtype std::string | 
|---|
| 183 |  | 
|---|
| 184 | #define type2string(s, data, elem) \ | 
|---|
| 185 | stringtype | 
|---|
| 186 |  | 
|---|
| 187 |  | 
|---|
| 188 | #include "Actions/ActionRegistry.hpp" | 
|---|
| 189 | //#include "Actions/ActionTraits.hpp" | 
|---|
| 190 | #include "UIElements/Dialog.hpp" | 
|---|
| 191 |  | 
|---|
| 192 | #ifdef paramtokens | 
|---|
| 193 | #define statenecessary 1 | 
|---|
| 194 | #endif | 
|---|
| 195 | #ifndef statetokens | 
|---|
| 196 | #define statenecessary 1 | 
|---|
| 197 | #endif | 
|---|
| 198 |  | 
|---|
| 199 | namespace MoleCuilder { | 
|---|
| 200 |  | 
|---|
| 201 | // =========== memento to remember the state when undoing =========== | 
|---|
| 202 | #ifdef statenecessary | 
|---|
| 203 | class STATE : public ActionState { | 
|---|
| 204 | public: | 
|---|
| 205 | STATE( | 
|---|
| 206 | #if defined statetypes && defined statereferences // if we have parameters, we have to add "_" before each reference and add the params as the last one | 
|---|
| 207 | #define OP(s,data,elem) BOOST_PP_CAT(data, elem)  // OP to add "_" | 
|---|
| 208 | #define BOOST_PP_LOCAL_MACRO(n) type_list(~, n, BOOST_PP_SEQ_PUSH_BACK(statetypes, const ACTION::PARAMS &), BOOST_PP_SEQ_TRANSFORM(OP, _, BOOST_PP_SEQ_PUSH_BACK(statereferences, params))) | 
|---|
| 209 | #else /// if not, params is only list | 
|---|
| 210 | #define BOOST_PP_LOCAL_MACRO(n) type_list(~, n, (const ACTION::PARAMS &), (_params)) | 
|---|
| 211 | #endif | 
|---|
| 212 | #define BOOST_PP_LOCAL_LIMITS  (0, MAXSTATETYPES) | 
|---|
| 213 | #include BOOST_PP_LOCAL_ITERATE() | 
|---|
| 214 | ) : | 
|---|
| 215 | #if defined statetypes && defined statereferences // do we have parameters at all? | 
|---|
| 216 | BOOST_PP_REPEAT(MAXSTATETYPES, initialiser_print, statereferences) | 
|---|
| 217 | #endif | 
|---|
| 218 | params(_params) | 
|---|
| 219 | {} | 
|---|
| 220 |  | 
|---|
| 221 | #if defined statetypes && defined statereferences // do we have parameters at all? | 
|---|
| 222 | #define BOOST_PP_LOCAL_MACRO(n) type_print(~, n, statetypes, statereferences, ;) | 
|---|
| 223 | #define BOOST_PP_LOCAL_LIMITS  (0, MAXSTATETYPES-1) | 
|---|
| 224 | #include BOOST_PP_LOCAL_ITERATE() | 
|---|
| 225 | #endif | 
|---|
| 226 | ACTION::PARAMS params; | 
|---|
| 227 | }; | 
|---|
| 228 | #endif /* statenecessary */ | 
|---|
| 229 |  | 
|---|
| 230 | // (const) prototype to be placed into the ActionRegistry (must be deleted by registry itself) | 
|---|
| 231 | //const ACTION INSTANCE; | 
|---|
| 232 | //boost::shared_ptr< ACTION > INSTANCE( new ACTION() ); | 
|---|
| 233 |  | 
|---|
| 234 | // =========== constructor =========== | 
|---|
| 235 | ACTION::ACTION () : | 
|---|
| 236 | Action(ActionTraits< ACTION >(), false) | 
|---|
| 237 | {} | 
|---|
| 238 |  | 
|---|
| 239 | // =========== destructor =========== | 
|---|
| 240 | ACTION::~ACTION () | 
|---|
| 241 | { | 
|---|
| 242 | //std::cout << "Action ACTION is being destroyed." << std::endl; | 
|---|
| 243 | } | 
|---|
| 244 |  | 
|---|
| 245 | // =========== parameter constructor =========== | 
|---|
| 246 | ACTION::PARAMS::PARAMS() | 
|---|
| 247 | #if defined paramtokens && defined paramreferences && defined paramvalids | 
|---|
| 248 | : | 
|---|
| 249 | #define BOOST_PP_LOCAL_MACRO(n) valid_print(~, n, paramtokens, paramreferences, paramvalids, paramdefaults) | 
|---|
| 250 | #define BOOST_PP_LOCAL_LIMITS  (0, MAXPARAMTYPES-1) | 
|---|
| 251 | #include BOOST_PP_LOCAL_ITERATE() | 
|---|
| 252 | #endif | 
|---|
| 253 | {} | 
|---|
| 254 |  | 
|---|
| 255 | ACTION::PARAMS::PARAMS(const PARAMS &p) | 
|---|
| 256 | #if defined paramtokens && defined paramreferences | 
|---|
| 257 | : | 
|---|
| 258 | #define BOOST_PP_LOCAL_MACRO(n) validcopy_print(~, n, paramtokens, paramreferences, p) | 
|---|
| 259 | #define BOOST_PP_LOCAL_LIMITS  (0, MAXPARAMTYPES-1) | 
|---|
| 260 | #include BOOST_PP_LOCAL_ITERATE() | 
|---|
| 261 | #endif | 
|---|
| 262 | {} | 
|---|
| 263 |  | 
|---|
| 264 | // =========== fill a dialog =========== | 
|---|
| 265 | Dialog* ACTION::fillDialog(Dialog *dialog) { | 
|---|
| 266 | ASSERT(dialog,"No Dialog given when filling actionname's dialog"); | 
|---|
| 267 | #if BOOST_PP_EQUAL(MAXPARAMTYPES,0) | 
|---|
| 268 | dialog->queryEmpty(TOKEN, Traits.getDescription()); | 
|---|
| 269 | #else | 
|---|
| 270 | #define BOOST_PP_LOCAL_MACRO(n) dialog_print(~, n, ~) | 
|---|
| 271 | #define BOOST_PP_LOCAL_LIMITS  (0, MAXPARAMTYPES-1) | 
|---|
| 272 | #include BOOST_PP_LOCAL_ITERATE() | 
|---|
| 273 | #endif | 
|---|
| 274 | return dialog; | 
|---|
| 275 | }; | 
|---|
| 276 |  | 
|---|
| 277 | // =========== time the action =========== | 
|---|
| 278 | // we need this here to have the correct function name | 
|---|
| 279 | void ACTION::startTimer() const { Chronos::getInstance().startTiming( std::string( TOKEN ) ); } | 
|---|
| 280 | void ACTION::endTimer() const { Chronos::getInstance().endTiming( std::string( TOKEN ) ); } | 
|---|
| 281 |  | 
|---|
| 282 | // =========== command for calling action directly =========== | 
|---|
| 283 | void COMMAND( | 
|---|
| 284 | #if defined paramtypes && defined paramreferences && BOOST_PP_NOT_EQUAL(MAXPARAMTYPES,0) | 
|---|
| 285 | #define BOOST_PP_LOCAL_MACRO(n) type_list(~, n, paramtypes, paramreferences) | 
|---|
| 286 | #define BOOST_PP_LOCAL_LIMITS  (0, MAXPARAMTYPES-1) | 
|---|
| 287 | #include BOOST_PP_LOCAL_ITERATE() | 
|---|
| 288 | #endif | 
|---|
| 289 | ) | 
|---|
| 290 | { | 
|---|
| 291 | ACTION *ToCall = dynamic_cast<ACTION*>(ActionRegistry::getInstance().getActionByName( TOKEN )); //->clone(params); | 
|---|
| 292 | //ACTION::PARAMS params; | 
|---|
| 293 | #if defined paramreferences && BOOST_PP_NOT_EQUAL(MAXPARAMTYPES,0) | 
|---|
| 294 | #define BOOST_PP_LOCAL_MACRO(n) value_print(~, n, paramreferences, ToCall->params.) | 
|---|
| 295 | #define BOOST_PP_LOCAL_LIMITS  (0, MAXPARAMTYPES-1) | 
|---|
| 296 | #include BOOST_PP_LOCAL_ITERATE() | 
|---|
| 297 | #endif | 
|---|
| 298 | ToCall->call(Action::NonInteractive); | 
|---|
| 299 | }; | 
|---|
| 300 |  | 
|---|
| 301 | void BOOST_PP_CAT( COMMAND, _stringargs)( | 
|---|
| 302 | #if defined paramtypes && defined paramreferences && BOOST_PP_NOT_EQUAL(MAXPARAMTYPES,0) | 
|---|
| 303 | #define BOOST_PP_LOCAL_MACRO(n) type_list(~, n, BOOST_PP_SEQ_TRANSFORM( type2string, , paramtypes), paramreferences) | 
|---|
| 304 | #define BOOST_PP_LOCAL_LIMITS  (0, MAXPARAMTYPES-1) | 
|---|
| 305 | #include BOOST_PP_LOCAL_ITERATE() | 
|---|
| 306 | #endif | 
|---|
| 307 | ) { | 
|---|
| 308 | ACTION *ToCall = dynamic_cast<ACTION*>(ActionRegistry::getInstance().getActionByName( TOKEN )); //->clone(params); | 
|---|
| 309 | //ACTION::PARAMS params; | 
|---|
| 310 | #if defined paramtypes && defined paramtypes && BOOST_PP_NOT_EQUAL(MAXPARAMTYPES,0) | 
|---|
| 311 | #define BOOST_PP_LOCAL_MACRO(n) valuetype_print(~, n, paramreferences, paramtypes, ToCall->params. ) | 
|---|
| 312 | #define BOOST_PP_LOCAL_LIMITS  (0, MAXPARAMTYPES-1) | 
|---|
| 313 | #include BOOST_PP_LOCAL_ITERATE() | 
|---|
| 314 | #endif | 
|---|
| 315 | ToCall->call(MoleCuilder::Action::NonInteractive); | 
|---|
| 316 | }; | 
|---|
| 317 |  | 
|---|
| 318 | } | 
|---|
| 319 |  | 
|---|
| 320 | // free up defines | 
|---|
| 321 | #undef paramvalids | 
|---|
| 322 | #undef paramtypes | 
|---|
| 323 | #undef paramtokens | 
|---|
| 324 | #undef paramreferences | 
|---|
| 325 | #undef paramdescriptions | 
|---|
| 326 | #undef paramdefaults | 
|---|
| 327 | #undef MAXPARAMTYPES | 
|---|
| 328 | #undef MAXPARAMDEFAULTS | 
|---|
| 329 | #undef statetypes | 
|---|
| 330 | #undef statereferences | 
|---|
| 331 | #undef MAXSTATETYPES | 
|---|
| 332 | #undef PARAM_DEFAULT | 
|---|
| 333 |  | 
|---|
| 334 | #undef type2string | 
|---|
| 335 | #undef stringtype | 
|---|
| 336 | #undef initialiser_print | 
|---|
| 337 | #undef type_print | 
|---|
| 338 | #undef type_list | 
|---|
| 339 | #undef dialog_print | 
|---|
| 340 | #undef sequencer | 
|---|
| 341 | #undef valid_print | 
|---|
| 342 | #undef validcopy_print | 
|---|
| 343 | #undef value_print | 
|---|
| 344 | #undef valuetype_print | 
|---|
| 345 |  | 
|---|
| 346 | #undef ACTION | 
|---|
| 347 | #undef COMMAND | 
|---|
| 348 | #undef PARAMS | 
|---|
| 349 | #undef STATE | 
|---|
| 350 | #undef INSTANCE | 
|---|
| 351 |  | 
|---|
| 352 | #undef ACTIONNAME | 
|---|
| 353 | #undef CATEGORY | 
|---|
| 354 | #undef TOKEN | 
|---|