3 * Copyright (C) 2008-2010 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
20 * Jürg Billeter <j@bitron.ch>
25 public enum Vala
.TokenType
{
138 TEMPLATE_STRING_LITERAL
,
150 VERBATIM_STRING_LITERAL
,
158 public unowned
string to_string () {
160 case ABSTRACT
: return "`abstract'";
161 case AS
: return "`as'";
162 case ASSIGN
: return "`='";
163 case ASSIGN_ADD
: return "`+='";
164 case ASSIGN_BITWISE_AND
: return "`&='";
165 case ASSIGN_BITWISE_OR
: return "`|='";
166 case ASSIGN_BITWISE_XOR
: return "`^='";
167 case ASSIGN_DIV
: return "`/='";
168 case ASSIGN_MUL
: return "`*='";
169 case ASSIGN_PERCENT
: return "`%='";
170 case ASSIGN_SHIFT_LEFT
: return "`<<='";
171 case ASSIGN_SUB
: return "`-='";
172 case ASYNC
: return "`async'";
173 case BASE
: return "`base'";
174 case BITWISE_AND
: return "`&'";
175 case BITWISE_OR
: return "`|'";
176 case BREAK
: return "`break'";
177 case CARRET
: return "`^'";
178 case CASE
: return "`case'";
179 case CATCH
: return "`catch'";
180 case CHARACTER_LITERAL
: return "character literal";
181 case CLASS
: return "`class'";
182 case CLOSE_BRACE
: return "`}'";
183 case CLOSE_BRACKET
: return "`]'";
184 case CLOSE_PARENS
: return "`)'";
185 case CLOSE_REGEX_LITERAL
: return "`/'";
186 case CLOSE_TEMPLATE
: return "close template";
187 case COLON
: return "`:'";
188 case COMMA
: return "`,'";
189 case CONST
: return "`const'";
190 case CONSTRUCT
: return "`construct'";
191 case CONTINUE
: return "`continue'";
192 case DEFAULT
: return "`default'";
193 case DELEGATE
: return "`delegate'";
194 case DELETE
: return "`delete'";
195 case DIV
: return "`/'";
196 case DO
: return "`do'";
197 case DOUBLE_COLON
: return "`::'";
198 case DOT
: return "`.'";
199 case DYNAMIC
: return "`dynamic'";
200 case ELLIPSIS
: return "`...'";
201 case ELSE
: return "`else'";
202 case ENUM
: return "`enum'";
203 case ENSURES
: return "`ensures'";
204 case ERRORDOMAIN
: return "`errordomain'";
205 case EOF
: return "end of file";
206 case EXTERN
: return "`extern'";
207 case FALSE
: return "`false'";
208 case FINALLY
: return "`finally'";
209 case FOR
: return "`for'";
210 case FOREACH
: return "`foreach'";
211 case GET
: return "`get'";
212 case HASH
: return "`hash'";
213 case IDENTIFIER
: return "identifier";
214 case IF
: return "`if'";
215 case IN
: return "`in'";
216 case INLINE
: return "`inline'";
217 case INTEGER_LITERAL
: return "integer literal";
218 case INTERFACE
: return "`interface'";
219 case INTERNAL
: return "`internal'";
220 case INTERR
: return "`?'";
221 case IS
: return "`is'";
222 case LAMBDA
: return "`=>'";
223 case LOCK
: return "`lock'";
224 case MINUS
: return "`-'";
225 case NAMESPACE
: return "`namespace'";
226 case NEW
: return "`new'";
227 case NULL
: return "`null'";
228 case OUT
: return "`out'";
229 case OP_AND
: return "`&&'";
230 case OP_COALESCING
: return "`??'";
231 case OP_DEC
: return "`--'";
232 case OP_EQ
: return "`=='";
233 case OP_GE
: return "`>='";
234 case OP_GT
: return "`>'";
235 case OP_INC
: return "`++'";
236 case OP_LE
: return "`<='";
237 case OP_LT
: return "`<'";
238 case OP_NE
: return "`!='";
239 case OP_NEG
: return "`!'";
240 case OP_OR
: return "`||'";
241 case OP_PTR
: return "`->'";
242 case OP_SHIFT_LEFT
: return "`<<'";
243 case OPEN_BRACE
: return "`{'";
244 case OPEN_BRACKET
: return "`['";
245 case OPEN_PARENS
: return "`('";
246 case OPEN_REGEX_LITERAL
: return "`/'";
247 case OPEN_TEMPLATE
: return "open template";
248 case OVERRIDE
: return "`override'";
249 case OWNED
: return "`owned'";
250 case PARAMS
: return "`params'";
251 case PERCENT
: return "`%'";
252 case PLUS
: return "`+'";
253 case PRIVATE
: return "`private'";
254 case PROTECTED
: return "`protected'";
255 case PUBLIC
: return "`public'";
256 case REAL_LITERAL
: return "real literal";
257 case REF
: return "`ref'";
258 case REGEX_LITERAL
: return "regex literal";
259 case REQUIRES
: return "`requires'";
260 case RETURN
: return "`return'";
261 case SEALED
: return "`sealed'";
262 case SEMICOLON
: return "`;'";
263 case SET
: return "`set'";
264 case SIGNAL
: return "`signal'";
265 case SIZEOF
: return "`sizeof'";
266 case STAR
: return "`*'";
267 case STATIC
: return "`static'";
268 case STRING_LITERAL
: return "string literal";
269 case STRUCT
: return "`struct'";
270 case SWITCH
: return "`switch'";
271 case TEMPLATE_STRING_LITERAL
: return "template string literal";
272 case THIS
: return "`this'";
273 case THROW
: return "`throw'";
274 case THROWS
: return "`throws'";
275 case TILDE
: return "`~'";
276 case TRUE
: return "`true'";
277 case TRY
: return "`try'";
278 case TYPEOF
: return "`typeof'";
279 case UNLOCK
: return "`unlock'";
280 case UNOWNED
: return "`unowned'";
281 case USING
: return "`using'";
282 case VAR
: return "`var'";
283 case VERBATIM_STRING_LITERAL
: return "verbatim string literal";
284 case VIRTUAL
: return "`virtual'";
285 case VOID
: return "`void'";
286 case VOLATILE
: return "`volatile'";
287 case WEAK
: return "`weak'";
288 case WHILE
: return "`while'";
289 case YIELD
: return "`yield'";
290 default: return "unknown token";