CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

tokenlist.h File Reference

Token list helper macros. More...

#include <CS_TOKEN_ITEM_FILE>

Go to the source code of this file.

Token list helper macros

The macros here provide an easy way to automatically build a token list useful for e.g.

parsers. The list of tokens have to be declared in an external file, surrounded by 'CS_TOKEN_LIST_TOKEN()'. The name of the file (full path!) has to be put in a macro named CS_TOKEN_ITEM_FILE.

Example (from a real-world use): fire.tok:

 CS_TOKEN_LIST_TOKEN(PALETTE)
 // ... 

fire.h:

 class csFireLoader
 {
  csStringHash tokens;
 #define CS_TOKEN_ITEM_FILE "proctex/standard/fire.tok"
 #include "cstool/tokenlist.h"
 // ...
 };

fire.cpp:



#define CS_TOKEN_LIST_TOKEN(X)   XMLTOKEN_ ## X,
 A token list entry. More...

#define CS_TOKEN_LIST_TOKEN(X)
 A token list entry. More...


Detailed Description

Token list helper macros.

Definition in file tokenlist.h.


Generated for Crystal Space by doxygen 1.2.14