Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
TokenTypes |
|
| 3.0;3 |
1 | //////////////////////////////////////////////////////////////////////////////// | |
2 | // checkstyle: Checks Java source code for adherence to a set of rules. | |
3 | // Copyright (C) 2001-2014 Oliver Burn | |
4 | // | |
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. | |
9 | // | |
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. | |
14 | // | |
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | //////////////////////////////////////////////////////////////////////////////// | |
19 | package com.puppycrawl.tools.checkstyle.api; | |
20 | ||
21 | import com.google.common.collect.ImmutableMap; | |
22 | ||
23 | import com.puppycrawl.tools.checkstyle.grammars.GeneratedJavaTokenTypes; | |
24 | import java.lang.reflect.Field; | |
25 | import java.util.ResourceBundle; | |
26 | ||
27 | /** | |
28 | * Contains the constants for all the tokens contained in the Abstract | |
29 | * Syntax Tree. | |
30 | * | |
31 | * <p>Implementation detail: This class has been introduced to break | |
32 | * the circular dependency between packages.<p> | |
33 | * | |
34 | * @author Oliver Burn | |
35 | * @author <a href="mailto:dobratzp@ele.uri.edu">Peter Dobratz</a> | |
36 | * @version 1.0 | |
37 | */ | |
38 | public final class TokenTypes | |
39 | { | |
40 | ///CLOVER:OFF | |
41 | /** prevent instantiation */ | |
42 | private TokenTypes() | |
43 | 0 | { |
44 | 0 | } |
45 | ///CLOVER:ON | |
46 | ||
47 | // The following three types are never part of an AST, | |
48 | // left here as a reminder so nobody will read them accidentally | |
49 | ||
50 | /* * token representing a NULL_TREE_LOOKAHEAD */ | |
51 | // public static final int NULL_TREE_LOOKAHEAD = 3; | |
52 | /* * token representing a BLOCK */ | |
53 | // public static final int BLOCK = 4; | |
54 | /* * token representing a VOCAB */ | |
55 | // public static final int VOCAB = 149; | |
56 | ||
57 | // These are the types that can actually occur in an AST | |
58 | // it makes sense to register Checks for these types | |
59 | ||
60 | /** | |
61 | * The end of file token. This is the root node for the source | |
62 | * file. It's children are an optional package definition, zero | |
63 | * or more import statements, and one or more class or interface | |
64 | * definitions. | |
65 | * | |
66 | * @see #PACKAGE_DEF | |
67 | * @see #IMPORT | |
68 | * @see #CLASS_DEF | |
69 | * @see #INTERFACE_DEF | |
70 | **/ | |
71 | public static final int EOF = GeneratedJavaTokenTypes.EOF; | |
72 | /** | |
73 | * Modifiers for type, method, and field declarations. The | |
74 | * modifiers element is always present even though it may have no | |
75 | * children. | |
76 | * | |
77 | * @see <a | |
78 | * href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html">Java | |
79 | * Language Specification, Chapter 8</a> | |
80 | * @see #LITERAL_PUBLIC | |
81 | * @see #LITERAL_PROTECTED | |
82 | * @see #LITERAL_PRIVATE | |
83 | * @see #ABSTRACT | |
84 | * @see #LITERAL_STATIC | |
85 | * @see #FINAL | |
86 | * @see #LITERAL_TRANSIENT | |
87 | * @see #LITERAL_VOLATILE | |
88 | * @see #LITERAL_SYNCHRONIZED | |
89 | * @see #LITERAL_NATIVE | |
90 | * @see #STRICTFP | |
91 | * @see #ANNOTATION | |
92 | **/ | |
93 | public static final int MODIFIERS = GeneratedJavaTokenTypes.MODIFIERS; | |
94 | /** | |
95 | * An object block. These are children of class, interface, enum, | |
96 | * annotation and enum constant declarations. | |
97 | * Also, object blocks are children of the new keyword when defining | |
98 | * anonymous inner types. | |
99 | * | |
100 | * @see #LCURLY | |
101 | * @see #INSTANCE_INIT | |
102 | * @see #STATIC_INIT | |
103 | * @see #CLASS_DEF | |
104 | * @see #CTOR_DEF | |
105 | * @see #METHOD_DEF | |
106 | * @see #VARIABLE_DEF | |
107 | * @see #RCURLY | |
108 | * @see #INTERFACE_DEF | |
109 | * @see #LITERAL_NEW | |
110 | * @see #ENUM_DEF | |
111 | * @see #ENUM_CONSTANT_DEF | |
112 | * @see #ANNOTATION_DEF | |
113 | **/ | |
114 | public static final int OBJBLOCK = GeneratedJavaTokenTypes.OBJBLOCK; | |
115 | /** | |
116 | * A list of statements. | |
117 | * | |
118 | * @see #RCURLY | |
119 | * @see #EXPR | |
120 | * @see #LABELED_STAT | |
121 | * @see #LITERAL_THROWS | |
122 | * @see #LITERAL_RETURN | |
123 | * @see #SEMI | |
124 | * @see #METHOD_DEF | |
125 | * @see #CTOR_DEF | |
126 | * @see #LITERAL_FOR | |
127 | * @see #LITERAL_WHILE | |
128 | * @see #LITERAL_IF | |
129 | * @see #LITERAL_ELSE | |
130 | * @see #CASE_GROUP | |
131 | **/ | |
132 | public static final int SLIST = GeneratedJavaTokenTypes.SLIST; | |
133 | /** | |
134 | * A constructor declaration. | |
135 | * | |
136 | * <p>For example:</p> | |
137 | * <pre> | |
138 | * public SpecialEntry(int value, String text) | |
139 | * { | |
140 | * this.value = value; | |
141 | * this.text = text; | |
142 | * } | |
143 | * </pre> | |
144 | * <p>parses as:</p> | |
145 | * <pre> | |
146 | * +--CTOR_DEF | |
147 | * | | |
148 | * +--MODIFIERS | |
149 | * | | |
150 | * +--LITERAL_PUBLIC (public) | |
151 | * +--IDENT (SpecialEntry) | |
152 | * +--LPAREN (() | |
153 | * +--PARAMETERS | |
154 | * | | |
155 | * +--PARAMETER_DEF | |
156 | * | | |
157 | * +--MODIFIERS | |
158 | * +--TYPE | |
159 | * | | |
160 | * +--LITERAL_INT (int) | |
161 | * +--IDENT (value) | |
162 | * +--COMMA (,) | |
163 | * +--PARAMETER_DEF | |
164 | * | | |
165 | * +--MODIFIERS | |
166 | * +--TYPE | |
167 | * | | |
168 | * +--IDENT (String) | |
169 | * +--IDENT (text) | |
170 | * +--RPAREN ()) | |
171 | * +--SLIST ({) | |
172 | * | | |
173 | * +--EXPR | |
174 | * | | |
175 | * +--ASSIGN (=) | |
176 | * | | |
177 | * +--DOT (.) | |
178 | * | | |
179 | * +--LITERAL_THIS (this) | |
180 | * +--IDENT (value) | |
181 | * +--IDENT (value) | |
182 | * +--SEMI (;) | |
183 | * +--EXPR | |
184 | * | | |
185 | * +--ASSIGN (=) | |
186 | * | | |
187 | * +--DOT (.) | |
188 | * | | |
189 | * +--LITERAL_THIS (this) | |
190 | * +--IDENT (text) | |
191 | * +--IDENT (text) | |
192 | * +--SEMI (;) | |
193 | * +--RCURLY (}) | |
194 | * </pre> | |
195 | * | |
196 | * @see #OBJBLOCK | |
197 | * @see #CLASS_DEF | |
198 | **/ | |
199 | public static final int CTOR_DEF = GeneratedJavaTokenTypes.CTOR_DEF; | |
200 | /** | |
201 | * A method declaration. The children are modifiers, type parameters, | |
202 | * return type, method name, parameter list, an optional throws list, and | |
203 | * statement list. The statement list is omitted if the method | |
204 | * declaration appears in an interface declaration. Method | |
205 | * declarations may appear inside object blocks of class | |
206 | * declarations, interface declarations, enum declarations, | |
207 | * enum constant declarations or anonymous inner-class declarations. | |
208 | * | |
209 | * <p>For example:</p> | |
210 | * | |
211 | * <pre> | |
212 | * public static int square(int x) | |
213 | * { | |
214 | * return x*x; | |
215 | * } | |
216 | * </pre> | |
217 | * | |
218 | * <p>parses as:</p> | |
219 | * | |
220 | * <pre> | |
221 | * +--METHOD_DEF | |
222 | * | | |
223 | * +--MODIFIERS | |
224 | * | | |
225 | * +--LITERAL_PUBLIC (public) | |
226 | * +--LITERAL_STATIC (static) | |
227 | * +--TYPE | |
228 | * | | |
229 | * +--LITERAL_INT (int) | |
230 | * +--IDENT (square) | |
231 | * +--PARAMETERS | |
232 | * | | |
233 | * +--PARAMETER_DEF | |
234 | * | | |
235 | * +--MODIFIERS | |
236 | * +--TYPE | |
237 | * | | |
238 | * +--LITERAL_INT (int) | |
239 | * +--IDENT (x) | |
240 | * +--SLIST ({) | |
241 | * | | |
242 | * +--LITERAL_RETURN (return) | |
243 | * | | |
244 | * +--EXPR | |
245 | * | | |
246 | * +--STAR (*) | |
247 | * | | |
248 | * +--IDENT (x) | |
249 | * +--IDENT (x) | |
250 | * +--SEMI (;) | |
251 | * +--RCURLY (}) | |
252 | * </pre> | |
253 | * | |
254 | * @see #MODIFIERS | |
255 | * @see #TYPE_PARAMETERS | |
256 | * @see #TYPE | |
257 | * @see #IDENT | |
258 | * @see #PARAMETERS | |
259 | * @see #LITERAL_THROWS | |
260 | * @see #SLIST | |
261 | * @see #OBJBLOCK | |
262 | **/ | |
263 | public static final int METHOD_DEF = GeneratedJavaTokenTypes.METHOD_DEF; | |
264 | /** | |
265 | * A field or local variable declaration. The children are | |
266 | * modifiers, type, the identifier name, and an optional | |
267 | * assignment statement. | |
268 | * | |
269 | * @see #MODIFIERS | |
270 | * @see #TYPE | |
271 | * @see #IDENT | |
272 | * @see #ASSIGN | |
273 | **/ | |
274 | public static final int VARIABLE_DEF = | |
275 | GeneratedJavaTokenTypes.VARIABLE_DEF; | |
276 | ||
277 | /** | |
278 | * An instance initializer. Zero or more instance initializers | |
279 | * may appear in class and enum definitions. This token will be a child | |
280 | * of the object block of the declaring type. | |
281 | * | |
282 | * @see <a | |
283 | * href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#246032">Java | |
284 | * Language Specification§8.6</a> | |
285 | * @see #SLIST | |
286 | * @see #OBJBLOCK | |
287 | **/ | |
288 | public static final int INSTANCE_INIT = | |
289 | GeneratedJavaTokenTypes.INSTANCE_INIT; | |
290 | ||
291 | /** | |
292 | * A static initialization block. Zero or more static | |
293 | * initializers may be children of the object block of a class | |
294 | * or enum declaration (interfaces cannot have static initializers). The | |
295 | * first and only child is a statement list. | |
296 | * | |
297 | * @see <a | |
298 | * href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#39245">Java | |
299 | * Language Specification, §8.7</a> | |
300 | * @see #SLIST | |
301 | * @see #OBJBLOCK | |
302 | **/ | |
303 | public static final int STATIC_INIT = | |
304 | GeneratedJavaTokenTypes.STATIC_INIT; | |
305 | ||
306 | /** | |
307 | * A type. This is either a return type of a method or a type of | |
308 | * a variable or field. The first child of this element is the | |
309 | * actual type. This may be a primitive type, an identifier, a | |
310 | * dot which is the root of a fully qualified type, or an array of | |
311 | * any of these. The second child may be type arguments to the type. | |
312 | * | |
313 | * @see #VARIABLE_DEF | |
314 | * @see #METHOD_DEF | |
315 | * @see #PARAMETER_DEF | |
316 | * @see #IDENT | |
317 | * @see #DOT | |
318 | * @see #LITERAL_VOID | |
319 | * @see #LITERAL_BOOLEAN | |
320 | * @see #LITERAL_BYTE | |
321 | * @see #LITERAL_CHAR | |
322 | * @see #LITERAL_SHORT | |
323 | * @see #LITERAL_INT | |
324 | * @see #LITERAL_FLOAT | |
325 | * @see #LITERAL_LONG | |
326 | * @see #LITERAL_DOUBLE | |
327 | * @see #ARRAY_DECLARATOR | |
328 | * @see #TYPE_ARGUMENTS | |
329 | **/ | |
330 | public static final int TYPE = GeneratedJavaTokenTypes.TYPE; | |
331 | /** | |
332 | * A class declaration. | |
333 | * | |
334 | * <p>For example:</p> | |
335 | * <pre> | |
336 | * public class MyClass | |
337 | * implements Serializable | |
338 | * { | |
339 | * } | |
340 | * </pre> | |
341 | * <p>parses as:</p> | |
342 | * <pre> | |
343 | * +--CLASS_DEF | |
344 | * | | |
345 | * +--MODIFIERS | |
346 | * | | |
347 | * +--LITERAL_PUBLIC (public) | |
348 | * +--LITERAL_CLASS (class) | |
349 | * +--IDENT (MyClass) | |
350 | * +--EXTENDS_CLAUSE | |
351 | * +--IMPLEMENTS_CLAUSE | |
352 | * | | |
353 | * +--IDENT (Serializable) | |
354 | * +--OBJBLOCK | |
355 | * | | |
356 | * +--LCURLY ({) | |
357 | * +--RCURLY (}) | |
358 | * </pre> | |
359 | * | |
360 | * @see <a | |
361 | * href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html">Java | |
362 | * Language Specification, Chapter 8</a> | |
363 | * @see #MODIFIERS | |
364 | * @see #IDENT | |
365 | * @see #EXTENDS_CLAUSE | |
366 | * @see #IMPLEMENTS_CLAUSE | |
367 | * @see #OBJBLOCK | |
368 | * @see #LITERAL_NEW | |
369 | **/ | |
370 | public static final int CLASS_DEF = GeneratedJavaTokenTypes.CLASS_DEF; | |
371 | /** | |
372 | * An interface declaration. | |
373 | * | |
374 | * <p>For example:</p> | |
375 | * | |
376 | * <pre> | |
377 | * public interface MyInterface | |
378 | * { | |
379 | * } | |
380 | * | |
381 | * </pre> | |
382 | * | |
383 | * <p>parses as:</p> | |
384 | * | |
385 | * <pre> | |
386 | * +--INTERFACE_DEF | |
387 | * | | |
388 | * +--MODIFIERS | |
389 | * | | |
390 | * +--LITERAL_PUBLIC (public) | |
391 | * +--LITERAL_INTERFACE (interface) | |
392 | * +--IDENT (MyInterface) | |
393 | * +--EXTENDS_CLAUSE | |
394 | * +--OBJBLOCK | |
395 | * | | |
396 | * +--LCURLY ({) | |
397 | * +--RCURLY (}) | |
398 | * </pre> | |
399 | * | |
400 | * @see <a | |
401 | * href="http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html">Java | |
402 | * Language Specification, Chapter 9</a> | |
403 | * @see #MODIFIERS | |
404 | * @see #IDENT | |
405 | * @see #EXTENDS_CLAUSE | |
406 | * @see #OBJBLOCK | |
407 | **/ | |
408 | public static final int INTERFACE_DEF = | |
409 | GeneratedJavaTokenTypes.INTERFACE_DEF; | |
410 | ||
411 | /** | |
412 | * The package declaration. This is optional, but if it is | |
413 | * included, then there is only one package declaration per source | |
414 | * file and it must be the first non-comment in the file. A package | |
415 | * declaration may be annotated in which case the annotations comes | |
416 | * before the rest of the declaration (and are the first children). | |
417 | * | |
418 | * <p>For example:</p> | |
419 | * | |
420 | * <pre> | |
421 | * package com.puppycrawl.tools.checkstyle.api; | |
422 | * </pre> | |
423 | * | |
424 | * <p>parses as:</p> | |
425 | * | |
426 | * <pre> | |
427 | * +--PACKAGE_DEF (package) | |
428 | * | | |
429 | * +--ANNOTATIONS | |
430 | * +--DOT (.) | |
431 | * | | |
432 | * +--DOT (.) | |
433 | * | | |
434 | * +--DOT (.) | |
435 | * | | |
436 | * +--DOT (.) | |
437 | * | | |
438 | * +--IDENT (com) | |
439 | * +--IDENT (puppycrawl) | |
440 | * +--IDENT (tools) | |
441 | * +--IDENT (checkstyle) | |
442 | * +--IDENT (api) | |
443 | * +--SEMI (;) | |
444 | * </pre> | |
445 | * | |
446 | * @see <a | |
447 | * href="http://java.sun.com/docs/books/jls/second_edition/html/packages.doc.html#26619">Java | |
448 | * Language Specification §7.4</a> | |
449 | * @see #DOT | |
450 | * @see #IDENT | |
451 | * @see #SEMI | |
452 | * @see #ANNOTATIONS | |
453 | * @see FullIdent | |
454 | **/ | |
455 | public static final int PACKAGE_DEF = GeneratedJavaTokenTypes.PACKAGE_DEF; | |
456 | /** | |
457 | * An array declaration. | |
458 | * | |
459 | * <p>If the array declaration represents a type, then the type of | |
460 | * the array elements is the first child. Multidimensional arrays | |
461 | * may be regarded as arrays of arrays. In other words, the first | |
462 | * child of the array declaration is another array | |
463 | * declaration.</p> | |
464 | * | |
465 | * <p>For example:</p> | |
466 | * <pre> | |
467 | * int[] x; | |
468 | * </pre> | |
469 | * <p>parses as:</p> | |
470 | * <pre> | |
471 | * +--VARIABLE_DEF | |
472 | * | | |
473 | * +--MODIFIERS | |
474 | * +--TYPE | |
475 | * | | |
476 | * +--ARRAY_DECLARATOR ([) | |
477 | * | | |
478 | * +--LITERAL_INT (int) | |
479 | * +--IDENT (x) | |
480 | * +--SEMI (;) | |
481 | * </pre> | |
482 | * | |
483 | * <p>The array declaration may also represent an inline array | |
484 | * definition. In this case, the first child will be either an | |
485 | * expression specifying the length of the array or an array | |
486 | * initialization block.</p> | |
487 | * | |
488 | * @see <a | |
489 | * href="http://java.sun.com/docs/books/jls/second_edition/html/arrays.doc.html">Java | |
490 | * Language Specification Chapter 10</a> | |
491 | * @see #TYPE | |
492 | * @see #ARRAY_INIT | |
493 | **/ | |
494 | public static final int ARRAY_DECLARATOR = | |
495 | GeneratedJavaTokenTypes.ARRAY_DECLARATOR; | |
496 | ||
497 | /** | |
498 | * An extends clause. This appear as part of class and interface | |
499 | * definitions. This element appears even if the | |
500 | * <code>extends</code> keyword is not explicitly used. The child | |
501 | * is an optional identifier. | |
502 | * | |
503 | * <p>For example:</p> | |
504 | * <pre> | |
505 | * </pre> | |
506 | * <p>parses as:</p> | |
507 | * <pre> | |
508 | * +--EXTENDS_CLAUSE | |
509 | * | | |
510 | * +--DOT (.) | |
511 | * | | |
512 | * +--DOT (.) | |
513 | * | | |
514 | * +--IDENT (java) | |
515 | * +--IDENT (util) | |
516 | * +--IDENT (LinkedList) | |
517 | * </pre> | |
518 | * | |
519 | * @see #IDENT | |
520 | * @see #DOT | |
521 | * @see #CLASS_DEF | |
522 | * @see #INTERFACE_DEF | |
523 | * @see FullIdent | |
524 | **/ | |
525 | public static final int EXTENDS_CLAUSE = | |
526 | GeneratedJavaTokenTypes.EXTENDS_CLAUSE; | |
527 | ||
528 | /** | |
529 | * An implements clause. This always appears in a class or enum | |
530 | * declaration, even if there are no implemented interfaces. The | |
531 | * children are a comma separated list of zero or more | |
532 | * identifiers. | |
533 | * | |
534 | * <p>For example:</p> | |
535 | * <pre> | |
536 | * implements Serializable, Comparable | |
537 | * </pre> | |
538 | * <p>parses as:</p> | |
539 | * <pre> | |
540 | * +--IMPLEMENTS_CLAUSE | |
541 | * | | |
542 | * +--IDENT (Serializable) | |
543 | * +--COMMA (,) | |
544 | * +--IDENT (Comparable) | |
545 | * </pre> | |
546 | * | |
547 | * @see #IDENT | |
548 | * @see #DOT | |
549 | * @see #COMMA | |
550 | * @see #CLASS_DEF | |
551 | * @see #ENUM_DEF | |
552 | **/ | |
553 | public static final int IMPLEMENTS_CLAUSE = | |
554 | GeneratedJavaTokenTypes.IMPLEMENTS_CLAUSE; | |
555 | ||
556 | /** | |
557 | * A list of parameters to a method or constructor. The children | |
558 | * are zero or more parameter declarations separated by commas. | |
559 | * | |
560 | * <p>For example</p> | |
561 | * <pre> | |
562 | * int start, int end | |
563 | * </pre> | |
564 | * <p>parses as:</p> | |
565 | * <pre> | |
566 | * +--PARAMETERS | |
567 | * | | |
568 | * +--PARAMETER_DEF | |
569 | * | | |
570 | * +--MODIFIERS | |
571 | * +--TYPE | |
572 | * | | |
573 | * +--LITERAL_INT (int) | |
574 | * +--IDENT (start) | |
575 | * +--COMMA (,) | |
576 | * +--PARAMETER_DEF | |
577 | * | | |
578 | * +--MODIFIERS | |
579 | * +--TYPE | |
580 | * | | |
581 | * +--LITERAL_INT (int) | |
582 | * +--IDENT (end) | |
583 | * </pre> | |
584 | * | |
585 | * @see #PARAMETER_DEF | |
586 | * @see #COMMA | |
587 | * @see #METHOD_DEF | |
588 | * @see #CTOR_DEF | |
589 | **/ | |
590 | public static final int PARAMETERS = GeneratedJavaTokenTypes.PARAMETERS; | |
591 | /** | |
592 | * A parameter declaration. The last parameter in a list of parameters may | |
593 | * be variable length (indicated by the ELLIPSIS child node immediately | |
594 | * after the TYPE child). | |
595 | * | |
596 | * @see #MODIFIERS | |
597 | * @see #TYPE | |
598 | * @see #IDENT | |
599 | * @see #PARAMETERS | |
600 | * @see #ELLIPSIS | |
601 | **/ | |
602 | public static final int PARAMETER_DEF = | |
603 | GeneratedJavaTokenTypes.PARAMETER_DEF; | |
604 | ||
605 | /** | |
606 | * A labeled statement. | |
607 | * | |
608 | * <p>For example:</p> | |
609 | * <pre> | |
610 | * outside: ; | |
611 | * </pre> | |
612 | * <p>parses as:</p> | |
613 | * <pre> | |
614 | * +--LABELED_STAT (:) | |
615 | * | | |
616 | * +--IDENT (outside) | |
617 | * +--EMPTY_STAT (;) | |
618 | * </pre> | |
619 | * | |
620 | * @see <a | |
621 | * href="http://java.sun.com/docs/books/jls/second_edition/html/statements.doc.html#78993">Java | |
622 | * Language Specification, §14.7</a> | |
623 | * @see #SLIST | |
624 | **/ | |
625 | public static final int LABELED_STAT = | |
626 | GeneratedJavaTokenTypes.LABELED_STAT; | |
627 | ||
628 | /** | |
629 | * A type-cast. | |
630 | * | |
631 | * <p>For example:</p> | |
632 | * <pre> | |
633 | * (String)it.next() | |
634 | * </pre> | |
635 | * <p>parses as:</p> | |
636 | * <pre> | |
637 | * +--TYPECAST (() | |
638 | * | | |
639 | * +--TYPE | |
640 | * | | |
641 | * +--IDENT (String) | |
642 | * +--RPAREN ()) | |
643 | * +--METHOD_CALL (() | |
644 | * | | |
645 | * +--DOT (.) | |
646 | * | | |
647 | * +--IDENT (it) | |
648 | * +--IDENT (next) | |
649 | * +--ELIST | |
650 | * +--RPAREN ()) | |
651 | * </pre> | |
652 | * @see <a | |
653 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#238146">Java | |
654 | * Language Specification, §15.16</a> | |
655 | * @see #EXPR | |
656 | * @see #TYPE | |
657 | * @see #TYPE_ARGUMENTS | |
658 | * @see #RPAREN | |
659 | **/ | |
660 | public static final int TYPECAST = GeneratedJavaTokenTypes.TYPECAST; | |
661 | /** | |
662 | * The array index operator. | |
663 | * | |
664 | * <p>For example:</p> | |
665 | * <pre> | |
666 | * ar[2] = 5; | |
667 | * </pre> | |
668 | * <p>parses as:</p> | |
669 | * <pre> | |
670 | * +--EXPR | |
671 | * | | |
672 | * +--ASSIGN (=) | |
673 | * | | |
674 | * +--INDEX_OP ([) | |
675 | * | | |
676 | * +--IDENT (ar) | |
677 | * +--EXPR | |
678 | * | | |
679 | * +--NUM_INT (2) | |
680 | * +--NUM_INT (5) | |
681 | * +--SEMI (;) | |
682 | * </pre> | |
683 | * | |
684 | * @see #EXPR | |
685 | **/ | |
686 | public static final int INDEX_OP = GeneratedJavaTokenTypes.INDEX_OP; | |
687 | /** | |
688 | * The <code>++</code> (postfix increment) operator. | |
689 | * | |
690 | * @see <a | |
691 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#39438">Java | |
692 | * Language Specification, §15.14.1</a> | |
693 | * @see #EXPR | |
694 | * @see #INC | |
695 | **/ | |
696 | public static final int POST_INC = GeneratedJavaTokenTypes.POST_INC; | |
697 | /** | |
698 | * The <code>--</code> (postfix decrement) operator. | |
699 | * | |
700 | * @see <a | |
701 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#4987">Java | |
702 | * Language Specification, §15.14.2</a> | |
703 | * @see #EXPR | |
704 | * @see #DEC | |
705 | **/ | |
706 | public static final int POST_DEC = GeneratedJavaTokenTypes.POST_DEC; | |
707 | /** | |
708 | * A method call. A method call may have type arguments however these | |
709 | * are attached to the appropriate node in the qualified method name. | |
710 | * | |
711 | * <p>For example:</p> | |
712 | * <pre> | |
713 | * Math.random() | |
714 | * </pre> | |
715 | * <p>parses as: | |
716 | * <pre> | |
717 | * +--METHOD_CALL (() | |
718 | * | | |
719 | * +--DOT (.) | |
720 | * | | |
721 | * +--IDENT (Math) | |
722 | * +--IDENT (random) | |
723 | * +--ELIST | |
724 | * +--RPAREN ()) | |
725 | * </pre> | |
726 | * | |
727 | * @see #IDENT | |
728 | * @see #TYPE_ARGUMENTS | |
729 | * @see #DOT | |
730 | * @see #ELIST | |
731 | * @see #RPAREN | |
732 | * @see FullIdent | |
733 | **/ | |
734 | public static final int METHOD_CALL = GeneratedJavaTokenTypes.METHOD_CALL; | |
735 | /** | |
736 | * An expression. Operators with lower precedence appear at a | |
737 | * higher level in the tree than operators with higher precedence. | |
738 | * Parentheses are siblings to the operator they enclose. | |
739 | * | |
740 | * <p>For example:</p> | |
741 | * <pre> | |
742 | * x = 4 + 3 * 5 + (30 + 26) / 4 + 5 % 4 + (1<<3); | |
743 | * </pre> | |
744 | * <p>parses as:</p> | |
745 | * <pre> | |
746 | * +--EXPR | |
747 | * | | |
748 | * +--ASSIGN (=) | |
749 | * | | |
750 | * +--IDENT (x) | |
751 | * +--PLUS (+) | |
752 | * | | |
753 | * +--PLUS (+) | |
754 | * | | |
755 | * +--PLUS (+) | |
756 | * | | |
757 | * +--PLUS (+) | |
758 | * | | |
759 | * +--NUM_INT (4) | |
760 | * +--STAR (*) | |
761 | * | | |
762 | * +--NUM_INT (3) | |
763 | * +--NUM_INT (5) | |
764 | * +--DIV (/) | |
765 | * | | |
766 | * +--LPAREN (() | |
767 | * +--PLUS (+) | |
768 | * | | |
769 | * +--NUM_INT (30) | |
770 | * +--NUM_INT (26) | |
771 | * +--RPAREN ()) | |
772 | * +--NUM_INT (4) | |
773 | * +--MOD (%) | |
774 | * | | |
775 | * +--NUM_INT (5) | |
776 | * +--NUM_INT (4) | |
777 | * +--LPAREN (() | |
778 | * +--SL (<<) | |
779 | * | | |
780 | * +--NUM_INT (1) | |
781 | * +--NUM_INT (3) | |
782 | * +--RPAREN ()) | |
783 | * +--SEMI (;) | |
784 | * </pre> | |
785 | * | |
786 | * @see #ELIST | |
787 | * @see #ASSIGN | |
788 | * @see #LPAREN | |
789 | * @see #RPAREN | |
790 | **/ | |
791 | public static final int EXPR = GeneratedJavaTokenTypes.EXPR; | |
792 | /** | |
793 | * An array initialization. This may occur as part of an array | |
794 | * declaration or inline with <code>new</code>. | |
795 | * | |
796 | * <p>For example:</p> | |
797 | * <pre> | |
798 | * int[] y = | |
799 | * { | |
800 | * 1, | |
801 | * 2, | |
802 | * }; | |
803 | * </pre> | |
804 | * <p>parses as:</p> | |
805 | * <pre> | |
806 | * +--VARIABLE_DEF | |
807 | * | | |
808 | * +--MODIFIERS | |
809 | * +--TYPE | |
810 | * | | |
811 | * +--ARRAY_DECLARATOR ([) | |
812 | * | | |
813 | * +--LITERAL_INT (int) | |
814 | * +--IDENT (y) | |
815 | * +--ASSIGN (=) | |
816 | * | | |
817 | * +--ARRAY_INIT ({) | |
818 | * | | |
819 | * +--EXPR | |
820 | * | | |
821 | * +--NUM_INT (1) | |
822 | * +--COMMA (,) | |
823 | * +--EXPR | |
824 | * | | |
825 | * +--NUM_INT (2) | |
826 | * +--COMMA (,) | |
827 | * +--RCURLY (}) | |
828 | * +--SEMI (;) | |
829 | * </pre> | |
830 | * | |
831 | * <p>Also consider:</p> | |
832 | * <pre> | |
833 | * int[] z = new int[] | |
834 | * { | |
835 | * 1, | |
836 | * 2, | |
837 | * }; | |
838 | * </pre> | |
839 | * <p>which parses as:</p> | |
840 | * <pre> | |
841 | * +--VARIABLE_DEF | |
842 | * | | |
843 | * +--MODIFIERS | |
844 | * +--TYPE | |
845 | * | | |
846 | * +--ARRAY_DECLARATOR ([) | |
847 | * | | |
848 | * +--LITERAL_INT (int) | |
849 | * +--IDENT (z) | |
850 | * +--ASSIGN (=) | |
851 | * | | |
852 | * +--EXPR | |
853 | * | | |
854 | * +--LITERAL_NEW (new) | |
855 | * | | |
856 | * +--LITERAL_INT (int) | |
857 | * +--ARRAY_DECLARATOR ([) | |
858 | * +--ARRAY_INIT ({) | |
859 | * | | |
860 | * +--EXPR | |
861 | * | | |
862 | * +--NUM_INT (1) | |
863 | * +--COMMA (,) | |
864 | * +--EXPR | |
865 | * | | |
866 | * +--NUM_INT (2) | |
867 | * +--COMMA (,) | |
868 | * +--RCURLY (}) | |
869 | * </pre> | |
870 | * | |
871 | * @see #ARRAY_DECLARATOR | |
872 | * @see #TYPE | |
873 | * @see #LITERAL_NEW | |
874 | * @see #COMMA | |
875 | **/ | |
876 | public static final int ARRAY_INIT = GeneratedJavaTokenTypes.ARRAY_INIT; | |
877 | /** | |
878 | * An import declaration. Import declarations are option, but | |
879 | * must appear after the package declaration and before the first type | |
880 | * declaration. | |
881 | * | |
882 | * <p>For example:</p> | |
883 | * | |
884 | * <pre> | |
885 | * import java.io.IOException; | |
886 | * </pre> | |
887 | * | |
888 | * <p>parses as:</p> | |
889 | * | |
890 | * <pre> | |
891 | * +--IMPORT (import) | |
892 | * | | |
893 | * +--DOT (.) | |
894 | * | | |
895 | * +--DOT (.) | |
896 | * | | |
897 | * +--IDENT (java) | |
898 | * +--IDENT (io) | |
899 | * +--IDENT (IOException) | |
900 | * +--SEMI (;) | |
901 | * </pre> | |
902 | * | |
903 | * @see <a | |
904 | * href="http://java.sun.com/docs/books/jls/second_edition/html/packages.doc.html#70209">Java | |
905 | * Language Specification §7.5</a> | |
906 | * @see #DOT | |
907 | * @see #IDENT | |
908 | * @see #STAR | |
909 | * @see #SEMI | |
910 | * @see FullIdent | |
911 | **/ | |
912 | public static final int IMPORT = GeneratedJavaTokenTypes.IMPORT; | |
913 | /** | |
914 | * The <code>-</code> (unary minus) operator. | |
915 | * | |
916 | * @see <a | |
917 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#236345">Java | |
918 | * Language Specification, §15.15.4</a> | |
919 | * @see #EXPR | |
920 | **/ | |
921 | public static final int UNARY_MINUS = GeneratedJavaTokenTypes.UNARY_MINUS; | |
922 | /** | |
923 | * The <code>+</code> (unary plus) operator. | |
924 | * | |
925 | * @see <a | |
926 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#24924">Java | |
927 | * Language Specification, §15.15.3</a> | |
928 | * @see #EXPR | |
929 | **/ | |
930 | public static final int UNARY_PLUS = GeneratedJavaTokenTypes.UNARY_PLUS; | |
931 | /** | |
932 | * A group of case clauses. Case clauses with no associated | |
933 | * statements are grouped together into a case group. The last | |
934 | * child is a statement list containing the statements to execute | |
935 | * upon a match. | |
936 | * | |
937 | * <p>For example:</p> | |
938 | * <pre> | |
939 | * case 0: | |
940 | * case 1: | |
941 | * case 2: | |
942 | * x = 3; | |
943 | * break; | |
944 | * </pre> | |
945 | * <p>parses as:</p> | |
946 | * <pre> | |
947 | * +--CASE_GROUP | |
948 | * | | |
949 | * +--LITERAL_CASE (case) | |
950 | * | | |
951 | * +--EXPR | |
952 | * | | |
953 | * +--NUM_INT (0) | |
954 | * +--LITERAL_CASE (case) | |
955 | * | | |
956 | * +--EXPR | |
957 | * | | |
958 | * +--NUM_INT (1) | |
959 | * +--LITERAL_CASE (case) | |
960 | * | | |
961 | * +--EXPR | |
962 | * | | |
963 | * +--NUM_INT (2) | |
964 | * +--SLIST | |
965 | * | | |
966 | * +--EXPR | |
967 | * | | |
968 | * +--ASSIGN (=) | |
969 | * | | |
970 | * +--IDENT (x) | |
971 | * +--NUM_INT (3) | |
972 | * +--SEMI (;) | |
973 | * +--LITERAL_BREAK (break) | |
974 | * | | |
975 | * +--SEMI (;) | |
976 | * </pre> | |
977 | * | |
978 | * @see #LITERAL_CASE | |
979 | * @see #LITERAL_DEFAULT | |
980 | * @see #LITERAL_SWITCH | |
981 | **/ | |
982 | public static final int CASE_GROUP = GeneratedJavaTokenTypes.CASE_GROUP; | |
983 | /** | |
984 | * An expression list. The children are a comma separated list of | |
985 | * expressions. | |
986 | * | |
987 | * @see #LITERAL_NEW | |
988 | * @see #FOR_INIT | |
989 | * @see #FOR_ITERATOR | |
990 | * @see #EXPR | |
991 | * @see #METHOD_CALL | |
992 | * @see #CTOR_CALL | |
993 | * @see #SUPER_CTOR_CALL | |
994 | **/ | |
995 | public static final int ELIST = GeneratedJavaTokenTypes.ELIST; | |
996 | /** | |
997 | * A for loop initializer. This is a child of | |
998 | * <code>LITERAL_FOR</code>. The children of this element may be | |
999 | * a comma separated list of variable declarations, an expression | |
1000 | * list, or empty. | |
1001 | * | |
1002 | * @see #VARIABLE_DEF | |
1003 | * @see #ELIST | |
1004 | * @see #LITERAL_FOR | |
1005 | **/ | |
1006 | public static final int FOR_INIT = GeneratedJavaTokenTypes.FOR_INIT; | |
1007 | /** | |
1008 | * A for loop condition. This is a child of | |
1009 | * <code>LITERAL_FOR</code>. The child of this element is an | |
1010 | * optional expression. | |
1011 | * | |
1012 | * @see #EXPR | |
1013 | * @see #LITERAL_FOR | |
1014 | **/ | |
1015 | public static final int FOR_CONDITION = | |
1016 | GeneratedJavaTokenTypes.FOR_CONDITION; | |
1017 | ||
1018 | /** | |
1019 | * A for loop iterator. This is a child of | |
1020 | * <code>LITERAL_FOR</code>. The child of this element is an | |
1021 | * optional expression list. | |
1022 | * | |
1023 | * @see #ELIST | |
1024 | * @see #LITERAL_FOR | |
1025 | **/ | |
1026 | public static final int FOR_ITERATOR = | |
1027 | GeneratedJavaTokenTypes.FOR_ITERATOR; | |
1028 | ||
1029 | /** | |
1030 | * The empty statement. This goes in place of an | |
1031 | * <code>SLIST</code> for a <code>for</code> or <code>while</code> | |
1032 | * loop body. | |
1033 | * | |
1034 | * @see <a | |
1035 | * href="http://java.sun.com/docs/books/jls/second_edition/html/statements.doc.html#5970">Java | |
1036 | * Language Specification, §14.6</a> | |
1037 | * @see #LITERAL_FOR | |
1038 | * @see #LITERAL_WHILE | |
1039 | **/ | |
1040 | public static final int EMPTY_STAT = GeneratedJavaTokenTypes.EMPTY_STAT; | |
1041 | /** | |
1042 | * The <code>final</code> keyword. | |
1043 | * | |
1044 | * @see #MODIFIERS | |
1045 | **/ | |
1046 | public static final int FINAL = GeneratedJavaTokenTypes.FINAL; | |
1047 | /** | |
1048 | * The <code>abstract</code> keyword. | |
1049 | * | |
1050 | * @see #MODIFIERS | |
1051 | **/ | |
1052 | public static final int ABSTRACT = GeneratedJavaTokenTypes.ABSTRACT; | |
1053 | /** | |
1054 | * The <code>strictfp</code> keyword. | |
1055 | * | |
1056 | * @see #MODIFIERS | |
1057 | **/ | |
1058 | public static final int STRICTFP = GeneratedJavaTokenTypes.STRICTFP; | |
1059 | /** | |
1060 | * A super constructor call. | |
1061 | * | |
1062 | * @see #ELIST | |
1063 | * @see #RPAREN | |
1064 | * @see #SEMI | |
1065 | * @see #CTOR_CALL | |
1066 | **/ | |
1067 | public static final int SUPER_CTOR_CALL = | |
1068 | GeneratedJavaTokenTypes.SUPER_CTOR_CALL; | |
1069 | ||
1070 | /** | |
1071 | * A constructor call. | |
1072 | * | |
1073 | * <p>For example:</p> | |
1074 | * <pre> | |
1075 | * this(1); | |
1076 | * </pre> | |
1077 | * <p>parses as:</p> | |
1078 | * <pre> | |
1079 | * +--CTOR_CALL (this) | |
1080 | * | | |
1081 | * +--LPAREN (() | |
1082 | * +--ELIST | |
1083 | * | | |
1084 | * +--EXPR | |
1085 | * | | |
1086 | * +--NUM_INT (1) | |
1087 | * +--RPAREN ()) | |
1088 | * +--SEMI (;) | |
1089 | * </pre> | |
1090 | * | |
1091 | * @see #ELIST | |
1092 | * @see #RPAREN | |
1093 | * @see #SEMI | |
1094 | * @see #SUPER_CTOR_CALL | |
1095 | **/ | |
1096 | public static final int CTOR_CALL = GeneratedJavaTokenTypes.CTOR_CALL; | |
1097 | /* * | |
1098 | * This token does not appear in the tree. | |
1099 | * | |
1100 | * @see #PACKAGE_DEF | |
1101 | **/ | |
1102 | //public static final int LITERAL_PACKAGE = | |
1103 | // GeneratedJavaTokenTypes.LITERAL_package; | |
1104 | ||
1105 | /** | |
1106 | * The statement terminator (<code>;</code>). Depending on the | |
1107 | * context, this make occur as a sibling, a child, or not at all. | |
1108 | * | |
1109 | * @see #PACKAGE_DEF | |
1110 | * @see #IMPORT | |
1111 | * @see #SLIST | |
1112 | * @see #ARRAY_INIT | |
1113 | * @see #LITERAL_FOR | |
1114 | **/ | |
1115 | public static final int SEMI = GeneratedJavaTokenTypes.SEMI; | |
1116 | /* * | |
1117 | * This token does not appear in the tree. | |
1118 | * | |
1119 | * @see #IMPORT | |
1120 | **/ | |
1121 | // public static final int LITERAL_IMPORT = | |
1122 | // GeneratedJavaTokenTypes.LITERAL_import; | |
1123 | ||
1124 | /* * | |
1125 | * This token does not appear in the tree. | |
1126 | * | |
1127 | * @see #INDEX_OP | |
1128 | * @see #ARRAY_DECLARATOR | |
1129 | **/ | |
1130 | //public static final int LBRACK = GeneratedJavaTokenTypes.LBRACK; | |
1131 | /** | |
1132 | * The <code>]</code> symbol. | |
1133 | * | |
1134 | * @see #INDEX_OP | |
1135 | * @see #ARRAY_DECLARATOR | |
1136 | **/ | |
1137 | public static final int RBRACK = GeneratedJavaTokenTypes.RBRACK; | |
1138 | /** | |
1139 | * The <code>void</code> keyword. | |
1140 | * | |
1141 | * @see #TYPE | |
1142 | **/ | |
1143 | public static final int LITERAL_VOID = | |
1144 | GeneratedJavaTokenTypes.LITERAL_void; | |
1145 | ||
1146 | /** | |
1147 | * The <code>boolean</code> keyword. | |
1148 | * | |
1149 | * @see #TYPE | |
1150 | **/ | |
1151 | public static final int LITERAL_BOOLEAN = | |
1152 | GeneratedJavaTokenTypes.LITERAL_boolean; | |
1153 | ||
1154 | /** | |
1155 | * The <code>byte</code> keyword. | |
1156 | * | |
1157 | * @see #TYPE | |
1158 | **/ | |
1159 | public static final int LITERAL_BYTE = | |
1160 | GeneratedJavaTokenTypes.LITERAL_byte; | |
1161 | ||
1162 | /** | |
1163 | * The <code>char</code> keyword. | |
1164 | * | |
1165 | * @see #TYPE | |
1166 | **/ | |
1167 | public static final int LITERAL_CHAR = | |
1168 | GeneratedJavaTokenTypes.LITERAL_char; | |
1169 | ||
1170 | /** | |
1171 | * The <code>short</code> keyword. | |
1172 | * | |
1173 | * @see #TYPE | |
1174 | **/ | |
1175 | public static final int LITERAL_SHORT = | |
1176 | GeneratedJavaTokenTypes.LITERAL_short; | |
1177 | ||
1178 | /** | |
1179 | * The <code>int</code> keyword. | |
1180 | * | |
1181 | * @see #TYPE | |
1182 | **/ | |
1183 | public static final int LITERAL_INT = GeneratedJavaTokenTypes.LITERAL_int; | |
1184 | /** | |
1185 | * The <code>float</code> keyword. | |
1186 | * | |
1187 | * @see #TYPE | |
1188 | **/ | |
1189 | public static final int LITERAL_FLOAT = | |
1190 | GeneratedJavaTokenTypes.LITERAL_float; | |
1191 | ||
1192 | /** | |
1193 | * The <code>long</code> keyword. | |
1194 | * | |
1195 | * @see #TYPE | |
1196 | **/ | |
1197 | public static final int LITERAL_LONG = | |
1198 | GeneratedJavaTokenTypes.LITERAL_long; | |
1199 | ||
1200 | /** | |
1201 | * The <code>double</code> keyword. | |
1202 | * | |
1203 | * @see #TYPE | |
1204 | **/ | |
1205 | public static final int LITERAL_DOUBLE = | |
1206 | GeneratedJavaTokenTypes.LITERAL_double; | |
1207 | ||
1208 | /** | |
1209 | * An identifier. These can be names of types, subpackages, | |
1210 | * fields, methods, parameters, and local variables. | |
1211 | **/ | |
1212 | public static final int IDENT = GeneratedJavaTokenTypes.IDENT; | |
1213 | /** | |
1214 | * The <code>.</code> (dot) operator. | |
1215 | * | |
1216 | * @see FullIdent | |
1217 | **/ | |
1218 | public static final int DOT = GeneratedJavaTokenTypes.DOT; | |
1219 | /** | |
1220 | * The <code>*</code> (multiplication or wildcard) operator. | |
1221 | * | |
1222 | * @see <a | |
1223 | * href="http://java.sun.com/docs/books/jls/second_edition/html/packages.doc.html#26725">Java | |
1224 | * Language Specification, §7.5.2</a> | |
1225 | * @see <a | |
1226 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5036">Java | |
1227 | * Language Specification, §15.17.1</a> | |
1228 | * @see #EXPR | |
1229 | * @see #IMPORT | |
1230 | **/ | |
1231 | public static final int STAR = GeneratedJavaTokenTypes.STAR; | |
1232 | /** | |
1233 | * The <code>private</code> keyword. | |
1234 | * | |
1235 | * @see #MODIFIERS | |
1236 | **/ | |
1237 | public static final int LITERAL_PRIVATE = | |
1238 | GeneratedJavaTokenTypes.LITERAL_private; | |
1239 | ||
1240 | /** | |
1241 | * The <code>public</code> keyword. | |
1242 | * | |
1243 | * @see #MODIFIERS | |
1244 | **/ | |
1245 | public static final int LITERAL_PUBLIC = | |
1246 | GeneratedJavaTokenTypes.LITERAL_public; | |
1247 | ||
1248 | /** | |
1249 | * The <code>protected</code> keyword. | |
1250 | * | |
1251 | * @see #MODIFIERS | |
1252 | **/ | |
1253 | public static final int LITERAL_PROTECTED = | |
1254 | GeneratedJavaTokenTypes.LITERAL_protected; | |
1255 | ||
1256 | /** | |
1257 | * The <code>static</code> keyword. | |
1258 | * | |
1259 | * @see #MODIFIERS | |
1260 | **/ | |
1261 | public static final int LITERAL_STATIC = | |
1262 | GeneratedJavaTokenTypes.LITERAL_static; | |
1263 | ||
1264 | /** | |
1265 | * The <code>transient</code> keyword. | |
1266 | * | |
1267 | * @see #MODIFIERS | |
1268 | **/ | |
1269 | public static final int LITERAL_TRANSIENT = | |
1270 | GeneratedJavaTokenTypes.LITERAL_transient; | |
1271 | ||
1272 | /** | |
1273 | * The <code>native</code> keyword. | |
1274 | * | |
1275 | * @see #MODIFIERS | |
1276 | **/ | |
1277 | public static final int LITERAL_NATIVE = | |
1278 | GeneratedJavaTokenTypes.LITERAL_native; | |
1279 | ||
1280 | /** | |
1281 | * The <code>synchronized</code> keyword. This may be used as a | |
1282 | * modifier of a method or in the definition of a synchronized | |
1283 | * block. | |
1284 | * | |
1285 | * <p>For example:</p> | |
1286 | * | |
1287 | * <pre> | |
1288 | * synchronized(this) | |
1289 | * { | |
1290 | * x++; | |
1291 | * } | |
1292 | * </pre> | |
1293 | * | |
1294 | * <p>parses as:</p> | |
1295 | * | |
1296 | * <pre> | |
1297 | * +--LITERAL_SYNCHRONIZED (synchronized) | |
1298 | * | | |
1299 | * +--LPAREN (() | |
1300 | * +--EXPR | |
1301 | * | | |
1302 | * +--LITERAL_THIS (this) | |
1303 | * +--RPAREN ()) | |
1304 | * +--SLIST ({) | |
1305 | * | | |
1306 | * +--EXPR | |
1307 | * | | |
1308 | * +--POST_INC (++) | |
1309 | * | | |
1310 | * +--IDENT (x) | |
1311 | * +--SEMI (;) | |
1312 | * +--RCURLY (}) | |
1313 | * +--RCURLY (}) | |
1314 | * </pre> | |
1315 | * | |
1316 | * @see #MODIFIERS | |
1317 | * @see #LPAREN | |
1318 | * @see #EXPR | |
1319 | * @see #RPAREN | |
1320 | * @see #SLIST | |
1321 | * @see #RCURLY | |
1322 | **/ | |
1323 | public static final int LITERAL_SYNCHRONIZED = | |
1324 | GeneratedJavaTokenTypes.LITERAL_synchronized; | |
1325 | ||
1326 | /** | |
1327 | * The <code>volatile</code> keyword. | |
1328 | * | |
1329 | * @see #MODIFIERS | |
1330 | **/ | |
1331 | public static final int LITERAL_VOLATILE = | |
1332 | GeneratedJavaTokenTypes.LITERAL_volatile; | |
1333 | ||
1334 | /** | |
1335 | * The <code>class</code> keyword. This element appears both | |
1336 | * as part of a class declaration, and inline to reference a | |
1337 | * class object. | |
1338 | * | |
1339 | * <p>For example:</p> | |
1340 | * | |
1341 | * <pre> | |
1342 | * int.class | |
1343 | * </pre> | |
1344 | * <p>parses as:</p> | |
1345 | * <pre> | |
1346 | * +--EXPR | |
1347 | * | | |
1348 | * +--DOT (.) | |
1349 | * | | |
1350 | * +--LITERAL_INT (int) | |
1351 | * +--LITERAL_CLASS (class) | |
1352 | * </pre> | |
1353 | * | |
1354 | * @see #DOT | |
1355 | * @see #IDENT | |
1356 | * @see #CLASS_DEF | |
1357 | * @see FullIdent | |
1358 | **/ | |
1359 | public static final int LITERAL_CLASS = | |
1360 | GeneratedJavaTokenTypes.LITERAL_class; | |
1361 | ||
1362 | /* * | |
1363 | * This token does not appear in the tree. | |
1364 | * | |
1365 | * @see #EXTENDS_CLAUSE | |
1366 | **/ | |
1367 | //public static final int LITERAL_EXTENDS = | |
1368 | // GeneratedJavaTokenTypes.LITERAL_extends; | |
1369 | ||
1370 | /** | |
1371 | * The <code>interface</code> keyword. This token appears in | |
1372 | * interface definition. | |
1373 | * | |
1374 | * @see #INTERFACE_DEF | |
1375 | **/ | |
1376 | public static final int LITERAL_INTERFACE = | |
1377 | GeneratedJavaTokenTypes.LITERAL_interface; | |
1378 | ||
1379 | /** | |
1380 | * A left (curly) brace (<code>{</code>). | |
1381 | * | |
1382 | * @see #OBJBLOCK | |
1383 | * @see #ARRAY_INIT | |
1384 | * @see #SLIST | |
1385 | **/ | |
1386 | public static final int LCURLY = GeneratedJavaTokenTypes.LCURLY; | |
1387 | /** | |
1388 | * A right (curly) brace (<code>}</code>). | |
1389 | * | |
1390 | * @see #OBJBLOCK | |
1391 | * @see #ARRAY_INIT | |
1392 | * @see #SLIST | |
1393 | **/ | |
1394 | public static final int RCURLY = GeneratedJavaTokenTypes.RCURLY; | |
1395 | /** | |
1396 | * The <code>,</code> (comma) operator. | |
1397 | * | |
1398 | * @see #ARRAY_INIT | |
1399 | * @see #FOR_INIT | |
1400 | * @see #FOR_ITERATOR | |
1401 | * @see #LITERAL_THROWS | |
1402 | * @see #IMPLEMENTS_CLAUSE | |
1403 | **/ | |
1404 | public static final int COMMA = GeneratedJavaTokenTypes.COMMA; | |
1405 | /* * | |
1406 | * This token does not appear in the tree. | |
1407 | * | |
1408 | * @see #IMPLEMENTS_CLAUSE | |
1409 | **/ | |
1410 | // public static final int LITERAL_IMPLEMENTS = | |
1411 | // GeneratedJavaTokenTypes.LITERAL_implements; | |
1412 | ||
1413 | /** | |
1414 | * A left parenthesis (<code>(</code>). | |
1415 | * | |
1416 | * @see #LITERAL_FOR | |
1417 | * @see #LITERAL_NEW | |
1418 | * @see #EXPR | |
1419 | * @see #LITERAL_SWITCH | |
1420 | * @see #LITERAL_CATCH | |
1421 | **/ | |
1422 | public static final int LPAREN = GeneratedJavaTokenTypes.LPAREN; | |
1423 | /** | |
1424 | * A right parenthesis (<code>)</code>). | |
1425 | * | |
1426 | * @see #LITERAL_FOR | |
1427 | * @see #LITERAL_NEW | |
1428 | * @see #METHOD_CALL | |
1429 | * @see #TYPECAST | |
1430 | * @see #EXPR | |
1431 | * @see #LITERAL_SWITCH | |
1432 | * @see #LITERAL_CATCH | |
1433 | **/ | |
1434 | public static final int RPAREN = GeneratedJavaTokenTypes.RPAREN; | |
1435 | /** | |
1436 | * The <code>this</code> keyword. | |
1437 | * | |
1438 | * @see #EXPR | |
1439 | * @see #CTOR_CALL | |
1440 | **/ | |
1441 | public static final int LITERAL_THIS = | |
1442 | GeneratedJavaTokenTypes.LITERAL_this; | |
1443 | ||
1444 | /** | |
1445 | * The <code>super</code> keyword. | |
1446 | * | |
1447 | * @see #EXPR | |
1448 | * @see #SUPER_CTOR_CALL | |
1449 | **/ | |
1450 | public static final int LITERAL_SUPER = | |
1451 | GeneratedJavaTokenTypes.LITERAL_super; | |
1452 | ||
1453 | /** | |
1454 | * The <code>=</code> (assignment) operator. | |
1455 | * | |
1456 | * @see <a | |
1457 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5295">Java | |
1458 | * Language Specification, §15.26.1</a> | |
1459 | * @see #EXPR | |
1460 | **/ | |
1461 | public static final int ASSIGN = GeneratedJavaTokenTypes.ASSIGN; | |
1462 | /** | |
1463 | * The <code>throws</code> keyword. The children are a number of | |
1464 | * one or more identifiers separated by commas. | |
1465 | * | |
1466 | * @see <a | |
1467 | * href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#78323">Java | |
1468 | * Language Specification, §8.4.4</a> | |
1469 | * @see #IDENT | |
1470 | * @see #DOT | |
1471 | * @see #COMMA | |
1472 | * @see #METHOD_DEF | |
1473 | * @see #CTOR_DEF | |
1474 | * @see FullIdent | |
1475 | **/ | |
1476 | public static final int LITERAL_THROWS = | |
1477 | GeneratedJavaTokenTypes.LITERAL_throws; | |
1478 | ||
1479 | /** | |
1480 | * The <code>:</code> (colon) operator. This will appear as part | |
1481 | * of the conditional operator (<code>? :</code>). | |
1482 | * | |
1483 | * @see #QUESTION | |
1484 | * @see #LABELED_STAT | |
1485 | * @see #CASE_GROUP | |
1486 | **/ | |
1487 | public static final int COLON = GeneratedJavaTokenTypes.COLON; | |
1488 | /** | |
1489 | * The <code>if</code> keyword. | |
1490 | * | |
1491 | * <p>For example:</p> | |
1492 | * <pre> | |
1493 | * if(optimistic) | |
1494 | * { | |
1495 | * message = "half full"; | |
1496 | * } | |
1497 | * else | |
1498 | * { | |
1499 | * message = "half empty"; | |
1500 | * } | |
1501 | * </pre> | |
1502 | * <p>parses as:</p> | |
1503 | * <pre> | |
1504 | * +--LITERAL_IF (if) | |
1505 | * | | |
1506 | * +--LPAREN (() | |
1507 | * +--EXPR | |
1508 | * | | |
1509 | * +--IDENT (optimistic) | |
1510 | * +--RPAREN ()) | |
1511 | * +--SLIST ({) | |
1512 | * | | |
1513 | * +--EXPR | |
1514 | * | | |
1515 | * +--ASSIGN (=) | |
1516 | * | | |
1517 | * +--IDENT (message) | |
1518 | * +--STRING_LITERAL ("half full") | |
1519 | * +--SEMI (;) | |
1520 | * +--RCURLY (}) | |
1521 | * +--LITERAL_ELSE (else) | |
1522 | * | | |
1523 | * +--SLIST ({) | |
1524 | * | | |
1525 | * +--EXPR | |
1526 | * | | |
1527 | * +--ASSIGN (=) | |
1528 | * | | |
1529 | * +--IDENT (message) | |
1530 | * +--STRING_LITERAL ("half empty") | |
1531 | * +--SEMI (;) | |
1532 | * +--RCURLY (}) | |
1533 | * </pre> | |
1534 | * | |
1535 | * @see #LPAREN | |
1536 | * @see #EXPR | |
1537 | * @see #RPAREN | |
1538 | * @see #SLIST | |
1539 | * @see #EMPTY_STAT | |
1540 | * @see #LITERAL_ELSE | |
1541 | **/ | |
1542 | public static final int LITERAL_IF = GeneratedJavaTokenTypes.LITERAL_if; | |
1543 | /** | |
1544 | * The <code>for</code> keyword. The children are <code>(</code>, | |
1545 | * an initializer, a condition, an iterator, a <code>)</code> and | |
1546 | * either a statement list, a single expression, or an empty | |
1547 | * statement. | |
1548 | * | |
1549 | * <p>For example:</p> | |
1550 | * <pre> | |
1551 | * for(int i = 0, n = myArray.length; i < n; i++) | |
1552 | * { | |
1553 | * } | |
1554 | * </pre> | |
1555 | * | |
1556 | * <p>parses as:</p> | |
1557 | * <pre> | |
1558 | * +--LITERAL_FOR (for) | |
1559 | * | | |
1560 | * +--LPAREN (() | |
1561 | * +--FOR_INIT | |
1562 | * | | |
1563 | * +--VARIABLE_DEF | |
1564 | * | | |
1565 | * +--MODIFIERS | |
1566 | * +--TYPE | |
1567 | * | | |
1568 | * +--LITERAL_INT (int) | |
1569 | * +--IDENT (i) | |
1570 | * +--ASSIGN (=) | |
1571 | * | | |
1572 | * +--EXPR | |
1573 | * | | |
1574 | * +--NUM_INT (0) | |
1575 | * +--COMMA (,) | |
1576 | * +--VARIABLE_DEF | |
1577 | * | | |
1578 | * +--MODIFIERS | |
1579 | * +--TYPE | |
1580 | * | | |
1581 | * +--LITERAL_INT (int) | |
1582 | * +--IDENT (n) | |
1583 | * +--ASSIGN (=) | |
1584 | * | | |
1585 | * +--EXPR | |
1586 | * | | |
1587 | * +--DOT (.) | |
1588 | * | | |
1589 | * +--IDENT (myArray) | |
1590 | * +--IDENT (length) | |
1591 | * +--SEMI (;) | |
1592 | * +--FOR_CONDITION | |
1593 | * | | |
1594 | * +--EXPR | |
1595 | * | | |
1596 | * +--LT (<) | |
1597 | * | | |
1598 | * +--IDENT (i) | |
1599 | * +--IDENT (n) | |
1600 | * +--SEMI (;) | |
1601 | * +--FOR_ITERATOR | |
1602 | * | | |
1603 | * +--ELIST | |
1604 | * | | |
1605 | * +--EXPR | |
1606 | * | | |
1607 | * +--POST_INC (++) | |
1608 | * | | |
1609 | * +--IDENT (i) | |
1610 | * +--RPAREN ()) | |
1611 | * +--SLIST ({) | |
1612 | * | | |
1613 | * +--RCURLY (}) | |
1614 | * </pre> | |
1615 | * | |
1616 | * @see #LPAREN | |
1617 | * @see #FOR_INIT | |
1618 | * @see #SEMI | |
1619 | * @see #FOR_CONDITION | |
1620 | * @see #FOR_ITERATOR | |
1621 | * @see #RPAREN | |
1622 | * @see #SLIST | |
1623 | * @see #EMPTY_STAT | |
1624 | * @see #EXPR | |
1625 | **/ | |
1626 | public static final int LITERAL_FOR = GeneratedJavaTokenTypes.LITERAL_for; | |
1627 | /** | |
1628 | * The <code>while</code> keyword. | |
1629 | * | |
1630 | * <p>For example:</p> | |
1631 | * <pre> | |
1632 | * while(line != null) | |
1633 | * { | |
1634 | * process(line); | |
1635 | * line = in.readLine(); | |
1636 | * } | |
1637 | * </pre> | |
1638 | * <p>parses as:</p> | |
1639 | * <pre> | |
1640 | * +--LITERAL_WHILE (while) | |
1641 | * | | |
1642 | * +--LPAREN (() | |
1643 | * +--EXPR | |
1644 | * | | |
1645 | * +--NOT_EQUAL (!=) | |
1646 | * | | |
1647 | * +--IDENT (line) | |
1648 | * +--LITERAL_NULL (null) | |
1649 | * +--RPAREN ()) | |
1650 | * +--SLIST ({) | |
1651 | * | | |
1652 | * +--EXPR | |
1653 | * | | |
1654 | * +--METHOD_CALL (() | |
1655 | * | | |
1656 | * +--IDENT (process) | |
1657 | * +--ELIST | |
1658 | * | | |
1659 | * +--EXPR | |
1660 | * | | |
1661 | * +--IDENT (line) | |
1662 | * +--RPAREN ()) | |
1663 | * +--SEMI (;) | |
1664 | * +--EXPR | |
1665 | * | | |
1666 | * +--ASSIGN (=) | |
1667 | * | | |
1668 | * +--IDENT (line) | |
1669 | * +--METHOD_CALL (() | |
1670 | * | | |
1671 | * +--DOT (.) | |
1672 | * | | |
1673 | * +--IDENT (in) | |
1674 | * +--IDENT (readLine) | |
1675 | * +--ELIST | |
1676 | * +--RPAREN ()) | |
1677 | * +--SEMI (;) | |
1678 | * +--RCURLY (}) | |
1679 | * </pre> | |
1680 | **/ | |
1681 | public static final int LITERAL_WHILE = | |
1682 | GeneratedJavaTokenTypes.LITERAL_while; | |
1683 | ||
1684 | /** | |
1685 | * The <code>do</code> keyword. Note the the while token does not | |
1686 | * appear as part of the do-while construct. | |
1687 | * | |
1688 | * <p>For example:</p> | |
1689 | * <pre> | |
1690 | * do | |
1691 | * { | |
1692 | * x = rand.nextInt(10); | |
1693 | * } | |
1694 | * while(x < 5); | |
1695 | * </pre> | |
1696 | * <p>parses as:</p> | |
1697 | * <pre> | |
1698 | * +--LITERAL_DO (do) | |
1699 | * | | |
1700 | * +--SLIST ({) | |
1701 | * | | |
1702 | * +--EXPR | |
1703 | * | | |
1704 | * +--ASSIGN (=) | |
1705 | * | | |
1706 | * +--IDENT (x) | |
1707 | * +--METHOD_CALL (() | |
1708 | * | | |
1709 | * +--DOT (.) | |
1710 | * | | |
1711 | * +--IDENT (rand) | |
1712 | * +--IDENT (nextInt) | |
1713 | * +--ELIST | |
1714 | * | | |
1715 | * +--EXPR | |
1716 | * | | |
1717 | * +--NUM_INT (10) | |
1718 | * +--RPAREN ()) | |
1719 | * +--SEMI (;) | |
1720 | * +--RCURLY (}) | |
1721 | * +--LPAREN (() | |
1722 | * +--EXPR | |
1723 | * | | |
1724 | * +--LT (<) | |
1725 | * | | |
1726 | * +--IDENT (x) | |
1727 | * +--NUM_INT (5) | |
1728 | * +--RPAREN ()) | |
1729 | * +--SEMI (;) | |
1730 | * </pre> | |
1731 | * | |
1732 | * @see #SLIST | |
1733 | * @see #EXPR | |
1734 | * @see #EMPTY_STAT | |
1735 | * @see #LPAREN | |
1736 | * @see #RPAREN | |
1737 | * @see #SEMI | |
1738 | **/ | |
1739 | public static final int LITERAL_DO = GeneratedJavaTokenTypes.LITERAL_do; | |
1740 | /** | |
1741 | * Literal <code>while</code> in do-while loop. | |
1742 | * @see #LITERAL_DO | |
1743 | */ | |
1744 | public static final int DO_WHILE = GeneratedJavaTokenTypes.DO_WHILE; | |
1745 | /** | |
1746 | * The <code>break</code> keyword. The first child is an optional | |
1747 | * identifier and the last child is a semicolon. | |
1748 | * | |
1749 | * @see #IDENT | |
1750 | * @see #SEMI | |
1751 | * @see #SLIST | |
1752 | **/ | |
1753 | public static final int LITERAL_BREAK = | |
1754 | GeneratedJavaTokenTypes.LITERAL_break; | |
1755 | ||
1756 | /** | |
1757 | * The <code>continue</code> keyword. The first child is an | |
1758 | * optional identifier and the last child is a semicolon. | |
1759 | * | |
1760 | * @see #IDENT | |
1761 | * @see #SEMI | |
1762 | * @see #SLIST | |
1763 | **/ | |
1764 | public static final int LITERAL_CONTINUE = | |
1765 | GeneratedJavaTokenTypes.LITERAL_continue; | |
1766 | ||
1767 | /** | |
1768 | * The <code>return</code> keyword. The first child is an | |
1769 | * optional expression for the return value. The last child is a | |
1770 | * semi colon. | |
1771 | * | |
1772 | * @see #EXPR | |
1773 | * @see #SEMI | |
1774 | * @see #SLIST | |
1775 | **/ | |
1776 | public static final int LITERAL_RETURN = | |
1777 | GeneratedJavaTokenTypes.LITERAL_return; | |
1778 | ||
1779 | /** | |
1780 | * The <code>switch</code> keyword. | |
1781 | * | |
1782 | * <p>For example:</p> | |
1783 | * <pre> | |
1784 | * switch(type) | |
1785 | * { | |
1786 | * case 0: | |
1787 | * background = Color.blue; | |
1788 | * break; | |
1789 | * case 1: | |
1790 | * background = Color.red; | |
1791 | * break; | |
1792 | * default: | |
1793 | * background = Color.green; | |
1794 | * break; | |
1795 | * } | |
1796 | * </pre> | |
1797 | * <p>parses as:</p> | |
1798 | * <pre> | |
1799 | * +--LITERAL_SWITCH (switch) | |
1800 | * | | |
1801 | * +--LPAREN (() | |
1802 | * +--EXPR | |
1803 | * | | |
1804 | * +--IDENT (type) | |
1805 | * +--RPAREN ()) | |
1806 | * +--LCURLY ({) | |
1807 | * +--CASE_GROUP | |
1808 | * | | |
1809 | * +--LITERAL_CASE (case) | |
1810 | * | | |
1811 | * +--EXPR | |
1812 | * | | |
1813 | * +--NUM_INT (0) | |
1814 | * +--SLIST | |
1815 | * | | |
1816 | * +--EXPR | |
1817 | * | | |
1818 | * +--ASSIGN (=) | |
1819 | * | | |
1820 | * +--IDENT (background) | |
1821 | * +--DOT (.) | |
1822 | * | | |
1823 | * +--IDENT (Color) | |
1824 | * +--IDENT (blue) | |
1825 | * +--SEMI (;) | |
1826 | * +--LITERAL_BREAK (break) | |
1827 | * | | |
1828 | * +--SEMI (;) | |
1829 | * +--CASE_GROUP | |
1830 | * | | |
1831 | * +--LITERAL_CASE (case) | |
1832 | * | | |
1833 | * +--EXPR | |
1834 | * | | |
1835 | * +--NUM_INT (1) | |
1836 | * +--SLIST | |
1837 | * | | |
1838 | * +--EXPR | |
1839 | * | | |
1840 | * +--ASSIGN (=) | |
1841 | * | | |
1842 | * +--IDENT (background) | |
1843 | * +--DOT (.) | |
1844 | * | | |
1845 | * +--IDENT (Color) | |
1846 | * +--IDENT (red) | |
1847 | * +--SEMI (;) | |
1848 | * +--LITERAL_BREAK (break) | |
1849 | * | | |
1850 | * +--SEMI (;) | |
1851 | * +--CASE_GROUP | |
1852 | * | | |
1853 | * +--LITERAL_DEFAULT (default) | |
1854 | * +--SLIST | |
1855 | * | | |
1856 | * +--EXPR | |
1857 | * | | |
1858 | * +--ASSIGN (=) | |
1859 | * | | |
1860 | * +--IDENT (background) | |
1861 | * +--DOT (.) | |
1862 | * | | |
1863 | * +--IDENT (Color) | |
1864 | * +--IDENT (green) | |
1865 | * +--SEMI (;) | |
1866 | * +--LITERAL_BREAK (break) | |
1867 | * | | |
1868 | * +--SEMI (;) | |
1869 | * +--RCURLY (}) | |
1870 | * </pre> | |
1871 | * | |
1872 | * @see <a | |
1873 | * href="http://java.sun.com/docs/books/jls/second_edition/html/statements.doc.html#35518">Java | |
1874 | * Language Specification, §14.10</a> | |
1875 | * @see #LPAREN | |
1876 | * @see #EXPR | |
1877 | * @see #RPAREN | |
1878 | * @see #LCURLY | |
1879 | * @see #CASE_GROUP | |
1880 | * @see #RCURLY | |
1881 | * @see #SLIST | |
1882 | **/ | |
1883 | public static final int LITERAL_SWITCH = | |
1884 | GeneratedJavaTokenTypes.LITERAL_switch; | |
1885 | ||
1886 | /** | |
1887 | * The <code>throw</code> keyword. The first child is an | |
1888 | * expression that evaluates to a <code>Throwable</code> instance. | |
1889 | * | |
1890 | * @see <a | |
1891 | * href="http://java.sun.com/docs/books/jls/second_edition/html/statements.doc.html#237350">Java | |
1892 | * Language Specification, §14.17</a> | |
1893 | * @see #SLIST | |
1894 | * @see #EXPR | |
1895 | **/ | |
1896 | public static final int LITERAL_THROW = | |
1897 | GeneratedJavaTokenTypes.LITERAL_throw; | |
1898 | ||
1899 | /** | |
1900 | * The <code>else</code> keyword. This appears as a child of an | |
1901 | * <code>if</code> statement. | |
1902 | * | |
1903 | * @see #SLIST | |
1904 | * @see #EXPR | |
1905 | * @see #EMPTY_STAT | |
1906 | * @see #LITERAL_IF | |
1907 | **/ | |
1908 | public static final int LITERAL_ELSE = | |
1909 | GeneratedJavaTokenTypes.LITERAL_else; | |
1910 | ||
1911 | /** | |
1912 | * The <code>case</code> keyword. The first child is a constant | |
1913 | * expression that evaluates to a integer. | |
1914 | * | |
1915 | * @see #CASE_GROUP | |
1916 | * @see #EXPR | |
1917 | **/ | |
1918 | public static final int LITERAL_CASE = | |
1919 | GeneratedJavaTokenTypes.LITERAL_case; | |
1920 | ||
1921 | /** | |
1922 | * The <code>default</code> keyword. This element has no | |
1923 | * children. | |
1924 | * | |
1925 | * @see #CASE_GROUP | |
1926 | **/ | |
1927 | public static final int LITERAL_DEFAULT = | |
1928 | GeneratedJavaTokenTypes.LITERAL_default; | |
1929 | ||
1930 | /** | |
1931 | * The <code>try</code> keyword. The children are a statement | |
1932 | * list, zero or more catch blocks and then an optional finally | |
1933 | * block. | |
1934 | * | |
1935 | * <p>For example:</p> | |
1936 | * <pre> | |
1937 | * try | |
1938 | * { | |
1939 | * FileReader in = new FileReader("abc.txt"); | |
1940 | * } | |
1941 | * catch(IOException ioe) | |
1942 | * { | |
1943 | * } | |
1944 | * finally | |
1945 | * { | |
1946 | * } | |
1947 | * </pre> | |
1948 | * <p>parses as:</p> | |
1949 | * <pre> | |
1950 | * +--LITERAL_TRY (try) | |
1951 | * | | |
1952 | * +--SLIST ({) | |
1953 | * | | |
1954 | * +--VARIABLE_DEF | |
1955 | * | | |
1956 | * +--MODIFIERS | |
1957 | * +--TYPE | |
1958 | * | | |
1959 | * +--IDENT (FileReader) | |
1960 | * +--IDENT (in) | |
1961 | * +--ASSIGN (=) | |
1962 | * | | |
1963 | * +--EXPR | |
1964 | * | | |
1965 | * +--LITERAL_NEW (new) | |
1966 | * | | |
1967 | * +--IDENT (FileReader) | |
1968 | * +--LPAREN (() | |
1969 | * +--ELIST | |
1970 | * | | |
1971 | * +--EXPR | |
1972 | * | | |
1973 | * +--STRING_LITERAL ("abc.txt") | |
1974 | * +--RPAREN ()) | |
1975 | * +--SEMI (;) | |
1976 | * +--RCURLY (}) | |
1977 | * +--LITERAL_CATCH (catch) | |
1978 | * | | |
1979 | * +--LPAREN (() | |
1980 | * +--PARAMETER_DEF | |
1981 | * | | |
1982 | * +--MODIFIERS | |
1983 | * +--TYPE | |
1984 | * | | |
1985 | * +--IDENT (IOException) | |
1986 | * +--IDENT (ioe) | |
1987 | * +--RPAREN ()) | |
1988 | * +--SLIST ({) | |
1989 | * | | |
1990 | * +--RCURLY (}) | |
1991 | * +--LITERAL_FINALLY (finally) | |
1992 | * | | |
1993 | * +--SLIST ({) | |
1994 | * | | |
1995 | * +--RCURLY (}) | |
1996 | * +--RCURLY (}) | |
1997 | * </pre> | |
1998 | * | |
1999 | * @see <a | |
2000 | * href="http://java.sun.com/docs/books/jls/second_edition/html/statements.doc.html#79311">Java | |
2001 | * Language Specification, §14.19</a> | |
2002 | * @see #SLIST | |
2003 | * @see #LITERAL_CATCH | |
2004 | * @see #LITERAL_FINALLY | |
2005 | **/ | |
2006 | public static final int LITERAL_TRY = GeneratedJavaTokenTypes.LITERAL_try; | |
2007 | ||
2008 | /** | |
2009 | * Java 7 try-with-resources construct. | |
2010 | * | |
2011 | * <p>For example:</p> | |
2012 | * <pre> | |
2013 | * try (Foo foo = new Foo(); Bar bar = new Bar()) { } | |
2014 | * </pre> | |
2015 | * <p>parses as:</p> | |
2016 | * <pre> | |
2017 | * +--LITERAL_TRY (try) | |
2018 | * | | |
2019 | * +--RESOURCE_SPECIFICATION | |
2020 | * | | |
2021 | * +--LPAREN (() | |
2022 | * +--RESOURCES | |
2023 | * | | |
2024 | * +--RESOURCE | |
2025 | * | | |
2026 | * +--MODIFIERS | |
2027 | * +--TYPE | |
2028 | * | | |
2029 | * +--IDENT (Foo) | |
2030 | * +--IDENT (foo) | |
2031 | * +--ASSIGN (=) | |
2032 | * +--EXPR | |
2033 | * | | |
2034 | * +--LITERAL_NEW (new) | |
2035 | * | | |
2036 | * +--IDENT (Foo) | |
2037 | * +--LPAREN (() | |
2038 | * +--ELIST | |
2039 | * +--RPAREN ()) | |
2040 | * +--SEMI (;) | |
2041 | * +--RESOURCE | |
2042 | * | | |
2043 | * +--MODIFIERS | |
2044 | * +--TYPE | |
2045 | * | | |
2046 | * +--IDENT (Bar) | |
2047 | * +--IDENT (bar) | |
2048 | * +--ASSIGN (=) | |
2049 | * +--EXPR | |
2050 | * | | |
2051 | * +--LITERAL_NEW (new) | |
2052 | * | | |
2053 | * +--IDENT (Bar) | |
2054 | * +--LPAREN (() | |
2055 | * +--ELIST | |
2056 | * +--RPAREN ()) | |
2057 | * +--RPAREN ()) | |
2058 | * +--SLIST ({) | |
2059 | * +--RCURLY (}) | |
2060 | * </pre> | |
2061 | * | |
2062 | * @see #LPAREN | |
2063 | * @see #RESOURCES | |
2064 | * @see #RESOURCE | |
2065 | * @see #SEMI | |
2066 | * @see #RPAREN | |
2067 | * @see #LITERAL_TRY | |
2068 | **/ | |
2069 | public static final int RESOURCE_SPECIFICATION = | |
2070 | GeneratedJavaTokenTypes.RESOURCE_SPECIFICATION; | |
2071 | ||
2072 | /** | |
2073 | * Java 7 try-with-resources construct. | |
2074 | * | |
2075 | * @see #RESOURCE_SPECIFICATION | |
2076 | **/ | |
2077 | public static final int RESOURCES = | |
2078 | GeneratedJavaTokenTypes.RESOURCES; | |
2079 | ||
2080 | /** | |
2081 | * Java 7 try-with-resources construct. | |
2082 | * | |
2083 | * @see #RESOURCE_SPECIFICATION | |
2084 | **/ | |
2085 | public static final int RESOURCE = | |
2086 | GeneratedJavaTokenTypes.RESOURCE; | |
2087 | ||
2088 | /** | |
2089 | * The <code>catch</code> keyword. | |
2090 | * | |
2091 | * @see #LPAREN | |
2092 | * @see #PARAMETER_DEF | |
2093 | * @see #RPAREN | |
2094 | * @see #SLIST | |
2095 | * @see #LITERAL_TRY | |
2096 | **/ | |
2097 | public static final int LITERAL_CATCH = | |
2098 | GeneratedJavaTokenTypes.LITERAL_catch; | |
2099 | ||
2100 | /** | |
2101 | * The <code>finally</code> keyword. | |
2102 | * | |
2103 | * @see #SLIST | |
2104 | * @see #LITERAL_TRY | |
2105 | **/ | |
2106 | public static final int LITERAL_FINALLY = | |
2107 | GeneratedJavaTokenTypes.LITERAL_finally; | |
2108 | ||
2109 | /** | |
2110 | * The <code>+=</code> (addition assignment) operator. | |
2111 | * | |
2112 | * @see <a | |
2113 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5304">Java | |
2114 | * Language Specification, §15.26.2</a> | |
2115 | * @see #EXPR | |
2116 | **/ | |
2117 | public static final int PLUS_ASSIGN = GeneratedJavaTokenTypes.PLUS_ASSIGN; | |
2118 | /** | |
2119 | * The <code>-=</code> (subtraction assignment) operator. | |
2120 | * | |
2121 | * @see <a | |
2122 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5304">Java | |
2123 | * Language Specification, §15.26.2</a> | |
2124 | * @see #EXPR | |
2125 | **/ | |
2126 | public static final int MINUS_ASSIGN = | |
2127 | GeneratedJavaTokenTypes.MINUS_ASSIGN; | |
2128 | ||
2129 | /** | |
2130 | * The <code>*=</code> (multiplication assignment) operator. | |
2131 | * | |
2132 | * @see <a | |
2133 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5304">Java | |
2134 | * Language Specification, §15.26.2</a> | |
2135 | * @see #EXPR | |
2136 | **/ | |
2137 | public static final int STAR_ASSIGN = GeneratedJavaTokenTypes.STAR_ASSIGN; | |
2138 | /** | |
2139 | * The <code>/=</code> (division assignment) operator. | |
2140 | * | |
2141 | * @see <a | |
2142 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5304">Java | |
2143 | * Language Specification, §15.26.2</a> | |
2144 | * @see #EXPR | |
2145 | **/ | |
2146 | public static final int DIV_ASSIGN = GeneratedJavaTokenTypes.DIV_ASSIGN; | |
2147 | /** | |
2148 | * The <code>%=</code> (remainder assignment) operator. | |
2149 | * | |
2150 | * @see <a | |
2151 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5304">Java | |
2152 | * Language Specification, §15.26.2</a> | |
2153 | * @see #EXPR | |
2154 | **/ | |
2155 | public static final int MOD_ASSIGN = GeneratedJavaTokenTypes.MOD_ASSIGN; | |
2156 | /** | |
2157 | * The <code>>>=</code> (signed right shift assignment) | |
2158 | * operator. | |
2159 | * | |
2160 | * @see <a | |
2161 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5304">Java | |
2162 | * Language Specification, §15.26.2</a> | |
2163 | * @see #EXPR | |
2164 | **/ | |
2165 | public static final int SR_ASSIGN = GeneratedJavaTokenTypes.SR_ASSIGN; | |
2166 | /** | |
2167 | * The <code>>>>=</code> (unsigned right shift assignment) | |
2168 | * operator. | |
2169 | * | |
2170 | * @see <a | |
2171 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5304">Java | |
2172 | * Language Specification, §15.26.2</a> | |
2173 | * @see #EXPR | |
2174 | **/ | |
2175 | public static final int BSR_ASSIGN = GeneratedJavaTokenTypes.BSR_ASSIGN; | |
2176 | /** | |
2177 | * The <code><<=</code> (left shift assignment) operator. | |
2178 | * | |
2179 | * @see <a | |
2180 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5304">Java | |
2181 | * Language Specification, §15.26.2</a> | |
2182 | * @see #EXPR | |
2183 | **/ | |
2184 | public static final int SL_ASSIGN = GeneratedJavaTokenTypes.SL_ASSIGN; | |
2185 | /** | |
2186 | * The <code>&=</code> (bitwise AND assignment) operator. | |
2187 | * | |
2188 | * @see <a | |
2189 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5304">Java | |
2190 | * Language Specification, §15.26.2</a> | |
2191 | * @see #EXPR | |
2192 | **/ | |
2193 | public static final int BAND_ASSIGN = GeneratedJavaTokenTypes.BAND_ASSIGN; | |
2194 | /** | |
2195 | * The <code>^=</code> (bitwise exclusive OR assignment) operator. | |
2196 | * | |
2197 | * @see <a | |
2198 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5304">Java | |
2199 | * Language Specification, §15.26.2</a> | |
2200 | * @see #EXPR | |
2201 | **/ | |
2202 | public static final int BXOR_ASSIGN = GeneratedJavaTokenTypes.BXOR_ASSIGN; | |
2203 | /** | |
2204 | * The <code>|=</code> (bitwise OR assignment) operator. | |
2205 | * | |
2206 | * @see <a | |
2207 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5304">Java | |
2208 | * Language Specification, §15.26.2</a> | |
2209 | * @see #EXPR | |
2210 | **/ | |
2211 | public static final int BOR_ASSIGN = GeneratedJavaTokenTypes.BOR_ASSIGN; | |
2212 | /** | |
2213 | * The <code>?</code> (conditional) operator. Technically, | |
2214 | * the colon is also part of this operator, but it appears as a | |
2215 | * separate token. | |
2216 | * | |
2217 | * <p>For example:</p> | |
2218 | * <pre> | |
2219 | * (quantity == 1) ? "": "s" | |
2220 | * </pre> | |
2221 | * <p> | |
2222 | * <p>parses as:</p> | |
2223 | * </p> | |
2224 | * <pre> | |
2225 | * +--QUESTION (?) | |
2226 | * | | |
2227 | * +--LPAREN (() | |
2228 | * +--EQUAL (==) | |
2229 | * | | |
2230 | * +--IDENT (quantity) | |
2231 | * +--NUM_INT (1) | |
2232 | * +--RPAREN ()) | |
2233 | * +--STRING_LITERAL ("") | |
2234 | * +--COLON (:) | |
2235 | * +--STRING_LITERAL ("s") | |
2236 | * </pre> | |
2237 | * | |
2238 | * @see <a | |
2239 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#290293">Java | |
2240 | * Language Specification, §15.25</a> | |
2241 | * @see #EXPR | |
2242 | * @see #COLON | |
2243 | **/ | |
2244 | public static final int QUESTION = GeneratedJavaTokenTypes.QUESTION; | |
2245 | /** | |
2246 | * The <code>||</code> (conditional OR) operator. | |
2247 | * | |
2248 | * @see <a | |
2249 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#54532">Java | |
2250 | * Language Specification, §15.24</a> | |
2251 | * @see #EXPR | |
2252 | **/ | |
2253 | public static final int LOR = GeneratedJavaTokenTypes.LOR; | |
2254 | /** | |
2255 | * The <code>&&</code> (conditional AND) operator. | |
2256 | * | |
2257 | * @see <a | |
2258 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5247">Java | |
2259 | * Language Specification, §15.23</a> | |
2260 | * @see #EXPR | |
2261 | **/ | |
2262 | public static final int LAND = GeneratedJavaTokenTypes.LAND; | |
2263 | /** | |
2264 | * The <code>|</code> (bitwise OR) operator. | |
2265 | * | |
2266 | * @see <a | |
2267 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5233">Java | |
2268 | * Language Specification, §15.22.1</a> | |
2269 | * @see #EXPR | |
2270 | **/ | |
2271 | public static final int BOR = GeneratedJavaTokenTypes.BOR; | |
2272 | /** | |
2273 | * The <code>^</code> (bitwise exclusive OR) operator. | |
2274 | * | |
2275 | * @see <a | |
2276 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5233">Java | |
2277 | * Language Specification, §15.22.1</a> | |
2278 | * @see #EXPR | |
2279 | **/ | |
2280 | public static final int BXOR = GeneratedJavaTokenTypes.BXOR; | |
2281 | /** | |
2282 | * The <code>&</code> (bitwise AND) operator. | |
2283 | * | |
2284 | * @see <a | |
2285 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5233">Java | |
2286 | * Language Specification, §15.22.1</a> | |
2287 | * @see #EXPR | |
2288 | **/ | |
2289 | public static final int BAND = GeneratedJavaTokenTypes.BAND; | |
2290 | /** | |
2291 | * The <code>!=</code> (not equal) operator. | |
2292 | * | |
2293 | * @see #EXPR | |
2294 | **/ | |
2295 | public static final int NOT_EQUAL = GeneratedJavaTokenTypes.NOT_EQUAL; | |
2296 | /** | |
2297 | * The <code>==</code> (equal) operator. | |
2298 | * | |
2299 | * @see #EXPR | |
2300 | **/ | |
2301 | public static final int EQUAL = GeneratedJavaTokenTypes.EQUAL; | |
2302 | /** | |
2303 | * The <code><</code> (less than) operator. | |
2304 | * | |
2305 | * @see #EXPR | |
2306 | **/ | |
2307 | public static final int LT = GeneratedJavaTokenTypes.LT; | |
2308 | /** | |
2309 | * The <code>></code> (greater than) operator. | |
2310 | * | |
2311 | * @see #EXPR | |
2312 | **/ | |
2313 | public static final int GT = GeneratedJavaTokenTypes.GT; | |
2314 | /** | |
2315 | * The <code><=</code> (less than or equal) operator. | |
2316 | * | |
2317 | * @see #EXPR | |
2318 | **/ | |
2319 | public static final int LE = GeneratedJavaTokenTypes.LE; | |
2320 | /** | |
2321 | * The <code>>=</code> (greater than or equal) operator. | |
2322 | * | |
2323 | * @see #EXPR | |
2324 | **/ | |
2325 | public static final int GE = GeneratedJavaTokenTypes.GE; | |
2326 | /** | |
2327 | * The <code>instanceof</code> operator. The first child is an | |
2328 | * object reference or something that evaluates to an object | |
2329 | * reference. The second child is a reference type. | |
2330 | * | |
2331 | * @see <a | |
2332 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#80289">Java | |
2333 | * Language Specification, §15.20.2</a> | |
2334 | * @see #EXPR | |
2335 | * @see #METHOD_CALL | |
2336 | * @see #IDENT | |
2337 | * @see #DOT | |
2338 | * @see #TYPE | |
2339 | * @see FullIdent | |
2340 | **/ | |
2341 | public static final int LITERAL_INSTANCEOF = | |
2342 | GeneratedJavaTokenTypes.LITERAL_instanceof; | |
2343 | ||
2344 | /** | |
2345 | * The <code><<</code> (shift left) operator. | |
2346 | * | |
2347 | * @see <a | |
2348 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5121">Java | |
2349 | * Language Specification, §15.19</a> | |
2350 | * @see #EXPR | |
2351 | **/ | |
2352 | public static final int SL = GeneratedJavaTokenTypes.SL; | |
2353 | /** | |
2354 | * The <code>>></code> (signed shift right) operator. | |
2355 | * | |
2356 | * @see <a | |
2357 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5121">Java | |
2358 | * Language Specification, §15.19</a> | |
2359 | * @see #EXPR | |
2360 | **/ | |
2361 | public static final int SR = GeneratedJavaTokenTypes.SR; | |
2362 | /** | |
2363 | * The <code>>>></code> (unsigned shift right) operator. | |
2364 | * | |
2365 | * @see <a | |
2366 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5121">Java | |
2367 | * Language Specification, §15.19</a> | |
2368 | * @see #EXPR | |
2369 | **/ | |
2370 | public static final int BSR = GeneratedJavaTokenTypes.BSR; | |
2371 | /** | |
2372 | * The <code>+</code> (addition) operator. | |
2373 | * | |
2374 | * @see <a | |
2375 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#15746">Java | |
2376 | * Language Specification, §15.18</a> | |
2377 | * @see #EXPR | |
2378 | **/ | |
2379 | public static final int PLUS = GeneratedJavaTokenTypes.PLUS; | |
2380 | /** | |
2381 | * The <code>-</code> (subtraction) operator. | |
2382 | * | |
2383 | * @see <a | |
2384 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#15746">Java | |
2385 | * Language Specification, §15.18</a> | |
2386 | * @see #EXPR | |
2387 | **/ | |
2388 | public static final int MINUS = GeneratedJavaTokenTypes.MINUS; | |
2389 | /** | |
2390 | * The <code>/</code> (division) operator. | |
2391 | * | |
2392 | * @see <a | |
2393 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5047">Java | |
2394 | * Language Specification, §15.17.2</a> | |
2395 | * @see #EXPR | |
2396 | **/ | |
2397 | public static final int DIV = GeneratedJavaTokenTypes.DIV; | |
2398 | /** | |
2399 | * The <code>%</code> (remainder) operator. | |
2400 | * | |
2401 | * @see <a | |
2402 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#24956">Java | |
2403 | * Language Specification, §15.17.3</a> | |
2404 | * @see #EXPR | |
2405 | **/ | |
2406 | public static final int MOD = GeneratedJavaTokenTypes.MOD; | |
2407 | /** | |
2408 | * The <code>++</code> (prefix increment) operator. | |
2409 | * | |
2410 | * @see <a | |
2411 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#39547">Java | |
2412 | * Language Specification, §15.15.1</a> | |
2413 | * @see #EXPR | |
2414 | * @see #POST_INC | |
2415 | **/ | |
2416 | public static final int INC = GeneratedJavaTokenTypes.INC; | |
2417 | /** | |
2418 | * The <code>--</code> (prefix decrement) operator. | |
2419 | * | |
2420 | * @see <a | |
2421 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#239136">Java | |
2422 | * Language Specification, §15.15.2</a> | |
2423 | * @see #EXPR | |
2424 | * @see #POST_DEC | |
2425 | **/ | |
2426 | public static final int DEC = GeneratedJavaTokenTypes.DEC; | |
2427 | /** | |
2428 | * The <code>~</code> (bitwise complement) operator. | |
2429 | * | |
2430 | * @see <a | |
2431 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#5017">Java | |
2432 | * Language Specification, §15.15.5</a> | |
2433 | * @see #EXPR | |
2434 | **/ | |
2435 | public static final int BNOT = GeneratedJavaTokenTypes.BNOT; | |
2436 | /** | |
2437 | * The <code>!</code> (logical complement) operator. | |
2438 | * | |
2439 | * @see <a | |
2440 | * href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#13350">Java | |
2441 | * Language Specification, §15.15.6</a> | |
2442 | * @see #EXPR | |
2443 | **/ | |
2444 | public static final int LNOT = GeneratedJavaTokenTypes.LNOT; | |
2445 | /** | |
2446 | * The <code>true</code> keyword. | |
2447 | * | |
2448 | * @see <a | |
2449 | * href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#49652">Java | |
2450 | * Language Specification, §3.10.3</a> | |
2451 | * @see #EXPR | |
2452 | * @see #LITERAL_FALSE | |
2453 | **/ | |
2454 | public static final int LITERAL_TRUE = | |
2455 | GeneratedJavaTokenTypes.LITERAL_true; | |
2456 | ||
2457 | /** | |
2458 | * The <code>false</code> keyword. | |
2459 | * | |
2460 | * @see <a | |
2461 | * href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#49652">Java | |
2462 | * Language Specification, §3.10.3</a> | |
2463 | * @see #EXPR | |
2464 | * @see #LITERAL_TRUE | |
2465 | **/ | |
2466 | public static final int LITERAL_FALSE = | |
2467 | GeneratedJavaTokenTypes.LITERAL_false; | |
2468 | ||
2469 | /** | |
2470 | * The <code>null</code> keyword. | |
2471 | * | |
2472 | * @see <a | |
2473 | * href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#230717">Java | |
2474 | * Language Specification, §3.10.7</a> | |
2475 | * @see #EXPR | |
2476 | **/ | |
2477 | public static final int LITERAL_NULL = | |
2478 | GeneratedJavaTokenTypes.LITERAL_null; | |
2479 | ||
2480 | /** | |
2481 | * The <code>new</code> keyword. This element is used to define | |
2482 | * new instances of objects, new arrays, and new anonymous inner | |
2483 | * classes. | |
2484 | * | |
2485 | * <p>For example:</p> | |
2486 | * | |
2487 | * <pre> | |
2488 | * new ArrayList(50) | |
2489 | * </pre> | |
2490 | * | |
2491 | * <p>parses as:</p> | |
2492 | * <pre> | |
2493 | * +--LITERAL_NEW (new) | |
2494 | * | | |
2495 | * +--IDENT (ArrayList) | |
2496 | * +--LPAREN (() | |
2497 | * +--ELIST | |
2498 | * | | |
2499 | * +--EXPR | |
2500 | * | | |
2501 | * +--NUM_INT (50) | |
2502 | * +--RPAREN ()) | |
2503 | * </pre> | |
2504 | * | |
2505 | * <p>For example:</p> | |
2506 | * <pre> | |
2507 | * new float[] | |
2508 | * { | |
2509 | * 3.0f, | |
2510 | * 4.0f | |
2511 | * }; | |
2512 | * </pre> | |
2513 | * | |
2514 | * <p>parses as:</p> | |
2515 | * <pre> | |
2516 | * +--LITERAL_NEW (new) | |
2517 | * | | |
2518 | * +--LITERAL_FLOAT (float) | |
2519 | * +--ARRAY_DECLARATOR ([) | |
2520 | * +--ARRAY_INIT ({) | |
2521 | * | | |
2522 | * +--EXPR | |
2523 | * | | |
2524 | * +--NUM_FLOAT (3.0f) | |
2525 | * +--COMMA (,) | |
2526 | * +--EXPR | |
2527 | * | | |
2528 | * +--NUM_FLOAT (4.0f) | |
2529 | * +--RCURLY (}) | |
2530 | * </pre> | |
2531 | * | |
2532 | * <p>For example:</p> | |
2533 | * <pre> | |
2534 | * new FilenameFilter() | |
2535 | * { | |
2536 | * public boolean accept(File dir, String name) | |
2537 | * { | |
2538 | * return name.endsWith(".java"); | |
2539 | * } | |
2540 | * } | |
2541 | * </pre> | |
2542 | * | |
2543 | * <p>parses as:</p> | |
2544 | * <pre> | |
2545 | * +--LITERAL_NEW (new) | |
2546 | * | | |
2547 | * +--IDENT (FilenameFilter) | |
2548 | * +--LPAREN (() | |
2549 | * +--ELIST | |
2550 | * +--RPAREN ()) | |
2551 | * +--OBJBLOCK | |
2552 | * | | |
2553 | * +--LCURLY ({) | |
2554 | * +--METHOD_DEF | |
2555 | * | | |
2556 | * +--MODIFIERS | |
2557 | * | | |
2558 | * +--LITERAL_PUBLIC (public) | |
2559 | * +--TYPE | |
2560 | * | | |
2561 | * +--LITERAL_BOOLEAN (boolean) | |
2562 | * +--IDENT (accept) | |
2563 | * +--PARAMETERS | |
2564 | * | | |
2565 | * +--PARAMETER_DEF | |
2566 | * | | |
2567 | * +--MODIFIERS | |
2568 | * +--TYPE | |
2569 | * | | |
2570 | * +--IDENT (File) | |
2571 | * +--IDENT (dir) | |
2572 | * +--COMMA (,) | |
2573 | * +--PARAMETER_DEF | |
2574 | * | | |
2575 | * +--MODIFIERS | |
2576 | * +--TYPE | |
2577 | * | | |
2578 | * +--IDENT (String) | |
2579 | * +--IDENT (name) | |
2580 | * +--SLIST ({) | |
2581 | * | | |
2582 | * +--LITERAL_RETURN (return) | |
2583 | * | | |
2584 | * +--EXPR | |
2585 | * | | |
2586 | * +--METHOD_CALL (() | |
2587 | * | | |
2588 | * +--DOT (.) | |
2589 | * | | |
2590 | * +--IDENT (name) | |
2591 | * +--IDENT (endsWith) | |
2592 | * +--ELIST | |
2593 | * | | |
2594 | * +--EXPR | |
2595 | * | | |
2596 | * +--STRING_LITERAL (".java") | |
2597 | * +--RPAREN ()) | |
2598 | * +--SEMI (;) | |
2599 | * +--RCURLY (}) | |
2600 | * +--RCURLY (}) | |
2601 | * </pre> | |
2602 | * | |
2603 | * @see #IDENT | |
2604 | * @see #DOT | |
2605 | * @see #LPAREN | |
2606 | * @see #ELIST | |
2607 | * @see #RPAREN | |
2608 | * @see #OBJBLOCK | |
2609 | * @see #ARRAY_INIT | |
2610 | * @see FullIdent | |
2611 | **/ | |
2612 | public static final int LITERAL_NEW = GeneratedJavaTokenTypes.LITERAL_new; | |
2613 | /** | |
2614 | * An integer literal. These may be specified in decimal, | |
2615 | * hexadecimal, or octal form. | |
2616 | * | |
2617 | * @see <a | |
2618 | * href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#48282">Java | |
2619 | * Language Specification, §3.10.1</a> | |
2620 | * @see #EXPR | |
2621 | * @see #NUM_LONG | |
2622 | **/ | |
2623 | public static final int NUM_INT = GeneratedJavaTokenTypes.NUM_INT; | |
2624 | /** | |
2625 | * A character literal. This is a (possibly escaped) character | |
2626 | * enclosed in single quotes. | |
2627 | * | |
2628 | * @see <a | |
2629 | * href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#100960">Java | |
2630 | * Language Specification, §3.10.4</a> | |
2631 | * @see #EXPR | |
2632 | **/ | |
2633 | public static final int CHAR_LITERAL = | |
2634 | GeneratedJavaTokenTypes.CHAR_LITERAL; | |
2635 | ||
2636 | /** | |
2637 | * A string literal. This is a sequence of (possibly escaped) | |
2638 | * characters enclosed in double quotes. | |
2639 | * | |
2640 | * @see <a | |
2641 | * href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#101084">Java | |
2642 | * Language Specification, §3.10.5</a> | |
2643 | * @see #EXPR | |
2644 | **/ | |
2645 | public static final int STRING_LITERAL = | |
2646 | GeneratedJavaTokenTypes.STRING_LITERAL; | |
2647 | ||
2648 | /** | |
2649 | * A single precision floating point literal. This is a floating | |
2650 | * point number with an <code>F</code> or <code>f</code> suffix. | |
2651 | * | |
2652 | * @see <a | |
2653 | * href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#230798">Java | |
2654 | * Language Specification, §3.10.2</a> | |
2655 | * @see #EXPR | |
2656 | * @see #NUM_DOUBLE | |
2657 | **/ | |
2658 | public static final int NUM_FLOAT = GeneratedJavaTokenTypes.NUM_FLOAT; | |
2659 | /** | |
2660 | * A long integer literal. These are almost the same as integer | |
2661 | * literals, but they have an <code>L</code> or <code>l</code> | |
2662 | * (ell) suffix. | |
2663 | * | |
2664 | * @see <a | |
2665 | * href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#48282">Java | |
2666 | * Language Specification, §3.10.1</a> | |
2667 | * @see #EXPR | |
2668 | * @see #NUM_INT | |
2669 | **/ | |
2670 | public static final int NUM_LONG = GeneratedJavaTokenTypes.NUM_LONG; | |
2671 | /** | |
2672 | * A double precision floating point literal. This is a floating | |
2673 | * point number with an optional <code>D</code> or <code>d</code> | |
2674 | * suffix. | |
2675 | * | |
2676 | * @see <a | |
2677 | * href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#230798">Java | |
2678 | * Language Specification, §3.10.2</a> | |
2679 | * @see #EXPR | |
2680 | * @see #NUM_FLOAT | |
2681 | **/ | |
2682 | public static final int NUM_DOUBLE = GeneratedJavaTokenTypes.NUM_DOUBLE; | |
2683 | /* * | |
2684 | * This token does not appear in the tree. | |
2685 | * | |
2686 | * @see <a | |
2687 | * href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#95710">Java | |
2688 | * Language Specification, §3.6</a> | |
2689 | * @see FileContents | |
2690 | **/ | |
2691 | //public static final int WS = GeneratedJavaTokenTypes.WS; | |
2692 | /* * | |
2693 | * This token does not appear in the tree. | |
2694 | * | |
2695 | * @see <a | |
2696 | * href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#48125">Java | |
2697 | * Language Specification, §3.7</a> | |
2698 | * @see FileContents | |
2699 | **/ | |
2700 | //public static final int SL_COMMENT = GeneratedJavaTokenTypes.SL_COMMENT; | |
2701 | /* * | |
2702 | * This token does not appear in the tree. | |
2703 | * | |
2704 | * @see <a | |
2705 | * href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#48125">Java | |
2706 | * Language Specification, §3.7</a> | |
2707 | * @see FileContents | |
2708 | **/ | |
2709 | //public static final int ML_COMMENT = GeneratedJavaTokenTypes.ML_COMMENT; | |
2710 | /* * | |
2711 | * This token does not appear in the tree. | |
2712 | * | |
2713 | * @see <a | |
2714 | * href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#101089">Java | |
2715 | * Language Specification, §3.10.6</a> | |
2716 | * @see #CHAR_LITERAL | |
2717 | * @see #STRING_LITERAL | |
2718 | **/ | |
2719 | //public static final int ESC = GeneratedJavaTokenTypes.ESC; | |
2720 | /* * | |
2721 | * This token does not appear in the tree. | |
2722 | * | |
2723 | * @see #NUM_INT | |
2724 | * @see #NUM_LONG | |
2725 | **/ | |
2726 | //public static final int HEX_DIGIT = GeneratedJavaTokenTypes.HEX_DIGIT; | |
2727 | /* * | |
2728 | * This token does not appear in the tree. | |
2729 | * | |
2730 | * @see #NUM_FLOAT | |
2731 | * @see #NUM_DOUBLE | |
2732 | **/ | |
2733 | //public static final int EXPONENT = GeneratedJavaTokenTypes.EXPONENT; | |
2734 | /* * | |
2735 | * This token does not appear in the tree. | |
2736 | * | |
2737 | * @see #NUM_FLOAT | |
2738 | * @see #NUM_DOUBLE | |
2739 | **/ | |
2740 | // public static final int FLOAT_SUFFIX = | |
2741 | // GeneratedJavaTokenTypes.FLOAT_SUFFIX; | |
2742 | ||
2743 | /** | |
2744 | * The <code>assert</code> keyword. This is only for Java 1.4 and | |
2745 | * later. | |
2746 | * | |
2747 | * <p>For example:</p> | |
2748 | * <pre> | |
2749 | * assert(x==4); | |
2750 | * </pre> | |
2751 | * <p>parses as:</p> | |
2752 | * <pre> | |
2753 | * +--LITERAL_ASSERT (assert) | |
2754 | * | | |
2755 | * +--EXPR | |
2756 | * | | |
2757 | * +--LPAREN (() | |
2758 | * +--EQUAL (==) | |
2759 | * | | |
2760 | * +--IDENT (x) | |
2761 | * +--NUM_INT (4) | |
2762 | * +--RPAREN ()) | |
2763 | * +--SEMI (;) | |
2764 | * </pre> | |
2765 | **/ | |
2766 | public static final int LITERAL_ASSERT = GeneratedJavaTokenTypes.ASSERT; | |
2767 | ||
2768 | /** | |
2769 | * A static import declaration. Static import declarations are optional, | |
2770 | * but must appear after the package declaration and before the type | |
2771 | * declaration. | |
2772 | * | |
2773 | * <p>For example:</p> | |
2774 | * | |
2775 | * <pre> | |
2776 | * import static java.io.IOException; | |
2777 | * </pre> | |
2778 | * | |
2779 | * <p>parses as:</p> | |
2780 | * | |
2781 | * <pre> | |
2782 | * +--STATIC_IMPORT (import) | |
2783 | * | | |
2784 | * +--LITERAL_STATIC | |
2785 | * +--DOT (.) | |
2786 | * | | |
2787 | * +--DOT (.) | |
2788 | * | | |
2789 | * +--IDENT (java) | |
2790 | * +--IDENT (io) | |
2791 | * +--IDENT (IOException) | |
2792 | * +--SEMI (;) | |
2793 | * </pre> | |
2794 | * | |
2795 | * @see <a href="http://www.jcp.org/en/jsr/detail?id=201"> | |
2796 | * JSR201</a> | |
2797 | * @see #LITERAL_STATIC | |
2798 | * @see #DOT | |
2799 | * @see #IDENT | |
2800 | * @see #STAR | |
2801 | * @see #SEMI | |
2802 | * @see FullIdent | |
2803 | **/ | |
2804 | public static final int STATIC_IMPORT = | |
2805 | GeneratedJavaTokenTypes.STATIC_IMPORT; | |
2806 | ||
2807 | /** | |
2808 | * An enum declaration. Its notable children are | |
2809 | * enum constant declarations followed by | |
2810 | * any construct that may be expected in a class body. | |
2811 | * | |
2812 | * <p>For example:</p> | |
2813 | * <pre> | |
2814 | * public enum MyEnum | |
2815 | * implements Serializable | |
2816 | * { | |
2817 | * FIRST_CONSTANT, | |
2818 | * SECOND_CONSTANT; | |
2819 | * | |
2820 | * public void someMethod() | |
2821 | * { | |
2822 | * } | |
2823 | * } | |
2824 | * </pre> | |
2825 | * <p>parses as:</p> | |
2826 | * <pre> | |
2827 | * +--ENUM_DEF | |
2828 | * | | |
2829 | * +--MODIFIERS | |
2830 | * | | |
2831 | * +--LITERAL_PUBLIC (public) | |
2832 | * +--ENUM (enum) | |
2833 | * +--IDENT (MyEnum) | |
2834 | * +--EXTENDS_CLAUSE | |
2835 | * +--IMPLEMENTS_CLAUSE | |
2836 | * | | |
2837 | * +--IDENT (Serializable) | |
2838 | * +--OBJBLOCK | |
2839 | * | | |
2840 | * +--LCURLY ({) | |
2841 | * +--ENUM_CONSTANT_DEF | |
2842 | * | | |
2843 | * +--IDENT (FIRST_CONSTANT) | |
2844 | * +--COMMA (,) | |
2845 | * +--ENUM_CONSTANT_DEF | |
2846 | * | | |
2847 | * +--IDENT (SECOND_CONSTANT) | |
2848 | * +--SEMI (;) | |
2849 | * +--METHOD_DEF | |
2850 | * | | |
2851 | * +--MODIFIERS | |
2852 | * | | |
2853 | * +--LITERAL_PUBLIC (public) | |
2854 | * +--TYPE | |
2855 | * | | |
2856 | * +--LITERAL_void (void) | |
2857 | * +--IDENT (someMethod) | |
2858 | * +--LPAREN (() | |
2859 | * +--PARAMETERS | |
2860 | * +--RPAREN ()) | |
2861 | * +--SLIST ({) | |
2862 | * | | |
2863 | * +--RCURLY (}) | |
2864 | * +--RCURLY (}) | |
2865 | * </pre> | |
2866 | * | |
2867 | * @see <a href="http://www.jcp.org/en/jsr/detail?id=201"> | |
2868 | * JSR201</a> | |
2869 | * @see #MODIFIERS | |
2870 | * @see #ENUM | |
2871 | * @see #IDENT | |
2872 | * @see #EXTENDS_CLAUSE | |
2873 | * @see #IMPLEMENTS_CLAUSE | |
2874 | * @see #OBJBLOCK | |
2875 | * @see #LITERAL_NEW | |
2876 | * @see #ENUM_CONSTANT_DEF | |
2877 | **/ | |
2878 | public static final int ENUM_DEF = | |
2879 | GeneratedJavaTokenTypes.ENUM_DEF; | |
2880 | ||
2881 | /** | |
2882 | * The <code>enum</code> keyword. This element appears | |
2883 | * as part of an enum declaration. | |
2884 | **/ | |
2885 | public static final int ENUM = | |
2886 | GeneratedJavaTokenTypes.ENUM; | |
2887 | ||
2888 | /** | |
2889 | * An enum constant declaration. Its notable children are annotations, | |
2890 | * arguments and object block akin to an annonymous | |
2891 | * inner class' body. | |
2892 | * | |
2893 | * <p>For example:</p> | |
2894 | * <pre> | |
2895 | * SOME_CONSTANT(1) | |
2896 | * { | |
2897 | * public void someMethodOverridenFromMainBody() | |
2898 | * { | |
2899 | * } | |
2900 | * } | |
2901 | * </pre> | |
2902 | * <p>parses as:</p> | |
2903 | * <pre> | |
2904 | * +--ENUM_CONSTANT_DEF | |
2905 | * | | |
2906 | * +--ANNOTATIONS | |
2907 | * +--IDENT (SOME_CONSTANT) | |
2908 | * +--LPAREN (() | |
2909 | * +--ELIST | |
2910 | * | | |
2911 | * +--EXPR | |
2912 | * | | |
2913 | * +--NUM_INT (1) | |
2914 | * +--RPAREN ()) | |
2915 | * +--OBJBLOCK | |
2916 | * | | |
2917 | * +--LCURLY ({) | |
2918 | * | | |
2919 | * +--METHOD_DEF | |
2920 | * | | |
2921 | * +--MODIFIERS | |
2922 | * | | |
2923 | * +--LITERAL_PUBLIC (public) | |
2924 | * +--TYPE | |
2925 | * | | |
2926 | * +--LITERAL_void (void) | |
2927 | * +--IDENT (someMethodOverridenFromMainBody) | |
2928 | * +--LPAREN (() | |
2929 | * +--PARAMETERS | |
2930 | * +--RPAREN ()) | |
2931 | * +--SLIST ({) | |
2932 | * | | |
2933 | * +--RCURLY (}) | |
2934 | * +--RCURLY (}) | |
2935 | * </pre> | |
2936 | * | |
2937 | * @see <a href="http://www.jcp.org/en/jsr/detail?id=201"> | |
2938 | * JSR201</a> | |
2939 | * @see #ANNOTATIONS | |
2940 | * @see #MODIFIERS | |
2941 | * @see #IDENT | |
2942 | * @see #ELIST | |
2943 | * @see #OBJBLOCK | |
2944 | **/ | |
2945 | public static final int ENUM_CONSTANT_DEF = | |
2946 | GeneratedJavaTokenTypes.ENUM_CONSTANT_DEF; | |
2947 | ||
2948 | /** | |
2949 | * A for-each clause. This is a child of | |
2950 | * <code>LITERAL_FOR</code>. The children of this element may be | |
2951 | * a parameter definition, the colon literal and an expression. | |
2952 | * | |
2953 | * @see #VARIABLE_DEF | |
2954 | * @see #ELIST | |
2955 | * @see #LITERAL_FOR | |
2956 | **/ | |
2957 | public static final int FOR_EACH_CLAUSE = | |
2958 | GeneratedJavaTokenTypes.FOR_EACH_CLAUSE; | |
2959 | ||
2960 | /** | |
2961 | * An annotation declaration. The notable children are the name of the | |
2962 | * annotation type, annotation field declarations and (constant) fields. | |
2963 | * | |
2964 | * <p>For example:</p> | |
2965 | * <pre> | |
2966 | * public @interface MyAnnotation | |
2967 | * { | |
2968 | * int someValue(); | |
2969 | * } | |
2970 | * </pre> | |
2971 | * <p>parses as:</p> | |
2972 | * <pre> | |
2973 | * +--ANNOTATION_DEF | |
2974 | * | | |
2975 | * +--MODIFIERS | |
2976 | * | | |
2977 | * +--LITERAL_PUBLIC (public) | |
2978 | * +--AT (@) | |
2979 | * +--LITERAL_INTERFACE (interface) | |
2980 | * +--IDENT (MyAnnotation) | |
2981 | * +--OBJBLOCK | |
2982 | * | | |
2983 | * +--LCURLY ({) | |
2984 | * +--ANNOTATION_FIELD_DEF | |
2985 | * | | |
2986 | * +--MODIFIERS | |
2987 | * +--TYPE | |
2988 | * | | |
2989 | * +--LITERAL_INT (int) | |
2990 | * +--IDENT (someValue) | |
2991 | * +--LPAREN (() | |
2992 | * +--RPAREN ()) | |
2993 | * +--SEMI (;) | |
2994 | * +--RCURLY (}) | |
2995 | * </pre> | |
2996 | * | |
2997 | * @see <a href="http://www.jcp.org/en/jsr/detail?id=201"> | |
2998 | * JSR201</a> | |
2999 | * @see #MODIFIERS | |
3000 | * @see #LITERAL_INTERFACE | |
3001 | * @see #IDENT | |
3002 | * @see #OBJBLOCK | |
3003 | * @see #ANNOTATION_FIELD_DEF | |
3004 | **/ | |
3005 | public static final int ANNOTATION_DEF = | |
3006 | GeneratedJavaTokenTypes.ANNOTATION_DEF; | |
3007 | ||
3008 | ||
3009 | /** | |
3010 | * An annotation field declaration. The notable children are modifiers, | |
3011 | * field type, field name and an optional default value (a conditional | |
3012 | * compile-time constant expression). Default values may also by | |
3013 | * annotations. | |
3014 | * | |
3015 | * <p>For example:</p> | |
3016 | * | |
3017 | * <pre> | |
3018 | * String someField() default "Hello world"; | |
3019 | * </pre> | |
3020 | * | |
3021 | * <p>parses as:</p> | |
3022 | * | |
3023 | * <pre> | |
3024 | * +--ANNOTATION_FIELD_DEF | |
3025 | * | | |
3026 | * +--MODIFIERS | |
3027 | * +--TYPE | |
3028 | * | | |
3029 | * +--IDENT (String) | |
3030 | * +--IDENT (someField) | |
3031 | * +--LPAREN (() | |
3032 | * +--RPAREN ()) | |
3033 | * +--LITERAL_DEFAULT (default) | |
3034 | * +--STRING_LITERAL ("Hello world") | |
3035 | * +--SEMI (;) | |
3036 | * </pre> | |
3037 | * | |
3038 | * @see <a href="http://www.jcp.org/en/jsr/detail?id=201"> | |
3039 | * JSR201</a> | |
3040 | * @see #MODIFIERS | |
3041 | * @see #TYPE | |
3042 | * @see #LITERAL_DEFAULT | |
3043 | */ | |
3044 | public static final int ANNOTATION_FIELD_DEF = | |
3045 | GeneratedJavaTokenTypes.ANNOTATION_FIELD_DEF; | |
3046 | ||
3047 | // note: @ is the html escape for '@', | |
3048 | // used here to avoid confusing the javadoc tool | |
3049 | /** | |
3050 | * A collection of annotations on a package or enum constant. | |
3051 | * A collections of annotations will only occur on these nodes | |
3052 | * as all other nodes that may be qualified with an annotation can | |
3053 | * be qualified with any other modifier and hence these annotations | |
3054 | * would be contained in a {@link #MODIFIERS} node. | |
3055 | * | |
3056 | * <p>For example:</p> | |
3057 | * | |
3058 | * <pre> | |
3059 | * @MyAnnotation package blah; | |
3060 | * </pre> | |
3061 | * | |
3062 | * <p>parses as:</p> | |
3063 | * | |
3064 | * <pre> | |
3065 | * +--PACKAGE_DEF (package) | |
3066 | * | | |
3067 | * +--ANNOTATIONS | |
3068 | * | | |
3069 | * +--ANNOTATION | |
3070 | * | | |
3071 | * +--AT (@) | |
3072 | * +--IDENT (MyAnnotation) | |
3073 | * +--IDENT (blah) | |
3074 | * +--SEMI (;) | |
3075 | * </pre> | |
3076 | * | |
3077 | * @see <a href="http://www.jcp.org/en/jsr/detail?id=201"> | |
3078 | * JSR201</a> | |
3079 | * @see #ANNOTATION | |
3080 | * @see #AT | |
3081 | * @see #IDENT | |
3082 | */ | |
3083 | public static final int ANNOTATIONS = | |
3084 | GeneratedJavaTokenTypes.ANNOTATIONS; | |
3085 | ||
3086 | // note: @ is the html escape for '@', | |
3087 | // used here to avoid confusing the javadoc tool | |
3088 | /** | |
3089 | * An annotation of a package, type, field, parameter or variable. | |
3090 | * An annotation may occur anywhere modifiers occur (it is a | |
3091 | * type of modifier) and may also occur prior to a package definition. | |
3092 | * The notable children are: The annotation name and either a single | |
3093 | * default annotation value or a sequence of name value pairs. | |
3094 | * Annotation values may also be annotations themselves. | |
3095 | * | |
3096 | * <p>For example:</p> | |
3097 | * | |
3098 | * <pre> | |
3099 | * @MyAnnotation(someField1 = "Hello", | |
3100 | * someField2 = @SomeOtherAnnotation) | |
3101 | * </pre> | |
3102 | * | |
3103 | * <p>parses as:</p> | |
3104 | * | |
3105 | * <pre> | |
3106 | * +--ANNOTATION | |
3107 | * | | |
3108 | * +--AT (@) | |
3109 | * +--IDENT (MyAnnotation) | |
3110 | * +--LPAREN (() | |
3111 | * +--ANNOTATION_MEMBER_VALUE_PAIR | |
3112 | * | | |
3113 | * +--IDENT (someField1) | |
3114 | * +--ASSIGN (=) | |
3115 | * +--ANNOTATION | |
3116 | * | | |
3117 | * +--AT (@) | |
3118 | * +--IDENT (SomeOtherAnnotation) | |
3119 | * +--ANNOTATION_MEMBER_VALUE_PAIR | |
3120 | * | | |
3121 | * +--IDENT (someField2) | |
3122 | * +--ASSIGN (=) | |
3123 | * +--STRING_LITERAL ("Hello") | |
3124 | * +--RPAREN ()) | |
3125 | * </pre> | |
3126 | * | |
3127 | * @see <a href="http://www.jcp.org/en/jsr/detail?id=201"> | |
3128 | * JSR201</a> | |
3129 | * @see #MODIFIERS | |
3130 | * @see #IDENT | |
3131 | * @see #ANNOTATION_MEMBER_VALUE_PAIR | |
3132 | */ | |
3133 | public static final int ANNOTATION = | |
3134 | GeneratedJavaTokenTypes.ANNOTATION; | |
3135 | ||
3136 | /** | |
3137 | * An initialisation of an annotation member with a value. | |
3138 | * Its children are the name of the member, the assignment literal | |
3139 | * and the (compile-time constant conditional expression) value. | |
3140 | * | |
3141 | * @see <a href="http://www.jcp.org/en/jsr/detail?id=201"> | |
3142 | * JSR201</a> | |
3143 | * @see #ANNOTATION | |
3144 | * @see #IDENT | |
3145 | */ | |
3146 | public static final int ANNOTATION_MEMBER_VALUE_PAIR = | |
3147 | GeneratedJavaTokenTypes.ANNOTATION_MEMBER_VALUE_PAIR; | |
3148 | ||
3149 | /** | |
3150 | * An annotation array member initialisation. | |
3151 | * Initializers can not be nested. | |
3152 | * Am initializer may be present as a default to a annotation | |
3153 | * member, as the single default value to an annotation | |
3154 | * (e.g. @Annotation({1,2})) or as the value of an annotation | |
3155 | * member value pair. | |
3156 | * | |
3157 | * <p>For example:</p> | |
3158 | * | |
3159 | * <pre> | |
3160 | * { 1, 2 } | |
3161 | * </pre> | |
3162 | * | |
3163 | * <p>parses as:</p> | |
3164 | * | |
3165 | * <pre> | |
3166 | * +--ANNOTATION_ARRAY_INIT ({) | |
3167 | * | | |
3168 | * +--NUM_INT (1) | |
3169 | * +--COMMA (,) | |
3170 | * +--NUM_INT (2) | |
3171 | * +--RCURLY (}) | |
3172 | * </pre> | |
3173 | * | |
3174 | * @see <a href="http://www.jcp.org/en/jsr/detail?id=201"> | |
3175 | * JSR201</a> | |
3176 | * @see #ANNOTATION | |
3177 | * @see #IDENT | |
3178 | * @see #ANNOTATION_MEMBER_VALUE_PAIR | |
3179 | */ | |
3180 | public static final int ANNOTATION_ARRAY_INIT = | |
3181 | GeneratedJavaTokenTypes.ANNOTATION_ARRAY_INIT; | |
3182 | ||
3183 | /** | |
3184 | * A list of type parameters to a class, interface or | |
3185 | * method definition. Children are LT, at least one | |
3186 | * TYPE_PARAMETER, zero or more of: a COMMAs followed by a single | |
3187 | * TYPE_PARAMETER and a final GT. | |
3188 | * | |
3189 | * <p>For example:</p> | |
3190 | * | |
3191 | * <pre> | |
3192 | * public class Blah<A, B> | |
3193 | * { | |
3194 | * } | |
3195 | * </pre> | |
3196 | * | |
3197 | * <p>parses as:</p> | |
3198 | * | |
3199 | * <pre> | |
3200 | * +--CLASS_DEF ({) | |
3201 | * | | |
3202 | * +--MODIFIERS | |
3203 | * | | |
3204 | * +--LITERAL_PUBLIC (public) | |
3205 | * +--LITERAL_CLASS (class) | |
3206 | * +--IDENT (Blah) | |
3207 | * +--TYPE_PARAMETERS | |
3208 | * | | |
3209 | * +--GENERIC_START (<) | |
3210 | * +--TYPE_PARAMETER | |
3211 | * | | |
3212 | * +--IDENT (A) | |
3213 | * +--COMMA (,) | |
3214 | * +--TYPE_PARAMETER | |
3215 | * | | |
3216 | * +--IDENT (B) | |
3217 | * +--GENERIC_END (>) | |
3218 | * +--OBJBLOCK | |
3219 | * | | |
3220 | * +--LCURLY ({) | |
3221 | * +--NUM_INT (1) | |
3222 | * +--COMMA (,) | |
3223 | * +--NUM_INT (2) | |
3224 | * +--RCURLY (}) | |
3225 | * </pre> | |
3226 | * | |
3227 | * @see <a href="http://www.jcp.org/en/jsr/detail?id=14"> | |
3228 | * JSR14</a> | |
3229 | * @see #GENERIC_START | |
3230 | * @see #GENERIC_END | |
3231 | * @see #TYPE_PARAMETER | |
3232 | * @see #COMMA | |
3233 | */ | |
3234 | public static final int TYPE_PARAMETERS = | |
3235 | GeneratedJavaTokenTypes.TYPE_PARAMETERS; | |
3236 | ||
3237 | /** | |
3238 | * A type parameter to a class, interface or method definition. | |
3239 | * Children are the type name and an optional TYPE_UPPER_BOUNDS. | |
3240 | * | |
3241 | * <p>For example:</p> | |
3242 | * | |
3243 | * <pre> | |
3244 | * A extends Collection | |
3245 | * </pre> | |
3246 | * | |
3247 | * <p>parses as:</p> | |
3248 | * | |
3249 | * <pre> | |
3250 | * +--TYPE_PARAMETER | |
3251 | * | | |
3252 | * +--IDENT (A) | |
3253 | * +--TYPE_UPPER_BOUNDS | |
3254 | * | | |
3255 | * +--IDENT (Collection) | |
3256 | * </pre> | |
3257 | * | |
3258 | * @see <a href="http://www.jcp.org/en/jsr/detail?id=14"> | |
3259 | * JSR14</a> | |
3260 | * @see #IDENT | |
3261 | * @see #WILDCARD_TYPE | |
3262 | * @see #TYPE_UPPER_BOUNDS | |
3263 | */ | |
3264 | public static final int TYPE_PARAMETER = | |
3265 | GeneratedJavaTokenTypes.TYPE_PARAMETER; | |
3266 | ||
3267 | /** | |
3268 | * A list of type arguments to a type reference or | |
3269 | * a method/ctor invocation. Children are GENERIC_START, at least one | |
3270 | * TYPE_ARGUMENT, zero or more of a COMMAs followed by a single | |
3271 | * TYPE_ARGUMENT, and a final GENERIC_END. | |
3272 | * | |
3273 | * <p>For example:</p> | |
3274 | * | |
3275 | * <pre> | |
3276 | * public Collection<?> a; | |
3277 | * </pre> | |
3278 | * | |
3279 | * <p>parses as:</p> | |
3280 | * | |
3281 | * <pre> | |
3282 | * +--VARIABLE_DEF | |
3283 | * | | |
3284 | * +--MODIFIERS | |
3285 | * | | |
3286 | * +--LITERAL_PUBLIC (public) | |
3287 | * +--TYPE | |
3288 | * | | |
3289 | * +--IDENT (Collection) | |
3290 | * | | |
3291 | * +--TYPE_ARGUMENTS | |
3292 | * | | |
3293 | * +--GENERIC_START (<) | |
3294 | * +--TYPE_ARGUMENT | |
3295 | * | | |
3296 | * +--WILDCARD_TYPE (?) | |
3297 | * +--GENERIC_END (>) | |
3298 | * +--IDENT (a) | |
3299 | * +--SEMI (;) | |
3300 | * </pre> | |
3301 | * | |
3302 | * @see #GENERIC_START | |
3303 | * @see #GENERIC_END | |
3304 | * @see #TYPE_ARGUMENT | |
3305 | * @see #COMMA | |
3306 | */ | |
3307 | public static final int TYPE_ARGUMENTS = | |
3308 | GeneratedJavaTokenTypes.TYPE_ARGUMENTS; | |
3309 | ||
3310 | /** | |
3311 | * A type arguments to a type reference or a method/ctor invocation. | |
3312 | * Children are either: type name or wildcard type with possible type | |
3313 | * upper or lower bounds. | |
3314 | * | |
3315 | * <p>For example:</p> | |
3316 | * | |
3317 | * <pre> | |
3318 | * ? super List | |
3319 | * </pre> | |
3320 | * | |
3321 | * <p>parses as:</p> | |
3322 | * | |
3323 | * <pre> | |
3324 | * +--TYPE_ARGUMENT | |
3325 | * | | |
3326 | * +--WILDCARD_TYPE (?) | |
3327 | * +--TYPE_LOWER_BOUNDS | |
3328 | * | | |
3329 | * +--IDENT (List) | |
3330 | * </pre> | |
3331 | * | |
3332 | * @see <a href="http://www.jcp.org/en/jsr/detail?id=14"> | |
3333 | * JSR14</a> | |
3334 | * @see #WILDCARD_TYPE | |
3335 | * @see #TYPE_UPPER_BOUNDS | |
3336 | * @see #TYPE_LOWER_BOUNDS | |
3337 | */ | |
3338 | public static final int TYPE_ARGUMENT = | |
3339 | GeneratedJavaTokenTypes.TYPE_ARGUMENT; | |
3340 | ||
3341 | /** | |
3342 | * The type that refers to all types. This node has no children. | |
3343 | * | |
3344 | * @see <a href="http://www.jcp.org/en/jsr/detail?id=14"> | |
3345 | * JSR14</a> | |
3346 | * @see #TYPE_ARGUMENT | |
3347 | * @see #TYPE_UPPER_BOUNDS | |
3348 | * @see #TYPE_LOWER_BOUNDS | |
3349 | */ | |
3350 | public static final int WILDCARD_TYPE = | |
3351 | GeneratedJavaTokenTypes.WILDCARD_TYPE; | |
3352 | ||
3353 | /** | |
3354 | * An upper bounds on a wildcard type argument or type parameter. | |
3355 | * This node has one child - the type that is being used for | |
3356 | * the bounding. | |
3357 | * | |
3358 | * @see <a href="http://www.jcp.org/en/jsr/detail?id=14"> | |
3359 | * JSR14</a> | |
3360 | * @see #TYPE_PARAMETER | |
3361 | * @see #TYPE_ARGUMENT | |
3362 | * @see #WILDCARD_TYPE | |
3363 | */ | |
3364 | public static final int TYPE_UPPER_BOUNDS = | |
3365 | GeneratedJavaTokenTypes.TYPE_UPPER_BOUNDS; | |
3366 | ||
3367 | /** | |
3368 | * A lower bounds on a wildcard type argument. This node has one child | |
3369 | * - the type that is being used for the bounding. | |
3370 | * | |
3371 | * @see <a href="http://www.jcp.org/en/jsr/detail?id=14"> | |
3372 | * JSR14</a> | |
3373 | * @see #TYPE_ARGUMENT | |
3374 | * @see #WILDCARD_TYPE | |
3375 | */ | |
3376 | public static final int TYPE_LOWER_BOUNDS = | |
3377 | GeneratedJavaTokenTypes.TYPE_LOWER_BOUNDS; | |
3378 | ||
3379 | /** | |
3380 | * An 'at' symbol - signifying an annotation instance or the prefix | |
3381 | * to the interface literal signifying the definition of an annotation | |
3382 | * declaration. | |
3383 | * | |
3384 | * @see <a href="http://www.jcp.org/en/jsr/detail?id=201"> | |
3385 | * JSR201</a> | |
3386 | */ | |
3387 | public static final int AT = GeneratedJavaTokenTypes.AT; | |
3388 | ||
3389 | /** | |
3390 | * A triple dot for variable-length parameters. This token only ever occurs | |
3391 | * in a parameter declaration immediately after the type of the parameter. | |
3392 | * | |
3393 | * @see <a href="http://www.jcp.org/en/jsr/detail?id=201"> | |
3394 | * JSR201</a> | |
3395 | */ | |
3396 | public static final int ELLIPSIS = GeneratedJavaTokenTypes.ELLIPSIS; | |
3397 | ||
3398 | /** | |
3399 | * '&' symbol when used in a generic upper or lower bounds constrain | |
3400 | * e.g. Comparable<? extends Serializable, CharSequence>. | |
3401 | */ | |
3402 | public static final int TYPE_EXTENSION_AND = | |
3403 | GeneratedJavaTokenTypes.TYPE_EXTENSION_AND; | |
3404 | ||
3405 | /** | |
3406 | * '<' symbol signifying the start of type arguments or type parameters. | |
3407 | */ | |
3408 | public static final int GENERIC_START = | |
3409 | GeneratedJavaTokenTypes.GENERIC_START; | |
3410 | ||
3411 | /** | |
3412 | * '>' symbol signifying the end of type arguments or type parameters. | |
3413 | */ | |
3414 | public static final int GENERIC_END = GeneratedJavaTokenTypes.GENERIC_END; | |
3415 | ||
3416 | //////////////////////////////////////////////////////////////////////// | |
3417 | // The interesting code goes here | |
3418 | //////////////////////////////////////////////////////////////////////// | |
3419 | ||
3420 | /** maps from a token name to value */ | |
3421 | private static final ImmutableMap<String, Integer> TOKEN_NAME_TO_VALUE; | |
3422 | /** maps from a token value to name */ | |
3423 | private static final String[] TOKEN_VALUE_TO_NAME; | |
3424 | ||
3425 | // initialise the constants | |
3426 | static { | |
3427 | 1 | final ImmutableMap.Builder<String, Integer> builder = |
3428 | ImmutableMap.builder(); | |
3429 | 1 | final Field[] fields = TokenTypes.class.getDeclaredFields(); |
3430 | 1 | String[] tempTokenValueToName = new String[0]; |
3431 | 165 | for (final Field f : fields) { |
3432 | // Only process the int declarations. | |
3433 | 164 | if (f.getType() != Integer.TYPE) { |
3434 | 2 | continue; |
3435 | } | |
3436 | ||
3437 | 162 | final String name = f.getName(); |
3438 | try { | |
3439 | 162 | final int tokenValue = f.getInt(name); |
3440 | 162 | builder.put(name, tokenValue); |
3441 | 162 | if (tokenValue > tempTokenValueToName.length - 1) { |
3442 | 80 | final String[] temp = new String[tokenValue + 1]; |
3443 | 80 | System.arraycopy(tempTokenValueToName, 0, |
3444 | temp, 0, tempTokenValueToName.length); | |
3445 | 80 | tempTokenValueToName = temp; |
3446 | } | |
3447 | 162 | tempTokenValueToName[tokenValue] = name; |
3448 | } | |
3449 | 0 | catch (final IllegalArgumentException e) { |
3450 | 0 | e.printStackTrace(); |
3451 | 0 | System.exit(1); |
3452 | } | |
3453 | 0 | catch (final IllegalAccessException e) { |
3454 | 0 | e.printStackTrace(); |
3455 | 0 | System.exit(1); |
3456 | 162 | } |
3457 | } | |
3458 | ||
3459 | 1 | TOKEN_NAME_TO_VALUE = builder.build(); |
3460 | 1 | TOKEN_VALUE_TO_NAME = tempTokenValueToName; |
3461 | 1 | } |
3462 | ||
3463 | /** | |
3464 | * Returns the name of a token for a given ID. | |
3465 | * @param aID the ID of the token name to get | |
3466 | * @return a token name | |
3467 | */ | |
3468 | public static String getTokenName(int aID) | |
3469 | { | |
3470 | 374268 | if (aID > TOKEN_VALUE_TO_NAME.length - 1) { |
3471 | 0 | throw new IllegalArgumentException("given id " + aID); |
3472 | } | |
3473 | 374268 | final String name = TOKEN_VALUE_TO_NAME[aID]; |
3474 | 374268 | if (name == null) { |
3475 | 0 | throw new IllegalArgumentException("given id " + aID); |
3476 | } | |
3477 | 374268 | return name; |
3478 | } | |
3479 | ||
3480 | /** | |
3481 | * Returns the ID of a token for a given name. | |
3482 | * @param aName the name of the token ID to get | |
3483 | * @return a token ID | |
3484 | */ | |
3485 | public static int getTokenId(String aName) | |
3486 | { | |
3487 | 107 | final Integer id = TOKEN_NAME_TO_VALUE.get(aName); |
3488 | 107 | if (id == null) { |
3489 | 0 | throw new IllegalArgumentException("given name " + aName); |
3490 | } | |
3491 | 107 | return id.intValue(); |
3492 | } | |
3493 | ||
3494 | /** | |
3495 | * Returns the short description of a token for a given name. | |
3496 | * @param aName the name of the token ID to get | |
3497 | * @return a short description | |
3498 | */ | |
3499 | public static String getShortDescription(String aName) | |
3500 | { | |
3501 | 1 | if (!TOKEN_NAME_TO_VALUE.containsKey(aName)) { |
3502 | 0 | throw new IllegalArgumentException("given name " + aName); |
3503 | } | |
3504 | ||
3505 | 1 | final String tokentypes = |
3506 | "com.puppycrawl.tools.checkstyle.api.tokentypes"; | |
3507 | 1 | final ResourceBundle bundle = ResourceBundle.getBundle(tokentypes); |
3508 | 1 | return bundle.getString(aName); |
3509 | } | |
3510 | } |