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