Insert "%s" argument in printf calls with non-literal format string
[vala-lang.git] / vala / valatokentype.vala
blobbfacde16dda1edf5ad5d13a50575e7ff51073e1a
1 /* valatokentype.vala
3 * Copyright (C) 2008-2009 Jürg Billeter
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 * Author:
20 * Jürg Billeter <j@bitron.ch>
23 using GLib;
25 public enum Vala.TokenType {
26 NONE,
27 ABSTRACT,
28 AS,
29 ASSIGN,
30 ASSIGN_ADD,
31 ASSIGN_BITWISE_AND,
32 ASSIGN_BITWISE_OR,
33 ASSIGN_BITWISE_XOR,
34 ASSIGN_DIV,
35 ASSIGN_MUL,
36 ASSIGN_PERCENT,
37 ASSIGN_SHIFT_LEFT,
38 ASSIGN_SUB,
39 ASYNC,
40 BASE,
41 BITWISE_AND,
42 BITWISE_OR,
43 BREAK,
44 CARRET,
45 CASE,
46 CATCH,
47 CHARACTER_LITERAL,
48 CLASS,
49 CLOSE_BRACE,
50 CLOSE_BRACKET,
51 CLOSE_PARENS,
52 CLOSE_TEMPLATE,
53 COLON,
54 COMMA,
55 CONST,
56 CONSTRUCT,
57 CONTINUE,
58 DEFAULT,
59 DELEGATE,
60 DELETE,
61 DIV,
62 DO,
63 DOUBLE_COLON,
64 DOT,
65 DYNAMIC,
66 ELLIPSIS,
67 ELSE,
68 ENUM,
69 ENSURES,
70 ERRORDOMAIN,
71 EOF,
72 EXTERN,
73 FALSE,
74 FINALLY,
75 FOR,
76 FOREACH,
77 GET,
78 HASH,
79 IDENTIFIER,
80 IF,
81 IN,
82 INLINE,
83 INTEGER_LITERAL,
84 INTERFACE,
85 INTERNAL,
86 INTERR,
87 IS,
88 LAMBDA,
89 LOCK,
90 MINUS,
91 NAMESPACE,
92 NEW,
93 NULL,
94 OUT,
95 OP_AND,
96 OP_DEC,
97 OP_EQ,
98 OP_GE,
99 OP_GT,
100 OP_INC,
101 OP_LE,
102 OP_LT,
103 OP_NE,
104 OP_NEG,
105 OP_OR,
106 OP_PTR,
107 OP_SHIFT_LEFT,
108 OPEN_BRACE,
109 OPEN_BRACKET,
110 OPEN_PARENS,
111 OPEN_TEMPLATE,
112 OVERRIDE,
113 OWNED,
114 PARAMS,
115 PERCENT,
116 PLUS,
117 PRIVATE,
118 PROTECTED,
119 PUBLIC,
120 REAL_LITERAL,
121 REF,
122 REQUIRES,
123 RETURN,
124 SEMICOLON,
125 SET,
126 SIGNAL,
127 SIZEOF,
128 STAR,
129 STATIC,
130 STRING_LITERAL,
131 STRUCT,
132 SWITCH,
133 TEMPLATE_STRING_LITERAL,
134 THIS,
135 THROW,
136 THROWS,
137 TILDE,
138 TRUE,
139 TRY,
140 TYPEOF,
141 UNOWNED,
142 USING,
143 VAR,
144 VERBATIM_STRING_LITERAL,
145 VIRTUAL,
146 VOID,
147 VOLATILE,
148 WEAK,
149 WHILE,
150 YIELD;
152 public weak string to_string () {
153 switch (this) {
154 case ABSTRACT: return "`abstract'";
155 case AS: return "`as'";
156 case ASSIGN: return "`='";
157 case ASSIGN_ADD: return "`+='";
158 case ASSIGN_BITWISE_AND: return "`&='";
159 case ASSIGN_BITWISE_OR: return "`|='";
160 case ASSIGN_BITWISE_XOR: return "`^='";
161 case ASSIGN_DIV: return "`/='";
162 case ASSIGN_MUL: return "`*='";
163 case ASSIGN_PERCENT: return "`%='";
164 case ASSIGN_SHIFT_LEFT: return "`<<='";
165 case ASSIGN_SUB: return "`-='";
166 case ASYNC: return "`async'";
167 case BASE: return "`base'";
168 case BITWISE_AND: return "`&'";
169 case BITWISE_OR: return "`|'";
170 case BREAK: return "`break'";
171 case CARRET: return "`^'";
172 case CASE: return "`case'";
173 case CATCH: return "`catch'";
174 case CHARACTER_LITERAL: return "character literal";
175 case CLASS: return "`class'";
176 case CLOSE_BRACE: return "`}'";
177 case CLOSE_BRACKET: return "`]'";
178 case CLOSE_PARENS: return "`)'";
179 case COLON: return "`:'";
180 case COMMA: return "`,'";
181 case CONST: return "`const'";
182 case CONSTRUCT: return "`construct'";
183 case CONTINUE: return "`continue'";
184 case DEFAULT: return "`default'";
185 case DELEGATE: return "`delegate'";
186 case DELETE: return "`delete'";
187 case DIV: return "`/'";
188 case DO: return "`do'";
189 case DOT: return "`.'";
190 case ELLIPSIS: return "`...'";
191 case ELSE: return "`else'";
192 case ENUM: return "`enum'";
193 case ENSURES: return "`ensures'";
194 case ERRORDOMAIN: return "`errordomain'";
195 case EOF: return "end of file";
196 case FALSE: return "`false'";
197 case FINALLY: return "`finally'";
198 case FOR: return "`for'";
199 case FOREACH: return "`foreach'";
200 case GET: return "`get'";
201 case HASH: return "`hash'";
202 case IDENTIFIER: return "identifier";
203 case IF: return "`if'";
204 case IN: return "`in'";
205 case INLINE: return "`inline'";
206 case INTEGER_LITERAL: return "integer literal";
207 case INTERFACE: return "`interface'";
208 case INTERNAL: return "`internal'";
209 case INTERR: return "`?'";
210 case IS: return "`is'";
211 case LAMBDA: return "`=>'";
212 case LOCK: return "`lock'";
213 case MINUS: return "`-'";
214 case NAMESPACE: return "`namespace'";
215 case NEW: return "`new'";
216 case NULL: return "`null'";
217 case OUT: return "`out'";
218 case OP_AND: return "`&&'";
219 case OP_DEC: return "`--'";
220 case OP_EQ: return "`=='";
221 case OP_GE: return "`>='";
222 case OP_GT: return "`>'";
223 case OP_INC: return "`++'";
224 case OP_LE: return "`<='";
225 case OP_LT: return "`<'";
226 case OP_NE: return "`!='";
227 case OP_NEG: return "`!'";
228 case OP_OR: return "`||'";
229 case OP_PTR: return "`->'";
230 case OP_SHIFT_LEFT: return "`<<'";
231 case OPEN_BRACE: return "`{'";
232 case OPEN_BRACKET: return "`['";
233 case OPEN_PARENS: return "`('";
234 case OVERRIDE: return "`override'";
235 case OWNED: return "`owned'";
236 case PARAMS: return "`params'";
237 case PERCENT: return "`%'";
238 case PLUS: return "`+'";
239 case PRIVATE: return "`private'";
240 case PROTECTED: return "`protected'";
241 case PUBLIC: return "`public'";
242 case REAL_LITERAL: return "real literal";
243 case REF: return "`ref'";
244 case REQUIRES: return "`requires'";
245 case RETURN: return "`return'";
246 case SEMICOLON: return "`;'";
247 case SET: return "`set'";
248 case SIGNAL: return "`signal'";
249 case SIZEOF: return "`sizeof'";
250 case STAR: return "`*'";
251 case STATIC: return "`static'";
252 case STRING_LITERAL: return "string literal";
253 case STRUCT: return "`struct'";
254 case SWITCH: return "`switch'";
255 case THIS: return "`this'";
256 case THROW: return "`throw'";
257 case THROWS: return "`throws'";
258 case TILDE: return "`~'";
259 case TRUE: return "`true'";
260 case TRY: return "`try'";
261 case TYPEOF: return "`typeof'";
262 case UNOWNED: return "`unowned'";
263 case USING: return "`using'";
264 case VAR: return "`var'";
265 case VIRTUAL: return "`virtual'";
266 case VOID: return "`void'";
267 case VOLATILE: return "`volatile'";
268 case WEAK: return "`weak'";
269 case WHILE: return "`while'";
270 case YIELD: return "`yield'";
271 default: return "unknown token";