1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the tools applications of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU
19** General Public License version 3 as published by the Free Software
20** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21** included in the packaging of this file. Please review the following
22** information to ensure the GNU General Public License requirements will
23** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24**
25** $QT_END_LICENSE$
26**
27****************************************************************************/
28
29#ifndef TOKEN_H
30#define TOKEN_H
31
32#include <QtCore/qglobal.h>
33
34QT_BEGIN_NAMESPACE
35
36#define FOR_ALL_TOKENS(F) \
37 F(NOTOKEN) \
38 F(IDENTIFIER) \
39 F(INTEGER_LITERAL) \
40 F(CHARACTER_LITERAL) \
41 F(STRING_LITERAL) \
42 F(BOOLEAN_LITERAL) \
43 F(HEADER_NAME) \
44 F(LANGLE) \
45 F(RANGLE) \
46 F(LPAREN) \
47 F(RPAREN) \
48 F(ELIPSIS) \
49 F(LBRACK) \
50 F(RBRACK) \
51 F(LBRACE) \
52 F(RBRACE) \
53 F(EQ) \
54 F(SCOPE) \
55 F(SEMIC) \
56 F(COLON) \
57 F(DOTSTAR) \
58 F(QUESTION) \
59 F(DOT) \
60 F(DYNAMIC_CAST) \
61 F(STATIC_CAST) \
62 F(REINTERPRET_CAST) \
63 F(CONST_CAST) \
64 F(TYPEID) \
65 F(THIS) \
66 F(TEMPLATE) \
67 F(THROW) \
68 F(TRY) \
69 F(CATCH) \
70 F(TYPEDEF) \
71 F(FRIEND) \
72 F(CLASS) \
73 F(NAMESPACE) \
74 F(ENUM) \
75 F(STRUCT) \
76 F(UNION) \
77 F(VIRTUAL) \
78 F(PRIVATE) \
79 F(PROTECTED) \
80 F(PUBLIC) \
81 F(EXPORT) \
82 F(AUTO) \
83 F(REGISTER) \
84 F(EXTERN) \
85 F(MUTABLE) \
86 F(ASM) \
87 F(USING) \
88 F(INLINE) \
89 F(EXPLICIT) \
90 F(STATIC) \
91 F(CONST) \
92 F(VOLATILE) \
93 F(OPERATOR) \
94 F(SIZEOF) \
95 F(NEW) \
96 F(DELETE) \
97 F(PLUS) \
98 F(MINUS) \
99 F(STAR) \
100 F(SLASH) \
101 F(PERCENT) \
102 F(HAT) \
103 F(AND) \
104 F(OR) \
105 F(TILDE) \
106 F(NOT) \
107 F(PLUS_EQ) \
108 F(MINUS_EQ) \
109 F(STAR_EQ) \
110 F(SLASH_EQ) \
111 F(PERCENT_EQ) \
112 F(HAT_EQ) \
113 F(AND_EQ) \
114 F(OR_EQ) \
115 F(LTLT) \
116 F(GTGT) \
117 F(GTGT_EQ) \
118 F(LTLT_EQ) \
119 F(EQEQ) \
120 F(NE) \
121 F(LE) \
122 F(GE) \
123 F(ANDAND) \
124 F(OROR) \
125 F(INCR) \
126 F(DECR) \
127 F(COMMA) \
128 F(ARROW_STAR) \
129 F(ARROW) \
130 F(CHAR) \
131 F(WCHAR) \
132 F(BOOL) \
133 F(SHORT) \
134 F(INT) \
135 F(LONG) \
136 F(SIGNED) \
137 F(UNSIGNED) \
138 F(FLOAT) \
139 F(DOUBLE) \
140 F(VOID) \
141 F(CASE) \
142 F(DEFAULT) \
143 F(IF) \
144 F(ELSE) \
145 F(SWITCH) \
146 F(WHILE) \
147 F(DO) \
148 F(FOR) \
149 F(BREAK) \
150 F(CONTINUE) \
151 F(GOTO) \
152 F(SIGNALS) \
153 F(SLOTS) \
154 F(RETURN) \
155 F(Q_OBJECT_TOKEN) \
156 F(Q_GADGET_TOKEN) \
157 F(Q_NAMESPACE_TOKEN) \
158 F(Q_PROPERTY_TOKEN) \
159 F(Q_PLUGIN_METADATA_TOKEN) \
160 F(Q_ENUMS_TOKEN) \
161 F(Q_ENUM_TOKEN) \
162 F(Q_ENUM_NS_TOKEN) \
163 F(Q_FLAGS_TOKEN) \
164 F(Q_FLAG_TOKEN) \
165 F(Q_FLAG_NS_TOKEN) \
166 F(Q_DECLARE_FLAGS_TOKEN) \
167 F(Q_DECLARE_INTERFACE_TOKEN) \
168 F(Q_DECLARE_METATYPE_TOKEN) \
169 F(Q_CLASSINFO_TOKEN) \
170 F(Q_INTERFACES_TOKEN) \
171 F(Q_SIGNALS_TOKEN) \
172 F(Q_SLOTS_TOKEN) \
173 F(Q_SIGNAL_TOKEN) \
174 F(Q_SLOT_TOKEN) \
175 F(Q_PRIVATE_SLOT_TOKEN) \
176 F(Q_MOC_COMPAT_TOKEN) \
177 F(Q_INVOKABLE_TOKEN) \
178 F(Q_SCRIPTABLE_TOKEN) \
179 F(Q_PRIVATE_PROPERTY_TOKEN) \
180 F(Q_REVISION_TOKEN) \
181 F(SPECIAL_TREATMENT_MARK) \
182 F(MOC_INCLUDE_BEGIN) \
183 F(MOC_INCLUDE_END) \
184 F(CPP_COMMENT) \
185 F(C_COMMENT) \
186 F(FLOATING_LITERAL) \
187 F(HASH) \
188 F(QUOTE) \
189 F(SINGLEQUOTE) \
190 F(LANGLE_SCOPE) \
191 F(DIGIT) \
192 F(CHARACTER) \
193 F(NEWLINE) \
194 F(WHITESPACE) \
195 F(BACKSLASH) \
196 F(INCOMPLETE) \
197 F(PP_DEFINE) \
198 F(PP_UNDEF) \
199 F(PP_IF) \
200 F(PP_IFDEF) \
201 F(PP_IFNDEF) \
202 F(PP_ELIF) \
203 F(PP_ELSE) \
204 F(PP_ENDIF) \
205 F(PP_INCLUDE) \
206 F(PP_HASHHASH) \
207 F(PP_HASH) \
208 F(PP_DEFINED) \
209 F(PP_INCOMPLETE) \
210 F(PP_MOC_TRUE) \
211 F(PP_MOC_FALSE)
212
213
214enum Token {
215
216#define CREATE_ENUM_VALUE(Name) Name,
217 FOR_ALL_TOKENS(CREATE_ENUM_VALUE)
218#undef CREATE_ENUM_VALUE
219
220 // aliases
221 PP_AND = AND,
222 PP_ANDAND = ANDAND,
223 PP_BACKSLASH = BACKSLASH,
224 PP_CHARACTER = CHARACTER,
225 PP_CHARACTER_LITERAL = CHARACTER_LITERAL,
226 PP_COLON = COLON,
227 PP_COMMA = COMMA,
228 PP_CPP_COMMENT = CPP_COMMENT,
229 PP_C_COMMENT = C_COMMENT,
230 PP_DIGIT = DIGIT,
231 PP_EQEQ = EQEQ,
232 PP_FLOATING_LITERAL = FLOATING_LITERAL,
233 PP_GE = GE,
234 PP_GTGT = GTGT,
235 PP_HAT = HAT,
236 PP_IDENTIFIER = IDENTIFIER,
237 PP_INTEGER_LITERAL = INTEGER_LITERAL,
238 PP_LANGLE = LANGLE,
239 PP_LE = LE,
240 PP_LPAREN = LPAREN,
241 PP_LTLT = LTLT,
242 PP_MINUS = MINUS,
243 PP_NE = NE,
244 PP_NEWLINE = NEWLINE,
245 PP_NOTOKEN = NOTOKEN,
246 PP_NOT = NOT,
247 PP_OR = OR,
248 PP_OROR = OROR,
249 PP_PERCENT = PERCENT,
250 PP_PLUS = PLUS,
251 PP_QUESTION = QUESTION,
252 PP_QUOTE = QUOTE,
253 PP_RANGLE = RANGLE,
254 PP_RPAREN = RPAREN,
255 PP_SINGLEQUOTE = SINGLEQUOTE,
256 PP_SLASH = SLASH,
257 PP_STAR = STAR,
258 PP_STRING_LITERAL = STRING_LITERAL,
259 PP_TILDE = TILDE,
260 PP_WHITESPACE = WHITESPACE,
261 Q_META_TOKEN_BEGIN = Q_OBJECT_TOKEN,
262 Q_META_TOKEN_END = SPECIAL_TREATMENT_MARK
263};
264
265// for debugging only
266#if defined(DEBUG_MOC)
267const char *tokenTypeName(Token t);
268#endif
269
270typedef Token PP_Token;
271
272QT_END_NAMESPACE
273
274#endif // TOKEN_H
275

source code of qtremoteobjects/tools/repc/moc_copy/token.h