1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
|
/* valagenietokentype.vala
*
* Copyright (C) 2008-2012 Jamie McCracken, Jürg Billeter
* Based on code by Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Author:
* Jamie McCracken jamiemcc gnome org
*/
using GLib;
public enum Vala.Genie.TokenType {
NONE,
ABSTRACT,
ARRAY,
AS,
ASSERT,
ASSIGN,
ASSIGN_ADD,
ASSIGN_BITWISE_AND,
ASSIGN_BITWISE_OR,
ASSIGN_BITWISE_XOR,
ASSIGN_DIV,
ASSIGN_MUL,
ASSIGN_PERCENT,
ASSIGN_SHIFT_LEFT,
ASSIGN_SUB,
ASYNC,
BITWISE_AND,
BITWISE_OR,
BREAK,
CARRET,
CASE,
CHARACTER_LITERAL,
CLASS,
CLOSE_BRACE,
CLOSE_BRACKET,
CLOSE_PARENS,
CLOSE_REGEX_LITERAL,
CLOSE_TEMPLATE,
COLON,
COMMA,
CONST,
CONSTRUCT,
CONTINUE,
DEDENT,
DEF,
DEFAULT,
DELEGATE,
DELETE,
DICT,
DIV,
DO,
DOT,
DOWNTO,
DYNAMIC,
ELLIPSIS,
ELSE,
ENUM,
ENSURES,
EOF,
EOL,
EVENT,
EXCEPT,
EXCEPTION,
EXTERN,
FALSE,
FINAL,
FINALLY,
FOR,
GET,
HASH,
IDENTIFIER,
IF,
IMPLEMENTS,
IN,
INDENT,
INIT,
INLINE,
INTEGER_LITERAL,
INTERFACE,
INTERNAL,
INTERR,
IS,
ISA,
LAMBDA,
LIST,
LOCK,
MINUS,
NAMESPACE,
NEW,
NULL,
OF,
OUT,
OP_AND,
OP_DEC,
OP_EQ,
OP_GE,
OP_GT,
OP_INC,
OP_LE,
OP_LT,
OP_NE,
OP_NEG,
OP_OR,
OP_PTR,
OP_SHIFT_LEFT,
OPEN_BRACE,
OPEN_BRACKET,
OPEN_PARENS,
OPEN_REGEX_LITERAL,
OPEN_TEMPLATE,
OVERRIDE,
OWNED,
PARAMS,
PASS,
PERCENT,
PLUS,
PRINT,
PRIVATE,
PROP,
PROTECTED,
PUBLIC,
RAISE,
RAISES,
READONLY,
REAL_LITERAL,
REF,
REGEX_LITERAL,
REQUIRES,
RETURN,
SEALED,
SELF,
SEMICOLON,
SET,
SIZEOF,
STAR,
STATIC,
STRING_LITERAL,
STRUCT,
SUPER,
TEMPLATE_STRING_LITERAL,
TILDE,
TO,
TRUE,
TRY,
TYPEOF,
UNOWNED,
USES,
VAR,
VERBATIM_STRING_LITERAL,
VERBATIM_TEMPLATE_STRING_LITERAL,
VIRTUAL,
VOID,
VOLATILE,
WEAK,
WHEN,
WHILE,
YIELD;
public unowned string to_string () {
switch (this) {
case ABSTRACT: return "`abstract'";
case ARRAY: return "`array'";
case AS: return "`as'";
case ASSERT: return "`assert'";
case ASSIGN: return "`='";
case ASSIGN_ADD: return "`+='";
case ASSIGN_BITWISE_AND: return "`&='";
case ASSIGN_BITWISE_OR: return "`|='";
case ASSIGN_BITWISE_XOR: return "`^='";
case ASSIGN_DIV: return "`/='";
case ASSIGN_MUL: return "`*='";
case ASSIGN_PERCENT: return "`%='";
case ASSIGN_SHIFT_LEFT: return "`<<='";
case ASSIGN_SUB: return "`-='";
case ASYNC: return "`async'";
case BITWISE_AND: return "`&'";
case BITWISE_OR: return "`|'";
case BREAK: return "`break'";
case CARRET: return "`^'";
case CASE: return "`case'";
case CHARACTER_LITERAL: return "character literal";
case CLASS: return "`class'";
case CLOSE_BRACE: return "`}'";
case CLOSE_BRACKET: return "`]'";
case CLOSE_PARENS: return "`)'";
case CLOSE_REGEX_LITERAL: return "`/'";
case CLOSE_TEMPLATE: return "close template";
case COLON: return "`:'";
case COMMA: return "`,'";
case CONST: return "`const'";
case CONSTRUCT: return "`construct'";
case CONTINUE: return "`continue'";
case DEDENT: return "end of block (dedent)";
case DEF: return "`def'";
case DEFAULT: return "`default'";
case DELEGATE: return "`delegate'";
case DELETE: return "`delete'";
case DICT: return "`dict'";
case DIV: return "`/'";
case DO: return "`do'";
case DOT: return "`.'";
case DOWNTO: return "`downto'";
case DYNAMIC: return "`dynamic'";
case ELLIPSIS: return "`...'";
case ELSE: return "`else'";
case ENUM: return "`enum'";
case ENSURES: return "`ensures'";
case EOF: return "end of file";
case EOL: return "end of line";
case EVENT: return "event";
case EXCEPT: return "`except'";
case EXCEPTION: return "`exception'";
case EXTERN: return "`extern'";
case FALSE: return "`false'";
case FINAL: return "`final'";
case FINALLY: return "`finally'";
case FOR: return "`for'";
case GET: return "`get'";
case HASH: return "`#'";
case IDENTIFIER: return "identifier";
case IF: return "`if'";
case IMPLEMENTS: return "`implements'";
case IN: return "`in'";
case INDENT: return "block (indent)";
case INIT: return "`init'";
case INLINE: return "`inline'";
case INTEGER_LITERAL: return "integer literal";
case INTERFACE: return "`interface'";
case INTERNAL: return "`internal'";
case INTERR: return "`?'";
case IS: return "`is'";
case ISA: return "`isa'";
case LAMBDA: return "`=>'";
case LIST: return "`list'";
case LOCK: return "`lock'";
case MINUS: return "`-'";
case NAMESPACE: return "`namespace'";
case NEW: return "`new'";
case NULL: return "`null'";
case OF: return "`of'";
case OUT: return "`out'";
case OP_AND: return "`and'";
case OP_DEC: return "`--'";
case OP_EQ: return "`=='";
case OP_GE: return "`>='";
case OP_GT: return "`>'";
case OP_INC: return "`++'";
case OP_LE: return "`<='";
case OP_LT: return "`<'";
case OP_NE: return "`!='";
case OP_NEG: return "`!'";
case OP_OR: return "`or'";
case OP_PTR: return "`->'";
case OP_SHIFT_LEFT: return "`<<'";
case OPEN_BRACE: return "`{'";
case OPEN_BRACKET: return "`['";
case OPEN_PARENS: return "`('";
case OPEN_REGEX_LITERAL: return "`/'";
case OPEN_TEMPLATE: return "open template";
case OVERRIDE: return "`override'";
case OWNED: return "`owned'";
case PARAMS: return "`params'";
case PASS: return "`pass'";
case PERCENT: return "`%'";
case PLUS: return "`+'";
case PRINT: return "`print'";
case PRIVATE: return "`private'";
case PROP: return "`prop'";
case PROTECTED: return "`protected'";
case PUBLIC: return "`public'";
case RAISE: return "`raise'";
case RAISES: return "`raises'";
case READONLY: return "`readonly'";
case REAL_LITERAL: return "real literal";
case REF: return "`ref'";
case REGEX_LITERAL: return "regex literal";
case REQUIRES: return "`requires'";
case RETURN: return "`return'";
case SEALED: return "`sealed'";
case SELF: return "`self'";
case SEMICOLON: return "`;'";
case SET: return "`set'";
case SIZEOF: return "`sizeof'";
case STAR: return "`*'";
case STATIC: return "`static'";
case STRING_LITERAL: return "string literal";
case STRUCT: return "`struct'";
case SUPER: return "`super'";
case TEMPLATE_STRING_LITERAL: return "template string literal";
case TILDE: return "`~'";
case TO: return "`to'";
case TRUE: return "`true'";
case TRY: return "`try'";
case TYPEOF: return "`typeof'";
case UNOWNED: return "`unowned'";
case USES: return "`uses'";
case VAR: return "`var'";
case VERBATIM_STRING_LITERAL: return "verbatim string literal";
case VERBATIM_TEMPLATE_STRING_LITERAL: return "verbatim template string literal";
case VIRTUAL: return "`virtual'";
case VOID: return "`void'";
case VOLATILE: return "`volatile'";
case WEAK: return "`weak'";
case WHEN: return "`when'";
case WHILE: return "`while'";
case YIELD: return "`yield'";
default: return "unknown token";
}
}
}
|