token_ids.hpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. /*=============================================================================
  2. Boost.Wave: A Standard compliant C++ preprocessor library
  3. The definition of a default set of token identifiers and related
  4. functions.
  5. http://www.boost.org/
  6. Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
  7. Software License, Version 1.0. (See accompanying file
  8. LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. =============================================================================*/
  10. #if !defined(BOOST_TOKEN_IDS_HPP_414E9A58_F079_4789_8AFF_513815CE475B_INCLUDED)
  11. #define BOOST_TOKEN_IDS_HPP_414E9A58_F079_4789_8AFF_513815CE475B_INCLUDED
  12. #include <string>
  13. #include <boost/wave/wave_config.hpp>
  14. // this must occur after all of the includes and before any code appears
  15. #ifdef BOOST_HAS_ABI_HEADERS
  16. #include BOOST_ABI_PREFIX
  17. #endif
  18. ///////////////////////////////////////////////////////////////////////////////
  19. // Allow external redefinition of the token identifiers to use
  20. #if !defined(BOOST_WAVE_TOKEN_IDS_DEFINED)
  21. #define BOOST_WAVE_TOKEN_IDS_DEFINED
  22. #if (defined (__FreeBSD__) || defined (__DragonFly__) || defined (__OpenBSD__)) && defined (T_DIVIDE)
  23. #undef T_DIVIDE
  24. #endif
  25. ///////////////////////////////////////////////////////////////////////////////
  26. namespace boost {
  27. namespace wave {
  28. ///////////////////////////////////////////////////////////////////////////////
  29. // assemble tokenids
  30. #define TOKEN_FROM_ID(id, cat) ((id) | (cat))
  31. #define ID_FROM_TOKEN(tok) ((tok) & ~TokenTypeMask)
  32. #define BASEID_FROM_TOKEN(tok) ((tok) & ~ExtTokenTypeMask)
  33. ///////////////////////////////////////////////////////////////////////////////
  34. // the token_category helps to classify the different token types
  35. enum token_category {
  36. IdentifierTokenType = 0x08040000,
  37. ParameterTokenType = 0x08840000,
  38. ExtParameterTokenType = 0x088C0000,
  39. OptParameterTokenType = 0x08940000,
  40. KeywordTokenType = 0x10040000,
  41. OperatorTokenType = 0x18040000,
  42. LiteralTokenType = 0x20040000,
  43. IntegerLiteralTokenType = 0x20840000,
  44. FloatingLiteralTokenType = 0x21040000,
  45. StringLiteralTokenType = 0x21840000,
  46. CharacterLiteralTokenType = 0x22040000,
  47. BoolLiteralTokenType = 0x22840000,
  48. PPTokenType = 0x28040000,
  49. PPConditionalTokenType = 0x28440000,
  50. UnknownTokenType = 0x50000000,
  51. EOLTokenType = 0x58000000,
  52. EOFTokenType = 0x60000000,
  53. WhiteSpaceTokenType = 0x68000000,
  54. InternalTokenType = 0x70040000,
  55. TokenTypeMask = 0x7F800000,
  56. AltTokenType = 0x00080000,
  57. TriGraphTokenType = 0x00100000,
  58. AltExtTokenType = 0x00280000, // and, bit_and etc.
  59. PPTokenFlag = 0x00040000, // these are 'real' pp-tokens
  60. ExtTokenTypeMask = 0x7FF80000,
  61. ExtTokenOnlyMask = 0x00780000,
  62. TokenValueMask = 0x0007FFFF,
  63. MainTokenMask = 0x7F87FFFF // TokenTypeMask|TokenValueMask
  64. };
  65. ///////////////////////////////////////////////////////////////////////////////
  66. // the token_id assigns unique numbers to the different C++ lexemes
  67. enum token_id {
  68. T_UNKNOWN = 0,
  69. T_FIRST_TOKEN = 256,
  70. T_AND = TOKEN_FROM_ID(T_FIRST_TOKEN, OperatorTokenType),
  71. T_AND_ALT = TOKEN_FROM_ID(T_FIRST_TOKEN, OperatorTokenType|AltExtTokenType),
  72. T_ANDAND = TOKEN_FROM_ID(257, OperatorTokenType),
  73. T_ANDAND_ALT = TOKEN_FROM_ID(257, OperatorTokenType|AltExtTokenType),
  74. T_ASSIGN = TOKEN_FROM_ID(258, OperatorTokenType),
  75. T_ANDASSIGN = TOKEN_FROM_ID(259, OperatorTokenType),
  76. T_ANDASSIGN_ALT = TOKEN_FROM_ID(259, OperatorTokenType|AltExtTokenType),
  77. T_OR = TOKEN_FROM_ID(260, OperatorTokenType),
  78. T_OR_ALT = TOKEN_FROM_ID(260, OperatorTokenType|AltExtTokenType),
  79. T_OR_TRIGRAPH = TOKEN_FROM_ID(260, OperatorTokenType|TriGraphTokenType),
  80. T_ORASSIGN = TOKEN_FROM_ID(261, OperatorTokenType),
  81. T_ORASSIGN_ALT = TOKEN_FROM_ID(261, OperatorTokenType|AltExtTokenType),
  82. T_ORASSIGN_TRIGRAPH = TOKEN_FROM_ID(261, OperatorTokenType|TriGraphTokenType),
  83. T_XOR = TOKEN_FROM_ID(262, OperatorTokenType),
  84. T_XOR_ALT = TOKEN_FROM_ID(262, OperatorTokenType|AltExtTokenType),
  85. T_XOR_TRIGRAPH = TOKEN_FROM_ID(262, OperatorTokenType|TriGraphTokenType),
  86. T_XORASSIGN = TOKEN_FROM_ID(263, OperatorTokenType),
  87. T_XORASSIGN_ALT = TOKEN_FROM_ID(263, OperatorTokenType|AltExtTokenType),
  88. T_XORASSIGN_TRIGRAPH = TOKEN_FROM_ID(263, OperatorTokenType|TriGraphTokenType),
  89. T_COMMA = TOKEN_FROM_ID(264, OperatorTokenType),
  90. T_COLON = TOKEN_FROM_ID(265, OperatorTokenType),
  91. T_DIVIDE = TOKEN_FROM_ID(266, OperatorTokenType),
  92. T_DIVIDEASSIGN = TOKEN_FROM_ID(267, OperatorTokenType),
  93. T_DOT = TOKEN_FROM_ID(268, OperatorTokenType),
  94. T_DOTSTAR = TOKEN_FROM_ID(269, OperatorTokenType),
  95. T_ELLIPSIS = TOKEN_FROM_ID(270, OperatorTokenType),
  96. T_EQUAL = TOKEN_FROM_ID(271, OperatorTokenType),
  97. T_GREATER = TOKEN_FROM_ID(272, OperatorTokenType),
  98. T_GREATEREQUAL = TOKEN_FROM_ID(273, OperatorTokenType),
  99. T_LEFTBRACE = TOKEN_FROM_ID(274, OperatorTokenType),
  100. T_LEFTBRACE_ALT = TOKEN_FROM_ID(274, OperatorTokenType|AltTokenType),
  101. T_LEFTBRACE_TRIGRAPH = TOKEN_FROM_ID(274, OperatorTokenType|TriGraphTokenType),
  102. T_LESS = TOKEN_FROM_ID(275, OperatorTokenType),
  103. T_LESSEQUAL = TOKEN_FROM_ID(276, OperatorTokenType),
  104. T_LEFTPAREN = TOKEN_FROM_ID(277, OperatorTokenType),
  105. T_LEFTBRACKET = TOKEN_FROM_ID(278, OperatorTokenType),
  106. T_LEFTBRACKET_ALT = TOKEN_FROM_ID(278, OperatorTokenType|AltTokenType),
  107. T_LEFTBRACKET_TRIGRAPH = TOKEN_FROM_ID(278, OperatorTokenType|TriGraphTokenType),
  108. T_MINUS = TOKEN_FROM_ID(279, OperatorTokenType),
  109. T_MINUSASSIGN = TOKEN_FROM_ID(280, OperatorTokenType),
  110. T_MINUSMINUS = TOKEN_FROM_ID(281, OperatorTokenType),
  111. T_PERCENT = TOKEN_FROM_ID(282, OperatorTokenType),
  112. T_PERCENTASSIGN = TOKEN_FROM_ID(283, OperatorTokenType),
  113. T_NOT = TOKEN_FROM_ID(284, OperatorTokenType),
  114. T_NOT_ALT = TOKEN_FROM_ID(284, OperatorTokenType|AltExtTokenType),
  115. T_NOTEQUAL = TOKEN_FROM_ID(285, OperatorTokenType),
  116. T_NOTEQUAL_ALT = TOKEN_FROM_ID(285, OperatorTokenType|AltExtTokenType),
  117. T_OROR = TOKEN_FROM_ID(286, OperatorTokenType),
  118. T_OROR_ALT = TOKEN_FROM_ID(286, OperatorTokenType|AltExtTokenType),
  119. T_OROR_TRIGRAPH = TOKEN_FROM_ID(286, OperatorTokenType|TriGraphTokenType),
  120. T_PLUS = TOKEN_FROM_ID(287, OperatorTokenType),
  121. T_PLUSASSIGN = TOKEN_FROM_ID(288, OperatorTokenType),
  122. T_PLUSPLUS = TOKEN_FROM_ID(289, OperatorTokenType),
  123. T_ARROW = TOKEN_FROM_ID(290, OperatorTokenType),
  124. T_ARROWSTAR = TOKEN_FROM_ID(291, OperatorTokenType),
  125. T_QUESTION_MARK = TOKEN_FROM_ID(292, OperatorTokenType),
  126. T_RIGHTBRACE = TOKEN_FROM_ID(293, OperatorTokenType),
  127. T_RIGHTBRACE_ALT = TOKEN_FROM_ID(293, OperatorTokenType|AltTokenType),
  128. T_RIGHTBRACE_TRIGRAPH = TOKEN_FROM_ID(293, OperatorTokenType|TriGraphTokenType),
  129. T_RIGHTPAREN = TOKEN_FROM_ID(294, OperatorTokenType),
  130. T_RIGHTBRACKET = TOKEN_FROM_ID(295, OperatorTokenType),
  131. T_RIGHTBRACKET_ALT = TOKEN_FROM_ID(295, OperatorTokenType|AltTokenType),
  132. T_RIGHTBRACKET_TRIGRAPH = TOKEN_FROM_ID(295, OperatorTokenType|TriGraphTokenType),
  133. T_COLON_COLON = TOKEN_FROM_ID(296, OperatorTokenType),
  134. T_SEMICOLON = TOKEN_FROM_ID(297, OperatorTokenType),
  135. T_SHIFTLEFT = TOKEN_FROM_ID(298, OperatorTokenType),
  136. T_SHIFTLEFTASSIGN = TOKEN_FROM_ID(299, OperatorTokenType),
  137. T_SHIFTRIGHT = TOKEN_FROM_ID(300, OperatorTokenType),
  138. T_SHIFTRIGHTASSIGN = TOKEN_FROM_ID(301, OperatorTokenType),
  139. T_STAR = TOKEN_FROM_ID(302, OperatorTokenType),
  140. T_COMPL = TOKEN_FROM_ID(303, OperatorTokenType),
  141. T_COMPL_ALT = TOKEN_FROM_ID(303, OperatorTokenType|AltExtTokenType),
  142. T_COMPL_TRIGRAPH = TOKEN_FROM_ID(303, OperatorTokenType|TriGraphTokenType),
  143. T_STARASSIGN = TOKEN_FROM_ID(304, OperatorTokenType),
  144. T_ASM = TOKEN_FROM_ID(305, KeywordTokenType),
  145. T_AUTO = TOKEN_FROM_ID(306, KeywordTokenType),
  146. T_BOOL = TOKEN_FROM_ID(307, KeywordTokenType),
  147. T_FALSE = TOKEN_FROM_ID(308, BoolLiteralTokenType),
  148. T_TRUE = TOKEN_FROM_ID(309, BoolLiteralTokenType),
  149. T_BREAK = TOKEN_FROM_ID(310, KeywordTokenType),
  150. T_CASE = TOKEN_FROM_ID(311, KeywordTokenType),
  151. T_CATCH = TOKEN_FROM_ID(312, KeywordTokenType),
  152. T_CHAR = TOKEN_FROM_ID(313, KeywordTokenType),
  153. T_CLASS = TOKEN_FROM_ID(314, KeywordTokenType),
  154. T_CONST = TOKEN_FROM_ID(315, KeywordTokenType),
  155. T_CONSTCAST = TOKEN_FROM_ID(316, KeywordTokenType),
  156. T_CONTINUE = TOKEN_FROM_ID(317, KeywordTokenType),
  157. T_DEFAULT = TOKEN_FROM_ID(318, KeywordTokenType),
  158. T_DELETE = TOKEN_FROM_ID(319, KeywordTokenType),
  159. T_DO = TOKEN_FROM_ID(320, KeywordTokenType),
  160. T_DOUBLE = TOKEN_FROM_ID(321, KeywordTokenType),
  161. T_DYNAMICCAST = TOKEN_FROM_ID(322, KeywordTokenType),
  162. T_ELSE = TOKEN_FROM_ID(323, KeywordTokenType),
  163. T_ENUM = TOKEN_FROM_ID(324, KeywordTokenType),
  164. T_EXPLICIT = TOKEN_FROM_ID(325, KeywordTokenType),
  165. T_EXPORT = TOKEN_FROM_ID(326, KeywordTokenType),
  166. T_EXTERN = TOKEN_FROM_ID(327, KeywordTokenType),
  167. T_FLOAT = TOKEN_FROM_ID(328, KeywordTokenType),
  168. T_FOR = TOKEN_FROM_ID(329, KeywordTokenType),
  169. T_FRIEND = TOKEN_FROM_ID(330, KeywordTokenType),
  170. T_GOTO = TOKEN_FROM_ID(331, KeywordTokenType),
  171. T_IF = TOKEN_FROM_ID(332, KeywordTokenType),
  172. T_INLINE = TOKEN_FROM_ID(333, KeywordTokenType),
  173. T_INT = TOKEN_FROM_ID(334, KeywordTokenType),
  174. T_LONG = TOKEN_FROM_ID(335, KeywordTokenType),
  175. T_MUTABLE = TOKEN_FROM_ID(336, KeywordTokenType),
  176. T_NAMESPACE = TOKEN_FROM_ID(337, KeywordTokenType),
  177. T_NEW = TOKEN_FROM_ID(338, KeywordTokenType),
  178. T_OPERATOR = TOKEN_FROM_ID(339, KeywordTokenType),
  179. T_PRIVATE = TOKEN_FROM_ID(340, KeywordTokenType),
  180. T_PROTECTED = TOKEN_FROM_ID(341, KeywordTokenType),
  181. T_PUBLIC = TOKEN_FROM_ID(342, KeywordTokenType),
  182. T_REGISTER = TOKEN_FROM_ID(343, KeywordTokenType),
  183. T_REINTERPRETCAST = TOKEN_FROM_ID(344, KeywordTokenType),
  184. T_RETURN = TOKEN_FROM_ID(345, KeywordTokenType),
  185. T_SHORT = TOKEN_FROM_ID(346, KeywordTokenType),
  186. T_SIGNED = TOKEN_FROM_ID(347, KeywordTokenType),
  187. T_SIZEOF = TOKEN_FROM_ID(348, KeywordTokenType),
  188. T_STATIC = TOKEN_FROM_ID(349, KeywordTokenType),
  189. T_STATICCAST = TOKEN_FROM_ID(350, KeywordTokenType),
  190. T_STRUCT = TOKEN_FROM_ID(351, KeywordTokenType),
  191. T_SWITCH = TOKEN_FROM_ID(352, KeywordTokenType),
  192. T_TEMPLATE = TOKEN_FROM_ID(353, KeywordTokenType),
  193. T_THIS = TOKEN_FROM_ID(354, KeywordTokenType),
  194. T_THROW = TOKEN_FROM_ID(355, KeywordTokenType),
  195. T_TRY = TOKEN_FROM_ID(356, KeywordTokenType),
  196. T_TYPEDEF = TOKEN_FROM_ID(357, KeywordTokenType),
  197. T_TYPEID = TOKEN_FROM_ID(358, KeywordTokenType),
  198. T_TYPENAME = TOKEN_FROM_ID(359, KeywordTokenType),
  199. T_UNION = TOKEN_FROM_ID(360, KeywordTokenType),
  200. T_UNSIGNED = TOKEN_FROM_ID(361, KeywordTokenType),
  201. T_USING = TOKEN_FROM_ID(362, KeywordTokenType),
  202. T_VIRTUAL = TOKEN_FROM_ID(363, KeywordTokenType),
  203. T_VOID = TOKEN_FROM_ID(364, KeywordTokenType),
  204. T_VOLATILE = TOKEN_FROM_ID(365, KeywordTokenType),
  205. T_WCHART = TOKEN_FROM_ID(366, KeywordTokenType),
  206. T_WHILE = TOKEN_FROM_ID(367, KeywordTokenType),
  207. T_PP_DEFINE = TOKEN_FROM_ID(368, PPTokenType),
  208. T_PP_IF = TOKEN_FROM_ID(369, PPConditionalTokenType),
  209. T_PP_IFDEF = TOKEN_FROM_ID(370, PPConditionalTokenType),
  210. T_PP_IFNDEF = TOKEN_FROM_ID(371, PPConditionalTokenType),
  211. T_PP_ELSE = TOKEN_FROM_ID(372, PPConditionalTokenType),
  212. T_PP_ELIF = TOKEN_FROM_ID(373, PPConditionalTokenType),
  213. T_PP_ENDIF = TOKEN_FROM_ID(374, PPConditionalTokenType),
  214. T_PP_ERROR = TOKEN_FROM_ID(375, PPTokenType),
  215. T_PP_LINE = TOKEN_FROM_ID(376, PPTokenType),
  216. T_PP_PRAGMA = TOKEN_FROM_ID(377, PPTokenType),
  217. T_PP_UNDEF = TOKEN_FROM_ID(378, PPTokenType),
  218. T_PP_WARNING = TOKEN_FROM_ID(379, PPTokenType),
  219. T_IDENTIFIER = TOKEN_FROM_ID(380, IdentifierTokenType),
  220. T_OCTALINT = TOKEN_FROM_ID(381, IntegerLiteralTokenType),
  221. T_DECIMALINT = TOKEN_FROM_ID(382, IntegerLiteralTokenType),
  222. T_HEXAINT = TOKEN_FROM_ID(383, IntegerLiteralTokenType),
  223. T_INTLIT = TOKEN_FROM_ID(384, IntegerLiteralTokenType),
  224. T_LONGINTLIT = TOKEN_FROM_ID(385, IntegerLiteralTokenType),
  225. T_FLOATLIT = TOKEN_FROM_ID(386, FloatingLiteralTokenType),
  226. T_FIXEDPOINTLIT = TOKEN_FROM_ID(386, FloatingLiteralTokenType|AltTokenType), // IDL specific
  227. T_CCOMMENT = TOKEN_FROM_ID(387, WhiteSpaceTokenType|AltTokenType),
  228. T_CPPCOMMENT = TOKEN_FROM_ID(388, WhiteSpaceTokenType|AltTokenType),
  229. T_CHARLIT = TOKEN_FROM_ID(389, CharacterLiteralTokenType),
  230. T_STRINGLIT = TOKEN_FROM_ID(390, StringLiteralTokenType),
  231. T_CONTLINE = TOKEN_FROM_ID(391, EOLTokenType),
  232. T_SPACE = TOKEN_FROM_ID(392, WhiteSpaceTokenType),
  233. T_SPACE2 = TOKEN_FROM_ID(393, WhiteSpaceTokenType),
  234. T_NEWLINE = TOKEN_FROM_ID(394, EOLTokenType),
  235. T_GENERATEDNEWLINE = TOKEN_FROM_ID(394, EOLTokenType|AltTokenType),
  236. T_POUND_POUND = TOKEN_FROM_ID(395, OperatorTokenType),
  237. T_POUND_POUND_ALT = TOKEN_FROM_ID(395, OperatorTokenType|AltTokenType),
  238. T_POUND_POUND_TRIGRAPH = TOKEN_FROM_ID(395, OperatorTokenType|TriGraphTokenType),
  239. T_POUND = TOKEN_FROM_ID(396, OperatorTokenType),
  240. T_POUND_ALT = TOKEN_FROM_ID(396, OperatorTokenType|AltTokenType),
  241. T_POUND_TRIGRAPH = TOKEN_FROM_ID(396, OperatorTokenType|TriGraphTokenType),
  242. T_ANY = TOKEN_FROM_ID(397, UnknownTokenType),
  243. T_ANY_TRIGRAPH = TOKEN_FROM_ID(397, UnknownTokenType|TriGraphTokenType),
  244. T_PP_INCLUDE = TOKEN_FROM_ID(398, PPTokenType),
  245. T_PP_QHEADER = TOKEN_FROM_ID(399, PPTokenType),
  246. T_PP_HHEADER = TOKEN_FROM_ID(400, PPTokenType),
  247. T_PP_INCLUDE_NEXT = TOKEN_FROM_ID(398, PPTokenType|AltTokenType),
  248. T_PP_QHEADER_NEXT = TOKEN_FROM_ID(399, PPTokenType|AltTokenType),
  249. T_PP_HHEADER_NEXT = TOKEN_FROM_ID(400, PPTokenType|AltTokenType),
  250. T_EOF = TOKEN_FROM_ID(401, EOFTokenType), // end of file reached
  251. T_EOI = TOKEN_FROM_ID(402, EOFTokenType), // end of input reached
  252. T_PP_NUMBER = TOKEN_FROM_ID(403, InternalTokenType),
  253. // MS extensions
  254. T_MSEXT_INT8 = TOKEN_FROM_ID(404, KeywordTokenType),
  255. T_MSEXT_INT16 = TOKEN_FROM_ID(405, KeywordTokenType),
  256. T_MSEXT_INT32 = TOKEN_FROM_ID(406, KeywordTokenType),
  257. T_MSEXT_INT64 = TOKEN_FROM_ID(407, KeywordTokenType),
  258. T_MSEXT_BASED = TOKEN_FROM_ID(408, KeywordTokenType),
  259. T_MSEXT_DECLSPEC = TOKEN_FROM_ID(409, KeywordTokenType),
  260. T_MSEXT_CDECL = TOKEN_FROM_ID(410, KeywordTokenType),
  261. T_MSEXT_FASTCALL = TOKEN_FROM_ID(411, KeywordTokenType),
  262. T_MSEXT_STDCALL = TOKEN_FROM_ID(412, KeywordTokenType),
  263. T_MSEXT_TRY = TOKEN_FROM_ID(413, KeywordTokenType),
  264. T_MSEXT_EXCEPT = TOKEN_FROM_ID(414, KeywordTokenType),
  265. T_MSEXT_FINALLY = TOKEN_FROM_ID(415, KeywordTokenType),
  266. T_MSEXT_LEAVE = TOKEN_FROM_ID(416, KeywordTokenType),
  267. T_MSEXT_INLINE = TOKEN_FROM_ID(417, KeywordTokenType),
  268. T_MSEXT_ASM = TOKEN_FROM_ID(418, KeywordTokenType),
  269. T_MSEXT_PP_REGION = TOKEN_FROM_ID(419, PPTokenType),
  270. T_MSEXT_PP_ENDREGION = TOKEN_FROM_ID(420, PPTokenType),
  271. // import is needed to be a keyword for the C++ module Standards proposal
  272. T_IMPORT = TOKEN_FROM_ID(421, KeywordTokenType),
  273. // C++11 keywords
  274. T_ALIGNAS = TOKEN_FROM_ID(422, KeywordTokenType),
  275. T_ALIGNOF = TOKEN_FROM_ID(423, KeywordTokenType),
  276. T_CHAR16_T = TOKEN_FROM_ID(424, KeywordTokenType),
  277. T_CHAR32_T = TOKEN_FROM_ID(425, KeywordTokenType),
  278. T_CONSTEXPR = TOKEN_FROM_ID(426, KeywordTokenType),
  279. T_DECLTYPE = TOKEN_FROM_ID(427, KeywordTokenType),
  280. T_NOEXCEPT = TOKEN_FROM_ID(428, KeywordTokenType),
  281. T_NULLPTR = TOKEN_FROM_ID(429, KeywordTokenType),
  282. T_STATICASSERT = TOKEN_FROM_ID(430, KeywordTokenType),
  283. T_THREADLOCAL = TOKEN_FROM_ID(431, KeywordTokenType),
  284. T_RAWSTRINGLIT = TOKEN_FROM_ID(432, StringLiteralTokenType),
  285. // C++20 keywords
  286. T_CHAR8_T = TOKEN_FROM_ID(433, KeywordTokenType),
  287. T_CONCEPT = TOKEN_FROM_ID(434, KeywordTokenType),
  288. T_CONSTEVAL = TOKEN_FROM_ID(435, KeywordTokenType),
  289. T_CONSTINIT = TOKEN_FROM_ID(436, KeywordTokenType),
  290. T_CO_AWAIT = TOKEN_FROM_ID(437, KeywordTokenType),
  291. T_CO_RETURN = TOKEN_FROM_ID(438, KeywordTokenType),
  292. T_CO_YIELD = TOKEN_FROM_ID(439, KeywordTokenType),
  293. T_REQUIRES = TOKEN_FROM_ID(440, KeywordTokenType),
  294. // C++20 operators
  295. T_SPACESHIP = TOKEN_FROM_ID(441, OperatorTokenType),
  296. T_LAST_TOKEN_ID,
  297. T_LAST_TOKEN = ID_FROM_TOKEN(T_LAST_TOKEN_ID & ~PPTokenFlag),
  298. T_UNKNOWN_UNIVERSALCHAR = TOKEN_FROM_ID('\\', UnknownTokenType),
  299. // pseudo tokens to help streamlining macro replacement, these should not
  300. // returned from the lexer nor should these be returned from the pp-iterator
  301. T_NONREPLACABLE_IDENTIFIER = TOKEN_FROM_ID(T_LAST_TOKEN+1, IdentifierTokenType),
  302. T_PLACEHOLDER = TOKEN_FROM_ID(T_LAST_TOKEN+2, WhiteSpaceTokenType),
  303. T_PLACEMARKER = TOKEN_FROM_ID(T_LAST_TOKEN+3, InternalTokenType),
  304. T_PARAMETERBASE = TOKEN_FROM_ID(T_LAST_TOKEN+4, ParameterTokenType),
  305. T_EXTPARAMETERBASE = TOKEN_FROM_ID(T_LAST_TOKEN+4, ExtParameterTokenType),
  306. T_OPTPARAMETERBASE = TOKEN_FROM_ID(T_LAST_TOKEN+4, OptParameterTokenType)
  307. };
  308. ///////////////////////////////////////////////////////////////////////////////
  309. // redefine the TOKEN_FROM_ID macro to be more type safe
  310. #undef TOKEN_FROM_ID
  311. #define TOKEN_FROM_ID(id, cat) boost::wave::token_id((id) | (cat))
  312. #undef ID_FROM_TOKEN
  313. #define ID_FROM_TOKEN(tok) \
  314. boost::wave::token_id((tok) & \
  315. ~(boost::wave::TokenTypeMask|boost::wave::PPTokenFlag)) \
  316. /**/
  317. #undef BASEID_FROM_TOKEN
  318. #define BASEID_FROM_TOKEN(tok) \
  319. boost::wave::token_id((tok) & \
  320. ~(boost::wave::ExtTokenTypeMask|boost::wave::PPTokenFlag)) \
  321. /**/
  322. #define BASE_TOKEN(tok) \
  323. boost::wave::token_id((tok) & boost::wave::MainTokenMask) \
  324. /**/
  325. #define CATEGORY_FROM_TOKEN(tok) ((tok) & boost::wave::TokenTypeMask)
  326. #define EXTCATEGORY_FROM_TOKEN(tok) ((tok) & boost::wave::ExtTokenTypeMask)
  327. #define IS_CATEGORY(tok, cat) \
  328. ((CATEGORY_FROM_TOKEN(tok) == CATEGORY_FROM_TOKEN(cat)) ? true : false) \
  329. /**/
  330. #define IS_EXTCATEGORY(tok, cat) \
  331. ((EXTCATEGORY_FROM_TOKEN(tok) == EXTCATEGORY_FROM_TOKEN(cat)) ? true : false) \
  332. /**/
  333. ///////////////////////////////////////////////////////////////////////////////
  334. // verify whether the given token(-id) represents a valid pp_token
  335. inline bool is_pp_token(boost::wave::token_id id)
  336. {
  337. return (id & boost::wave::PPTokenFlag) ? true : false;
  338. }
  339. template <typename TokenT>
  340. inline bool is_pp_token(TokenT const& tok)
  341. {
  342. return is_pp_token(boost::wave::token_id(tok));
  343. }
  344. ///////////////////////////////////////////////////////////////////////////////
  345. // return a token name
  346. BOOST_WAVE_DECL
  347. BOOST_WAVE_STRINGTYPE get_token_name(token_id tokid);
  348. ///////////////////////////////////////////////////////////////////////////////
  349. // return a token name
  350. BOOST_WAVE_DECL
  351. char const *get_token_value(token_id tokid);
  352. ///////////////////////////////////////////////////////////////////////////////
  353. } // namespace wave
  354. } // namespace boost
  355. #endif // #if !defined(BOOST_WAVE_TOKEN_IDS_DEFINED)
  356. // the suffix header occurs after all of the code
  357. #ifdef BOOST_HAS_ABI_HEADERS
  358. #include BOOST_ABI_SUFFIX
  359. #endif
  360. #endif // !defined(BOOST_TOKEN_IDS_HPP_414E9A58_F079_4789_8AFF_513815CE475B_INCLUDED)