1 /////////////////////////////////////////////////////////////////////////////////////////////// 2 // checkstyle: Checks Java source code and other text files for adherence to a set of rules. 3 // Copyright (C) 2001-2024 the original author or authors. 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 20 package com.puppycrawl.tools.checkstyle.api; 21 22 import com.puppycrawl.tools.checkstyle.grammar.java.JavaLanguageLexer; 23 24 /** 25 * Contains the constants for all the tokens contained in the Abstract 26 * Syntax Tree. 27 * 28 * <p>Implementation detail: This class has been introduced to break 29 * the circular dependency between packages.</p> 30 * 31 * @noinspection ClassWithTooManyDependents 32 * @noinspectionreason ClassWithTooManyDependents - this class is a core part of our API 33 */ 34 public final class TokenTypes { 35 36 /** 37 * This is the root node for the source file. It's children 38 * are an optional package definition, zero or more import statements, 39 * and zero or more type declarations. 40 * 41 * <p>For example:</p> 42 * <pre> 43 * import java.util.List; 44 * 45 * class MyClass{} 46 * interface MyInterface{} 47 * ; 48 * </pre> 49 * 50 * <p>parses as:</p> 51 * 52 * <pre> 53 * COMPILATION_UNIT -> COMPILATION_UNIT 54 * |--IMPORT -> import 55 * | |--DOT -> . 56 * | | |--DOT -> . 57 * | | | |--IDENT -> java 58 * | | | `--IDENT -> util 59 * | | `--IDENT -> List 60 * | `--SEMI -> ; 61 * |--CLASS_DEF -> CLASS_DEF 62 * | |--MODIFIERS -> MODIFIERS 63 * | |--LITERAL_CLASS -> class 64 * | |--IDENT -> MyClass 65 * | `--OBJBLOCK -> OBJBLOCK 66 * | |--LCURLY -> { 67 * | `--RCURLY -> } 68 * |--INTERFACE_DEF -> INTERFACE_DEF 69 * | |--MODIFIERS -> MODIFIERS 70 * | |--LITERAL_INTERFACE -> interface 71 * | |--IDENT -> MyInterface 72 * | `--OBJBLOCK -> OBJBLOCK 73 * | |--LCURLY -> { 74 * | `--RCURLY -> } 75 * `--SEMI -> ; 76 * </pre> 77 * 78 * @see #PACKAGE_DEF 79 * @see #IMPORT 80 * @see #CLASS_DEF 81 * @see #INTERFACE_DEF 82 * @see #RECORD_DEF 83 * @see #ANNOTATION_DEF 84 * @see #ENUM_DEF 85 **/ 86 public static final int COMPILATION_UNIT = JavaLanguageLexer.COMPILATION_UNIT; 87 /** 88 * Modifiers for type, method, and field declarations. The 89 * modifiers element is always present even though it may have no 90 * children. 91 * 92 * <p>For example:</p> 93 * <pre> 94 * public int x; 95 * </pre> 96 * 97 * <p>parses as:</p> 98 * <pre> 99 * VARIABLE_DEF -> VARIABLE_DEF 100 * |--MODIFIERS -> MODIFIERS 101 * | `--LITERAL_PUBLIC -> public 102 * |--TYPE -> TYPE 103 * | `--LITERAL_INT -> int 104 * |--IDENT -> x 105 * `--SEMI -> ; 106 * </pre> 107 * 108 * @see <a 109 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html">Java 110 * Language Specification, §8</a> 111 * @see #LITERAL_PUBLIC 112 * @see #LITERAL_PROTECTED 113 * @see #LITERAL_PRIVATE 114 * @see #ABSTRACT 115 * @see #LITERAL_STATIC 116 * @see #FINAL 117 * @see #LITERAL_TRANSIENT 118 * @see #LITERAL_VOLATILE 119 * @see #LITERAL_SYNCHRONIZED 120 * @see #LITERAL_NATIVE 121 * @see #STRICTFP 122 * @see #ANNOTATION 123 * @see #LITERAL_DEFAULT 124 **/ 125 public static final int MODIFIERS = JavaLanguageLexer.MODIFIERS; 126 127 /** 128 * An object block. These are children of class, interface, enum, 129 * annotation and enum constant declarations. 130 * Also, object blocks are children of the new keyword when defining 131 * anonymous inner types. 132 * 133 * <p>For example:</p> 134 * <pre> 135 * class Test {} 136 * </pre> 137 * 138 * <p>parses as:</p> 139 * <pre> 140 * CLASS_DEF -> CLASS_DEF 141 * |--MODIFIERS -> MODIFIERS 142 * |--LITERAL_CLASS -> class 143 * |--IDENT -> Test 144 * `--OBJBLOCK -> OBJBLOCK 145 * |--LCURLY -> { 146 * `--RCURLY -> } 147 * </pre> 148 * 149 * @see #LCURLY 150 * @see #INSTANCE_INIT 151 * @see #STATIC_INIT 152 * @see #CLASS_DEF 153 * @see #CTOR_DEF 154 * @see #METHOD_DEF 155 * @see #VARIABLE_DEF 156 * @see #RCURLY 157 * @see #INTERFACE_DEF 158 * @see #LITERAL_NEW 159 * @see #ENUM_DEF 160 * @see #ENUM_CONSTANT_DEF 161 * @see #ANNOTATION_DEF 162 **/ 163 public static final int OBJBLOCK = JavaLanguageLexer.OBJBLOCK; 164 /** 165 * A list of statements. 166 * 167 * <p>For example:</p> 168 * <pre> 169 * if (c == 1) { 170 * c = 0; 171 * } 172 * </pre> 173 * 174 * <p>parses as:</p> 175 * <pre> 176 * LITERAL_IF -> if 177 * |--LPAREN -> ( 178 * |--EXPR -> EXPR 179 * | `--EQUAL -> == 180 * | |--IDENT -> c 181 * | `--NUM_INT -> 1 182 * |--RPAREN -> ) 183 * `--SLIST -> { 184 * |--EXPR -> EXPR 185 * | `--ASSIGN -> = 186 * | |--IDENT -> c 187 * | `--NUM_INT -> 0 188 * |--SEMI -> ; 189 * `--RCURLY -> } 190 * </pre> 191 * 192 * @see #RCURLY 193 * @see #EXPR 194 * @see #LABELED_STAT 195 * @see #LITERAL_THROWS 196 * @see #LITERAL_RETURN 197 * @see #SEMI 198 * @see #METHOD_DEF 199 * @see #CTOR_DEF 200 * @see #LITERAL_FOR 201 * @see #LITERAL_WHILE 202 * @see #LITERAL_IF 203 * @see #LITERAL_ELSE 204 * @see #CASE_GROUP 205 **/ 206 public static final int SLIST = JavaLanguageLexer.SLIST; 207 /** 208 * A constructor declaration. 209 * 210 * <p>For example:</p> 211 * <pre> 212 * public SpecialEntry(int value, String text) 213 * { 214 * this.value = value; 215 * this.text = text; 216 * } 217 * </pre> 218 * 219 * <p>parses as:</p> 220 * <pre> 221 * CTOR_DEF -> CTOR_DEF 222 * |--MODIFIERS -> MODIFIERS 223 * | `--LITERAL_PUBLIC -> public 224 * |--IDENT -> SpecialEntry 225 * |--LPAREN -> ( 226 * |--PARAMETERS -> PARAMETERS 227 * | |--PARAMETER_DEF -> PARAMETER_DEF 228 * | | |--MODIFIERS -> MODIFIERS 229 * | | |--TYPE -> TYPE 230 * | | | `--LITERAL_INT -> int 231 * | | `--IDENT -> value 232 * | |--COMMA -> , 233 * | `--PARAMETER_DEF -> PARAMETER_DEF 234 * | |--MODIFIERS -> MODIFIERS 235 * | |--TYPE -> TYPE 236 * | | `--IDENT -> String 237 * | `--IDENT -> text 238 * |--RPAREN -> ) 239 * `--SLIST -> { 240 * |--EXPR -> EXPR 241 * | `--ASSIGN -> = 242 * | |--DOT -> . 243 * | |--LITERAL_THIS -> this 244 * | | `--IDENT -> value 245 * | `--IDENT -> value 246 * |--SEMI -> ; 247 * |--EXPR -> EXPR 248 * | `--ASSIGN -> = 249 * | |--DOT -> . 250 * | | |--LITERAL_THIS -> this 251 * | | `--IDENT -> text 252 * | `--IDENT -> text 253 * |--SEMI -> ; 254 * `--RCURLY -> } 255 * </pre> 256 * 257 * @see #OBJBLOCK 258 * @see #CLASS_DEF 259 **/ 260 public static final int CTOR_DEF = JavaLanguageLexer.CTOR_DEF; 261 /** 262 * A method declaration. The children are modifiers, type parameters, 263 * return type, method name, parameter list, an optional throws list, and 264 * statement list. The statement list is omitted if the method 265 * declaration appears in an interface declaration. Method 266 * declarations may appear inside object blocks of class 267 * declarations, interface declarations, enum declarations, 268 * enum constant declarations or anonymous inner-class declarations. 269 * 270 * <p>For example:</p> 271 * 272 * <pre> 273 * public static int square(int x) 274 * { 275 * return x*x; 276 * } 277 * </pre> 278 * 279 * <p>parses as:</p> 280 * 281 * <pre> 282 * --METHOD_DEF -> METHOD_DEF 283 * |--MODIFIERS -> MODIFIERS 284 * | |--LITERAL_PUBLIC -> public 285 * | `--LITERAL_STATIC -> static 286 * |--TYPE -> TYPE 287 * | `--LITERAL_INT -> int 288 * |--IDENT -> square 289 * |--LPAREN -> ( 290 * |--PARAMETERS -> PARAMETERS 291 * | `--PARAMETER_DEF -> PARAMETER_DEF 292 * | |--MODIFIERS -> MODIFIERS 293 * | |--TYPE -> TYPE 294 * | | `--LITERAL_INT -> int 295 * | `--IDENT -> x 296 * |--RPAREN -> ) 297 * `--SLIST -> { 298 * |--LITERAL_RETURN -> return 299 * | |--EXPR -> EXPR 300 * | | `--STAR -> * 301 * | | |--IDENT -> x 302 * | | `--IDENT -> x 303 * | `--SEMI -> ; 304 * `--RCURLY -> } 305 * </pre> 306 * 307 * @see #MODIFIERS 308 * @see #TYPE_PARAMETERS 309 * @see #TYPE 310 * @see #IDENT 311 * @see #PARAMETERS 312 * @see #LITERAL_THROWS 313 * @see #SLIST 314 * @see #OBJBLOCK 315 **/ 316 public static final int METHOD_DEF = JavaLanguageLexer.METHOD_DEF; 317 /** 318 * A field or local variable declaration. The children are 319 * modifiers, type, the identifier name, and an optional 320 * assignment statement. 321 * 322 * <p>For example:</p> 323 * <pre> 324 * final double PI = 3.14; 325 * </pre> 326 * 327 * <p>parses as:</p> 328 * <pre> 329 * VARIABLE_DEF -> VARIABLE_DEF 330 * |--MODIFIERS -> MODIFIERS 331 * | `--FINAL -> final 332 * |--TYPE -> TYPE 333 * | `--LITERAL_DOUBLE -> int 334 * |--IDENT -> PI 335 * |--ASSIGN -> = 336 * | `--EXPR -> EXPR 337 * | `--NUM_FLOAT -> 3.14 338 * `--SEMI -> ; 339 * </pre> 340 * 341 * @see #MODIFIERS 342 * @see #TYPE 343 * @see #IDENT 344 * @see #ASSIGN 345 **/ 346 public static final int VARIABLE_DEF = 347 JavaLanguageLexer.VARIABLE_DEF; 348 349 /** 350 * An instance initializer. Zero or more instance initializers 351 * may appear in class and enum definitions. This token will be a child 352 * of the object block of the declaring type. 353 * 354 * <p>For example:</p> 355 * <pre> 356 * public class MyClass { 357 * private int foo; 358 * {foo = 10;} 359 * } 360 * </pre> 361 * 362 * <p>parses as:</p> 363 * <pre> 364 * CLASS_DEF -> CLASS_DEF 365 * |--MODIFIERS -> MODIFIERS 366 * | `--LITERAL_PUBLIC -> public 367 * |--LITERAL_CLASS -> class 368 * |--IDENT -> MyClass 369 * `--OBJBLOCK -> OBJBLOCK 370 * |--LCURLY -> { 371 * |--VARIABLE_DEF -> VARIABLE_DEF 372 * | |--MODIFIERS -> MODIFIERS 373 * | | `--LITERAL_PRIVATE -> private 374 * | |--TYPE -> TYPE 375 * | | `--LITERAL_INT -> int 376 * | |--IDENT -> foo 377 * | `--SEMI -> ; 378 * |--INSTANCE_INIT -> INSTANCE_INIT 379 * | `--SLIST -> { 380 * | |--EXPR -> EXPR 381 * | | `--ASSIGN -> = 382 * | | |--IDENT -> foo 383 * | | `--NUM_INT -> 10 384 * | |--SEMI -> ; 385 * | `--RCURLY -> } 386 * `--RCURLY -> } 387 * </pre> 388 * 389 * @see <a 390 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.6">Java 391 * Language Specification§8.6</a> 392 * @see #SLIST 393 * @see #OBJBLOCK 394 **/ 395 public static final int INSTANCE_INIT = 396 JavaLanguageLexer.INSTANCE_INIT; 397 398 /** 399 * A static initialization block. Zero or more static 400 * initializers may be children of the object block of a class 401 * or enum declaration (interfaces cannot have static initializers). The 402 * first and only child is a statement list. 403 * 404 * <p>For Example:</p> 405 * <pre> 406 * static { 407 * num = 10; 408 * } 409 * </pre> 410 * 411 * <p>parses as:</p> 412 * <pre> 413 * STATIC_INIT -> STATIC_INIT 414 * `--SLIST -> { 415 * |--EXPR -> EXPR 416 * | `--ASSIGN -> = 417 * | |--IDENT -> num 418 * | `--NUM_INT -> 10 419 * |--SEMI -> ; 420 * `--RCURLY -> } 421 * </pre> 422 * 423 * @see <a 424 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.7">Java 425 * Language Specification, §8.7</a> 426 * @see #SLIST 427 * @see #OBJBLOCK 428 **/ 429 public static final int STATIC_INIT = 430 JavaLanguageLexer.STATIC_INIT; 431 432 /** 433 * A type. This is either a return type of a method or a type of 434 * a variable or field. The first child of this element is the 435 * actual type. This may be a primitive type, an identifier, a 436 * dot which is the root of a fully qualified type, or an array of 437 * any of these. The second child may be type arguments to the type. 438 * 439 * <p>For example:</p> 440 * <pre>boolean var = true;</pre> 441 * 442 * <p>parses as:</p> 443 * <pre> 444 * |--VARIABLE_DEF -> VARIABLE_DEF 445 * | |--MODIFIERS -> MODIFIERS 446 * | |--TYPE -> TYPE 447 * | | `--LITERAL_BOOLEAN -> boolean 448 * | |--IDENT -> var 449 * | `--ASSIGN -> = 450 * | `--EXPR -> EXPR 451 * | `--LITERAL_TRUE -> true 452 * |--SEMI -> ; 453 * </pre> 454 * 455 * @see #VARIABLE_DEF 456 * @see #METHOD_DEF 457 * @see #PARAMETER_DEF 458 * @see #IDENT 459 * @see #DOT 460 * @see #LITERAL_VOID 461 * @see #LITERAL_BOOLEAN 462 * @see #LITERAL_BYTE 463 * @see #LITERAL_CHAR 464 * @see #LITERAL_SHORT 465 * @see #LITERAL_INT 466 * @see #LITERAL_FLOAT 467 * @see #LITERAL_LONG 468 * @see #LITERAL_DOUBLE 469 * @see #ARRAY_DECLARATOR 470 * @see #TYPE_ARGUMENTS 471 **/ 472 public static final int TYPE = JavaLanguageLexer.TYPE; 473 /** 474 * A class declaration. 475 * 476 * <p>For example:</p> 477 * <pre> 478 * public class Test { 479 * } 480 * </pre> 481 * 482 * <p>parses as:</p> 483 * <pre> 484 * CLASS_DEF -> CLASS_DEF 485 * |--MODIFIERS -> MODIFIERS 486 * | `--LITERAL_PUBLIC -> public 487 * |--LITERAL_CLASS -> class 488 * |--IDENT -> Test 489 * `--OBJBLOCK -> OBJBLOCK 490 * |--LCURLY -> { 491 * `--RCURLY -> } 492 * </pre> 493 * 494 * @see <a 495 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html">Java 496 * Language Specification, §8</a> 497 * @see #MODIFIERS 498 * @see #IDENT 499 * @see #EXTENDS_CLAUSE 500 * @see #IMPLEMENTS_CLAUSE 501 * @see #OBJBLOCK 502 * @see #LITERAL_NEW 503 **/ 504 public static final int CLASS_DEF = JavaLanguageLexer.CLASS_DEF; 505 /** 506 * An interface declaration. 507 * 508 * <p>For example:</p> 509 * 510 * <pre> 511 * public interface MyInterface { 512 * 513 * } 514 * </pre> 515 * 516 * <p>parses as:</p> 517 * 518 * <pre> 519 * INTERFACE_DEF -> INTERFACE_DEF 520 * |--MODIFIERS -> MODIFIERS 521 * | `--LITERAL_PUBLIC -> public 522 * |--LITERAL_INTERFACE -> interface 523 * |--IDENT -> MyInterface 524 * `--OBJBLOCK -> OBJBLOCK 525 * |--LCURLY -> { 526 * `--RCURLY -> } 527 * </pre> 528 * 529 * @see <a 530 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-9.html">Java 531 * Language Specification, §9</a> 532 * @see #MODIFIERS 533 * @see #IDENT 534 * @see #EXTENDS_CLAUSE 535 * @see #OBJBLOCK 536 **/ 537 public static final int INTERFACE_DEF = 538 JavaLanguageLexer.INTERFACE_DEF; 539 540 /** 541 * The package declaration. This is optional, but if it is 542 * included, then there is only one package declaration per source 543 * file and it must be the first non-comment in the file. A package 544 * declaration may be annotated in which case the annotations comes 545 * before the rest of the declaration (and are the first children). 546 * 547 * <p>For example:</p> 548 * 549 * <pre> 550 * package com.puppycrawl.tools.checkstyle.api; 551 * </pre> 552 * 553 * <p>parses as:</p> 554 * 555 * <pre> 556 * PACKAGE_DEF -> package 557 * |--ANNOTATIONS -> ANNOTATIONS 558 * |--DOT -> . 559 * | |--DOT -> . 560 * | | |--DOT -> . 561 * | | | |--DOT -> . 562 * | | | | |--IDENT -> com 563 * | | | | `--IDENT -> puppycrawl 564 * | | | `--IDENT -> tools 565 * | | `--IDENT -> checkstyle 566 * | `--IDENT -> api 567 * `--SEMI -> ; 568 * </pre> 569 * 570 * @see <a 571 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-7.html#jls-7.4">Java 572 * Language Specification §7.4</a> 573 * @see #DOT 574 * @see #IDENT 575 * @see #SEMI 576 * @see #ANNOTATIONS 577 * @see FullIdent 578 **/ 579 public static final int PACKAGE_DEF = JavaLanguageLexer.PACKAGE_DEF; 580 /** 581 * An array declaration. 582 * 583 * <p>If the array declaration represents a type, then the type of 584 * the array elements is the first child. Multidimensional arrays 585 * may be regarded as arrays of arrays. In other words, the first 586 * child of the array declaration is another array 587 * declaration.</p> 588 * 589 * <p>For example:</p> 590 * <pre> 591 * int[] x; 592 * </pre> 593 * 594 * <p>parses as:</p> 595 * <pre> 596 * VARIABLE_DEF -> VARIABLE_DEF 597 * |--MODIFIERS -> MODIFIERS 598 * |--TYPE -> TYPE 599 * | |--LITERAL_INT -> int 600 * | `--ARRAY_DECLARATOR -> [ 601 * | `--RBRACK -> ] 602 * |--IDENT -> x 603 * `--SEMI -> ; 604 * </pre> 605 * 606 * <p>The array declaration may also represent an inline array 607 * definition. In this case, the first child will be either an 608 * expression specifying the length of the array or an array 609 * initialization block.</p> 610 * 611 * @see <a 612 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-10.html">Java 613 * Language Specification §10</a> 614 * @see #TYPE 615 * @see #ARRAY_INIT 616 **/ 617 public static final int ARRAY_DECLARATOR = 618 JavaLanguageLexer.ARRAY_DECLARATOR; 619 620 /** 621 * An extends clause. This appears as part of class and interface 622 * definitions. This element appears even if the 623 * {@code extends} keyword is not explicitly used. The child 624 * is an optional identifier. 625 * 626 * <p>For example:</p> 627 * <pre> 628 * public class Test extends ArrayList { 629 * } 630 * </pre> 631 * 632 * <p>parses as:</p> 633 * <pre> 634 * CLASS_DEF -> CLASS_DEF 635 * |--MODIFIERS -> MODIFIERS 636 * | `--LITERAL_PUBLIC -> public 637 * |--LITERAL_CLASS -> class 638 * |--IDENT -> Test 639 * |--EXTENDS_CLAUSE -> extends 640 * | `--IDENT -> ArrayList 641 * `--OBJBLOCK -> OBJBLOCK 642 * |--LCURLY -> { 643 * `--RCURLY -> } 644 * </pre> 645 * 646 * @see #IDENT 647 * @see #DOT 648 * @see #CLASS_DEF 649 * @see #INTERFACE_DEF 650 * @see FullIdent 651 **/ 652 public static final int EXTENDS_CLAUSE = 653 JavaLanguageLexer.EXTENDS_CLAUSE; 654 655 /** 656 * An implements clause. This always appears in a class or enum 657 * declaration, even if there are no implemented interfaces. The 658 * children are a comma separated list of zero or more 659 * identifiers. 660 * 661 * <p>For example:</p> 662 * <pre> 663 * public class MyClass implements Collection { 664 * 665 * } 666 * </pre> 667 * 668 * <p>parses as:</p> 669 * <pre> 670 * CLASS_DEF -> CLASS_DEF 671 * |--MODIFIERS -> MODIFIERS 672 * | `--LITERAL_PUBLIC -> public 673 * |--LITERAL_CLASS -> class 674 * |--IDENT -> MyClass 675 * |--IMPLEMENTS_CLAUSE -> implements 676 * | `--IDENT -> Collection 677 * `--OBJBLOCK -> OBJBLOCK 678 * |--LCURLY -> { 679 * `--RCURLY -> } 680 * </pre> 681 * 682 * @see #IDENT 683 * @see #DOT 684 * @see #COMMA 685 * @see #CLASS_DEF 686 * @see #ENUM_DEF 687 **/ 688 public static final int IMPLEMENTS_CLAUSE = 689 JavaLanguageLexer.IMPLEMENTS_CLAUSE; 690 691 /** 692 * A list of parameters to a method or constructor. The children 693 * are zero or more parameter declarations separated by commas. 694 * 695 * <p>For example</p> 696 * <pre> 697 * int start, int end 698 * </pre> 699 * 700 * <p>parses as:</p> 701 * <pre> 702 * PARAMETERS -> PARAMETERS 703 * |--PARAMETER_DEF -> PARAMETER_DEF 704 * | |--MODIFIERS -> MODIFIERS 705 * | |--TYPE -> TYPE 706 * | | `--LITERAL_INT -> int 707 * | `--IDENT -> start 708 * |--COMMA -> , 709 * `--PARAMETER_DEF -> PARAMETER_DEF 710 * |--MODIFIERS -> MODIFIERS 711 * |--TYPE -> TYPE 712 * | `--LITERAL_INT -> int 713 * `--IDENT -> end 714 * </pre> 715 * 716 * @see #PARAMETER_DEF 717 * @see #COMMA 718 * @see #METHOD_DEF 719 * @see #CTOR_DEF 720 **/ 721 public static final int PARAMETERS = JavaLanguageLexer.PARAMETERS; 722 /** 723 * A parameter declaration. The last parameter in a list of parameters may 724 * be variable length (indicated by the ELLIPSIS child node immediately 725 * after the TYPE child). 726 * 727 * <p>For example</p> 728 * <pre> 729 * void foo(SomeType SomeType.this, int firstParameter, int... secondParameter) {} 730 * </pre> 731 * 732 * <p>parses as:</p> 733 * <pre> 734 * METHOD_DEF -> METHOD_DEF 735 * |--MODIFIERS -> MODIFIERS 736 * |--TYPE -> TYPE 737 * | `--LITERAL_VOID -> void 738 * |--IDENT -> foo 739 * |--LPAREN -> ( 740 * |--PARAMETERS -> PARAMETERS 741 * | |--PARAMETER_DEF -> PARAMETER_DEF 742 * | | |--MODIFIERS -> MODIFIERS 743 * | | |--TYPE -> TYPE 744 * | | | `--IDENT -> SomeType 745 * | | `--DOT -> . 746 * | | |--IDENT -> SomeType 747 * | | `--LITERAL_THIS -> this 748 * | |--COMMA -> , 749 * | |--PARAMETER_DEF -> PARAMETER_DEF 750 * | | |--MODIFIERS -> MODIFIERS 751 * | | |--TYPE -> TYPE 752 * | | | `--LITERAL_INT -> int 753 * | | `--IDENT -> firstParameter 754 * | |--COMMA -> , 755 * | `--PARAMETER_DEF -> PARAMETER_DEF 756 * | |--MODIFIERS -> MODIFIERS 757 * | |--TYPE -> TYPE 758 * | | `--LITERAL_INT -> int 759 * | |--ELLIPSIS -> ... 760 * | `--IDENT -> secondParameter 761 * |--RPAREN -> ) 762 * `--SLIST -> { 763 * `--RCURLY -> } 764 * 765 * </pre> 766 * 767 * @see #MODIFIERS 768 * @see #TYPE 769 * @see #IDENT 770 * @see #PARAMETERS 771 * @see #ELLIPSIS 772 **/ 773 public static final int PARAMETER_DEF = 774 JavaLanguageLexer.PARAMETER_DEF; 775 776 /** 777 * A labeled statement. 778 * 779 * <p>For example:</p> 780 * <pre> 781 * outer: 782 * while (i < 10) { 783 * if (i == 5) 784 * continue outer; 785 * i++; 786 * } 787 * </pre> 788 * 789 * <p>parses as:</p> 790 * <pre> 791 * LABELED_STAT -> : 792 * |--IDENT -> outer 793 * `--LITERAL_WHILE -> while 794 * |--LPAREN -> ( 795 * |--EXPR -> EXPR 796 * | `--LT -> < 797 * | |--IDENT -> i 798 * | `--NUM_INT -> 10 799 * |--RPAREN -> ) 800 * `--SLIST -> { 801 * |--LITERAL_IF -> if 802 * | |--LPAREN -> ( 803 * | |--EXPR -> EXPR 804 * | | `--EQUAL -> == 805 * | | |--IDENT -> i 806 * | | `--NUM_INT -> 5 807 * | |--RPAREN -> ) 808 * | `--LITERAL_CONTINUE -> continue 809 * | |--IDENT -> outer 810 * | `--SEMI -> ; 811 * |--EXPR -> EXPR 812 * | `--POST_INC -> ++ 813 * | `--IDENT -> i 814 * |--SEMI -> ; 815 * `--RCURLY -> } 816 * </pre> 817 * 818 * @see <a 819 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.7">Java 820 * Language Specification, §14.7</a> 821 * @see #SLIST 822 **/ 823 public static final int LABELED_STAT = 824 JavaLanguageLexer.LABELED_STAT; 825 826 /** 827 * A type-cast. 828 * 829 * <p>For example:</p> 830 * <pre> 831 * (String)it.next() 832 * </pre> 833 * 834 * <p>parses as:</p> 835 * <pre> 836 * `--TYPECAST -> ( 837 * |--TYPE -> TYPE 838 * | `--IDENT -> String 839 * |--RPAREN -> ) 840 * `--METHOD_CALL -> ( 841 * |--DOT -> . 842 * | |--IDENT -> it 843 * | `--IDENT -> next 844 * |--ELIST -> ELIST 845 * `--RPAREN -> ) 846 * </pre> 847 * 848 * @see <a 849 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.16">Java 850 * Language Specification, §15.16</a> 851 * @see #EXPR 852 * @see #TYPE 853 * @see #TYPE_ARGUMENTS 854 * @see #RPAREN 855 **/ 856 public static final int TYPECAST = JavaLanguageLexer.TYPECAST; 857 /** 858 * The array index operator. 859 * 860 * <p>For example:</p> 861 * <pre> 862 * arr[0] = 10; 863 * </pre> 864 * 865 * <p>parses as:</p> 866 * <pre> 867 * |--EXPR -> EXPR 868 * | `--ASSIGN -> = 869 * | |--INDEX_OP -> [ 870 * | | |--IDENT -> arr 871 * | | |--EXPR -> EXPR 872 * | | | `--NUM_INT -> 0 873 * | | `--RBRACK -> ] 874 * | `--NUM_INT -> 10 875 * |--SEMI -> ; 876 * </pre> 877 * 878 * @see #EXPR 879 **/ 880 public static final int INDEX_OP = JavaLanguageLexer.INDEX_OP; 881 /** 882 * The {@code ++} (postfix increment) operator. 883 * 884 * <p>For example:</p> 885 * <pre> 886 * a++; 887 * </pre> 888 * 889 * <p>parses as:</p> 890 * <pre> 891 * |--EXPR -> EXPR 892 * | `--POST_INC -> ++ 893 * | `--IDENT -> a 894 * |--SEMI -> ; 895 * </pre> 896 * 897 * @see <a 898 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.14.1">Java 899 * Language Specification, §15.14.1</a> 900 * @see #EXPR 901 * @see #INC 902 **/ 903 public static final int POST_INC = JavaLanguageLexer.POST_INC; 904 /** 905 * The {@code --} (postfix decrement) operator. 906 * 907 * <p>For example:</p> 908 * <pre> 909 * a--; 910 * </pre> 911 * 912 * <p>parses as:</p> 913 * <pre> 914 * |--EXPR -> EXPR 915 * | `--POST_DEC -> -- 916 * | `--IDENT -> a 917 * |--SEMI -> ; 918 * </pre> 919 * 920 * @see <a 921 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.14.2">Java 922 * Language Specification, §15.14.2</a> 923 * @see #EXPR 924 * @see #DEC 925 **/ 926 public static final int POST_DEC = JavaLanguageLexer.POST_DEC; 927 /** 928 * A method call. A method call may have type arguments however these 929 * are attached to the appropriate node in the qualified method name. 930 * 931 * <p>For example:</p> 932 * <pre> 933 * Integer.parseInt("123"); 934 * </pre> 935 * 936 * <p>parses as:</p> 937 * <pre> 938 * |--EXPR -> EXPR 939 * | `--METHOD_CALL -> ( 940 * | |--DOT -> . 941 * | | |--IDENT -> Integer 942 * | | `--IDENT -> parseInt 943 * | |--ELIST -> ELIST 944 * | | `--EXPR -> EXPR 945 * | | `--STRING_LITERAL -> "123" 946 * | `--RPAREN -> ) 947 * |--SEMI -> ; 948 * </pre> 949 * 950 * 951 * @see #IDENT 952 * @see #TYPE_ARGUMENTS 953 * @see #DOT 954 * @see #ELIST 955 * @see #RPAREN 956 * @see FullIdent 957 **/ 958 public static final int METHOD_CALL = JavaLanguageLexer.METHOD_CALL; 959 960 /** 961 * A reference to a method or constructor without arguments. Part of Java 8 syntax. 962 * The token should be used for subscribing for double colon literal. 963 * {@link #DOUBLE_COLON} token does not appear in the tree. 964 * 965 * <p>For example:</p> 966 * <pre> 967 * Comparator<String> compare = String::compareToIgnoreCase; 968 * </pre> 969 * 970 * <p>parses as: 971 * <pre> 972 * |--VARIABLE_DEF -> VARIABLE_DEF 973 * | |--MODIFIERS -> MODIFIERS 974 * | |--TYPE -> TYPE 975 * | | |--IDENT -> Comparator 976 * | | `--TYPE_ARGUMENTS -> TYPE_ARGUMENTS 977 * | | |--GENERIC_START -> < 978 * | | |--TYPE_ARGUMENT -> TYPE_ARGUMENT 979 * | | | `--IDENT -> String 980 * | | `--GENERIC_END -> > 981 * | |--IDENT -> compare 982 * | `--ASSIGN -> = 983 * | `--EXPR -> EXPR 984 * | `--METHOD_REF -> :: 985 * | |--IDENT -> String 986 * | `--IDENT -> compareToIgnoreCase 987 * |--SEMI -> ; 988 * </pre> 989 * 990 * @see #IDENT 991 * @see #DOUBLE_COLON 992 */ 993 public static final int METHOD_REF = JavaLanguageLexer.METHOD_REF; 994 /** 995 * An expression. Operators with lower precedence appear at a 996 * higher level in the tree than operators with higher precedence. 997 * Parentheses are siblings to the operator they enclose. 998 * 999 * <p>For example:</p> 1000 * <pre> 1001 * int x = 4 + 2 * (5 % 3) + (1 << 3) - 4 * 5; 1002 * </pre> 1003 * 1004 * <p>parses as:</p> 1005 * <pre> 1006 * |--VARIABLE_DEF -> VARIABLE_DEF 1007 * | |--MODIFIERS -> MODIFIERS 1008 * | |--TYPE -> TYPE 1009 * | | `--LITERAL_INT -> int 1010 * | |--IDENT -> x 1011 * | `--ASSIGN -> = 1012 * | `--EXPR -> EXPR 1013 * | `--MINUS -> - 1014 * | |--PLUS -> + 1015 * | | |--PLUS -> + 1016 * | | | |--NUM_INT -> 4 1017 * | | | `--STAR -> * 1018 * | | | |--NUM_INT -> 2 1019 * | | | |--LPAREN -> ( 1020 * | | | |--MOD -> % 1021 * | | | | |--NUM_INT -> 5 1022 * | | | | `--NUM_INT -> 3 1023 * | | | `--RPAREN -> ) 1024 * | | |--LPAREN -> ( 1025 * | | |--SL -> << 1026 * | | | |--NUM_INT -> 1 1027 * | | | `--NUM_INT -> 3 1028 * | | `--RPAREN -> ) 1029 * | `--STAR -> * 1030 * | |--NUM_INT -> 4 1031 * | `--NUM_INT -> 5 1032 * |--SEMI -> ; 1033 * </pre> 1034 * 1035 * @see #ELIST 1036 * @see #ASSIGN 1037 * @see #LPAREN 1038 * @see #RPAREN 1039 **/ 1040 public static final int EXPR = JavaLanguageLexer.EXPR; 1041 /** 1042 * An array initialization. This may occur as part of an array 1043 * declaration or inline with {@code new}. 1044 * 1045 * <p>For example:</p> 1046 * <pre> 1047 * int[] y = 1048 * { 1049 * 1, 1050 * 2, 1051 * }; 1052 * </pre> 1053 * 1054 * <p>parses as:</p> 1055 * <pre> 1056 * VARIABLE_DEF -> VARIABLE_DEF 1057 * |--MODIFIERS -> MODIFIERS 1058 * |--TYPE -> TYPE 1059 * | |--LITERAL_INT -> int 1060 * | `--ARRAY_DECLARATOR -> [ 1061 * | `--RBRACK -> ] 1062 * |--IDENT -> y 1063 * |--ASSIGN -> = 1064 * | `--ARRAY_INIT -> { 1065 * | |--EXPR -> EXPR 1066 * | | `--NUM_INT -> 1 1067 * | |--COMMA -> , 1068 * | |--EXPR -> EXPR 1069 * | | `--NUM_INT -> 2 1070 * | |--COMMA -> , 1071 * | `--RCURLY -> } 1072 * `--SEMI -> ; 1073 * </pre> 1074 * 1075 * <p>Also consider:</p> 1076 * <pre> 1077 * int[] z = new int[] 1078 * { 1079 * 1, 1080 * 2, 1081 * }; 1082 * </pre> 1083 * 1084 * <p>which parses as:</p> 1085 * <pre> 1086 * VARIABLE_DEF -> VARIABLE_DEF 1087 * |--MODIFIERS -> MODIFIERS 1088 * |--TYPE -> TYPE [2:4] 1089 * | |--LITERAL_INT -> int 1090 * | `--ARRAY_DECLARATOR -> [ 1091 * | `--RBRACK -> ] 1092 * |--IDENT -> z 1093 * |--ASSIGN -> = 1094 * | `--EXPR -> EXPR 1095 * | `--LITERAL_NEW -> new 1096 * | |--LITERAL_INT -> int 1097 * | |--ARRAY_DECLARATOR -> [ 1098 * | | `--RBRACK -> ] 1099 * | `--ARRAY_INIT -> { 1100 * | |--EXPR -> EXPR 1101 * | | `--NUM_INT -> 1 1102 * | |--COMMA -> , 1103 * | |--EXPR -> EXPR 1104 * | | `--NUM_INT -> 2 1105 * | |--COMMA -> , 1106 * | `--RCURLY -> } 1107 * `--SEMI -> ; 1108 * </pre> 1109 * 1110 * @see #ARRAY_DECLARATOR 1111 * @see #TYPE 1112 * @see #LITERAL_NEW 1113 * @see #COMMA 1114 **/ 1115 public static final int ARRAY_INIT = JavaLanguageLexer.ARRAY_INIT; 1116 /** 1117 * An import declaration. Import declarations are option, but 1118 * must appear after the package declaration and before the first type 1119 * declaration. 1120 * 1121 * <p>For example:</p> 1122 * 1123 * <pre> 1124 * import java.io.IOException; 1125 * </pre> 1126 * 1127 * <p>parses as:</p> 1128 * 1129 * <pre> 1130 * IMPORT -> import 1131 * |--DOT -> . 1132 * | |--DOT -> . 1133 * | | |--IDENT -> java 1134 * | | `--IDENT -> io 1135 * | `--IDENT -> IOException 1136 * `--SEMI -> ; 1137 * </pre> 1138 * 1139 * @see <a 1140 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-7.html#jls-7.5">Java 1141 * Language Specification §7.5</a> 1142 * @see #DOT 1143 * @see #IDENT 1144 * @see #STAR 1145 * @see #SEMI 1146 * @see FullIdent 1147 **/ 1148 public static final int IMPORT = JavaLanguageLexer.IMPORT; 1149 /** 1150 * The {@code -} (unary minus) operator. 1151 * 1152 * <p>For example:</p> 1153 * <pre> 1154 * a = -b; 1155 * </pre> 1156 * 1157 * <p>parses as:</p> 1158 * <pre> 1159 * |--EXPR -> EXPR 1160 * | `--ASSIGN -> = 1161 * | |--IDENT -> a 1162 * | `--UNARY_MINUS -> - 1163 * | `--IDENT -> b 1164 * |--SEMI -> ; 1165 * </pre> 1166 * 1167 * @see <a 1168 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15.4">Java 1169 * Language Specification, §15.15.4</a> 1170 * @see #EXPR 1171 **/ 1172 public static final int UNARY_MINUS = JavaLanguageLexer.UNARY_MINUS; 1173 /** 1174 * The {@code +} (unary plus) operator. 1175 * 1176 * <p>For example:</p> 1177 * <pre> 1178 * a = + b; 1179 * </pre> 1180 * 1181 * <p>parses as:</p> 1182 * <pre> 1183 * |--EXPR -> EXPR 1184 * | `--ASSIGN -> = 1185 * | |--IDENT -> a 1186 * | `--UNARY_PLUS -> + 1187 * | `--IDENT -> b 1188 * |--SEMI -> ; 1189 * </pre> 1190 * 1191 * @see <a 1192 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15.3">Java 1193 * Language Specification, §15.15.3</a> 1194 * @see #EXPR 1195 **/ 1196 public static final int UNARY_PLUS = JavaLanguageLexer.UNARY_PLUS; 1197 /** 1198 * A group of case clauses. Case clauses with no associated 1199 * statements are grouped together into a case group. The last 1200 * child is a statement list containing the statements to execute 1201 * upon a match. 1202 * 1203 * <p>For example:</p> 1204 * <pre> 1205 * case 0: 1206 * case 1: 1207 * case 2: 1208 * x = 3; 1209 * break; 1210 * </pre> 1211 * 1212 * <p>parses as:</p> 1213 * <pre> 1214 * CASE_GROUP -> CASE_GROUP 1215 * |--LITERAL_CASE -> case 1216 * | |--EXPR -> EXPR 1217 * | | `--NUM_INT -> 0 1218 * | `--COLON -> : 1219 * |--LITERAL_CASE -> case 1220 * | |--EXPR -> EXPR 1221 * | | `--NUM_INT -> 1 1222 * | `--COLON -> : 1223 * |--LITERAL_CASE -> case 1224 * | |--EXPR -> EXPR 1225 * | | `--NUM_INT -> 2 1226 * | `--COLON -> : 1227 * `--SLIST -> SLIST 1228 * |--EXPR -> EXPR 1229 * | `--ASSIGN -> = 1230 * | |--IDENT -> x 1231 * | `--NUM_INT -> 3 1232 * |--SEMI -> ; 1233 * `--LITERAL_BREAK -> break 1234 * `--SEMI -> ; 1235 * </pre> 1236 * 1237 * @see #LITERAL_CASE 1238 * @see #LITERAL_DEFAULT 1239 * @see #LITERAL_SWITCH 1240 * @see #LITERAL_YIELD 1241 **/ 1242 public static final int CASE_GROUP = JavaLanguageLexer.CASE_GROUP; 1243 /** 1244 * An expression list. The children are a comma separated list of 1245 * expressions. 1246 * 1247 * <p>For example:</p> 1248 * <pre> 1249 * new ArrayList(50); 1250 * </pre> 1251 * 1252 * <p>parses as:</p> 1253 * <pre> 1254 * |--EXPR -> EXPR 1255 * | `--LITERAL_NEW -> new 1256 * | |--IDENT -> ArrayList 1257 * | |--TYPE_ARGUMENTS -> TYPE_ARGUMENTS 1258 * | | |--GENERIC_START -> < 1259 * | | `--GENERIC_END -> > 1260 * | |--LPAREN -> ( 1261 * | |--ELIST -> ELIST 1262 * | | `--EXPR -> EXPR 1263 * | | `--NUM_INT -> 50 1264 * | `--RPAREN -> ) 1265 * |--SEMI -> ; 1266 * </pre> 1267 * 1268 * @see #LITERAL_NEW 1269 * @see #FOR_INIT 1270 * @see #FOR_ITERATOR 1271 * @see #EXPR 1272 * @see #METHOD_CALL 1273 * @see #CTOR_CALL 1274 * @see #SUPER_CTOR_CALL 1275 **/ 1276 public static final int ELIST = JavaLanguageLexer.ELIST; 1277 /** 1278 * A for loop initializer. This is a child of 1279 * {@code LITERAL_FOR}. The children of this element may be 1280 * a comma separated list of variable declarations, an expression 1281 * list, or empty. 1282 * 1283 * <p>For example:</p> 1284 * <pre> 1285 * for (int i = 0; i < arr.length; i++) {} 1286 * </pre> 1287 * 1288 * <p>parses as:</p> 1289 * <pre> 1290 * LITERAL_FOR -> for 1291 * |--LPAREN -> ( 1292 * |--FOR_INIT -> FOR_INIT 1293 * | `--VARIABLE_DEF -> VARIABLE_DEF 1294 * | |--MODIFIERS -> MODIFIERS 1295 * | |--TYPE -> TYPE 1296 * | | `--LITERAL_INT -> int 1297 * | |--IDENT -> i 1298 * | `--ASSIGN -> = 1299 * | `--EXPR -> EXPR 1300 * | `--NUM_INT -> 0 1301 * |--SEMI -> ; 1302 * |--FOR_CONDITION -> FOR_CONDITION 1303 * | `--EXPR -> EXPR 1304 * | `--LT -> < 1305 * | |--IDENT -> i 1306 * | `--DOT -> . 1307 * | |--IDENT -> arr 1308 * | `--IDENT -> length 1309 * |--SEMI -> ; 1310 * |--FOR_ITERATOR -> FOR_ITERATOR 1311 * | `--ELIST -> ELIST 1312 * | `--EXPR -> EXPR 1313 * | `--POST_INC -> ++ 1314 * | `--IDENT -> i 1315 * |--RPAREN -> ) 1316 * `--SLIST -> { 1317 * `--RCURLY -> } 1318 * </pre> 1319 * 1320 * @see #VARIABLE_DEF 1321 * @see #ELIST 1322 * @see #LITERAL_FOR 1323 **/ 1324 public static final int FOR_INIT = JavaLanguageLexer.FOR_INIT; 1325 /** 1326 * A for loop condition. This is a child of 1327 * {@code LITERAL_FOR}. The child of this element is an 1328 * optional expression. 1329 * 1330 * <p>For example:</p> 1331 * <pre> 1332 * for (int i = 0; i < arr.length; i++) {} 1333 * </pre> 1334 * 1335 * <p>parses as:</p> 1336 * <pre> 1337 * LITERAL_FOR -> for 1338 * |--LPAREN -> ( 1339 * |--FOR_INIT -> FOR_INIT 1340 * | `--VARIABLE_DEF -> VARIABLE_DEF 1341 * | |--MODIFIERS -> MODIFIERS 1342 * | |--TYPE -> TYPE 1343 * | | `--LITERAL_INT -> int 1344 * | |--IDENT -> i 1345 * | `--ASSIGN -> = 1346 * | `--EXPR -> EXPR 1347 * | `--NUM_INT -> 0 1348 * |--SEMI -> ; 1349 * |--FOR_CONDITION -> FOR_CONDITION 1350 * | `--EXPR -> EXPR 1351 * | `--LT -> < 1352 * | |--IDENT -> i 1353 * | `--DOT -> . 1354 * | |--IDENT -> arr 1355 * | `--IDENT -> length 1356 * |--SEMI -> ; 1357 * |--FOR_ITERATOR -> FOR_ITERATOR 1358 * | `--ELIST -> ELIST 1359 * | `--EXPR -> EXPR 1360 * | `--POST_INC -> ++ 1361 * | `--IDENT -> i 1362 * |--RPAREN -> ) 1363 * `--SLIST -> { 1364 * `--RCURLY -> } 1365 * </pre> 1366 * 1367 * @see #EXPR 1368 * @see #LITERAL_FOR 1369 **/ 1370 public static final int FOR_CONDITION = 1371 JavaLanguageLexer.FOR_CONDITION; 1372 1373 /** 1374 * A for loop iterator. This is a child of 1375 * {@code LITERAL_FOR}. The child of this element is an 1376 * optional expression list. 1377 * 1378 * <p>For example:</p> 1379 * <pre> 1380 * for (int i = 0; i < arr.length; i++) {} 1381 * </pre> 1382 * 1383 * <p>parses as:</p> 1384 * <pre> 1385 * LITERAL_FOR -> for 1386 * |--LPAREN -> ( 1387 * |--FOR_INIT -> FOR_INIT 1388 * | `--VARIABLE_DEF -> VARIABLE_DEF 1389 * | |--MODIFIERS -> MODIFIERS 1390 * | |--TYPE -> TYPE 1391 * | | `--LITERAL_INT -> int 1392 * | |--IDENT -> i 1393 * | `--ASSIGN -> = 1394 * | `--EXPR -> EXPR 1395 * | `--NUM_INT -> 0 1396 * |--SEMI -> ; 1397 * |--FOR_CONDITION -> FOR_CONDITION 1398 * | `--EXPR -> EXPR 1399 * | `--LT -> < 1400 * | |--IDENT -> i 1401 * | `--DOT -> . 1402 * | |--IDENT -> arr 1403 * | `--IDENT -> length 1404 * |--SEMI -> ; 1405 * |--FOR_ITERATOR -> FOR_ITERATOR 1406 * | `--ELIST -> ELIST 1407 * | `--EXPR -> EXPR 1408 * | `--POST_INC -> ++ 1409 * | `--IDENT -> i 1410 * |--RPAREN -> ) 1411 * `--SLIST -> { 1412 * `--RCURLY -> } 1413 * </pre> 1414 * 1415 * @see #ELIST 1416 * @see #LITERAL_FOR 1417 **/ 1418 public static final int FOR_ITERATOR = 1419 JavaLanguageLexer.FOR_ITERATOR; 1420 1421 /** 1422 * The empty statement. This goes in place of an 1423 * {@code SLIST} for a {@code for} or {@code while} 1424 * loop body. 1425 * 1426 * <p>For example:</p> 1427 * <pre> 1428 * while(true); 1429 * </pre> 1430 * 1431 * <p>parses as:</p> 1432 * <pre> 1433 * LITERAL_WHILE -> while 1434 * |--LPAREN -> ( 1435 * |--EXPR -> EXPR 1436 * | `--LITERAL_TRUE -> true 1437 * |--RPAREN -> ) 1438 * `--EMPTY_STAT -> ; 1439 * </pre> 1440 * 1441 * @see <a 1442 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.6">Java 1443 * Language Specification, §14.6</a> 1444 * @see #LITERAL_FOR 1445 * @see #LITERAL_WHILE 1446 **/ 1447 public static final int EMPTY_STAT = JavaLanguageLexer.EMPTY_STAT; 1448 /** 1449 * The {@code final} keyword. 1450 * 1451 * <p>For example:</p> 1452 * <pre> 1453 * public final int x = 0; 1454 * </pre> 1455 * 1456 * <p>parses as:</p> 1457 * <pre> 1458 * VARIABLE_DEF -> VARIABLE_DEF 1459 * |--MODIFIERS -> MODIFIERS 1460 * | |--LITERAL_PUBLIC -> public 1461 * | `--FINAL -> final 1462 * |--TYPE -> TYPE 1463 * | `--LITERAL_INT -> int 1464 * |--IDENT -> x 1465 * |--ASSIGN -> = 1466 * | `--EXPR -> EXPR 1467 * | `--NUM_INT -> 0 1468 * `--SEMI -> ; 1469 * </pre> 1470 * 1471 * @see #MODIFIERS 1472 **/ 1473 public static final int FINAL = JavaLanguageLexer.FINAL; 1474 /** 1475 * The {@code abstract} keyword. 1476 * 1477 * <p>For example:</p> 1478 * <pre> 1479 * public abstract class MyClass 1480 * { 1481 * } 1482 * </pre> 1483 * 1484 * <p>parses as:</p> 1485 * <pre> 1486 * --CLASS_DEF 1487 * |--MODIFIERS 1488 * | |--LITERAL_PUBLIC (public) 1489 * | `--ABSTRACT (abstract) 1490 * |--LITERAL_CLASS (class) 1491 * |--IDENT (MyClass) 1492 * `--OBJBLOCK 1493 * |--LCURLY ({) 1494 * `--RCURLY (}) 1495 * </pre> 1496 * 1497 * @see #MODIFIERS 1498 **/ 1499 public static final int ABSTRACT = JavaLanguageLexer.ABSTRACT; 1500 /** 1501 * The {@code strictfp} keyword. 1502 * 1503 * <p>For example:</p> 1504 * <pre>public strictfp class Test {}</pre> 1505 * 1506 * <p>parses as:</p> 1507 * <pre> 1508 * CLASS_DEF -> CLASS_DEF 1509 * |--MODIFIERS -> MODIFIERS 1510 * | |--LITERAL_PUBLIC -> public 1511 * | `--STRICTFP -> strictfp 1512 * |--LITERAL_CLASS -> class 1513 * |--IDENT -> Test 1514 * `--OBJBLOCK -> OBJBLOCK 1515 * |--LCURLY -> { 1516 * `--RCURLY -> } 1517 * </pre> 1518 * 1519 * @see #MODIFIERS 1520 **/ 1521 public static final int STRICTFP = JavaLanguageLexer.STRICTFP; 1522 /** 1523 * A super constructor call. 1524 * 1525 * <p>For example:</p> 1526 * <pre> 1527 * super(1); 1528 * </pre> 1529 * 1530 * <p>parses as:</p> 1531 * <pre> 1532 * SUPER_CTOR_CALL -> super 1533 * |--LPAREN -> ( 1534 * |--ELIST -> ELIST 1535 * | `--EXPR -> EXPR 1536 * | `--NUM_INT -> 1 1537 * |--RPAREN -> ) 1538 * `--SEMI -> ; 1539 * </pre> 1540 * 1541 * @see #ELIST 1542 * @see #RPAREN 1543 * @see #SEMI 1544 * @see #CTOR_CALL 1545 **/ 1546 public static final int SUPER_CTOR_CALL = 1547 JavaLanguageLexer.SUPER_CTOR_CALL; 1548 1549 /** 1550 * A constructor call. 1551 * 1552 * <p>For example:</p> 1553 * <pre> 1554 * this(1); 1555 * </pre> 1556 * 1557 * <p>parses as:</p> 1558 * <pre> 1559 * CTOR_CALL -> this 1560 * |--LPAREN -> ( 1561 * |--ELIST -> ELIST 1562 * | `--EXPR -> EXPR 1563 * | `--NUM_INT -> 1 1564 * |--RPAREN -> ) 1565 * `--SEMI -> ; 1566 * </pre> 1567 * 1568 * @see #ELIST 1569 * @see #RPAREN 1570 * @see #SEMI 1571 * @see #SUPER_CTOR_CALL 1572 **/ 1573 public static final int CTOR_CALL = JavaLanguageLexer.CTOR_CALL; 1574 1575 /** 1576 * The statement terminator ({@code ;}). Depending on the 1577 * context, this make occur as a sibling, a child, or not at all. 1578 * 1579 * <p>For example:</p> 1580 * <pre> 1581 * for(;;); 1582 * </pre> 1583 * 1584 * <p>parses as:</p> 1585 * <pre> 1586 * LITERAL_FOR -> for 1587 * |--LPAREN -> ( 1588 * |--FOR_INIT -> FOR_INIT 1589 * |--SEMI -> ; 1590 * |--FOR_CONDITION -> FOR_CONDITION 1591 * |--SEMI -> ; 1592 * |--FOR_ITERATOR -> FOR_ITERATOR 1593 * |--RPAREN -> ) 1594 * `--EMPTY_STAT -> ; 1595 * </pre> 1596 * 1597 * @see #PACKAGE_DEF 1598 * @see #IMPORT 1599 * @see #SLIST 1600 * @see #ARRAY_INIT 1601 * @see #LITERAL_FOR 1602 **/ 1603 public static final int SEMI = JavaLanguageLexer.SEMI; 1604 1605 /** 1606 * The {@code ]} symbol. 1607 * 1608 * <p>For example:</p> 1609 * <pre> 1610 * int a[]; 1611 * </pre> 1612 * 1613 * <p>parses as:</p> 1614 * <pre> 1615 * VARIABLE_DEF -> VARIABLE_DEF 1616 * |--MODIFIERS -> MODIFIERS 1617 * |--TYPE -> TYPE 1618 * | |--LITERAL_INT -> int 1619 * | `--ARRAY_DECLARATOR -> [ 1620 * | `--RBRACK -> ] 1621 * |--IDENT -> a 1622 * `--SEMI -> ; 1623 * </pre> 1624 * 1625 * @see #INDEX_OP 1626 * @see #ARRAY_DECLARATOR 1627 **/ 1628 public static final int RBRACK = JavaLanguageLexer.RBRACK; 1629 /** 1630 * The {@code void} keyword. 1631 * 1632 * <p>For example:</p> 1633 * <pre> 1634 * {@code void LITERAL_VOID(){}} 1635 * </pre> 1636 * 1637 * <p>'void' parses as:</p> 1638 * <pre> 1639 * METHOD_DEF -> METHOD_DEF 1640 * |--MODIFIERS -> MODIFIERS 1641 * |--TYPE -> TYPE 1642 * | `--LITERAL_VOID -> void 1643 * |--IDENT -> LITERAL_VOID 1644 * </pre> 1645 * 1646 * @see #TYPE 1647 **/ 1648 public static final int LITERAL_VOID = 1649 JavaLanguageLexer.LITERAL_VOID; 1650 1651 /** 1652 * The {@code boolean} keyword. 1653 * 1654 * <p>For example:</p> 1655 * <pre> 1656 * public boolean flag; 1657 * </pre> 1658 * 1659 * <p>parses as:</p> 1660 * <pre> 1661 * VARIABLE_DEF -> VARIABLE_DEF 1662 * |--MODIFIERS -> MODIFIERS 1663 * | `--LITERAL_PUBLIC -> public 1664 * |--TYPE -> TYPE 1665 * | `--LITERAL_BOOLEAN -> boolean 1666 * |--IDENT -> flag 1667 * `--SEMI -> ; 1668 * </pre> 1669 * 1670 * @see #TYPE 1671 **/ 1672 public static final int LITERAL_BOOLEAN = 1673 JavaLanguageLexer.LITERAL_BOOLEAN; 1674 1675 /** 1676 * The {@code byte} keyword. 1677 * 1678 * <p>For example:</p> 1679 * <pre> 1680 * public byte x; 1681 * </pre> 1682 * 1683 * <p>parses as:</p> 1684 * <pre> 1685 * VARIABLE_DEF -> VARIABLE_DEF 1686 * |--MODIFIERS -> MODIFIERS 1687 * | `--LITERAL_PUBLIC -> public 1688 * |--TYPE -> TYPE 1689 * | `--LITERAL_BYTE -> byte 1690 * |--IDENT -> x 1691 * `--SEMI -> ; 1692 * </pre> 1693 * 1694 * @see #TYPE 1695 **/ 1696 public static final int LITERAL_BYTE = 1697 JavaLanguageLexer.LITERAL_BYTE; 1698 1699 /** 1700 * The {@code char} keyword. 1701 * 1702 * <p>For example:</p> 1703 * <pre> 1704 * char a = 'A'; 1705 * </pre> 1706 * 1707 * <p>parses as:</p> 1708 * <pre> 1709 * VARIABLE_DEF -> VARIABLE_DEF 1710 * |--MODIFIERS -> MODIFIERS 1711 * |--TYPE -> TYPE 1712 * | `--LITERAL_CHAR -> char 1713 * |--IDENT -> a 1714 * |--ASSIGN -> = 1715 * | `--EXPR -> EXPR 1716 * | `--CHAR_LITERAL -> 'A' 1717 * `--SEMI -> ; 1718 * </pre> 1719 * 1720 * @see #TYPE 1721 **/ 1722 public static final int LITERAL_CHAR = 1723 JavaLanguageLexer.LITERAL_CHAR; 1724 1725 /** 1726 * The {@code short} keyword. 1727 * 1728 * <p>For example:</p> 1729 * <pre> 1730 * public short x; 1731 * </pre> 1732 * 1733 * <p>parses as:</p> 1734 * <pre> 1735 * VARIABLE_DEF -> VARIABLE_DEF 1736 * |--MODIFIERS -> MODIFIERS 1737 * | `--LITERAL_PUBLIC -> public 1738 * |--TYPE -> TYPE 1739 * | `--LITERAL_SHORT -> short 1740 * |--IDENT -> x 1741 * `--SEMI -> ; 1742 * </pre> 1743 * 1744 * @see #TYPE 1745 **/ 1746 public static final int LITERAL_SHORT = 1747 JavaLanguageLexer.LITERAL_SHORT; 1748 1749 /** 1750 * The {@code int} keyword. 1751 * 1752 * <p>For example:</p> 1753 * <pre> 1754 * public int x; 1755 * </pre> 1756 * 1757 * <p>parses as:</p> 1758 * <pre> 1759 * VARIABLE_DEF -> VARIABLE_DEF 1760 * |--MODIFIERS -> MODIFIERS 1761 * | `--LITERAL_PUBLIC -> public 1762 * |--TYPE -> TYPE 1763 * | `--LITERAL_INT -> int 1764 * |--IDENT -> x 1765 * `--SEMI -> ; 1766 * </pre> 1767 * 1768 * @see #TYPE 1769 **/ 1770 public static final int LITERAL_INT = JavaLanguageLexer.LITERAL_INT; 1771 /** 1772 * The {@code float} keyword. 1773 * 1774 * <p>For example:</p> 1775 * <pre> 1776 * public float x; 1777 * </pre> 1778 * 1779 * <p>parses as:</p> 1780 * <pre> 1781 * VARIABLE_DEF -> VARIABLE_DEF 1782 * |--MODIFIERS -> MODIFIERS 1783 * | `--LITERAL_PUBLIC -> public 1784 * |--TYPE -> TYPE 1785 * | `--LITERAL_FLOAT -> float 1786 * |--IDENT -> x 1787 * `--SEMI -> ; 1788 * </pre> 1789 * 1790 * @see #TYPE 1791 **/ 1792 public static final int LITERAL_FLOAT = 1793 JavaLanguageLexer.LITERAL_FLOAT; 1794 1795 /** 1796 * The {@code long} keyword. 1797 * 1798 * <p>For example:</p> 1799 * <pre> 1800 * public long x; 1801 * </pre> 1802 * 1803 * <p>parses as:</p> 1804 * <pre> 1805 * VARIABLE_DEF -> VARIABLE_DEF 1806 * |--MODIFIERS -> MODIFIERS 1807 * | `--LITERAL_PUBLIC -> public 1808 * |--TYPE -> TYPE 1809 * | `--LITERAL_LONG -> long 1810 * |--IDENT -> x 1811 * `--SEMI -> ; 1812 * </pre> 1813 * 1814 * @see #TYPE 1815 **/ 1816 public static final int LITERAL_LONG = 1817 JavaLanguageLexer.LITERAL_LONG; 1818 1819 /** 1820 * The {@code double} keyword. 1821 * 1822 * <p>For example:</p> 1823 * <pre> 1824 * public double x; 1825 * </pre> 1826 * 1827 * <p>parses as:</p> 1828 * <pre> 1829 * VARIABLE_DEF -> VARIABLE_DEF 1830 * |--MODIFIERS -> MODIFIERS 1831 * | `--LITERAL_PUBLIC -> public 1832 * |--TYPE -> TYPE 1833 * | `--LITERAL_DOUBLE -> double 1834 * |--IDENT -> x 1835 * `--SEMI -> ; 1836 * </pre> 1837 * 1838 * @see #TYPE 1839 **/ 1840 public static final int LITERAL_DOUBLE = 1841 JavaLanguageLexer.LITERAL_DOUBLE; 1842 1843 /** 1844 * An identifier. These can be names of types, subpackages, 1845 * fields, methods, parameters, and local variables. 1846 * 1847 * <p>For example:</p> 1848 * <pre> 1849 * int a = 10; 1850 * </pre> 1851 * 1852 * <p>parses as:</p> 1853 * <pre> 1854 * VARIABLE_DEF -> VARIABLE_DEF 1855 * |--MODIFIERS -> MODIFIERS 1856 * |--TYPE -> TYPE 1857 * | `--LITERAL_INT -> int 1858 * |--IDENT -> a 1859 * | `--ASSIGN -> = 1860 * | `--EXPR -> EXPR 1861 * | `--NUM_INT -> 10 1862 * `--SEMI -> ; 1863 * </pre> 1864 * 1865 **/ 1866 public static final int IDENT = JavaLanguageLexer.IDENT; 1867 /** 1868 * The <code>.</code> (dot) operator. 1869 * 1870 * <p>For example:</p> 1871 * <pre> 1872 * return person.name; 1873 * </pre> 1874 * 1875 * <p>parses as:</p> 1876 * <pre> 1877 * --LITERAL_RETURN -> return 1878 * |--EXPR -> EXPR 1879 * | `--DOT -> . 1880 * | |--IDENT -> person 1881 * | `--IDENT -> name 1882 * `--SEMI -> ; 1883 * </pre> 1884 * 1885 * @see FullIdent 1886 * @noinspection HtmlTagCanBeJavadocTag 1887 * @noinspectionreason HtmlTagCanBeJavadocTag - encoded symbols were not decoded 1888 * when replaced with Javadoc tag 1889 **/ 1890 public static final int DOT = JavaLanguageLexer.DOT; 1891 /** 1892 * The {@code *} (multiplication or wildcard) operator. 1893 * 1894 * <p>For example:</p> 1895 * <pre> 1896 * f = m * a; 1897 * </pre> 1898 * 1899 * <p>parses as:</p> 1900 * <pre> 1901 * |--EXPR -> EXPR 1902 * | `--ASSIGN -> = 1903 * | |--IDENT -> f 1904 * | `--STAR -> * 1905 * | |--IDENT -> m 1906 * | `--IDENT -> a 1907 * |--SEMI -> ; 1908 * </pre> 1909 * 1910 * @see <a 1911 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-7.html#jls-7.5.2">Java 1912 * Language Specification, §7.5.2</a> 1913 * @see <a 1914 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.17.1">Java 1915 * Language Specification, §15.17.1</a> 1916 * @see #EXPR 1917 * @see #IMPORT 1918 **/ 1919 public static final int STAR = JavaLanguageLexer.STAR; 1920 /** 1921 * The {@code private} keyword. 1922 * 1923 * <p>For example:</p> 1924 * <pre> 1925 * private int x; 1926 * </pre> 1927 * 1928 * <p>parses as:</p> 1929 * <pre> 1930 * VARIABLE_DEF -> VARIABLE_DEF 1931 * |--MODIFIERS -> MODIFIERS 1932 * | `--LITERAL_PRIVATE -> private 1933 * |--TYPE -> TYPE 1934 * | `--LITERAL_INT -> int 1935 * |--IDENT -> x 1936 * `--SEMI -> ; 1937 * </pre> 1938 * 1939 * @see #MODIFIERS 1940 **/ 1941 public static final int LITERAL_PRIVATE = 1942 JavaLanguageLexer.LITERAL_PRIVATE; 1943 1944 /** 1945 * The {@code public} keyword. 1946 * 1947 * <p>For example:</p> 1948 * <pre> 1949 * public int x; 1950 * </pre> 1951 * 1952 * <p>parses as:</p> 1953 * <pre> 1954 * VARIABLE_DEF -> VARIABLE_DEF 1955 * |--MODIFIERS -> MODIFIERS 1956 * | `--LITERAL_PUBLIC -> public 1957 * |--TYPE -> TYPE 1958 * | `--LITERAL_INT -> int 1959 * |--IDENT -> x 1960 * `--SEMI -> ; 1961 * </pre> 1962 * 1963 * @see #MODIFIERS 1964 **/ 1965 public static final int LITERAL_PUBLIC = 1966 JavaLanguageLexer.LITERAL_PUBLIC; 1967 1968 /** 1969 * The {@code protected} keyword. 1970 * 1971 * <p>For example:</p> 1972 * <pre> 1973 * protected int x; 1974 * </pre> 1975 * 1976 * <p>parses as:</p> 1977 * <pre> 1978 * VARIABLE_DEF -> VARIABLE_DEF 1979 * |--MODIFIERS -> MODIFIERS 1980 * | `--LITERAL_PROTECTED -> protected 1981 * |--TYPE -> TYPE 1982 * | `--LITERAL_INT -> int 1983 * |--IDENT -> x 1984 * `--SEMI -> ; 1985 * </pre> 1986 * 1987 * @see #MODIFIERS 1988 **/ 1989 public static final int LITERAL_PROTECTED = 1990 JavaLanguageLexer.LITERAL_PROTECTED; 1991 1992 /** 1993 * The {@code static} keyword. 1994 * 1995 * <p>For example:</p> 1996 * <pre> 1997 * public static int x; 1998 * </pre> 1999 * 2000 * <p>parses as:</p> 2001 * <pre> 2002 * VARIABLE_DEF -> VARIABLE_DEF 2003 * |--MODIFIERS -> MODIFIERS 2004 * | |--LITERAL_PUBLIC -> public 2005 * | `--LITERAL_STATIC -> static 2006 * |--TYPE -> TYPE 2007 * | `--LITERAL_INT -> int 2008 * |--IDENT -> x 2009 * `--SEMI -> ; 2010 * </pre> 2011 * 2012 * @see #MODIFIERS 2013 **/ 2014 public static final int LITERAL_STATIC = 2015 JavaLanguageLexer.LITERAL_STATIC; 2016 2017 /** 2018 * The {@code transient} keyword. 2019 * 2020 * <p>For example:</p> 2021 * <pre> 2022 * transient int a; 2023 * </pre> 2024 * 2025 * <p>parses as:</p> 2026 * <pre> 2027 * VARIABLE_DEF -> VARIABLE_DEF 2028 * |--MODIFIERS -> MODIFIERS 2029 * | `--LITERAL_TRANSIENT -> transient 2030 * |--TYPE -> TYPE 2031 * | `--LITERAL_INT -> int 2032 * |--IDENT -> a 2033 * `--SEMI -> ; 2034 * </pre> 2035 * 2036 * @see #MODIFIERS 2037 **/ 2038 public static final int LITERAL_TRANSIENT = 2039 JavaLanguageLexer.LITERAL_TRANSIENT; 2040 2041 /** 2042 * The {@code native} keyword. 2043 * 2044 * <p>For example:</p> 2045 * <pre> 2046 * native void foo(){} 2047 * </pre> 2048 * 2049 * <p>parses as:</p> 2050 * <pre> 2051 * METHOD_DEF -> METHOD_DEF 2052 * |--MODIFIERS -> MODIFIERS 2053 * | `--LITERAL_NATIVE -> native 2054 * |--TYPE -> TYPE 2055 * | `--LITERAL_VOID -> void 2056 * |--IDENT -> foo 2057 * |--LPAREN -> ( 2058 * |--PARAMETERS -> PARAMETERS 2059 * |--RPAREN -> ) 2060 * `--SLIST -> { 2061 * `--RCURLY -> } 2062 * </pre> 2063 * 2064 * @see #MODIFIERS 2065 **/ 2066 public static final int LITERAL_NATIVE = 2067 JavaLanguageLexer.LITERAL_NATIVE; 2068 2069 /** 2070 * The {@code synchronized} keyword. This may be used as a 2071 * modifier of a method or in the definition of a synchronized 2072 * block. 2073 * 2074 * <p>For example:</p> 2075 * 2076 * <pre> 2077 * synchronized(this) 2078 * { 2079 * x++; 2080 * } 2081 * </pre> 2082 * 2083 * <p>parses as:</p> 2084 * 2085 * <pre> 2086 * |--LITERAL_SYNCHRONIZED -> synchronized 2087 * | |--LPAREN -> ( 2088 * | |--EXPR -> EXPR 2089 * | | `--LITERAL_THIS -> this 2090 * | |--RPAREN -> ) 2091 * | `--SLIST -> { 2092 * | |--EXPR -> EXPR 2093 * | | `--POST_INC -> ++ 2094 * | | `--IDENT -> x 2095 * | |--SEMI -> ; 2096 * | `--RCURLY -> } 2097 * `--RCURLY -> } 2098 * </pre> 2099 * 2100 * @see #MODIFIERS 2101 * @see #LPAREN 2102 * @see #EXPR 2103 * @see #RPAREN 2104 * @see #SLIST 2105 * @see #RCURLY 2106 **/ 2107 public static final int LITERAL_SYNCHRONIZED = 2108 JavaLanguageLexer.LITERAL_SYNCHRONIZED; 2109 2110 /** 2111 * The {@code volatile} keyword. This may be used as a 2112 * modifier of a field. 2113 * 2114 * <p>For example:</p> 2115 * <pre> 2116 * private volatile int x; 2117 * </pre> 2118 * 2119 * <p>parses as:</p> 2120 * <pre> 2121 * VARIABLE_DEF -> VARIABLE_DEF 2122 * |--MODIFIERS -> MODIFIERS 2123 * | |--LITERAL_PRIVATE -> private 2124 * | `--LITERAL_VOLATILE -> volatile 2125 * |--TYPE -> TYPE 2126 * | `--LITERAL_INT -> int 2127 * |--IDENT -> x 2128 * `--SEMI -> ; 2129 * </pre> 2130 * 2131 * @see #MODIFIERS 2132 **/ 2133 public static final int LITERAL_VOLATILE = 2134 JavaLanguageLexer.LITERAL_VOLATILE; 2135 2136 /** 2137 * The {@code class} keyword. This element appears both 2138 * as part of a class declaration, and inline to reference a 2139 * class object. 2140 * 2141 * <p>For example:</p> 2142 * <pre> 2143 * class Test { 2144 * } 2145 * </pre> 2146 * 2147 * <p>parses as:</p> 2148 * <pre> 2149 * CLASS_DEF -> CLASS_DEF 2150 * |--MODIFIERS -> MODIFIERS 2151 * |--LITERAL_CLASS -> class 2152 * |--IDENT -> Test 2153 * `--OBJBLOCK -> OBJBLOCK 2154 * |--LCURLY -> { 2155 * `--RCURLY -> } 2156 * </pre> 2157 * 2158 * <p>For example:</p> 2159 * <pre> int.class 2160 * </pre> 2161 * 2162 * <p>parses as:</p> 2163 * <pre> 2164 * EXPR -> EXPR 2165 * `--DOT -> . 2166 * |--LITERAL_INT -> int 2167 * `--LITERAL_CLASS -> class 2168 * </pre> 2169 * 2170 * @see #DOT 2171 * @see #IDENT 2172 * @see #CLASS_DEF 2173 * @see FullIdent 2174 **/ 2175 public static final int LITERAL_CLASS = 2176 JavaLanguageLexer.LITERAL_CLASS; 2177 2178 /** 2179 * The {@code interface} keyword. This token appears in 2180 * interface definition. 2181 * 2182 * <p>For example:</p> 2183 * 2184 * <pre> 2185 * public interface MyInterface { 2186 * 2187 * } 2188 * </pre> 2189 * 2190 * <p>parses as:</p> 2191 * 2192 * <pre> 2193 * INTERFACE_DEF -> INTERFACE_DEF 2194 * |--MODIFIERS -> MODIFIERS 2195 * | `--LITERAL_PUBLIC -> public 2196 * |--LITERAL_INTERFACE -> interface 2197 * |--IDENT -> MyInterface 2198 * `--OBJBLOCK -> OBJBLOCK 2199 * |--LCURLY -> { 2200 * `--RCURLY -> } 2201 * </pre> 2202 * 2203 * @see #INTERFACE_DEF 2204 **/ 2205 public static final int LITERAL_INTERFACE = 2206 JavaLanguageLexer.LITERAL_INTERFACE; 2207 2208 /** 2209 * A left curly brace (<code>{</code>). 2210 * 2211 * <p>For example:</p> 2212 * 2213 * <pre> 2214 * class App { 2215 * int num; 2216 * } 2217 * </pre> 2218 * 2219 * <p>parses as:</p> 2220 * <pre> 2221 * CLASS_DEF -> CLASS_DEF 2222 * |--MODIFIERS -> MODIFIERS 2223 * |--LITERAL_CLASS -> class 2224 * |--IDENT -> App 2225 * `--OBJBLOCK -> OBJBLOCK 2226 * |--LCURLY -> { 2227 * |--VARIABLE_DEF -> VARIABLE_DEF 2228 * | |--MODIFIERS -> MODIFIERS 2229 * | |--TYPE -> TYPE 2230 * | | `--LITERAL_INT -> int 2231 * | |--IDENT -> num 2232 * | `--SEMI -> ; 2233 * `--RCURLY -> } 2234 * </pre> 2235 * 2236 * @see #OBJBLOCK 2237 * @see #ARRAY_INIT 2238 * @see #SLIST 2239 **/ 2240 public static final int LCURLY = JavaLanguageLexer.LCURLY; 2241 /** 2242 * A right curly brace (<code>}</code>). 2243 * 2244 * <p>For example:</p> 2245 * <pre> 2246 * {@code 2247 * void foo(){} 2248 * } 2249 * </pre> 2250 * 2251 * <p>parses as:</p> 2252 * <pre> 2253 * METHOD_DEF -> METHOD_DEF 2254 * |--MODIFIERS -> MODIFIERS 2255 * |--TYPE -> TYPE 2256 * | `--LITERAL_VOID -> void 2257 * |--IDENT -> foo 2258 * |--LPAREN -> ( 2259 * |--PARAMETERS -> PARAMETERS 2260 * |--RPAREN -> ) 2261 * `--SLIST -> { 2262 * `--RCURLY -> } 2263 * </pre> 2264 * 2265 * @see #OBJBLOCK 2266 * @see #ARRAY_INIT 2267 * @see #SLIST 2268 **/ 2269 public static final int RCURLY = JavaLanguageLexer.RCURLY; 2270 2271 /** 2272 * The {@code ,} (comma) operator. 2273 * 2274 * <p>For example:</p> 2275 * <pre> 2276 * int a, b; 2277 * </pre> 2278 * 2279 * <p>parses as:</p> 2280 * <pre> 2281 * |--VARIABLE_DEF -> VARIABLE_DEF 2282 * | |--MODIFIERS -> MODIFIERS 2283 * | |--TYPE -> TYPE 2284 * | | `--LITERAL_INT -> int 2285 * | `--IDENT -> a 2286 * |--COMMA -> , 2287 * |--VARIABLE_DEF -> VARIABLE_DEF 2288 * | |--MODIFIERS -> MODIFIERS 2289 * | |--TYPE -> TYPE 2290 * | | `--LITERAL_INT -> int 2291 * | `--IDENT -> b 2292 * |--SEMI -> ; 2293 * </pre> 2294 * 2295 * @see #ARRAY_INIT 2296 * @see #FOR_INIT 2297 * @see #FOR_ITERATOR 2298 * @see #LITERAL_THROWS 2299 * @see #IMPLEMENTS_CLAUSE 2300 **/ 2301 public static final int COMMA = JavaLanguageLexer.COMMA; 2302 2303 /** 2304 * A left parenthesis ({@code (}). 2305 * 2306 * <p>For example:</p> 2307 * <pre> 2308 * Integer val = new Integer(); 2309 * while (false) { 2310 * val += (-3); 2311 * } 2312 * </pre> 2313 * 2314 * <p>parses as:</p> 2315 * <pre> 2316 * |--VARIABLE_DEF -> VARIABLE_DEF 2317 * | |--MODIFIERS -> MODIFIERS 2318 * | |--TYPE -> TYPE 2319 * | | `--IDENT -> Integer 2320 * | |--IDENT -> val 2321 * | `--ASSIGN -> = 2322 * | `--EXPR -> EXPR 2323 * | `--LITERAL_NEW -> new 2324 * | |--IDENT -> Integer 2325 * | |--LPAREN -> ( 2326 * | |--ELIST -> ELIST 2327 * | `--RPAREN -> ) 2328 * |--SEMI -> ; 2329 * |--LITERAL_WHILE -> while 2330 * | |--LPAREN -> ( 2331 * | |--EXPR -> EXPR 2332 * | | `--LITERAL_FALSE -> false 2333 * | |--RPAREN -> ) 2334 * | `--SLIST -> { 2335 * | |--EXPR -> EXPR 2336 * | | `--PLUS_ASSIGN -> += 2337 * | | |--IDENT -> val 2338 * | | |--LPAREN -> ( 2339 * | | |--UNARY_MINUS -> - 2340 * | | | `--NUM_INT -> 3 2341 * | | `--RPAREN -> ) 2342 * | |--SEMI -> ; 2343 * | `--RCURLY -> } 2344 * </pre> 2345 * 2346 * @see #LITERAL_FOR 2347 * @see #LITERAL_NEW 2348 * @see #EXPR 2349 * @see #LITERAL_SWITCH 2350 * @see #LITERAL_CATCH 2351 **/ 2352 public static final int LPAREN = JavaLanguageLexer.LPAREN; 2353 /** 2354 * A right parenthesis ({@code )}). 2355 * 2356 * <p>For example:</p> 2357 * <pre> 2358 * void check() { 2359 * } 2360 * </pre> 2361 * 2362 * <p>parses as:</p> 2363 * <pre> 2364 * METHOD_DEF -> METHOD_DEF 2365 * |--MODIFIERS -> MODIFIERS 2366 * |--TYPE -> TYPE 2367 * | `--LITERAL_VOID -> void 2368 * |--IDENT -> check 2369 * |--LPAREN -> ( 2370 * |--PARAMETERS -> PARAMETERS 2371 * |--RPAREN -> ) 2372 * `--SLIST -> { 2373 * `--RCURLY -> } 2374 * </pre> 2375 * 2376 * @see #LITERAL_FOR 2377 * @see #LITERAL_NEW 2378 * @see #METHOD_CALL 2379 * @see #TYPECAST 2380 * @see #EXPR 2381 * @see #LITERAL_SWITCH 2382 * @see #LITERAL_CATCH 2383 **/ 2384 public static final int RPAREN = JavaLanguageLexer.RPAREN; 2385 /** 2386 * The {@code this} keyword use to refer the current object. 2387 * This can also be used to call the constructor. 2388 * 2389 * <p>For example:</p> 2390 * <pre> 2391 * this.name = name; 2392 * </pre> 2393 * 2394 * <p>parses as:</p> 2395 * <pre> 2396 * EXPR -> EXPR 2397 * `--ASSIGN -> = 2398 * |--DOT -> . 2399 * | |--LITERAL_THIS -> this 2400 * | `--IDENT -> name 2401 * `--IDENT -> name 2402 * SEMI -> ; 2403 * </pre> 2404 * 2405 * <p>Also consider:</p> 2406 * <pre> 2407 * this(1, "NULL"); 2408 * </pre> 2409 * 2410 * <p>parses as:</p> 2411 * <pre> 2412 * CTOR_CALL -> this 2413 * |--LPAREN -> ( 2414 * |--ELIST -> ELIST 2415 * | |--EXPR -> EXPR 2416 * | | `--NUM_INT -> 1 2417 * | |--COMMA -> , 2418 * | `--EXPR -> EXPR 2419 * | `--STRING_LITERAL -> "NULL" 2420 * |--RPAREN -> ) 2421 * `--SEMI -> ; 2422 * </pre> 2423 * 2424 * @see #EXPR 2425 * @see #CTOR_CALL 2426 **/ 2427 public static final int LITERAL_THIS = 2428 JavaLanguageLexer.LITERAL_THIS; 2429 2430 /** 2431 * The {@code super} keyword. 2432 * 2433 * <p>For example:</p> 2434 * <pre> 2435 * super.toString(); 2436 * </pre> 2437 * 2438 * <p>parses as:</p> 2439 * <pre> 2440 * |--EXPR -> EXPR 2441 * | `--METHOD_CALL -> ( 2442 * | |--DOT -> . 2443 * | | |--LITERAL_SUPER -> super 2444 * | | `--IDENT -> toString 2445 * | |--ELIST -> ELIST 2446 * | `--RPAREN -> ) 2447 * |--SEMI -> ; 2448 * </pre> 2449 * 2450 * @see #EXPR 2451 * @see #SUPER_CTOR_CALL 2452 **/ 2453 public static final int LITERAL_SUPER = 2454 JavaLanguageLexer.LITERAL_SUPER; 2455 2456 /** 2457 * The {@code =} (assignment) operator. 2458 * 2459 * <p>For example:</p> 2460 * <pre> 2461 * a = b; 2462 * </pre> 2463 * 2464 * <p>parses as:</p> 2465 * <pre> 2466 * |--EXPR -> EXPR 2467 * | `--ASSIGN -> = 2468 * | |--IDENT -> a 2469 * | `--IDENT -> b 2470 * |--SEMI -> ; 2471 * </pre> 2472 * 2473 * @see <a 2474 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.1">Java 2475 * Language Specification, §15.26.1</a> 2476 * @see #EXPR 2477 **/ 2478 public static final int ASSIGN = JavaLanguageLexer.ASSIGN; 2479 /** 2480 * The {@code throws} keyword. The children are a number of 2481 * one or more identifiers separated by commas. 2482 * 2483 * <p>For example:</p> 2484 * <pre> 2485 * void test() throws FileNotFoundException, EOFException { 2486 * } 2487 * </pre> 2488 * 2489 * <p>parses as:</p> 2490 * <pre> 2491 * METHOD_DEF -> METHOD_DEF 2492 * |--MODIFIERS -> MODIFIERS 2493 * |--TYPE -> TYPE 2494 * | `--LITERAL_VOID -> void 2495 * |--IDENT -> test 2496 * |--LPAREN -> ( 2497 * |--PARAMETERS -> PARAMETERS 2498 * |--RPAREN -> ) 2499 * |--LITERAL_THROWS -> throws 2500 * | |--IDENT -> FileNotFoundException 2501 * | |--COMMA -> , 2502 * | `--IDENT -> EOFException 2503 * `--SLIST -> { 2504 * `--RCURLY -> } 2505 * </pre> 2506 * 2507 * @see <a 2508 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.4.4">Java 2509 * Language Specification, §8.4.4</a> 2510 * @see #IDENT 2511 * @see #DOT 2512 * @see #COMMA 2513 * @see #METHOD_DEF 2514 * @see #CTOR_DEF 2515 * @see FullIdent 2516 **/ 2517 public static final int LITERAL_THROWS = 2518 JavaLanguageLexer.LITERAL_THROWS; 2519 2520 /** 2521 * The {@code :} (colon) operator. This will appear as part 2522 * of the conditional operator ({@code ? :}). 2523 * 2524 * <p>For example:</p> 2525 * <pre> 2526 * num = isValid ? 1 : 0; 2527 * </pre> 2528 * 2529 * <p>parses as:</p> 2530 * <pre> 2531 * |--EXPR -> EXPR 2532 * | `--ASSIGN -> = 2533 * | |--IDENT -> num 2534 * | `--QUESTION -> ? 2535 * | |--IDENT -> isValid 2536 * | |--NUM_INT -> 1 2537 * | |--COLON -> : 2538 * | `--NUM_INT -> 0 2539 * |--SEMI -> ; 2540 * </pre> 2541 * 2542 * @see #QUESTION 2543 * @see #LABELED_STAT 2544 * @see #CASE_GROUP 2545 **/ 2546 public static final int COLON = JavaLanguageLexer.COLON; 2547 2548 /** 2549 * The {@code ::} (double colon) separator. 2550 * It is part of Java 8 syntax that is used for method reference. 2551 * The token does not appear in tree, {@link #METHOD_REF} should be used instead. 2552 * 2553 * <p>For example:</p> 2554 * <pre> 2555 * Function<Double, Double> square = MyClass::square; 2556 * </pre> 2557 * 2558 * <p>parses as:</p> 2559 * <pre> 2560 * VARIABLE_DEF -> VARIABLE_DEF 2561 * |--MODIFIERS -> MODIFIERS 2562 * |--TYPE -> TYPE 2563 * | |--IDENT -> Function 2564 * | | `--TYPE_ARGUMENTS -> TYPE_ARGUMENTS 2565 * | | |--GENERIC_START -> < 2566 * | | |--TYPE_ARGUMENT -> TYPE_ARGUMENT 2567 * | | | `--IDENT -> Double 2568 * | | |--COMMA -> , 2569 * | | |--TYPE_ARGUMENT -> TYPE_ARGUMENT 2570 * | | | `--IDENT -> Double 2571 * | | `--GENERIC_END -> > 2572 * | |--IDENT -> square 2573 * | |--ASSIGN -> = 2574 * | | `--EXPR -> EXPR 2575 * | | `--METHOD_REF -> :: 2576 * | | |--IDENT -> MyClass 2577 * | | `--IDENT -> square 2578 * | `--SEMI -> ; 2579 * </pre> 2580 * 2581 * @see #METHOD_REF 2582 */ 2583 public static final int DOUBLE_COLON = JavaLanguageLexer.DOUBLE_COLON; 2584 /** 2585 * The {@code if} keyword. 2586 * 2587 * <p>For example:</p> 2588 * <pre> 2589 * if (optimistic) 2590 * { 2591 * message = "half full"; 2592 * } 2593 * else 2594 * { 2595 * message = "half empty"; 2596 * } 2597 * </pre> 2598 * 2599 * <p>parses as:</p> 2600 * <pre> 2601 * LITERAL_IF -> if 2602 * |--LPAREN -> ( 2603 * |--EXPR -> EXPR 2604 * | `--IDENT -> optimistic 2605 * |--RPAREN -> ) 2606 * |--SLIST -> { 2607 * | |--EXPR -> EXPR 2608 * | | `--ASSIGN -> = 2609 * | | |--IDENT -> message 2610 * | | `--STRING_LITERAL -> "half full" 2611 * | |--SEMI -> ; 2612 * | `--RCURLY -> } 2613 * `--LITERAL_ELSE -> else 2614 * `--SLIST -> { 2615 * |--EXPR -> EXPR 2616 * | `--ASSIGN -> = 2617 * | |--IDENT -> message 2618 * | `--STRING_LITERAL -> "half empty" 2619 * |--SEMI -> ; 2620 * `--RCURLY -> } 2621 * </pre> 2622 * 2623 * @see #LPAREN 2624 * @see #EXPR 2625 * @see #RPAREN 2626 * @see #SLIST 2627 * @see #EMPTY_STAT 2628 * @see #LITERAL_ELSE 2629 **/ 2630 public static final int LITERAL_IF = JavaLanguageLexer.LITERAL_IF; 2631 /** 2632 * The {@code for} keyword. The children are {@code (}, 2633 * an initializer, a condition, an iterator, a {@code )} and 2634 * either a statement list, a single expression, or an empty 2635 * statement. 2636 * 2637 * <p>For example:</p> 2638 * <pre> 2639 * for (int i = 0; i < arr.length; i++) {} 2640 * </pre> 2641 * 2642 * <p>parses as:</p> 2643 * <pre> 2644 * LITERAL_FOR -> for 2645 * |--LPAREN -> ( 2646 * |--FOR_INIT -> FOR_INIT 2647 * | `--VARIABLE_DEF -> VARIABLE_DEF 2648 * | |--MODIFIERS -> MODIFIERS 2649 * | |--TYPE -> TYPE 2650 * | | `--LITERAL_INT -> int 2651 * | |--IDENT -> i 2652 * | `--ASSIGN -> = 2653 * | `--EXPR -> EXPR 2654 * | `--NUM_INT -> 0 2655 * |--SEMI -> ; 2656 * |--FOR_CONDITION -> FOR_CONDITION 2657 * | `--EXPR -> EXPR 2658 * | `--LT -> < 2659 * | |--IDENT -> i 2660 * | `--DOT -> . 2661 * | |--IDENT -> arr 2662 * | `--IDENT -> length 2663 * |--SEMI -> ; 2664 * |--FOR_ITERATOR -> FOR_ITERATOR 2665 * | `--ELIST -> ELIST 2666 * | `--EXPR -> EXPR 2667 * | `--POST_INC -> ++ 2668 * | `--IDENT -> i 2669 * |--RPAREN -> ) 2670 * `--SLIST -> { 2671 * `--RCURLY -> } 2672 * </pre> 2673 * 2674 * @see #LPAREN 2675 * @see #FOR_INIT 2676 * @see #SEMI 2677 * @see #FOR_CONDITION 2678 * @see #FOR_ITERATOR 2679 * @see #RPAREN 2680 * @see #SLIST 2681 * @see #EMPTY_STAT 2682 * @see #EXPR 2683 **/ 2684 public static final int LITERAL_FOR = JavaLanguageLexer.LITERAL_FOR; 2685 /** 2686 * The {@code while} keyword. 2687 * 2688 * <p>For example:</p> 2689 * <pre> 2690 * while (i < 5) { 2691 * i++; 2692 * } 2693 * </pre> 2694 * 2695 * <p>parses as:</p> 2696 * <pre> 2697 * LITERAL_WHILE -> while 2698 * |--LPAREN -> ( 2699 * |--EXPR -> EXPR 2700 * | `--LT -> < 2701 * | |--IDENT -> i 2702 * | `--NUM_INT -> 5 2703 * |--RPAREN -> ) 2704 * `--SLIST -> { 2705 * |--EXPR -> EXPR 2706 * | `--POST_INC -> ++ 2707 * | `--IDENT -> i 2708 * |--SEMI -> ; 2709 * `--RCURLY -> } 2710 * </pre> 2711 **/ 2712 public static final int LITERAL_WHILE = 2713 JavaLanguageLexer.LITERAL_WHILE; 2714 2715 /** 2716 * The {@code do} keyword. Note that the while token does not 2717 * appear as part of the do-while construct. 2718 * 2719 * <p>For example:</p> 2720 * <pre> 2721 * do { 2722 * x = rand.nextInt(); 2723 * } while (x < 5); 2724 * </pre> 2725 * 2726 * <p>parses as:</p> 2727 * <pre> 2728 * LITERAL_DO -> do 2729 * |--SLIST -> { 2730 * | |--EXPR -> EXPR 2731 * | | `--ASSIGN -> = 2732 * | | |--IDENT -> x 2733 * | | `--METHOD_CALL -> ( 2734 * | | |--DOT -> . 2735 * | | | |--IDENT -> rand 2736 * | | | `--IDENT -> nextInt 2737 * | | |--ELIST -> ELIST 2738 * | | `--RPAREN -> ) 2739 * | |--SEMI -> ; 2740 * | `--RCURLY -> } 2741 * |--DO_WHILE -> while 2742 * |--LPAREN -> ( 2743 * |--EXPR -> EXPR 2744 * | `--LT -> < 2745 * | |--IDENT -> x 2746 * | `--NUM_INT -> 5 2747 * |--RPAREN -> ) 2748 * `--SEMI -> ; 2749 * </pre> 2750 * 2751 * @see #SLIST 2752 * @see #EXPR 2753 * @see #EMPTY_STAT 2754 * @see #LPAREN 2755 * @see #RPAREN 2756 * @see #SEMI 2757 **/ 2758 public static final int LITERAL_DO = JavaLanguageLexer.LITERAL_DO; 2759 /** 2760 * Literal {@code while} in do-while loop. 2761 * 2762 * <p>For example:</p> 2763 * <pre> 2764 * do { 2765 * 2766 * } while (a > 0); 2767 * </pre> 2768 * 2769 * <p>parses as:</p> 2770 * <pre> 2771 * --LITERAL_DO -> do 2772 * |--SLIST -> { 2773 * | `--RCURLY -> } 2774 * |--DO_WHILE -> while 2775 * |--LPAREN -> ( 2776 * |--EXPR -> EXPR 2777 * | `--GT -> > 2778 * | |--IDENT -> a 2779 * | `--NUM_INT -> 0 2780 * |--RPAREN -> ) 2781 * `--SEMI -> ; 2782 * </pre> 2783 * 2784 * @see #LITERAL_DO 2785 */ 2786 public static final int DO_WHILE = JavaLanguageLexer.DO_WHILE; 2787 /** 2788 * The {@code break} keyword. The first child is an optional 2789 * identifier and the last child is a semicolon. 2790 * 2791 * <p>For example:</p> 2792 * <pre> 2793 * for (;;) { 2794 * break; 2795 * } 2796 * </pre> 2797 * 2798 * <p>parses as:</p> 2799 * <pre> 2800 * LITERAL_FOR -> for 2801 * |--LPAREN -> ( 2802 * |--FOR_INIT -> FOR_INIT 2803 * |--SEMI -> ; 2804 * |--FOR_CONDITION -> FOR_CONDITION 2805 * |--SEMI -> ; 2806 * |--FOR_ITERATOR -> FOR_ITERATOR 2807 * |--RPAREN -> ) 2808 * `--SLIST -> { 2809 * |--LITERAL_BREAK -> break 2810 * | `--SEMI -> ; 2811 * `--RCURLY -> } 2812 * </pre> 2813 * 2814 * @see #IDENT 2815 * @see #SEMI 2816 * @see #SLIST 2817 **/ 2818 public static final int LITERAL_BREAK = 2819 JavaLanguageLexer.LITERAL_BREAK; 2820 2821 /** 2822 * The {@code continue} keyword. The first child is an 2823 * optional identifier and the last child is a semicolon. 2824 * 2825 * <p>For example:</p> 2826 * <pre> 2827 * for (;;) { 2828 * continue; 2829 * } 2830 * </pre> 2831 * 2832 * <p>parses as:</p> 2833 * <pre> 2834 * LITERAL_FOR -> for 2835 * |--LPAREN -> ( 2836 * |--FOR_INIT -> FOR_INIT 2837 * |--SEMI -> ; 2838 * |--FOR_CONDITION -> FOR_CONDITION 2839 * |--SEMI -> ; 2840 * |--FOR_ITERATOR -> FOR_ITERATOR 2841 * |--RPAREN -> ) 2842 * `--SLIST -> { 2843 * |--LITERAL_CONTINUE -> continue 2844 * | `--SEMI -> ; 2845 * `--RCURLY -> } 2846 * </pre> 2847 * 2848 * @see #IDENT 2849 * @see #SEMI 2850 * @see #SLIST 2851 **/ 2852 public static final int LITERAL_CONTINUE = 2853 JavaLanguageLexer.LITERAL_CONTINUE; 2854 2855 /** 2856 * The {@code return} keyword. The first child is an 2857 * optional expression for the return value. The last child is a 2858 * semicolon. 2859 * 2860 * <p>For example:</p> 2861 * <pre> 2862 * public int foo(int i) { 2863 * return i+1; 2864 * } 2865 * </pre> 2866 * 2867 * <p>parses as:</p> 2868 * <pre> 2869 * METHOD_DEF -> METHOD_DEF 2870 * |--MODIFIERS -> MODIFIERS 2871 * | `--LITERAL_PUBLIC -> public 2872 * |--TYPE -> TYPE 2873 * | `--LITERAL_INT -> int 2874 * |--IDENT -> foo 2875 * |--LPAREN -> ( 2876 * |--PARAMETERS -> PARAMETERS 2877 * | `--PARAMETER_DEF -> PARAMETER_DEF 2878 * | |--MODIFIERS -> MODIFIERS 2879 * | |--TYPE -> TYPE 2880 * | | `--LITERAL_INT -> int 2881 * | `--IDENT -> i 2882 * |--RPAREN -> ) 2883 * `--SLIST -> { 2884 * |--LITERAL_RETURN -> return 2885 * | |--EXPR -> EXPR 2886 * | | `--PLUS -> + 2887 * | | |--IDENT -> i 2888 * | | `--NUM_INT -> 1 2889 * | `--SEMI -> ; 2890 * `--RCURLY -> } 2891 * </pre> 2892 * 2893 * @see #EXPR 2894 * @see #SEMI 2895 * @see #SLIST 2896 **/ 2897 public static final int LITERAL_RETURN = 2898 JavaLanguageLexer.LITERAL_RETURN; 2899 2900 /** 2901 * The {@code switch} keyword. 2902 * 2903 * <p>For example:</p> 2904 * <pre> 2905 * switch (type) { 2906 * case 0: 2907 * background = Color.red; 2908 * break; 2909 * case 1: 2910 * background = Color.blue; 2911 * break; 2912 * default: 2913 * background = Color.green; 2914 * } 2915 * </pre> 2916 * 2917 * <p>parses as:</p> 2918 * <pre> 2919 * LITERAL_SWITCH -> switch 2920 * |--LPAREN -> ( 2921 * |--EXPR -> EXPR 2922 * | `--IDENT -> type 2923 * |--RPAREN -> ) 2924 * |--LCURLY -> { 2925 * |--CASE_GROUP -> CASE_GROUP 2926 * | |--LITERAL_CASE -> case 2927 * | | |--EXPR -> EXPR 2928 * | | | `--NUM_INT -> 0 2929 * | | `--COLON -> : 2930 * | `--SLIST -> SLIST 2931 * | |--EXPR -> EXPR 2932 * | | `--ASSIGN -> = 2933 * | | |--IDENT -> background 2934 * | | `--DOT -> . 2935 * | | |--IDENT -> Color 2936 * | | `--IDENT -> red 2937 * | |--SEMI -> ; 2938 * | `--LITERAL_BREAK -> break 2939 * | `--SEMI -> ; 2940 * |--CASE_GROUP -> CASE_GROUP 2941 * | |--LITERAL_CASE -> case 2942 * | | |--EXPR -> EXPR 2943 * | | | `--NUM_INT -> 1 2944 * | | `--COLON -> : 2945 * | `--SLIST -> SLIST 2946 * | |--EXPR -> EXPR 2947 * | | `--ASSIGN -> = 2948 * | | |--IDENT -> background 2949 * | | `--DOT -> . 2950 * | | |--IDENT -> Color 2951 * | | `--IDENT -> blue 2952 * | |--SEMI -> ; 2953 * | `--LITERAL_BREAK -> break 2954 * | `--SEMI -> ; 2955 * |--CASE_GROUP -> CASE_GROUP 2956 * | |--LITERAL_DEFAULT -> default 2957 * | | `--COLON -> : 2958 * | `--SLIST -> SLIST 2959 * | |--EXPR -> EXPR 2960 * | | `--ASSIGN -> = 2961 * | | |--IDENT -> background 2962 * | | `--DOT -> . 2963 * | | |--IDENT -> Color 2964 * | | `--IDENT -> green 2965 * | `--SEMI -> ; 2966 * `--RCURLY -> } 2967 * </pre> 2968 * 2969 * @see <a 2970 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.10">Java 2971 * Language Specification, §14.10</a> 2972 * @see #LPAREN 2973 * @see #EXPR 2974 * @see #RPAREN 2975 * @see #LCURLY 2976 * @see #CASE_GROUP 2977 * @see #RCURLY 2978 * @see #SLIST 2979 * @see #SWITCH_RULE 2980 **/ 2981 public static final int LITERAL_SWITCH = 2982 JavaLanguageLexer.LITERAL_SWITCH; 2983 2984 /** 2985 * The {@code throw} keyword. The first child is an 2986 * expression that evaluates to a {@code Throwable} instance. 2987 * 2988 * <p>For example:</p> 2989 * <pre> 2990 * throw new ArithmeticException("An exception occurred."); 2991 * </pre> 2992 * 2993 * <p>parses as:</p> 2994 * <pre> 2995 * LITERAL_THROW -> throw 2996 * |--EXPR -> EXPR 2997 * | `--LITERAL_NEW -> new 2998 * | |--IDENT -> ArithmeticException 2999 * | |--LPAREN -> ( 3000 * | |--ELIST -> ELIST 3001 * | | `--EXPR -> EXPR 3002 * | | `--STRING_LITERAL -> "An exception occurred." 3003 * | `--RPAREN -> ) 3004 * `--SEMI -> ; 3005 * </pre> 3006 * 3007 * @see <a 3008 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.17">Java 3009 * Language Specification, §14.17</a> 3010 * @see #SLIST 3011 * @see #EXPR 3012 **/ 3013 public static final int LITERAL_THROW = 3014 JavaLanguageLexer.LITERAL_THROW; 3015 3016 /** 3017 * The {@code else} keyword. This appears as a child of an 3018 * {@code if} statement. 3019 * 3020 * <p>For example:</p> 3021 * <pre> 3022 * if (flag) { 3023 * 3024 * } else { 3025 * 3026 * } 3027 * </pre> 3028 * 3029 * <p>parses as:</p> 3030 * <pre> 3031 * LITERAL_IF -> if 3032 * |--LPAREN -> ( 3033 * |--EXPR -> EXPR 3034 * | `--IDENT -> flag 3035 * |--RPAREN -> ) 3036 * |--SLIST -> { 3037 * | `--RCURLY -> } 3038 * `--LITERAL_ELSE -> else 3039 * `--SLIST -> { 3040 * `--RCURLY -> } 3041 * </pre> 3042 * 3043 * @see #SLIST 3044 * @see #EXPR 3045 * @see #EMPTY_STAT 3046 * @see #LITERAL_IF 3047 **/ 3048 public static final int LITERAL_ELSE = 3049 JavaLanguageLexer.LITERAL_ELSE; 3050 3051 /** 3052 * The {@code case} keyword. The first child is a constant 3053 * expression that evaluates to an integer. 3054 * 3055 * <p>For example:</p> 3056 * <pre> 3057 * switch(num){ 3058 * case 0: 3059 * num = 1; 3060 * } 3061 * </pre> 3062 * 3063 * <p>parses as:</p> 3064 * <pre> 3065 * 3066 * CASE_GROUP -> CASE_GROUP 3067 * |--LITERAL_CASE -> cas 3068 * | |--EXPR -> EXPR 3069 * | | `--NUM_INT -> 0 3070 * | `--COLON -> : 3071 * `--SLIST -> SLIST 3072 * |--EXPR -> EXPR 3073 * | `--ASSIGN -> = 3074 * | |--IDENT -> num 3075 * | `--NUM_INT -> 1 3076 * `--SEMI -> ; 3077 * </pre> 3078 * 3079 * <p>For example:</p> 3080 * <pre> 3081 * switch(num){ 3082 * case 1 -> num = -1 3083 * } 3084 * </pre> 3085 * 3086 * <p>parses as:</p> 3087 * <pre> 3088 * SWITCH_RULE -> SWITCH_RULE 3089 * |--LITERAL_CASE -> case 3090 * | `--EXPR -> EXPR 3091 * | `--NUM_INT -> 1 3092 * |--LAMBDA -> -> 3093 * |--EXPR -> EXPR 3094 * | `--ASSIGN -> = 3095 * | |--IDENT -> num 3096 * | `--UNARY_MINUS -> - 3097 * | `--NUM_INT -> 1 3098 * `--SEMI -> ; 3099 * </pre> 3100 * 3101 * @see #CASE_GROUP 3102 * @see #EXPR 3103 **/ 3104 public static final int LITERAL_CASE = 3105 JavaLanguageLexer.LITERAL_CASE; 3106 3107 /** 3108 * The {@code default} keyword. This element has no 3109 * children. 3110 * 3111 * <p>For example:</p> 3112 * <pre> 3113 * switch (type) { 3114 * case 1: 3115 * x = 1; 3116 * break; 3117 * default: 3118 * x = 3; 3119 * } 3120 * </pre> 3121 * 3122 * <p>parses as:</p> 3123 * <pre> 3124 * LITERAL_SWITCH -> switch 3125 * |--LPAREN -> ( 3126 * |--EXPR -> EXPR 3127 * | `--IDENT -> type 3128 * |--RPAREN -> ) 3129 * |--LCURLY -> { 3130 * |--CASE_GROUP -> CASE_GROUP 3131 * | |--LITERAL_CASE -> case 3132 * | | |--EXPR -> EXPR 3133 * | | | `--NUM_INT -> 1 3134 * | | `--COLON -> : 3135 * | `--SLIST -> SLIST 3136 * | |--EXPR -> EXPR 3137 * | | `--ASSIGN -> = 3138 * | | |--IDENT -> x 3139 * | | `--NUM_INT -> 1 3140 * | | | |--SEMI -> ; 3141 * | `--LITERAL_BREAK -> break 3142 * | `--SEMI -> ; 3143 * |--CASE_GROUP -> CASE_GROUP 3144 * | |--LITERAL_DEFAULT -> default 3145 * | | `--COLON -> : 3146 * | `--SLIST -> SLIST 3147 * | |--EXPR -> EXPR 3148 * | | `--ASSIGN -> = 3149 * | | |--IDENT -> x 3150 * | | `--NUM_INT -> 3 3151 * | `--SEMI -> ; 3152 * `--RCURLY -> } 3153 * </pre> 3154 * 3155 * @see #CASE_GROUP 3156 * @see #MODIFIERS 3157 * @see #SWITCH_RULE 3158 **/ 3159 public static final int LITERAL_DEFAULT = 3160 JavaLanguageLexer.LITERAL_DEFAULT; 3161 3162 /** 3163 * The {@code try} keyword. The children are a statement 3164 * list, zero or more catch blocks and then an optional finally 3165 * block. 3166 * 3167 * <p>For example:</p> 3168 * <pre> 3169 * try { } finally {} 3170 * </pre> 3171 * 3172 * <p>parses as:</p> 3173 * <pre> 3174 * LITERAL_TRY -> try 3175 * |--SLIST -> { 3176 * | `--RCURLY -> } 3177 * `--LITERAL_FINALLY -> finally 3178 * `--SLIST -> { 3179 * `--RCURLY -> } 3180 * </pre> 3181 * 3182 * @see <a 3183 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.19">Java 3184 * Language Specification, §14.19</a> 3185 * @see #SLIST 3186 * @see #LITERAL_CATCH 3187 * @see #LITERAL_FINALLY 3188 **/ 3189 public static final int LITERAL_TRY = JavaLanguageLexer.LITERAL_TRY; 3190 3191 /** 3192 * The Java 7 try-with-resources construct. 3193 * 3194 * <p>For example:</p> 3195 * <pre> 3196 * try (Foo foo = new Foo(); Bar bar = new Bar()) { 3197 * } 3198 * </pre> 3199 * 3200 * <p>parses as:</p> 3201 * <pre> 3202 * LITERAL_TRY -> try 3203 * |--RESOURCE_SPECIFICATION -> RESOURCE_SPECIFICATION 3204 * | |--LPAREN -> ( 3205 * | |--RESOURCES -> RESOURCES 3206 * | | |--RESOURCE -> RESOURCE 3207 * | | | |--MODIFIERS -> MODIFIERS 3208 * | | | |--TYPE -> TYPE 3209 * | | | | `--IDENT -> Foo 3210 * | | | |--IDENT -> foo 3211 * | | | `--ASSIGN -> = 3212 * | | | `--EXPR -> EXPR 3213 * | | | `--LITERAL_NEW -> new 3214 * | | | |--IDENT -> Foo 3215 * | | | |--LPAREN -> ( 3216 * | | | |--ELIST -> ELIST 3217 * | | | `--RPAREN -> ) 3218 * | | |--SEMI -> ; 3219 * | | `--RESOURCE -> RESOURCE 3220 * | | |--MODIFIERS -> MODIFIERS 3221 * | | |--TYPE -> TYPE 3222 * | | | `--IDENT -> Bar 3223 * | | |--IDENT -> bar 3224 * | | `--ASSIGN -> = 3225 * | | `--EXPR -> EXPR 3226 * | | `--LITERAL_NEW -> new 3227 * | | |--IDENT -> Bar 3228 * | | |--LPAREN -> ( 3229 * | | |--ELIST -> ELIST 3230 * | | `--RPAREN -> ) 3231 * | `--RPAREN -> ) 3232 * `--SLIST -> { 3233 * `--RCURLY -> } 3234 * </pre> 3235 * 3236 * <p>Also consider:</p> 3237 * <pre> 3238 * try (BufferedReader br = new BufferedReader(new FileReader(path))) { 3239 * } 3240 * </pre> 3241 * 3242 * <p>which parses as:</p> 3243 * <pre> 3244 * LITERAL_TRY -> try 3245 * |--RESOURCE_SPECIFICATION -> RESOURCE_SPECIFICATION 3246 * | |--LPAREN -> ( 3247 * | |--RESOURCES -> RESOURCES 3248 * | | `--RESOURCE -> RESOURCE 3249 * | | |--MODIFIERS -> MODIFIERS 3250 * | | |--TYPE -> TYPE 3251 * | | | `--IDENT -> BufferedReader 3252 * | | |--IDENT -> br 3253 * | | `--ASSIGN -> = 3254 * | | `--EXPR -> EXPR 3255 * | | `--LITERAL_NEW -> new 3256 * | | |--IDENT -> BufferedReader 3257 * | | |--LPAREN -> ( 3258 * | | |--ELIST -> ELIST 3259 * | | | `--EXPR -> EXPR 3260 * | | | `--LITERAL_NEW -> new 3261 * | | | |--IDENT -> FileReader 3262 * | | | |--LPAREN -> ( 3263 * | | | |--ELIST -> ELIST 3264 * | | | | `--EXPR -> EXPR 3265 * | | | | `--IDENT -> path 3266 * | | | `--RPAREN -> ) 3267 * | | `--RPAREN -> ) 3268 * | `--RPAREN -> ) 3269 * `--SLIST -> { 3270 * `--RCURLY -> } 3271 * </pre> 3272 * 3273 * @see #LPAREN 3274 * @see #RESOURCES 3275 * @see #RESOURCE 3276 * @see #SEMI 3277 * @see #RPAREN 3278 * @see #LITERAL_TRY 3279 **/ 3280 public static final int RESOURCE_SPECIFICATION = 3281 JavaLanguageLexer.RESOURCE_SPECIFICATION; 3282 3283 /** 3284 * A list of resources in the Java 7 try-with-resources construct. 3285 * This is a child of RESOURCE_SPECIFICATION. 3286 * 3287 * <p>For example:</p> 3288 * <pre> 3289 * try (FileReader fr = new FileReader("config.xml")) { 3290 * } finally {} 3291 * </pre> 3292 * 3293 * <p>parses as:</p> 3294 * <pre> 3295 * LITERAL_TRY -> try 3296 * |--RESOURCE_SPECIFICATION -> RESOURCE_SPECIFICATION 3297 * | |--LPAREN -> ( 3298 * | |--RESOURCES -> RESOURCES 3299 * | | `--RESOURCE -> RESOURCE 3300 * | | |--MODIFIERS -> MODIFIERS 3301 * | | |--TYPE -> TYPE 3302 * | | | `--IDENT -> FileReader 3303 * | | |--IDENT -> fr 3304 * | | `--ASSIGN -> = 3305 * | | `--EXPR -> EXPR 3306 * | | `--LITERAL_NEW -> new 3307 * | | |--IDENT -> FileReader 3308 * | | |--LPAREN -> ( 3309 * | | |--ELIST -> ELIST 3310 * | | | `--EXPR -> EXPR 3311 * | | | `--STRING_LITERAL -> "config.xml" 3312 * | | `--RPAREN -> ) 3313 * | `--RPAREN -> ) 3314 * |--SLIST -> { 3315 * | `--RCURLY -> } 3316 * `--LITERAL_FINALLY -> finally 3317 * `--SLIST -> { 3318 * `--RCURLY -> } 3319 * </pre> 3320 * 3321 * @see #RESOURCE_SPECIFICATION 3322 **/ 3323 public static final int RESOURCES = 3324 JavaLanguageLexer.RESOURCES; 3325 3326 /** 3327 * A resource in the Java 7 try-with-resources construct. 3328 * This is a child of RESOURCES. 3329 * 3330 * <p>For example:</p> 3331 * <pre> 3332 * try (Foo foo = new Foo(); Bar bar = new Bar()) { } 3333 * </pre> 3334 * 3335 * <p>parses as:</p> 3336 * <pre> 3337 * LITERAL_TRY -> try 3338 * |--RESOURCE_SPECIFICATION -> RESOURCE_SPECIFICATION 3339 * | |--LPAREN -> ( 3340 * | |--RESOURCES -> RESOURCES 3341 * | | |--RESOURCE -> RESOURCE 3342 * | | | |--MODIFIERS -> MODIFIERS 3343 * | | | |--TYPE -> TYPE 3344 * | | | | `--IDENT -> Foo 3345 * | | | |--IDENT -> foo 3346 * | | | `--ASSIGN -> = 3347 * | | | `--EXPR -> EXPR 3348 * | | | `--LITERAL_NEW -> new 3349 * | | | |--IDENT -> Foo 3350 * | | | |--LPAREN -> ( 3351 * | | | |--ELIST -> ELIST 3352 * | | | `--RPAREN -> ) 3353 * | | |--SEMI -> ; 3354 * | | `--RESOURCE -> RESOURCE 3355 * | | |--MODIFIERS -> MODIFIERS 3356 * | | |--TYPE -> TYPE 3357 * | | | `--IDENT -> Bar 3358 * | | |--IDENT -> bar 3359 * | | `--ASSIGN -> = 3360 * | | `--EXPR -> EXPR 3361 * | | `--LITERAL_NEW -> new 3362 * | | |--IDENT -> Bar 3363 * | | |--LPAREN -> ( 3364 * | | |--ELIST -> ELIST 3365 * | | `--RPAREN -> ) 3366 * | `--RPAREN -> ) 3367 * `--SLIST -> { 3368 * `--RCURLY -> } 3369 * </pre> 3370 * 3371 * @see #RESOURCES 3372 * @see #RESOURCE_SPECIFICATION 3373 **/ 3374 public static final int RESOURCE = 3375 JavaLanguageLexer.RESOURCE; 3376 3377 /** 3378 * The {@code catch} keyword. 3379 * 3380 * <p>For example:</p> 3381 * <pre> 3382 * try { 3383 * FileReader fr = new FileReader("Test.txt"); 3384 * } catch (FileNotFoundException e) { 3385 * 3386 * } 3387 * </pre> 3388 * 3389 * <p>parses as:</p> 3390 * <pre> 3391 * LITERAL_TRY -> try 3392 * |--SLIST -> { 3393 * | |--VARIABLE_DEF -> VARIABLE_DEF 3394 * | | |--MODIFIERS -> MODIFIERS 3395 * | | |--TYPE -> TYPE 3396 * | | | `--IDENT -> FileReader 3397 * | | |--IDENT -> fr 3398 * | | `--ASSIGN -> = 3399 * | | `--EXPR -> EXPR 3400 * | | `--LITERAL_NEW -> new 3401 * | | |--IDENT -> FileReader 3402 * | | |--LPAREN -> ( 3403 * | | |--ELIST -> ELIST 3404 * | | | `--EXPR -> EXPR 3405 * | | | `--STRING_LITERAL -> "Test.txt" 3406 * | | `--RPAREN -> ) 3407 * | |--SEMI -> ; 3408 * | `--RCURLY -> } 3409 * `--LITERAL_CATCH -> catch 3410 * |--LPAREN -> ( 3411 * |--PARAMETER_DEF -> PARAMETER_DEF 3412 * | |--MODIFIERS -> MODIFIERS 3413 * | |--TYPE -> TYPE 3414 * | | `--IDENT -> FileNotFoundException 3415 * | `--IDENT -> e 3416 * |--RPAREN -> ) 3417 * `--SLIST -> { 3418 * `--RCURLY -> } 3419 * </pre> 3420 * 3421 * @see #LPAREN 3422 * @see #PARAMETER_DEF 3423 * @see #RPAREN 3424 * @see #SLIST 3425 * @see #LITERAL_TRY 3426 **/ 3427 public static final int LITERAL_CATCH = 3428 JavaLanguageLexer.LITERAL_CATCH; 3429 3430 /** 3431 * The {@code finally} keyword. 3432 * 3433 * <p>For example:</p> 3434 * <pre> 3435 * try {} finally {} 3436 * </pre> 3437 * 3438 * <p>parses as:</p> 3439 * <pre> 3440 * LITERAL_TRY -> try 3441 * |--SLIST -> { 3442 * | `--RCURLY -> } 3443 * `--LITERAL_FINALLY -> finally 3444 * `--SLIST -> { 3445 * `--RCURLY -> } 3446 * </pre> 3447 * 3448 * @see #SLIST 3449 * @see #LITERAL_TRY 3450 **/ 3451 public static final int LITERAL_FINALLY = 3452 JavaLanguageLexer.LITERAL_FINALLY; 3453 3454 /** 3455 * The {@code +=} (addition assignment) operator. 3456 * 3457 * <p>For example:</p> 3458 * <pre> 3459 * a += b; 3460 * </pre> 3461 * 3462 * <p>parses as:</p> 3463 * <pre> 3464 * |--EXPR -> EXPR 3465 * | `--PLUS_ASSIGN -> += 3466 * | |--IDENT -> a 3467 * | `--IDENT -> b 3468 * |--SEMI -> ; 3469 * </pre> 3470 * 3471 * @see <a 3472 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java 3473 * Language Specification, §15.26.2</a> 3474 * @see #EXPR 3475 **/ 3476 public static final int PLUS_ASSIGN = JavaLanguageLexer.PLUS_ASSIGN; 3477 /** 3478 * The {@code -=} (subtraction assignment) operator. 3479 * 3480 * <p>For example:</p> 3481 * <pre> 3482 * a -= b; 3483 * </pre> 3484 * 3485 * <p>parses as:</p> 3486 * <pre> 3487 * |--EXPR -> EXPR 3488 * | `--MINUS_ASSIGN -> -= 3489 * | |--IDENT -> a 3490 * | `--IDENT -> b 3491 * |--SEMI -> ; 3492 * </pre> 3493 * 3494 * @see <a 3495 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java 3496 * Language Specification, §15.26.2</a> 3497 * @see #EXPR 3498 **/ 3499 public static final int MINUS_ASSIGN = 3500 JavaLanguageLexer.MINUS_ASSIGN; 3501 3502 /** 3503 * The {@code *=} (multiplication assignment) operator. 3504 * 3505 * <p>For example:</p> 3506 * <pre> 3507 * a *= b; 3508 * </pre> 3509 * 3510 * <p>parses as:</p> 3511 * <pre> 3512 * |--EXPR -> EXPR 3513 * | `--STAR_ASSIGN -> *= 3514 * | |--IDENT -> a 3515 * | `--IDENT -> b 3516 * |--SEMI -> ; 3517 * </pre> 3518 * 3519 * @see <a 3520 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java 3521 * Language Specification, §15.26.2</a> 3522 * @see #EXPR 3523 **/ 3524 public static final int STAR_ASSIGN = JavaLanguageLexer.STAR_ASSIGN; 3525 /** 3526 * The {@code /=} (division assignment) operator. 3527 * 3528 * <p>For example:</p> 3529 * <pre> 3530 * a /= b; 3531 * </pre> 3532 * 3533 * <p>parses as:</p> 3534 * <pre> 3535 * |--EXPR -> EXPR 3536 * | `--DIV_ASSIGN -> /= 3537 * | |--IDENT -> a 3538 * | `--IDENT -> b 3539 * |--SEMI -> ; 3540 * </pre> 3541 * 3542 * @see <a 3543 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java 3544 * Language Specification, §15.26.2</a> 3545 * @see #EXPR 3546 **/ 3547 public static final int DIV_ASSIGN = JavaLanguageLexer.DIV_ASSIGN; 3548 /** 3549 * The {@code %=} (remainder assignment) operator. 3550 * 3551 * <p>For example:</p> 3552 * <pre>a %= 2;</pre> 3553 * 3554 * <p>parses as:</p> 3555 * <pre> 3556 * |--EXPR -> EXPR 3557 * | `--MOD_ASSIGN -> %= 3558 * | |--IDENT -> a 3559 * | `--NUM_INT -> 2 3560 * |--SEMI -> ; 3561 * </pre> 3562 * 3563 * @see <a 3564 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java 3565 * Language Specification, §15.26.2</a> 3566 * @see #EXPR 3567 **/ 3568 public static final int MOD_ASSIGN = JavaLanguageLexer.MOD_ASSIGN; 3569 /** 3570 * The {@code >>=} (signed right shift assignment) 3571 * operator. 3572 * 3573 * <p>For example:</p> 3574 * <pre> 3575 * a >>= b; 3576 * </pre> 3577 * 3578 * <p>parses as:</p> 3579 * <pre> 3580 * |--EXPR -> EXPR 3581 * | `--SR_ASSIGN -> >>= 3582 * | |--IDENT -> a 3583 * | `--IDENT -> b 3584 * |--SEMI -> ; 3585 * </pre> 3586 * 3587 * @see <a 3588 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java 3589 * Language Specification, §15.26.2</a> 3590 * @see #EXPR 3591 **/ 3592 public static final int SR_ASSIGN = JavaLanguageLexer.SR_ASSIGN; 3593 /** 3594 * The {@code >>>=} (unsigned right shift assignment) 3595 * operator. 3596 * 3597 * <p>For example:</p> 3598 * <pre> 3599 * a >>>= b; 3600 * </pre> 3601 * 3602 * <p>parses as:</p> 3603 * <pre> 3604 * |--EXPR -> EXPR 3605 * | `--BSR_ASSIGN -> >>>= 3606 * | |--IDENT -> a 3607 * | `--IDENT -> b 3608 * |--SEMI -> ; 3609 * </pre> 3610 * 3611 * @see <a 3612 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java 3613 * Language Specification, §15.26.2</a> 3614 * @see #EXPR 3615 **/ 3616 public static final int BSR_ASSIGN = JavaLanguageLexer.BSR_ASSIGN; 3617 /** 3618 * The {@code <<=} (left shift assignment) operator. 3619 * 3620 * @see <a 3621 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java 3622 * Language Specification, §15.26.2</a> 3623 * @see #EXPR 3624 **/ 3625 public static final int SL_ASSIGN = JavaLanguageLexer.SL_ASSIGN; 3626 /** 3627 * The {@code &=} (bitwise AND assignment) operator. 3628 * 3629 * <p>For example:</p> 3630 * <pre> 3631 * a &= b; 3632 * </pre> 3633 * 3634 * <p>parses as:</p> 3635 * <pre> 3636 * |--EXPR -> EXPR 3637 * | `--BAND_ASSIGN -> &= 3638 * | |--IDENT -> a 3639 * | `--IDENT -> b 3640 * |--SEMI -> ; 3641 * </pre> 3642 * 3643 * @see <a 3644 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java 3645 * Language Specification, §15.26.2</a> 3646 * @see #EXPR 3647 **/ 3648 public static final int BAND_ASSIGN = JavaLanguageLexer.BAND_ASSIGN; 3649 /** 3650 * The {@code ^=} (bitwise exclusive OR assignment) operator. 3651 * 3652 * @see <a 3653 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java 3654 * Language Specification, §15.26.2</a> 3655 * @see #EXPR 3656 **/ 3657 public static final int BXOR_ASSIGN = JavaLanguageLexer.BXOR_ASSIGN; 3658 /** 3659 * The {@code |=} (bitwise OR assignment) operator. 3660 * 3661 * <p>For example:</p> 3662 * <pre> 3663 * a |= b; 3664 * </pre> 3665 * 3666 * <p>parses as:</p> 3667 * <pre> 3668 * |--EXPR -> EXPR 3669 * | `--BOR_ASSIGN -> |= 3670 * | |--IDENT -> a 3671 * | `--IDENT -> b 3672 * |--SEMI -> ; 3673 * </pre> 3674 * 3675 * @see <a 3676 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.26.2">Java 3677 * Language Specification, §15.26.2</a> 3678 * @see #EXPR 3679 **/ 3680 public static final int BOR_ASSIGN = JavaLanguageLexer.BOR_ASSIGN; 3681 /** 3682 * The <code>?</code> (conditional) operator. Technically, 3683 * the colon is also part of this operator, but it appears as a 3684 * separate token. 3685 * 3686 * <p>For example:</p> 3687 * <pre> 3688 * String variable=(quantity==1)?"true":"false"; 3689 * </pre> 3690 * 3691 * <p>parses as:</p> 3692 * <pre> 3693 * |--VARIABLE_DEF -> VARIABLE_DEF 3694 * | |--MODIFIERS -> MODIFIERS 3695 * | |--TYPE -> TYPE 3696 * | | `--IDENT -> String 3697 * | |--IDENT -> variable 3698 * | `--ASSIGN -> = 3699 * | `--EXPR -> EXPR 3700 * | `--QUESTION -> ? 3701 * | |--LPAREN -> ( 3702 * | |--EQUAL -> == 3703 * | | |--IDENT -> quantity 3704 * | | `--NUM_INT -> 1 3705 * | |--RPAREN -> ) 3706 * | |--STRING_LITERAL -> "true" 3707 * | |--COLON -> : 3708 * | `--STRING_LITERAL -> "false" 3709 * |--SEMI -> ; 3710 * </pre> 3711 * 3712 * @see <a 3713 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.25">Java 3714 * Language Specification, §15.25</a> 3715 * @see #EXPR 3716 * @see #COLON 3717 * @noinspection HtmlTagCanBeJavadocTag 3718 * @noinspectionreason HtmlTagCanBeJavadocTag - encoded symbols were not decoded 3719 * when replaced with Javadoc tag 3720 **/ 3721 public static final int QUESTION = JavaLanguageLexer.QUESTION; 3722 /** 3723 * The {@code ||} (conditional OR) operator. 3724 * 3725 * <p>For example:</p> 3726 * <pre> 3727 * if (a || b) { 3728 * } 3729 * </pre> 3730 * 3731 * <p> 3732 * parses as: 3733 * </p> 3734 * <pre> 3735 * LITERAL_IF -> if 3736 * |--LPAREN -> ( 3737 * |--EXPR -> EXPR 3738 * | `--LOR -> || 3739 * | |--IDENT -> a 3740 * | `--IDENT -> b 3741 * |--RPAREN -> ) 3742 * |--SLIST -> { 3743 * | |--RCURLY -> } 3744 * </pre> 3745 * 3746 * @see <a 3747 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.24">Java 3748 * Language Specification, §15.24</a> 3749 * @see #EXPR 3750 **/ 3751 public static final int LOR = JavaLanguageLexer.LOR; 3752 /** 3753 * The {@code &&} (conditional AND) operator. 3754 * 3755 * <p>For example:</p> 3756 * <pre> 3757 * if (a && b) { 3758 * } 3759 * </pre> 3760 * 3761 * <p>parses as:</p> 3762 * <pre> 3763 * LITERAL_IF -> if 3764 * |--LPAREN -> ( 3765 * |--EXPR -> EXPR 3766 * | `--LAND -> && 3767 * | |--IDENT -> a 3768 * | `--IDENT -> b 3769 * |--RPAREN -> ) 3770 * |--SLIST -> { 3771 * | |--RCURLY -> } 3772 * </pre> 3773 * 3774 * @see <a 3775 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.23">Java 3776 * Language Specification, §15.23</a> 3777 * @see #EXPR 3778 **/ 3779 public static final int LAND = JavaLanguageLexer.LAND; 3780 /** 3781 * The {@code |} (bitwise OR) operator. 3782 * 3783 * <p>For example:</p> 3784 * <pre> 3785 * a = a | b; 3786 * </pre> 3787 * 3788 * <p>parses as:</p> 3789 * <pre> 3790 * |--EXPR -> EXPR 3791 * | `--ASSIGN -> = 3792 * | |--IDENT -> a 3793 * | `--BOR -> | 3794 * | |--IDENT -> a 3795 * | `--IDENT -> b 3796 * |--SEMI -> ; 3797 * </pre> 3798 * 3799 * @see <a 3800 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.22.1">Java 3801 * Language Specification, §15.22.1</a> 3802 * @see #EXPR 3803 **/ 3804 public static final int BOR = JavaLanguageLexer.BOR; 3805 /** 3806 * The {@code ^} (bitwise exclusive OR) operator. 3807 * 3808 * @see <a 3809 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.22.1">Java 3810 * Language Specification, §15.22.1</a> 3811 * @see #EXPR 3812 **/ 3813 public static final int BXOR = JavaLanguageLexer.BXOR; 3814 /** 3815 * The {@code &} (bitwise AND) operator. 3816 * 3817 * <p>For example:</p> 3818 * <pre> 3819 * c = a & b; 3820 * </pre> 3821 * 3822 * <p>parses as:</p> 3823 * <pre> 3824 * |--EXPR -> EXPR 3825 * | `--ASSIGN -> = 3826 * | |--IDENT -> c 3827 * | `--BAND -> & 3828 * | |--IDENT -> a 3829 * | `--IDENT -> b 3830 * |--SEMI -> ; 3831 * </pre> 3832 * 3833 * @see <a 3834 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.22.1">Java 3835 * Language Specification, §15.22.1</a> 3836 * @see #EXPR 3837 **/ 3838 public static final int BAND = JavaLanguageLexer.BAND; 3839 /** 3840 * The <code>!=</code> (not equal) operator. 3841 * 3842 * <p>For example:</p> 3843 * <pre> 3844 * a != b; 3845 * </pre> 3846 * 3847 * <p>parses as:</p> 3848 * <pre> 3849 * |--EXPR -> EXPR 3850 * | `--NOT_EQUAL -> != 3851 * | |--IDENT -> a 3852 * | `--IDENT -> b 3853 * `--SEMI -> ; 3854 * </pre> 3855 * 3856 * @see #EXPR 3857 * @noinspection HtmlTagCanBeJavadocTag 3858 * @noinspectionreason HtmlTagCanBeJavadocTag - encoded symbols were not decoded 3859 * when replaced with Javadoc tag 3860 **/ 3861 public static final int NOT_EQUAL = JavaLanguageLexer.NOT_EQUAL; 3862 /** 3863 * The {@code ==} (equal) operator. 3864 * 3865 * <p>For example:</p> 3866 * <pre> 3867 * return a == b; 3868 * </pre> 3869 * 3870 * <p>parses as:</p> 3871 * <pre> 3872 * |--EXPR -> EXPR 3873 * | `--EQUAL -> == 3874 * | |--IDENT -> a 3875 * | `--IDENT -> b 3876 * `--SEMI -> ; 3877 * </pre> 3878 * 3879 * @see #EXPR 3880 **/ 3881 public static final int EQUAL = JavaLanguageLexer.EQUAL; 3882 /** 3883 * The {@code <} (less than) operator. 3884 * 3885 * <p>For example:</p> 3886 * <pre> 3887 * c = a < b; 3888 * </pre> 3889 * 3890 * <p>parses as:</p> 3891 * <pre> 3892 * |--EXPR -> EXPR 3893 * | `--ASSIGN -> = 3894 * | |--IDENT -> c 3895 * | `--LT -> < 3896 * | |--IDENT -> a 3897 * | `--IDENT -> b 3898 * |--SEMI -> ; 3899 * </pre> 3900 * 3901 * @see #EXPR 3902 **/ 3903 public static final int LT = JavaLanguageLexer.LT; 3904 /** 3905 * The {@code >} (greater than) operator. 3906 * 3907 * <p>For example:</p> 3908 * <pre> 3909 * c = a > b; 3910 * </pre> 3911 * 3912 * <p>parses as:</p> 3913 * <pre> 3914 * |--EXPR -> EXPR 3915 * | `--ASSIGN -> = 3916 * | |--IDENT -> c 3917 * | `--BAND -> > 3918 * | |--IDENT -> a 3919 * | `--IDENT -> b 3920 * |--SEMI -> ; 3921 * </pre> 3922 * 3923 * @see #EXPR 3924 **/ 3925 public static final int GT = JavaLanguageLexer.GT; 3926 /** 3927 * The {@code <=} (less than or equal) operator. 3928 * 3929 * <p>For example:</p> 3930 * <pre> 3931 * c = a <= b; 3932 * </pre> 3933 * 3934 * <p>parses as:</p> 3935 * <pre> 3936 * |--EXPR -> EXPR 3937 * | `--ASSIGN -> = 3938 * | |--IDENT -> c 3939 * | `--LE -> <= 3940 * | |--IDENT -> a 3941 * | `--IDENT -> b 3942 * |--SEMI -> ; 3943 * </pre> 3944 * 3945 * @see #EXPR 3946 **/ 3947 public static final int LE = JavaLanguageLexer.LE; 3948 /** 3949 * The {@code >=} (greater than or equal) operator. 3950 * 3951 * <p>For example:</p> 3952 * <pre> 3953 * boolean b = a >= 3; 3954 * </pre> 3955 * 3956 * <p>parses as:</p> 3957 * <pre> 3958 * VARIABLE_DEF -> VARIABLE_DEF 3959 * |--MODIFIERS -> MODIFIERS 3960 * |--TYPE -> TYPE 3961 * | `--LITERAL_BOOLEAN -> boolean 3962 * |--IDENT -> b 3963 * `--ASSIGN -> = 3964 * `--EXPR -> EXPR 3965 * `--GE -> >= 3966 * |--IDENT -> a 3967 * `--NUM_INT -> 3 3968 * </pre> 3969 * 3970 * @see #EXPR 3971 **/ 3972 public static final int GE = JavaLanguageLexer.GE; 3973 /** 3974 * The {@code instanceof} operator. The first child is an 3975 * object reference or something that evaluates to an object 3976 * reference. The second child is a reference type or pattern. 3977 * 3978 * <p>For example:</p> 3979 * <pre> 3980 * boolean isBuilderReferenceType = text instanceof StringBuilder; // reference type 3981 * boolean isBuilderPatternWithPattern = 3982 * text instanceof StringBuilder s; // type pattern, no `PATTERN_DEF` 3983 * boolean isBuilderEmpty = text instanceof 3984 * (StringBuilder sb && sb.isEmpty()); // guarded pattern, `PATTERN_DEF` 3985 * </pre> 3986 * 3987 * <p>parses as:</p> 3988 * <pre> 3989 * |--VARIABLE_DEF -> VARIABLE_DEF 3990 * | |--MODIFIERS -> MODIFIERS 3991 * | |--TYPE -> TYPE 3992 * | | `--LITERAL_BOOLEAN -> boolean 3993 * | |--IDENT -> isBuilderReferenceType 3994 * | `--ASSIGN -> = 3995 * | `--EXPR -> EXPR 3996 * | `--LITERAL_INSTANCEOF -> instanceof 3997 * | |--IDENT -> text 3998 * | `--TYPE -> TYPE 3999 * | `--IDENT -> StringBuilder 4000 * |--SEMI -> ; 4001 * |--VARIABLE_DEF -> VARIABLE_DEF 4002 * | |--MODIFIERS -> MODIFIERS 4003 * | |--TYPE -> TYPE 4004 * | | `--LITERAL_BOOLEAN -> boolean 4005 * | |--IDENT -> isBuilderPatternWithPattern 4006 * | `--ASSIGN -> = 4007 * | `--EXPR -> EXPR 4008 * | `--LITERAL_INSTANCEOF -> instanceof 4009 * | |--IDENT -> text 4010 * | `--PATTERN_VARIABLE_DEF -> PATTERN_VARIABLE_DEF 4011 * | |--MODIFIERS -> MODIFIERS 4012 * | |--TYPE -> TYPE 4013 * | | `--IDENT -> StringBuilder 4014 * | `--IDENT -> s 4015 * |--SEMI -> ; 4016 * |--VARIABLE_DEF -> VARIABLE_DEF 4017 * | |--MODIFIERS -> MODIFIERS 4018 * | |--TYPE -> TYPE 4019 * | | `--LITERAL_BOOLEAN -> boolean 4020 * | |--IDENT -> isBuilderEmpty 4021 * | `--ASSIGN -> = 4022 * | `--EXPR -> EXPR 4023 * | `--LITERAL_INSTANCEOF -> instanceof 4024 * | |--IDENT -> text 4025 * | `--PATTERN_DEF -> PATTERN_DEF 4026 * | `--LPAREN -> ( 4027 * | |--LAND -> && 4028 * | | |--PATTERN_VARIABLE_DEF -> PATTERN_VARIABLE_DEF 4029 * | | | |--MODIFIERS -> MODIFIERS 4030 * | | | |--TYPE -> TYPE 4031 * | | | | `--IDENT -> StringBuilder 4032 * | | | `--IDENT -> sb 4033 * | | `--METHOD_CALL -> ( 4034 * | | |--DOT -> . 4035 * | | | |--IDENT -> sb 4036 * | | | `--IDENT -> isEmpty 4037 * | | |--ELIST -> ELIST 4038 * | | `--RPAREN -> ) 4039 * | `--RPAREN -> ) 4040 * `--SEMI -> ; 4041 * </pre> 4042 * 4043 * @see <a 4044 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.20.2">Java 4045 * Language Specification, §15.20.2</a> 4046 * @see #EXPR 4047 * @see #METHOD_CALL 4048 * @see #IDENT 4049 * @see #DOT 4050 * @see #TYPE 4051 * @see #PATTERN_VARIABLE_DEF 4052 * @see #PATTERN_DEF 4053 * @see FullIdent 4054 **/ 4055 public static final int LITERAL_INSTANCEOF = 4056 JavaLanguageLexer.LITERAL_INSTANCEOF; 4057 4058 /** 4059 * The {@code <<} (shift left) operator. 4060 * 4061 * <p>For example:</p> 4062 * <pre> 4063 * a = a << b; 4064 * </pre> 4065 * 4066 * <p>parses as:</p> 4067 * <pre> 4068 * |--EXPR -> EXPR 4069 * | `--ASSIGN -> = 4070 * | |--IDENT -> a 4071 * | `--SR -> << 4072 * | |--IDENT -> a 4073 * | `--IDENT -> b 4074 * |--SEMI -> ; 4075 * </pre> 4076 * 4077 * @see <a 4078 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.19">Java 4079 * Language Specification, §15.19</a> 4080 * @see #EXPR 4081 **/ 4082 public static final int SL = JavaLanguageLexer.SL; 4083 /** 4084 * The {@code >>} (signed shift right) operator. 4085 * 4086 * <p>For example:</p> 4087 * <pre> 4088 * a = a >> b; 4089 * </pre> 4090 * 4091 * <p>parses as:</p> 4092 * <pre> 4093 * |--EXPR -> EXPR 4094 * | `--ASSIGN -> = 4095 * | |--IDENT -> a 4096 * | `--SR -> >> 4097 * | |--IDENT -> a 4098 * | `--IDENT -> b 4099 * |--SEMI -> ; 4100 * </pre> 4101 * 4102 * @see <a 4103 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.19">Java 4104 * Language Specification, §15.19</a> 4105 * @see #EXPR 4106 **/ 4107 public static final int SR = JavaLanguageLexer.SR; 4108 /** 4109 * The {@code >>>} (unsigned shift right) operator. 4110 * 4111 * <p>For example:</p> 4112 * <pre> 4113 * a >>> b; 4114 * </pre> 4115 * 4116 * <p>parses as:</p> 4117 * <pre> 4118 * |--EXPR -> EXPR 4119 * | `--BSR -> >>> 4120 * | |--IDENT -> a 4121 * | `--IDENT -> b 4122 * |--SEMI -> ; 4123 * </pre> 4124 * 4125 * @see <a 4126 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.19">Java 4127 * Language Specification, §15.19</a> 4128 * @see #EXPR 4129 **/ 4130 public static final int BSR = JavaLanguageLexer.BSR; 4131 /** 4132 * The {@code +} (addition) operator. 4133 * 4134 * <p>For example:</p> 4135 * <pre> 4136 * c = a + b; 4137 * </pre> 4138 * 4139 * <p>parses as:</p> 4140 * <pre> 4141 * |--EXPR -> EXPR 4142 * | `--ASSIGN -> = 4143 * | |--IDENT -> c 4144 * | `--PLUS -> + 4145 * | |--IDENT -> a 4146 * | `--IDENT -> b 4147 * |--SEMI -> ; 4148 * </pre> 4149 * 4150 * @see <a 4151 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.18">Java 4152 * Language Specification, §15.18</a> 4153 * @see #EXPR 4154 **/ 4155 public static final int PLUS = JavaLanguageLexer.PLUS; 4156 /** 4157 * The {@code -} (subtraction) operator. 4158 * 4159 * <p>For example:</p> 4160 * <pre> 4161 * c = a - b; 4162 * </pre> 4163 * 4164 * <p>parses as:</p> 4165 * <pre> 4166 * |--EXPR -> EXPR 4167 * | `--ASSIGN -> = 4168 * | |--IDENT -> c 4169 * | `--MINUS -> - 4170 * | |--IDENT -> a 4171 * | `--IDENT -> b 4172 * |--SEMI -> ; 4173 * </pre> 4174 * 4175 * @see <a 4176 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.18">Java 4177 * Language Specification, §15.18</a> 4178 * @see #EXPR 4179 **/ 4180 public static final int MINUS = JavaLanguageLexer.MINUS; 4181 /** 4182 * The {@code /} (division) operator. 4183 * 4184 * <p>For example:</p> 4185 * <pre> 4186 * a = 4 / 2; 4187 * </pre> 4188 * 4189 * <p>parses as:</p> 4190 * <pre> 4191 * |--EXPR -> EXPR 4192 * | `--ASSIGN -> = 4193 * | |--IDENT -> a 4194 * | `--DIV -> / 4195 * | |--NUM_INT -> 4 4196 * | `--NUM_INT -> 2 4197 * |--SEMI -> ; 4198 * </pre> 4199 * 4200 * @see <a 4201 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.17.2">Java 4202 * Language Specification, §15.17.2</a> 4203 * @see #EXPR 4204 **/ 4205 public static final int DIV = JavaLanguageLexer.DIV; 4206 /** 4207 * The {@code %} (remainder) operator. 4208 * 4209 * <p>For example:</p> 4210 * <pre> 4211 * c = a % b; 4212 * </pre> 4213 * 4214 * <p>parses as:</p> 4215 * <pre> 4216 * EXPR -> EXPR 4217 * `--ASSIGN -> = 4218 * |--IDENT -> c 4219 * `--MOD -> % 4220 * |--IDENT -> a 4221 * `--IDENT -> b 4222 * SEMI -> ; 4223 * </pre> 4224 * 4225 * @see <a 4226 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.17.3">Java 4227 * Language Specification, §15.17.3</a> 4228 * @see #EXPR 4229 **/ 4230 public static final int MOD = JavaLanguageLexer.MOD; 4231 /** 4232 * The {@code ++} (prefix increment) operator. 4233 * 4234 * <p>For example:</p> 4235 * <pre> 4236 * ++a; 4237 * </pre> 4238 * 4239 * <p>parses as:</p> 4240 * <pre> 4241 * |--EXPR -> EXPR 4242 * | `--INC -> ++ 4243 * | `--IDENT -> a 4244 * |--SEMI -> ; 4245 * </pre> 4246 * 4247 * @see <a 4248 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15.1">Java 4249 * Language Specification, §15.15.1</a> 4250 * @see #EXPR 4251 * @see #POST_INC 4252 **/ 4253 public static final int INC = JavaLanguageLexer.INC; 4254 /** 4255 * The {@code --} (prefix decrement) operator. 4256 * 4257 * <p>For example:</p> 4258 * <pre> 4259 * --a; 4260 * </pre> 4261 * 4262 * <p>parses as:</p> 4263 * <pre> 4264 * |--EXPR -> EXPR 4265 * | `--DEC -> -- 4266 * | `--IDENT -> a 4267 * |--SEMI -> ; 4268 * </pre> 4269 * 4270 * @see <a 4271 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15.2">Java 4272 * Language Specification, §15.15.2</a> 4273 * @see #EXPR 4274 * @see #POST_DEC 4275 **/ 4276 public static final int DEC = JavaLanguageLexer.DEC; 4277 /** 4278 * The {@code ~} (bitwise complement) operator. 4279 * 4280 * <p>For example:</p> 4281 * <pre> 4282 * a = ~ a; 4283 * </pre> 4284 * 4285 * <p>parses as:</p> 4286 * <pre> 4287 * |--EXPR -> EXPR 4288 * | `--ASSIGN -> = 4289 * | |--IDENT -> a 4290 * | `--BNOT -> ~ 4291 * | `--IDENT -> a 4292 * |--SEMI -> ; 4293 * </pre> 4294 * 4295 * @see <a 4296 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15.5">Java 4297 * Language Specification, §15.15.5</a> 4298 * @see #EXPR 4299 **/ 4300 public static final int BNOT = JavaLanguageLexer.BNOT; 4301 /** 4302 * The <code>!</code> (logical complement) operator. 4303 * 4304 * <p>For example:</p> 4305 * <pre> 4306 * c = ! a; 4307 * </pre> 4308 * 4309 * <p>parses as:</p> 4310 * <pre> 4311 * |--EXPR -> EXPR 4312 * | `--ASSIGN -> = 4313 * | |--IDENT -> c 4314 * | `--LNOT -> ! 4315 * | `--IDENT -> a 4316 * |--SEMI -> ; 4317 * </pre> 4318 * 4319 * @see <a 4320 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.15.6">Java 4321 * Language Specification, §15.15.6</a> 4322 * @see #EXPR 4323 * @noinspection HtmlTagCanBeJavadocTag 4324 * @noinspectionreason HtmlTagCanBeJavadocTag - encoded symbols were not decoded 4325 * when replaced with Javadoc tag 4326 **/ 4327 public static final int LNOT = JavaLanguageLexer.LNOT; 4328 /** 4329 * The {@code true} keyword. 4330 * 4331 * <p>For example:</p> 4332 * <pre> 4333 * boolean a = true; 4334 * </pre> 4335 * 4336 * <p>parses as:</p> 4337 * <pre> 4338 * |--VARIABLE_DEF -> VARIABLE_DEF 4339 * | |--MODIFIERS -> MODIFIERS 4340 * | |--TYPE -> TYPE 4341 * | | `--LITERAL_BOOLEAN -> boolean 4342 * | |--IDENT -> a 4343 * | `--ASSIGN -> = 4344 * | `--EXPR -> EXPR 4345 * | `--LITERAL_TRUE -> true 4346 * |--SEMI -> ; 4347 * </pre> 4348 * 4349 * @see <a 4350 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.3">Java 4351 * Language Specification, §3.10.3</a> 4352 * @see #EXPR 4353 * @see #LITERAL_FALSE 4354 **/ 4355 public static final int LITERAL_TRUE = 4356 JavaLanguageLexer.LITERAL_TRUE; 4357 4358 /** 4359 * The {@code false} keyword. 4360 * 4361 * <p>For example:</p> 4362 * <pre> 4363 * boolean a = false; 4364 * </pre> 4365 * 4366 * <p>parses as:</p> 4367 * <pre> 4368 * VARIABLE_DEF -> VARIABLE_DEF 4369 * |--MODIFIERS -> MODIFIERS 4370 * |--TYPE -> TYPE 4371 * | `--LITERAL_BOOLEAN -> boolean 4372 * |--IDENT -> a 4373 * |--ASSIGN -> = 4374 * | `--EXPR -> EXPR 4375 * | `--LITERAL_FALSE -> false 4376 * `--SEMI -> ; 4377 * </pre> 4378 * 4379 * @see <a 4380 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.3">Java 4381 * Language Specification, §3.10.3</a> 4382 * @see #EXPR 4383 * @see #LITERAL_TRUE 4384 **/ 4385 public static final int LITERAL_FALSE = 4386 JavaLanguageLexer.LITERAL_FALSE; 4387 4388 /** 4389 * The {@code null} keyword. 4390 * 4391 * <p>For example:</p> 4392 * <pre> 4393 * String s = null; 4394 * </pre> 4395 * 4396 * <p>parses as:</p> 4397 * <pre> 4398 * VARIABLE_DEF -> VARIABLE_DEF 4399 * |--MODIFIERS -> MODIFIERS 4400 * |--TYPE -> TYPE 4401 * | `--IDENT -> String 4402 * |--IDENT -> s 4403 * |--ASSIGN -> = 4404 * | `--EXPR -> EXPR 4405 * | `--LITERAL_NULL -> null 4406 * `--SEMI -> ; 4407 * </pre> 4408 * 4409 * @see <a 4410 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.7">Java 4411 * Language Specification, §3.10.7</a> 4412 * @see #EXPR 4413 **/ 4414 public static final int LITERAL_NULL = 4415 JavaLanguageLexer.LITERAL_NULL; 4416 4417 /** 4418 * The {@code new} keyword. This element is used to define 4419 * new instances of objects, new arrays, and new anonymous inner 4420 * classes. 4421 * 4422 * <p>For example:</p> 4423 * 4424 * <pre> 4425 * List<String> l = new ArrayList<String>(); 4426 * </pre> 4427 * 4428 * <p>parses as:</p> 4429 * <pre> 4430 * VARIABLE_DEF -> VARIABLE_DEF 4431 * |--MODIFIERS -> MODIFIERS 4432 * |--TYPE -> TYPE 4433 * | |--IDENT -> List 4434 * | `--TYPE_ARGUMENTS -> TYPE_ARGUMENTS 4435 * | |--GENERIC_START -> < 4436 * | |--TYPE_ARGUMENT -> TYPE_ARGUMENT 4437 * | | `--IDENT -> String 4438 * | `--GENERIC_END -> > 4439 * |--IDENT -> l 4440 * |--ASSIGN -> = 4441 * | `--EXPR -> EXPR 4442 * | `--LITERAL_NEW -> new 4443 * | |--IDENT -> ArrayList 4444 * | |--TYPE_ARGUMENTS -> TYPE_ARGUMENTS 4445 * | | |--GENERIC_START -> < 4446 * | | |--TYPE_ARGUMENT -> TYPE_ARGUMENT 4447 * | | | `--IDENT -> String 4448 * | | `--GENERIC_END -> > 4449 * | |--LPAREN -> ( 4450 * | |--ELIST -> ELIST 4451 * | `--RPAREN -> ) 4452 * `--SEMI -> ; 4453 * </pre> 4454 * 4455 * <p>For example:</p> 4456 * <pre> 4457 * String[] strings = new String[3]; 4458 * </pre> 4459 * 4460 * <p>parses as:</p> 4461 * <pre> 4462 * VARIABLE_DEF -> VARIABLE_DEF 4463 * |--MODIFIERS -> MODIFIERS 4464 * |--TYPE -> TYPE 4465 * | |--IDENT -> String 4466 * | `--ARRAY_DECLARATOR -> [ 4467 * | `--RBRACK -> ] 4468 * |--IDENT -> strings 4469 * |--ASSIGN -> = 4470 * | `--EXPR -> EXPR 4471 * | `--LITERAL_NEW -> new 4472 * | |--IDENT -> String 4473 * | `--ARRAY_DECLARATOR -> [ 4474 * | |--EXPR -> EXPR 4475 * | | `--NUM_INT -> 3 4476 * | `--RBRACK -> ] 4477 * `--SEMI -> ; 4478 * </pre> 4479 * 4480 * <p>For example:</p> 4481 * <pre> 4482 * Supplier<Integer> s = new Supplier<>() { 4483 * @Override 4484 * public Integer get() { 4485 * return 42; 4486 * } 4487 * }; 4488 * </pre> 4489 * 4490 * <p>parses as:</p> 4491 * <pre> 4492 * VARIABLE_DEF -> VARIABLE_DEF 4493 * |--MODIFIERS -> MODIFIERS 4494 * |--TYPE -> TYPE 4495 * | |--IDENT -> Supplier 4496 * | `--TYPE_ARGUMENTS -> TYPE_ARGUMENTS 4497 * | |--GENERIC_START -> < 4498 * | |--TYPE_ARGUMENT -> TYPE_ARGUMENT 4499 * | | `--IDENT -> Integer 4500 * | `--GENERIC_END -> > 4501 * |--IDENT -> s 4502 * |--ASSIGN -> = 4503 * | `--EXPR -> EXPR 4504 * | `--LITERAL_NEW -> new 4505 * | |--IDENT -> Supplier 4506 * | |--TYPE_ARGUMENTS -> TYPE_ARGUMENTS 4507 * | | |--GENERIC_START -> < 4508 * | | `--GENERIC_END -> > 4509 * | |--LPAREN -> ( 4510 * | |--ELIST -> ELIST 4511 * | |--RPAREN -> ) 4512 * | `--OBJBLOCK -> OBJBLOCK 4513 * | |--LCURLY -> { 4514 * | |--METHOD_DEF -> METHOD_DEF 4515 * | | |--MODIFIERS -> MODIFIERS 4516 * | | | |--ANNOTATION -> ANNOTATION 4517 * | | | | |--AT -> @ 4518 * | | | | `--IDENT -> Override 4519 * | | | `--LITERAL_PUBLIC -> public 4520 * | | |--TYPE -> TYPE 4521 * | | | `--IDENT -> Integer 4522 * | | |--IDENT -> get 4523 * | | |--LPAREN -> ( 4524 * | | |--PARAMETERS -> PARAMETERS 4525 * | | |--RPAREN -> ) 4526 * | | `--SLIST -> { 4527 * | | |--LITERAL_RETURN -> return 4528 * | | | |--EXPR -> EXPR 4529 * | | | | `--NUM_INT -> 42 4530 * | | | `--SEMI -> ; 4531 * | | `--RCURLY -> } 4532 * | `--RCURLY -> } 4533 * `--SEMI -> ; 4534 * </pre> 4535 * 4536 * @see #IDENT 4537 * @see #DOT 4538 * @see #LPAREN 4539 * @see #ELIST 4540 * @see #RPAREN 4541 * @see #OBJBLOCK 4542 * @see #ARRAY_INIT 4543 * @see FullIdent 4544 **/ 4545 public static final int LITERAL_NEW = JavaLanguageLexer.LITERAL_NEW; 4546 /** 4547 * An integer literal. These may be specified in decimal, 4548 * hexadecimal, or octal form. 4549 * 4550 * <p>For example:</p> 4551 * <pre> 4552 * a = 3; 4553 * </pre> 4554 * 4555 * <p>parses as:</p> 4556 * <pre> 4557 * |--EXPR -> EXPR 4558 * | `--ASSIGN -> = 4559 * | |--IDENT -> a 4560 * | `--NUM_INT -> 3 4561 * |--SEMI -> ; 4562 * </pre> 4563 * 4564 * @see <a 4565 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.1">Java 4566 * Language Specification, §3.10.1</a> 4567 * @see #EXPR 4568 * @see #NUM_LONG 4569 **/ 4570 public static final int NUM_INT = JavaLanguageLexer.NUM_INT; 4571 /** 4572 * A character literal. This is a (possibly escaped) character 4573 * enclosed in single quotes. 4574 * 4575 * <p>For example:</p> 4576 * <pre> 4577 * return 'a'; 4578 * </pre> 4579 * 4580 * <p>parses as:</p> 4581 * <pre> 4582 * --LITERAL_RETURN -> return 4583 * |--EXPR -> EXPR 4584 * | `--CHAR_LITERAL -> 'a' 4585 * `--SEMI -> ; 4586 * </pre> 4587 * 4588 * @see <a 4589 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.4">Java 4590 * Language Specification, §3.10.4</a> 4591 * @see #EXPR 4592 **/ 4593 public static final int CHAR_LITERAL = 4594 JavaLanguageLexer.CHAR_LITERAL; 4595 4596 /** 4597 * A string literal. This is a sequence of (possibly escaped) 4598 * characters enclosed in double quotes. 4599 * 4600 * <p>For example:</p> 4601 * <pre>String str = "StringLiteral";</pre> 4602 * 4603 * <p>parses as:</p> 4604 * <pre> 4605 * |--VARIABLE_DEF -> VARIABLE_DEF 4606 * | |--MODIFIERS -> MODIFIERS 4607 * | |--TYPE -> TYPE 4608 * | | `--IDENT -> String 4609 * | |--IDENT -> str 4610 * | `--ASSIGN -> = 4611 * | `--EXPR -> EXPR 4612 * | `--STRING_LITERAL -> "StringLiteral" 4613 * |--SEMI -> ; 4614 * </pre> 4615 * 4616 * @see <a 4617 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.5">Java 4618 * Language Specification, §3.10.5</a> 4619 * @see #EXPR 4620 **/ 4621 public static final int STRING_LITERAL = 4622 JavaLanguageLexer.STRING_LITERAL; 4623 4624 /** 4625 * A single precision floating point literal. This is a floating 4626 * point number with an {@code F} or {@code f} suffix. 4627 * 4628 * <p>For example:</p> 4629 * <pre> 4630 * a = 3.14f; 4631 * </pre> 4632 * 4633 * <p>parses as:</p> 4634 * <pre> 4635 * |--EXPR -> EXPR 4636 * | `--ASSIGN -> = 4637 * | |--IDENT -> a 4638 * | `--NUM_FLOAT -> 3.14f 4639 * |--SEMI -> ; 4640 * </pre> 4641 * 4642 * @see <a 4643 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.2">Java 4644 * Language Specification, §3.10.2</a> 4645 * @see #EXPR 4646 * @see #NUM_DOUBLE 4647 **/ 4648 public static final int NUM_FLOAT = JavaLanguageLexer.NUM_FLOAT; 4649 /** 4650 * A long integer literal. These are almost the same as integer 4651 * literals, but they have an {@code L} or {@code l} 4652 * (ell) suffix. 4653 * 4654 * <p>For example:</p> 4655 * <pre> 4656 * a = 3l; 4657 * </pre> 4658 * 4659 * <p>parses as:</p> 4660 * <pre> 4661 * |--EXPR -> EXPR 4662 * | `--ASSIGN -> = 4663 * | |--IDENT -> a 4664 * | `--NUM_LONG -> 3l 4665 * |--SEMI -> ; 4666 * </pre> 4667 * 4668 * @see <a 4669 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.1">Java 4670 * Language Specification, §3.10.1</a> 4671 * @see #EXPR 4672 * @see #NUM_INT 4673 **/ 4674 public static final int NUM_LONG = JavaLanguageLexer.NUM_LONG; 4675 /** 4676 * A double precision floating point literal. This is a floating 4677 * point number with an optional {@code D} or {@code d} 4678 * suffix. 4679 * 4680 * <p>For example:</p> 4681 * <pre> 4682 * a = 3.14d; 4683 * </pre> 4684 * 4685 * <p>parses as:</p> 4686 * <pre> 4687 * |--EXPR -> EXPR 4688 * | `--ASSIGN -> = 4689 * | |--IDENT -> a 4690 * | `--NUM_DOUBLE -> 3.14d 4691 * |--SEMI -> ; 4692 * </pre> 4693 * 4694 * @see <a 4695 * href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.2">Java 4696 * Language Specification, §3.10.2</a> 4697 * @see #EXPR 4698 * @see #NUM_FLOAT 4699 **/ 4700 public static final int NUM_DOUBLE = JavaLanguageLexer.NUM_DOUBLE; 4701 4702 /** 4703 * The {@code assert} keyword. This is only for Java 1.4 and 4704 * later. 4705 * 4706 * <p>For example:</p> 4707 * <pre> 4708 * assert(x==4); 4709 * </pre> 4710 * 4711 * <p>parses as:</p> 4712 * <pre> 4713 * LITERAL_ASSERT -> assert 4714 * |--EXPR -> EXPR 4715 * | |--LPAREN -> ( 4716 * | |--EQUAL -> == 4717 * | | |--IDENT -> x 4718 * | | `--NUM_INT -> 4 4719 * | `--RPAREN -> ) 4720 * `--SEMI -> ; 4721 * </pre> 4722 **/ 4723 public static final int LITERAL_ASSERT = JavaLanguageLexer.ASSERT; 4724 4725 /** 4726 * A static import declaration. Static import declarations are optional, 4727 * but must appear after the package declaration and before the type 4728 * declaration. 4729 * 4730 * <p>For example:</p> 4731 * <pre> 4732 * import static java.io.IOException; 4733 * </pre> 4734 * 4735 * <p>parses as:</p> 4736 * <pre> 4737 * STATIC_IMPORT -> import 4738 * |--LITERAL_STATIC -> static 4739 * |--DOT -> . 4740 * | |--DOT -> . 4741 * | | |--IDENT -> java 4742 * | | `--IDENT -> io 4743 * | `--IDENT -> IOException 4744 * `--SEMI -> ; 4745 * </pre> 4746 * 4747 * @see <a href="https://www.jcp.org/en/jsr/detail?id=201"> 4748 * JSR201</a> 4749 * @see #LITERAL_STATIC 4750 * @see #DOT 4751 * @see #IDENT 4752 * @see #STAR 4753 * @see #SEMI 4754 * @see FullIdent 4755 **/ 4756 public static final int STATIC_IMPORT = 4757 JavaLanguageLexer.STATIC_IMPORT; 4758 4759 /** 4760 * An enum declaration. Its notable children are 4761 * enum constant declarations followed by 4762 * any construct that may be expected in a class body. 4763 * 4764 * <p>For example:</p> 4765 * <pre> 4766 * public enum MyEnum 4767 * implements Serializable 4768 * { 4769 * FIRST_CONSTANT, 4770 * SECOND_CONSTANT; 4771 * 4772 * public void someMethod() 4773 * { 4774 * } 4775 * } 4776 * </pre> 4777 * 4778 * <p>parses as:</p> 4779 * <pre> 4780 * ENUM_DEF -> ENUM_DEF 4781 * |--MODIFIERS -> MODIFIERS 4782 * | `--LITERAL_PUBLIC -> public 4783 * |--ENUM -> enum 4784 * |--IDENT -> MyEnum 4785 * |--IMPLEMENTS_CLAUSE -> implements 4786 * | `--IDENT -> Serializable 4787 * `--OBJBLOCK -> OBJBLOCK 4788 * |--LCURLY -> { 4789 * |--ENUM_CONSTANT_DEF -> ENUM_CONSTANT_DEF 4790 * | |--ANNOTATIONS -> ANNOTATIONS 4791 * | `--IDENT -> FIRST_CONSTANT 4792 * |--COMMA -> , 4793 * |--ENUM_CONSTANT_DEF -> ENUM_CONSTANT_DEF 4794 * | |--ANNOTATIONS -> ANNOTATIONS 4795 * | `--IDENT -> SECOND_CONSTANT 4796 * |--SEMI -> ; 4797 * |--METHOD_DEF -> METHOD_DEF 4798 * | |--MODIFIERS -> MODIFIERS 4799 * | | `--LITERAL_PUBLIC -> public 4800 * | |--TYPE -> TYPE 4801 * | | `--LITERAL_VOID -> void 4802 * | |--IDENT -> someMethod 4803 * | |--LPAREN -> ( 4804 * | |--PARAMETERS -> PARAMETERS 4805 * | |--RPAREN -> ) 4806 * | `--SLIST -> { 4807 * | `--RCURLY -> } 4808 * `--RCURLY -> } 4809 * </pre> 4810 * 4811 * @see <a href="https://www.jcp.org/en/jsr/detail?id=201"> 4812 * JSR201</a> 4813 * @see #MODIFIERS 4814 * @see #ENUM 4815 * @see #IDENT 4816 * @see #EXTENDS_CLAUSE 4817 * @see #IMPLEMENTS_CLAUSE 4818 * @see #OBJBLOCK 4819 * @see #LITERAL_NEW 4820 * @see #ENUM_CONSTANT_DEF 4821 **/ 4822 public static final int ENUM_DEF = 4823 JavaLanguageLexer.ENUM_DEF; 4824 4825 /** 4826 * The {@code enum} keyword. This element appears 4827 * as part of an enum declaration. 4828 * 4829 * <p>For example:</p> 4830 * <pre> 4831 * public enum Count {} 4832 * </pre> 4833 * 4834 * <p>parses as:</p> 4835 * <pre> 4836 * ENUM_DEF -> ENUM_DEF 4837 * |--MODIFIERS -> MODIFIERS 4838 * | `--LITERAL_PUBLIC -> public 4839 * |--ENUM -> enum 4840 * |--IDENT -> Count 4841 * `--OBJBLOCK -> OBJBLOCK 4842 * |--LCURLY -> { 4843 * `--RCURLY -> } 4844 * </pre> 4845 * 4846 * @see <a href="https://www.jcp.org/en/jsr/detail?id=201">JSR201</a> 4847 * @see #MODIFIERS 4848 * @see #ENUM_DEF 4849 * @see #IDENT 4850 * @see #OBJBLOCK 4851 **/ 4852 public static final int ENUM = 4853 JavaLanguageLexer.ENUM; 4854 4855 /** 4856 * An enum constant declaration. Its notable children are annotations, 4857 * arguments and object block akin to an anonymous 4858 * inner class' body. 4859 * 4860 * <p>For example:</p> 4861 * <pre> 4862 * SOME_CONSTANT(1) 4863 * { 4864 * public void someMethodOverriddenFromMainBody() 4865 * { 4866 * } 4867 * } 4868 * </pre> 4869 * 4870 * <p>parses as:</p> 4871 * <pre> 4872 * ENUM_CONSTANT_DEF -> ENUM_CONSTANT_DEF 4873 * | |--ANNOTATIONS -> ANNOTATIONS 4874 * | |--IDENT -> SOME_CONSTANT 4875 * | |--LPAREN -> ( 4876 * | |--ELIST -> ELIST 4877 * | | `--EXPR -> EXPR 4878 * | | `--NUM_INT -> 1 4879 * | |--RPAREN -> ) 4880 * | `--OBJBLOCK -> OBJBLOCK 4881 * | |--LCURLY -> { 4882 * | |--METHOD_DEF -> METHOD_DEF 4883 * | | |--MODIFIERS -> MODIFIERS 4884 * | | | `--LITERAL_PUBLIC -> public 4885 * | | |--TYPE -> TYPE 4886 * | | | `--LITERAL_VOID -> void 4887 * | | |--IDENT -> someMethodOverriddenFromMainBody 4888 * | | |--LPAREN -> ( 4889 * | | |--PARAMETERS -> PARAMETERS 4890 * | | |--RPAREN -> ) 4891 * | | `--SLIST -> { 4892 * | | `--RCURLY -> } 4893 * | `--RCURLY -> } 4894 * </pre> 4895 * 4896 * @see <a href="https://www.jcp.org/en/jsr/detail?id=201"> 4897 * JSR201</a> 4898 * @see #ANNOTATIONS 4899 * @see #MODIFIERS 4900 * @see #IDENT 4901 * @see #ELIST 4902 * @see #OBJBLOCK 4903 **/ 4904 public static final int ENUM_CONSTANT_DEF = 4905 JavaLanguageLexer.ENUM_CONSTANT_DEF; 4906 4907 /** 4908 * A for-each clause. This is a child of 4909 * {@code LITERAL_FOR}. The children of this element may be 4910 * a parameter definition, the colon literal and an expression. 4911 * 4912 * <p>For example:</p> 4913 * <pre> 4914 * for (int value : values) { 4915 * doSmth(); 4916 * } 4917 * </pre> 4918 * 4919 * <p>parses as:</p> 4920 * <pre> 4921 * LITERAL_FOR -> for 4922 * |--LPAREN -> ( 4923 * |--FOR_EACH_CLAUSE -> FOR_EACH_CLAUSE 4924 * | |--VARIABLE_DEF -> VARIABLE_DEF 4925 * | | |--MODIFIERS -> MODIFIERS 4926 * | | |--TYPE -> TYPE 4927 * | | | `--LITERAL_INT -> int 4928 * | | `--IDENT -> value 4929 * | |--COLON -> : 4930 * | `--EXPR -> EXPR 4931 * | `--IDENT -> values 4932 * |--RPAREN -> ) 4933 * `--SLIST -> { 4934 * |--EXPR -> EXPR 4935 * | `--METHOD_CALL -> ( 4936 * | |--IDENT -> doSmth 4937 * | |--ELIST -> ELIST 4938 * | `--RPAREN -> ) 4939 * |--SEMI -> ; 4940 * `--RCURLY -> } 4941 * </pre> 4942 * 4943 * @see #VARIABLE_DEF 4944 * @see #ELIST 4945 * @see #LITERAL_FOR 4946 **/ 4947 public static final int FOR_EACH_CLAUSE = 4948 JavaLanguageLexer.FOR_EACH_CLAUSE; 4949 4950 /** 4951 * An annotation declaration. The notable children are the name of the 4952 * annotation type, annotation field declarations and (constant) fields. 4953 * 4954 * <p>For example:</p> 4955 * <pre> 4956 * public @interface MyAnnotation 4957 * { 4958 * int someValue(); 4959 * } 4960 * </pre> 4961 * 4962 * <p>parses as:</p> 4963 * <pre> 4964 * ANNOTATION_DEF -> ANNOTATION_DEF 4965 * |--MODIFIERS -> MODIFIERS 4966 * | `--LITERAL_PUBLIC -> public 4967 * |--AT -> @ 4968 * |--LITERAL_INTERFACE -> interface 4969 * |--IDENT -> MyAnnotation 4970 * `--OBJBLOCK -> OBJBLOCK 4971 * |--LCURLY -> { 4972 * |--ANNOTATION_FIELD_DEF -> ANNOTATION_FIELD_DEF 4973 * | |--MODIFIERS -> MODIFIERS 4974 * | |--TYPE -> TYPE 4975 * | | `--LITERAL_INT -> int 4976 * | |--IDENT -> someValue 4977 * | |--LPAREN -> ( 4978 * | |--RPAREN -> ) 4979 * | `--SEMI -> ; 4980 * `--RCURLY -> } 4981 * </pre> 4982 * 4983 * @see <a href="https://www.jcp.org/en/jsr/detail?id=201"> 4984 * JSR201</a> 4985 * @see #MODIFIERS 4986 * @see #LITERAL_INTERFACE 4987 * @see #IDENT 4988 * @see #OBJBLOCK 4989 * @see #ANNOTATION_FIELD_DEF 4990 **/ 4991 public static final int ANNOTATION_DEF = 4992 JavaLanguageLexer.ANNOTATION_DEF; 4993 4994 /** 4995 * An annotation field declaration. The notable children are modifiers, 4996 * field type, field name and an optional default value (a conditional 4997 * compile-time constant expression). Default values may also be 4998 * annotations. 4999 * 5000 * <p>For example:</p> 5001 * 5002 * <pre> 5003 * String someField() default "Hello world"; 5004 * </pre> 5005 * 5006 * <p>parses as:</p> 5007 * 5008 * <pre> 5009 * ANNOTATION_FIELD_DEF -> ANNOTATION_FIELD_DEF 5010 * |--MODIFIERS -> MODIFIERS 5011 * |--TYPE -> TYPE 5012 * | `--IDENT -> String 5013 * |--IDENT -> someField 5014 * |--LPAREN -> ( 5015 * |--RPAREN -> ) 5016 * |--LITERAL_DEFAULT -> default 5017 * | `--EXPR -> EXPR 5018 * | `--STRING_LITERAL -> "Hello world" 5019 * `--SEMI -> ; 5020 * </pre> 5021 * 5022 * @see <a href="https://www.jcp.org/en/jsr/detail?id=201"> 5023 * JSR201</a> 5024 * @see #MODIFIERS 5025 * @see #TYPE 5026 * @see #LITERAL_DEFAULT 5027 */ 5028 public static final int ANNOTATION_FIELD_DEF = 5029 JavaLanguageLexer.ANNOTATION_FIELD_DEF; 5030 5031 // note: @ is the html escape for '@', 5032 // used here to avoid confusing the javadoc tool 5033 /** 5034 * A collection of annotations on a package or enum constant. 5035 * A collections of annotations will only occur on these nodes 5036 * as all other nodes that may be qualified with an annotation can 5037 * be qualified with any other modifier and hence these annotations 5038 * would be contained in a {@link #MODIFIERS} node. 5039 * 5040 * <p>For example:</p> 5041 * 5042 * <pre> 5043 * @MyAnnotation package blah; 5044 * </pre> 5045 * 5046 * <p>parses as:</p> 5047 * 5048 * <pre> 5049 * PACKAGE_DEF -> package 5050 * |--ANNOTATIONS -> ANNOTATIONS 5051 * | `--ANNOTATION -> ANNOTATION 5052 * | |--AT -> @ 5053 * | `--IDENT -> MyAnnotation 5054 * |--IDENT -> blah 5055 * `--SEMI -> ; 5056 * </pre> 5057 * 5058 * @see <a href="https://www.jcp.org/en/jsr/detail?id=201"> 5059 * JSR201</a> 5060 * @see #ANNOTATION 5061 * @see #AT 5062 * @see #IDENT 5063 */ 5064 public static final int ANNOTATIONS = 5065 JavaLanguageLexer.ANNOTATIONS; 5066 5067 // note: @ is the html escape for '@', 5068 // used here to avoid confusing the javadoc tool 5069 /** 5070 * An annotation of a package, type, field, parameter or variable. 5071 * An annotation may occur anywhere modifiers occur (it is a 5072 * type of modifier) and may also occur prior to a package definition. 5073 * The notable children are: The annotation name and either a single 5074 * default annotation value or a sequence of name value pairs. 5075 * Annotation values may also be annotations themselves. 5076 * 5077 * <p>For example:</p> 5078 * <pre> 5079 * @MyAnnotation(someField1 = "Hello", 5080 * someField2 = @SomeOtherAnnotation) 5081 * </pre> 5082 * 5083 * <p>parses as:</p> 5084 * <pre> 5085 * ANNOTATION -> ANNOTATION 5086 * |--AT -> @ 5087 * |--IDENT -> MyAnnotation 5088 * |--LPAREN -> ( 5089 * |--ANNOTATION_MEMBER_VALUE_PAIR -> ANNOTATION_MEMBER_VALUE_PAIR 5090 * | |--IDENT -> someField1 5091 * | |--ASSIGN -> = 5092 * | `--EXPR -> EXPR 5093 * | `--STRING_LITERAL -> "Hello" 5094 * |--COMMA -> , 5095 * |--ANNOTATION_MEMBER_VALUE_PAIR -> ANNOTATION_MEMBER_VALUE_PAIR 5096 * | |--IDENT -> someField2 5097 * | |--ASSIGN -> = 5098 * | `--ANNOTATION -> ANNOTATION 5099 * | |--AT -> @ 5100 * | `--IDENT -> SomeOtherAnnotation 5101 * `--RPAREN -> ) 5102 * </pre> 5103 * 5104 * @see <a href="https://www.jcp.org/en/jsr/detail?id=201"> 5105 * JSR201</a> 5106 * @see #MODIFIERS 5107 * @see #IDENT 5108 * @see #ANNOTATION_MEMBER_VALUE_PAIR 5109 */ 5110 public static final int ANNOTATION = 5111 JavaLanguageLexer.ANNOTATION; 5112 5113 /** 5114 * An initialization of an annotation member with a value. 5115 * Its children are the name of the member, the assignment literal 5116 * and the (compile-time constant conditional expression) value. 5117 * 5118 * <p>For example:</p> 5119 * <pre> 5120 * @Annotation( 5121 * value="123" 5122 * ) 5123 * </pre> 5124 * 5125 * <p>parses as:</p> 5126 * <pre> 5127 * ANNOTATION -> ANNOTATION 5128 * |--AT -> @ 5129 * |--IDENT -> Annotation 5130 * |--LPAREN -> ( 5131 * |--ANNOTATION_MEMBER_VALUE_PAIR -> ANNOTATION_MEMBER_VALUE_PAIR 5132 * | |--IDENT -> value 5133 * | |--ASSIGN -> = 5134 * | `--EXPR -> EXPR 5135 * | `--STRING_LITERAL -> "123" 5136 * `--RPAREN -> ) 5137 * </pre> 5138 * 5139 * @see <a href="https://www.jcp.org/en/jsr/detail?id=201"> 5140 * JSR201</a> 5141 * @see #ANNOTATION 5142 * @see #IDENT 5143 */ 5144 public static final int ANNOTATION_MEMBER_VALUE_PAIR = 5145 JavaLanguageLexer.ANNOTATION_MEMBER_VALUE_PAIR; 5146 5147 /** 5148 * An annotation array member initialization. 5149 * Initializers can not be nested. 5150 * An initializer may be present as a default to an annotation 5151 * member, as the single default value to an annotation 5152 * (e.g. @Annotation({1,2})) or as the value of an annotation 5153 * member value pair. 5154 * 5155 * <p>For example:</p> 5156 * <pre> 5157 * @Annotation({1, 2}) 5158 * </pre> 5159 * 5160 * <p>parses as:</p> 5161 * <pre> 5162 * ANNOTATION -> ANNOTATION 5163 * |--AT -> @ 5164 * |--IDENT -> Annotation 5165 * |--LPAREN -> ( 5166 * |--ANNOTATION_ARRAY_INIT -> { 5167 * | |--EXPR -> EXPR 5168 * | | `--NUM_INT -> 1 5169 * | |--COMMA -> , 5170 * | |--EXPR -> EXPR 5171 * | | `--NUM_INT -> 2 5172 * | `--RCURLY -> } 5173 * `--RPAREN -> ) 5174 * </pre> 5175 * 5176 * @see <a href="https://www.jcp.org/en/jsr/detail?id=201"> 5177 * JSR201</a> 5178 * @see #ANNOTATION 5179 * @see #IDENT 5180 * @see #ANNOTATION_MEMBER_VALUE_PAIR 5181 */ 5182 public static final int ANNOTATION_ARRAY_INIT = 5183 JavaLanguageLexer.ANNOTATION_ARRAY_INIT; 5184 5185 /** 5186 * A list of type parameters to a class, interface or 5187 * method definition. Children are LT, at least one 5188 * TYPE_PARAMETER, zero or more of: a COMMAs followed by a single 5189 * TYPE_PARAMETER and a final GT. 5190 * 5191 * <p>For example:</p> 5192 * 5193 * <pre> 5194 * public class MyClass<A, B> { 5195 * 5196 * } 5197 * </pre> 5198 * 5199 * <p>parses as:</p> 5200 * 5201 * <pre> 5202 * CLASS_DEF -> CLASS_DEF 5203 * |--MODIFIERS -> MODIFIERS 5204 * | `--LITERAL_PUBLIC -> public 5205 * |--LITERAL_CLASS -> class 5206 * |--IDENT -> MyClass 5207 * |--TYPE_PARAMETERS -> TYPE_PARAMETERS 5208 * | |--GENERIC_START -> < 5209 * | |--TYPE_PARAMETER -> TYPE_PARAMETER 5210 * | | `--IDENT -> A 5211 * | |--COMMA -> , 5212 * | |--TYPE_PARAMETER -> TYPE_PARAMETER 5213 * | | `--IDENT -> B 5214 * | `--GENERIC_END -> > 5215 * `--OBJBLOCK -> OBJBLOCK 5216 * |--LCURLY -> { 5217 * `--RCURLY -> } 5218 * </pre> 5219 * 5220 * @see <a href="https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-8.1.2"> 5221 * Generic Classes and Type Parameters</a> 5222 * @see #GENERIC_START 5223 * @see #GENERIC_END 5224 * @see #TYPE_PARAMETER 5225 * @see #COMMA 5226 */ 5227 public static final int TYPE_PARAMETERS = 5228 JavaLanguageLexer.TYPE_PARAMETERS; 5229 5230 /** 5231 * A type parameter to a class, interface or method definition. 5232 * Children are the type name and an optional TYPE_UPPER_BOUNDS. 5233 * 5234 * <p>For example:</p> 5235 * 5236 * <pre> 5237 * public class MyClass <A extends Collection> { 5238 * 5239 * } 5240 * </pre> 5241 * 5242 * <p>parses as:</p> 5243 * 5244 * <pre> 5245 * CLASS_DEF -> CLASS_DEF 5246 * |--MODIFIERS -> MODIFIERS 5247 * | `--LITERAL_PUBLIC -> public 5248 * |--LITERAL_CLASS -> class 5249 * |--IDENT -> MyClass 5250 * |--TYPE_PARAMETERS -> TYPE_PARAMETERS 5251 * | |--GENERIC_START -> < 5252 * | |--TYPE_PARAMETER -> TYPE_PARAMETER 5253 * | | |--IDENT -> A 5254 * | | `--TYPE_UPPER_BOUNDS -> extends 5255 * | | `--IDENT -> Collection 5256 * | `--GENERIC_END -> > 5257 * `--OBJBLOCK -> OBJBLOCK 5258 * |--LCURLY -> { 5259 * `--RCURLY -> } 5260 * </pre> 5261 * 5262 * @see <a href="https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-8.1.2"> 5263 * Generic Classes and Type Parameters</a> 5264 * @see #IDENT 5265 * @see #WILDCARD_TYPE 5266 * @see #TYPE_UPPER_BOUNDS 5267 */ 5268 public static final int TYPE_PARAMETER = 5269 JavaLanguageLexer.TYPE_PARAMETER; 5270 5271 /** 5272 * A list of type arguments to a type reference or 5273 * a method/ctor invocation. Children are GENERIC_START, at least one 5274 * TYPE_ARGUMENT, zero or more of a COMMAs followed by a single 5275 * TYPE_ARGUMENT, and a final GENERIC_END. 5276 * 5277 * <p>For example:</p> 5278 * 5279 * <pre> 5280 * public Collection<?> a; 5281 * </pre> 5282 * 5283 * <p>parses as:</p> 5284 * 5285 * <pre> 5286 * VARIABLE_DEF -> VARIABLE_DEF 5287 * |--MODIFIERS -> MODIFIERS 5288 * | `--LITERAL_PUBLIC -> public 5289 * |--TYPE -> TYPE 5290 * | |--IDENT -> Collection 5291 * | `--TYPE_ARGUMENTS -> TYPE_ARGUMENTS 5292 * | |--GENERIC_START -> < 5293 * | |--TYPE_ARGUMENT -> TYPE_ARGUMENT 5294 * | | `--WILDCARD_TYPE -> ? 5295 * | `--GENERIC_END -> > 5296 * |--IDENT -> a 5297 * `--SEMI -> ; 5298 * </pre> 5299 * 5300 * @see #GENERIC_START 5301 * @see #GENERIC_END 5302 * @see #TYPE_ARGUMENT 5303 * @see #COMMA 5304 */ 5305 public static final int TYPE_ARGUMENTS = 5306 JavaLanguageLexer.TYPE_ARGUMENTS; 5307 5308 /** 5309 * A type arguments to a type reference or a method/ctor invocation. 5310 * Children are either: type name or wildcard type with possible type 5311 * upper or lower bounds. 5312 * 5313 * <p>For example:</p> 5314 * <pre>List<? super List> list;</pre> 5315 * 5316 * <p>parses as:</p> 5317 * <pre> 5318 * VARIABLE_DEF -> VARIABLE_DEF 5319 * |--MODIFIERS -> MODIFIERS 5320 * |--TYPE -> TYPE 5321 * | |--IDENT -> List 5322 * | `--TYPE_ARGUMENTS -> TYPE_ARGUMENTS 5323 * | |--GENERIC_START -> < 5324 * | |--TYPE_ARGUMENT -> TYPE_ARGUMENT 5325 * | | |--WILDCARD_TYPE -> ? 5326 * | | `--TYPE_LOWER_BOUNDS -> super 5327 * | | `--IDENT -> List 5328 * | `--GENERIC_END -> > 5329 * |--IDENT -> list 5330 * `--SEMI -> ; 5331 * </pre> 5332 * 5333 * @see <a href="https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-8.1.2"> 5334 * Generic Classes and Type Parameters</a> 5335 * @see #WILDCARD_TYPE 5336 * @see #TYPE_UPPER_BOUNDS 5337 * @see #TYPE_LOWER_BOUNDS 5338 */ 5339 public static final int TYPE_ARGUMENT = 5340 JavaLanguageLexer.TYPE_ARGUMENT; 5341 5342 /** 5343 * The type that refers to all types. This node has no children. 5344 * 5345 * <p>For example: </p> 5346 * <pre> 5347 * 5348 * List<?> list; 5349 * </pre> 5350 * 5351 * <p>parses as:</p> 5352 * <pre> 5353 * |--VARIABLE_DEF -> VARIABLE_DEF 5354 * | |--MODIFIERS -> MODIFIERS 5355 * | |--TYPE -> TYPE 5356 * | | |--IDENT -> List 5357 * | | |`--TYPE_ARGUMENTS -> TYPE_ARGUMENTS 5358 * | | |--GENERIC_START -> < 5359 * | | |--TYPE_ARGUMENT -> TYPE_ARGUMENT 5360 * | | | `--WILDCARD_TYPE -> ? 5361 * | | `--GENERIC_END -> > 5362 * | `--IDENT -> list 5363 * |--SEMI -> ; 5364 * </pre> 5365 * 5366 * @see <a href="https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-8.1.2"> 5367 * Generic Classes and Type Parameters</a> 5368 * @see #TYPE_ARGUMENT 5369 * @see #TYPE_UPPER_BOUNDS 5370 * @see #TYPE_LOWER_BOUNDS 5371 */ 5372 public static final int WILDCARD_TYPE = 5373 JavaLanguageLexer.WILDCARD_TYPE; 5374 5375 /** 5376 * An upper bounds on a wildcard type argument or type parameter. 5377 * This node has one child - the type that is being used for 5378 * the bounding. 5379 * 5380 * <p>For example:</p> 5381 * <pre>List<? extends Number> list;</pre> 5382 * 5383 * <p>parses as:</p> 5384 * <pre> 5385 * --VARIABLE_DEF -> VARIABLE_DEF 5386 * |--MODIFIERS -> MODIFIERS 5387 * |--TYPE -> TYPE 5388 * | |--IDENT -> List 5389 * | `--TYPE_ARGUMENTS -> TYPE_ARGUMENTS 5390 * | |--GENERIC_START -> < 5391 * | |--TYPE_ARGUMENT -> TYPE_ARGUMENT 5392 * | | |--WILDCARD_TYPE -> ? 5393 * | | `--TYPE_UPPER_BOUNDS -> extends 5394 * | | `--IDENT -> Number 5395 * | `--GENERIC_END -> > 5396 * |--IDENT -> list 5397 * `--SEMI -> ; 5398 * </pre> 5399 * 5400 * @see <a href="https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-8.1.2"> 5401 * Generic Classes and Type Parameters</a> 5402 * @see #TYPE_PARAMETER 5403 * @see #TYPE_ARGUMENT 5404 * @see #WILDCARD_TYPE 5405 */ 5406 public static final int TYPE_UPPER_BOUNDS = 5407 JavaLanguageLexer.TYPE_UPPER_BOUNDS; 5408 5409 /** 5410 * A lower bounds on a wildcard type argument. This node has one child 5411 * - the type that is being used for the bounding. 5412 * 5413 * <p>For example:</p> 5414 * <pre>List<? super Integer> list;</pre> 5415 * 5416 * <p>parses as:</p> 5417 * <pre> 5418 * --VARIABLE_DEF -> VARIABLE_DEF 5419 * |--MODIFIERS -> MODIFIERS 5420 * |--TYPE -> TYPE 5421 * | |--IDENT -> List 5422 * | `--TYPE_ARGUMENTS -> TYPE_ARGUMENTS 5423 * | |--GENERIC_START -> < 5424 * | |--TYPE_ARGUMENT -> TYPE_ARGUMENT 5425 * | | |--WILDCARD_TYPE -> ? 5426 * | | `--TYPE_LOWER_BOUNDS -> super 5427 * | | `--IDENT -> Integer 5428 * | `--GENERIC_END -> > 5429 * |--IDENT -> list 5430 * `--SEMI -> ; 5431 * </pre> 5432 * 5433 * @see <a href="https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-8.1.2"> 5434 * Generic Classes and Type Parameters</a> 5435 * @see #TYPE_ARGUMENT 5436 * @see #WILDCARD_TYPE 5437 */ 5438 public static final int TYPE_LOWER_BOUNDS = 5439 JavaLanguageLexer.TYPE_LOWER_BOUNDS; 5440 5441 /** 5442 * An {@code @} symbol - signifying an annotation instance or the prefix 5443 * to the interface literal signifying the definition of an annotation 5444 * declaration. 5445 * 5446 * <p>For example:</p> 5447 * <pre> 5448 * @Deprecated 5449 * private int value; 5450 * </pre> 5451 * 5452 * <p>parses as:</p> 5453 * <pre> 5454 * VARIABLE_DEF -> VARIABLE_DEF 5455 * |--MODIFIERS -> MODIFIERS 5456 * | |--ANNOTATION -> ANNOTATION 5457 * | | |--AT -> @ 5458 * | | `--IDENT -> Deprecated 5459 * | `--LITERAL_PRIVATE -> private 5460 * |--TYPE -> TYPE 5461 * | `--LITERAL_INT -> int 5462 * |--IDENT -> value 5463 * `--SEMI -> ; 5464 * </pre> 5465 * 5466 * @see <a href="https://www.jcp.org/en/jsr/detail?id=201"> 5467 * JSR201</a> 5468 */ 5469 public static final int AT = JavaLanguageLexer.AT; 5470 5471 /** 5472 * A triple dot for variable-length parameters. This token only ever occurs 5473 * in a parameter declaration immediately after the type of the parameter. 5474 * 5475 * <p>For example:</p> 5476 * <pre> 5477 * public void myShape(int... dimension) { 5478 * 5479 * } 5480 * </pre> 5481 * 5482 * <p>parses as:</p> 5483 * <pre> 5484 * METHOD_DEF -> METHOD_DEF 5485 * |--MODIFIERS -> MODIFIERS 5486 * | `--LITERAL_PUBLIC -> public 5487 * |--TYPE -> TYPE 5488 * | `--LITERAL_VOID -> void 5489 * |--IDENT -> myShape 5490 * |--LPAREN -> ( 5491 * |--PARAMETERS -> PARAMETERS 5492 * | `--PARAMETER_DEF -> PARAMETER_DEF 5493 * | |--MODIFIERS -> MODIFIERS 5494 * | |--TYPE -> TYPE 5495 * | | `--LITERAL_INT -> int 5496 * | |--ELLIPSIS -> ... 5497 * | `--IDENT -> dimension 5498 * |--RPAREN -> ) 5499 * `--SLIST -> { 5500 * `--RCURLY -> } 5501 * </pre> 5502 * 5503 * @see <a href="https://www.jcp.org/en/jsr/detail?id=201"> 5504 * JSR201</a> 5505 */ 5506 public static final int ELLIPSIS = JavaLanguageLexer.ELLIPSIS; 5507 5508 /** 5509 * The {@code &} symbol when used to extend a generic upper or lower bounds constrain 5510 * or a type cast expression with an additional interface. 5511 * 5512 * <p>Generic type bounds extension: 5513 * {@code class Comparable<T extends Serializable & CharSequence>}</p> 5514 * <pre> 5515 * CLASS_DEF -> CLASS_DEF 5516 * |--MODIFIERS -> MODIFIERS 5517 * |--LITERAL_CLASS -> class 5518 * |--IDENT -> Comparable 5519 * |--TYPE_PARAMETERS -> TYPE_PARAMETERS 5520 * |--GENERIC_START -> < 5521 * |--TYPE_PARAMETER -> TYPE_PARAMETER 5522 * | |--IDENT -> T 5523 * | `--TYPE_UPPER_BOUNDS -> extends 5524 * | |--IDENT -> Serializable 5525 * | |--TYPE_EXTENSION_AND -> & 5526 * | `--IDENT -> CharSequence 5527 * `--GENERIC_END -> > 5528 * </pre> 5529 * 5530 * <p>Type cast extension: 5531 * {@code return (Serializable & CharSequence) null;}</p> 5532 * <pre> 5533 * --LITERAL_RETURN -> return 5534 * |--EXPR -> EXPR 5535 * | `--TYPECAST -> ( 5536 * | |--TYPE -> TYPE 5537 * | | `--IDENT -> Serializable 5538 * | |--TYPE_EXTENSION_AND -> & 5539 * | |--TYPE -> TYPE 5540 * | | `--IDENT -> CharSequence 5541 * | |--RPAREN -> ) 5542 * | `--LITERAL_NULL -> null 5543 * `--SEMI -> ; 5544 * </pre> 5545 * 5546 * @see #EXTENDS_CLAUSE 5547 * @see #TYPECAST 5548 * @see <a href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-4.html#jls-4.4"> 5549 * Java Language Specification, §4.4</a> 5550 * @see <a href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.16"> 5551 * Java Language Specification, §15.16</a> 5552 */ 5553 public static final int TYPE_EXTENSION_AND = 5554 JavaLanguageLexer.TYPE_EXTENSION_AND; 5555 5556 /** 5557 * A {@code <} symbol signifying the start of type arguments or type parameters. 5558 * 5559 * <p>For example:</p> 5560 * <pre> 5561 * class Test<T> {} 5562 * </pre> 5563 * 5564 * <p>parses as:</p> 5565 * <pre> 5566 * CLASS_DEF -> CLASS_DEF 5567 * |--MODIFIERS -> MODIFIERS 5568 * |--LITERAL_CLASS -> class 5569 * |--IDENT -> Test 5570 * |--TYPE_PARAMETERS -> TYPE_PARAMETERS 5571 * | |--GENERIC_START -> < 5572 * | |--TYPE_PARAMETER -> TYPE_PARAMETER 5573 * | | `--IDENT -> T 5574 * | `--GENERIC_END -> > 5575 * `--OBJBLOCK -> OBJBLOCK 5576 * |--LCURLY -> { 5577 * `--RCURLY -> } 5578 * </pre> 5579 * 5580 * @see #MODIFIERS 5581 * @see #IDENT 5582 * @see #OBJBLOCK 5583 * @see #TYPE_PARAMETERS 5584 * @see #GENERIC_END 5585 */ 5586 public static final int GENERIC_START = 5587 JavaLanguageLexer.GENERIC_START; 5588 5589 /** 5590 * A {@code >} symbol signifying the end of type arguments or type parameters. 5591 * 5592 * <p>For example:</p> 5593 * <pre> 5594 * class Test<T> {} 5595 * </pre> 5596 * 5597 * <p>parses as:</p> 5598 * <pre> 5599 * CLASS_DEF -> CLASS_DEF 5600 * |--MODIFIERS -> MODIFIERS 5601 * |--LITERAL_CLASS -> class 5602 * |--IDENT -> Test 5603 * |--TYPE_PARAMETERS -> TYPE_PARAMETERS 5604 * | |--GENERIC_START -> < 5605 * | |--TYPE_PARAMETER -> TYPE_PARAMETER 5606 * | | `--IDENT -> T 5607 * | `--GENERIC_END -> > 5608 * `--OBJBLOCK -> OBJBLOCK 5609 * |--LCURLY -> { 5610 * `--RCURLY -> } 5611 * </pre> 5612 * 5613 * @see #MODIFIERS 5614 * @see #IDENT 5615 * @see #OBJBLOCK 5616 * @see #TYPE_PARAMETERS 5617 * @see #GENERIC_START 5618 */ 5619 public static final int GENERIC_END = JavaLanguageLexer.GENERIC_END; 5620 5621 /** 5622 * Special lambda symbol {@code ->}. 5623 * 5624 * <p>For example:</p> 5625 * <pre> 5626 * numbers.forEach((n) -> System.out.println(n)); 5627 * </pre> 5628 * 5629 * <p>parses as:</p> 5630 * <pre> 5631 * METHOD_CALL -> ( 5632 * |--DOT -> . 5633 * | |--IDENT -> numbers 5634 * | `--IDENT -> forEach 5635 * |--ELIST -> ELIST 5636 * | `--LAMBDA -> -> 5637 * | |--LPAREN -> ( 5638 * | |--PARAMETERS -> PARAMETERS 5639 * | | `--PARAMETER_DEF -> PARAMETER_DEF 5640 * | | |--MODIFIERS -> MODIFIERS 5641 * | | |--TYPE -> TYPE 5642 * | | `--IDENT -> n 5643 * | |--RPAREN -> ) 5644 * | `--EXPR -> EXPR 5645 * | `--METHOD_CALL -> ( 5646 * | |--DOT -> . 5647 * | | |--DOT -> . 5648 * | | | |--IDENT -> System 5649 * | | | `--IDENT -> out 5650 * | | `--IDENT -> println 5651 * | |--ELIST -> ELIST 5652 * | | `--EXPR -> EXPR 5653 * | | `--IDENT -> n 5654 * | `--RPAREN -> ) 5655 * `--RPAREN -> ) 5656 * </pre> 5657 * 5658 */ 5659 public static final int LAMBDA = JavaLanguageLexer.LAMBDA; 5660 5661 /** 5662 * Beginning of single-line comment: '//'. 5663 * 5664 * <pre> 5665 * SINGLE_LINE_COMMENT -> // 5666 * `--COMMENT_CONTENT -> \r\n 5667 * </pre> 5668 * 5669 * <p>For example:</p> 5670 * <pre> 5671 * // Comment content 5672 * </pre> 5673 * 5674 * <p>parses as:</p> 5675 * <pre> 5676 * SINGLE_LINE_COMMENT -> // 5677 * `--COMMENT_CONTENT -> Comment Content\n 5678 * </pre> 5679 */ 5680 public static final int SINGLE_LINE_COMMENT = 5681 JavaLanguageLexer.SINGLE_LINE_COMMENT; 5682 5683 /** 5684 * Beginning of block comment: '/*'. 5685 * 5686 * <p>For example:</p> 5687 * <pre> 5688 * /* Comment content 5689 * */ 5690 * </pre> 5691 * 5692 * <p>parses as:</p> 5693 * <pre> 5694 * --BLOCK_COMMENT_BEGIN -> /* 5695 * |--COMMENT_CONTENT -> Comment content\r\n 5696 * `--BLOCK_COMMENT_END -> */ 5697 * </pre> 5698 */ 5699 public static final int BLOCK_COMMENT_BEGIN = 5700 JavaLanguageLexer.BLOCK_COMMENT_BEGIN; 5701 5702 /** 5703 * End of block comment: '*/'. 5704 * 5705 * <p>For example:</p> 5706 * <pre> 5707 * /*comment*/ 5708 * </pre> 5709 * 5710 * <p>parses as:</p> 5711 * <pre> 5712 * BLOCK_COMMENT_BEGIN -> /* 5713 * |--COMMENT_CONTENT -> comment 5714 * `--BLOCK_COMMENT_END -> */ 5715 * </pre> 5716 * 5717 */ 5718 public static final int BLOCK_COMMENT_END = 5719 JavaLanguageLexer.BLOCK_COMMENT_END; 5720 5721 /** 5722 * Text of single-line or block comment. 5723 * 5724 * <p>For example:</p> 5725 * <pre> 5726 * //this is single-line comment 5727 * 5728 * /* 5729 * this is multiline comment 5730 * */ 5731 * </pre> 5732 * 5733 * <p>parses as:</p> 5734 * <pre> 5735 * |--SINGLE_LINE_COMMENT -> // 5736 * | `--COMMENT_CONTENT -> this is single-line comment\n 5737 * |--BLOCK_COMMENT_BEGIN -> /* 5738 * | |--COMMENT_CONTENT -> \n\t\t\tthis is multiline comment\n\t\t 5739 * | `--BLOCK_COMMENT_END -> */ 5740 * </pre> 5741 * 5742 */ 5743 public static final int COMMENT_CONTENT = 5744 JavaLanguageLexer.COMMENT_CONTENT; 5745 5746 /** 5747 * A pattern variable definition; when conditionally matched, 5748 * this variable is assigned with the defined type. 5749 * 5750 * <p>For example:</p> 5751 * <pre> 5752 * if (obj instanceof String str) { } 5753 * </pre> 5754 * 5755 * <p>parses as:</p> 5756 * <pre> 5757 * LITERAL_IF -> if 5758 * |--LPAREN -> ( 5759 * |--EXPR -> EXPR 5760 * | `--LITERAL_INSTANCEOF -> instanceof 5761 * | |--IDENT -> obj 5762 * | `--PATTERN_VARIABLE_DEF -> PATTERN_VARIABLE_DEF 5763 * | |--TYPE -> TYPE 5764 * | | `--IDENT -> String 5765 * | `--IDENT -> str 5766 * |--RPAREN -> ) 5767 * `--SLIST -> { 5768 * `--RCURLY -> } 5769 * </pre> 5770 * 5771 * @see #LITERAL_INSTANCEOF 5772 * @since 8.35 5773 */ 5774 public static final int PATTERN_VARIABLE_DEF = 5775 JavaLanguageLexer.PATTERN_VARIABLE_DEF; 5776 5777 /** 5778 * The {@code record} keyword. This element appears 5779 * as part of a record declaration. 5780 * 5781 * <p>For example:</p> 5782 * <pre> 5783 * public record MyRecord () { 5784 * 5785 * } 5786 * </pre> 5787 * 5788 * <p>parses as:</p> 5789 * <pre> 5790 * RECORD_DEF -> RECORD_DEF 5791 * |--MODIFIERS -> MODIFIERS 5792 * | `--LITERAL_PUBLIC -> public 5793 * |--LITERAL_RECORD -> record 5794 * |--IDENT -> MyRecord 5795 * |--LPAREN -> ( 5796 * |--RECORD_COMPONENTS -> RECORD_COMPONENTS 5797 * |--RPAREN -> ) 5798 * `--OBJBLOCK -> OBJBLOCK 5799 * |--LCURLY -> { 5800 * `--RCURLY -> } 5801 * </pre> 5802 * 5803 * @since 8.35 5804 **/ 5805 public static final int LITERAL_RECORD = 5806 JavaLanguageLexer.LITERAL_RECORD; 5807 5808 /** 5809 * A declaration of a record specifies a name, a header, and a body. 5810 * The header lists the components of the record, which are the variables 5811 * that make up its state. 5812 * 5813 * <p>For example:</p> 5814 * <pre> 5815 * public record MyRecord () { 5816 * 5817 * } 5818 * </pre> 5819 * 5820 * <p>parses as:</p> 5821 * <pre> 5822 * RECORD_DEF -> RECORD_DEF 5823 * |--MODIFIERS -> MODIFIERS 5824 * | `--LITERAL_PUBLIC -> public 5825 * |--LITERAL_RECORD -> record 5826 * |--IDENT -> MyRecord 5827 * |--LPAREN -> ( 5828 * |--RECORD_COMPONENTS -> RECORD_COMPONENTS 5829 * |--RPAREN -> ) 5830 * `--OBJBLOCK -> OBJBLOCK 5831 * |--LCURLY -> { 5832 * `--RCURLY -> } 5833 * </pre> 5834 * 5835 * @since 8.35 5836 */ 5837 public static final int RECORD_DEF = 5838 JavaLanguageLexer.RECORD_DEF; 5839 5840 /** 5841 * Record components are a (possibly empty) list containing the components of a record, which 5842 * are the variables that make up its state. 5843 * 5844 * <p>For example:</p> 5845 * <pre> 5846 * public record myRecord (Comp x, Comp y) { } 5847 * </pre> 5848 * 5849 * <p>parses as:</p> 5850 * <pre> 5851 * RECORD_DEF -> RECORD_DEF 5852 * |--MODIFIERS -> MODIFIERS 5853 * | `--LITERAL_PUBLIC -> public 5854 * |--LITERAL_RECORD -> record 5855 * |--IDENT -> myRecord 5856 * |--LPAREN -> ( 5857 * |--RECORD_COMPONENTS -> RECORD_COMPONENTS 5858 * | |--RECORD_COMPONENT_DEF -> RECORD_COMPONENT_DEF 5859 * | | |--ANNOTATIONS -> ANNOTATIONS 5860 * | | |--TYPE -> TYPE 5861 * | | | `--IDENT -> Comp 5862 * | | `--IDENT -> x 5863 * | |--COMMA -> , 5864 * | `--RECORD_COMPONENT_DEF -> RECORD_COMPONENT_DEF 5865 * | |--ANNOTATIONS -> ANNOTATIONS 5866 * | |--TYPE -> TYPE 5867 * | | `--IDENT -> Comp 5868 * | `--IDENT -> y 5869 * |--RPAREN -> ) 5870 * `--OBJBLOCK -> OBJBLOCK 5871 * |--LCURLY -> { 5872 * `--RCURLY -> } 5873 * </pre> 5874 * 5875 * @since 8.36 5876 */ 5877 public static final int RECORD_COMPONENTS = 5878 JavaLanguageLexer.RECORD_COMPONENTS; 5879 5880 /** 5881 * A record component is a variable that comprises the state of a record. Record components 5882 * have annotations (possibly), a type definition, and an identifier. They can also be of 5883 * variable arity ('...'). 5884 * 5885 * <p>For example:</p> 5886 * <pre> 5887 * public record MyRecord(Comp x, Comp... comps) { 5888 * 5889 * } 5890 * </pre> 5891 * 5892 * <p>parses as:</p> 5893 * <pre> 5894 * RECORD_DEF -> RECORD_DEF 5895 * |--MODIFIERS -> MODIFIERS 5896 * | `--LITERAL_PUBLIC -> public 5897 * |--LITERAL_RECORD -> record 5898 * |--IDENT -> MyRecord 5899 * |--LPAREN -> ( 5900 * |--RECORD_COMPONENTS -> RECORD_COMPONENTS 5901 * | |--RECORD_COMPONENT_DEF -> RECORD_COMPONENT_DEF 5902 * | | |--ANNOTATIONS -> ANNOTATIONS 5903 * | | |--TYPE -> TYPE 5904 * | | | `--IDENT -> Comp 5905 * | | `--IDENT -> x 5906 * | |--COMMA -> , 5907 * | `--RECORD_COMPONENT_DEF -> RECORD_COMPONENT_DEF 5908 * | |--ANNOTATIONS -> ANNOTATIONS 5909 * | |--TYPE -> TYPE 5910 * | | `--IDENT -> Comp 5911 * | |--ELLIPSIS -> ... 5912 * | `--IDENT -> comps 5913 * |--RPAREN -> ) 5914 * `--OBJBLOCK -> OBJBLOCK 5915 * |--LCURLY -> { 5916 * `--RCURLY -> } 5917 * </pre> 5918 * 5919 * @since 8.36 5920 */ 5921 public static final int RECORD_COMPONENT_DEF = 5922 JavaLanguageLexer.RECORD_COMPONENT_DEF; 5923 5924 /** 5925 * A compact canonical constructor eliminates the list of formal parameters; they are 5926 * declared implicitly. 5927 * 5928 * <p>For example:</p> 5929 * <pre> 5930 * public record myRecord () { 5931 * public myRecord{} 5932 * } 5933 * </pre> 5934 * 5935 * <p>parses as:</p> 5936 * <pre> 5937 * RECORD_DEF 5938 * |--MODIFIERS 5939 * | `--LITERAL_PUBLIC (public) 5940 * |--LITERAL_RECORD (record) 5941 * |--IDENT (myRecord) 5942 * |--LPAREN (() 5943 * |--RECORD_COMPONENTS 5944 * |--RPAREN ()) 5945 * `--OBJBLOCK 5946 * |--LCURLY ({) 5947 * |--COMPACT_CTOR_DEF 5948 * | |--MODIFIERS 5949 * | | `--LITERAL_PUBLIC (public) 5950 * | |--IDENT (myRecord) 5951 * | `--SLIST ({) 5952 * | `--RCURLY (}) 5953 * `--RCURLY (}) 5954 * </pre> 5955 * 5956 * @since 8.36 5957 */ 5958 public static final int COMPACT_CTOR_DEF = 5959 JavaLanguageLexer.COMPACT_CTOR_DEF; 5960 5961 /** 5962 * Text blocks are a new feature added to to Java SE 15 and later 5963 * that will make writing multi-line strings much easier and cleaner. 5964 * Beginning of a Java 15 Text Block literal, 5965 * delimited by three double quotes. 5966 * 5967 * <p>For example:</p> 5968 * <pre> 5969 * String hello = """ 5970 * Hello, world! 5971 * """; 5972 * </pre> 5973 * 5974 * <p>parses as:</p> 5975 * <pre> 5976 * |--VARIABLE_DEF -> VARIABLE_DEF 5977 * | |--MODIFIERS -> MODIFIERS 5978 * | |--TYPE -> TYPE 5979 * | | `--IDENT -> String 5980 * | |--IDENT -> hello 5981 * | `--ASSIGN -> = 5982 * | `--EXPR -> EXPR 5983 * | `--TEXT_BLOCK_LITERAL_BEGIN -> """ 5984 * | |--TEXT_BLOCK_CONTENT -> \n Hello, world!\n 5985 * | `--TEXT_BLOCK_LITERAL_END -> """ 5986 * `--SEMI -> ; 5987 * </pre> 5988 * 5989 * @since 8.36 5990 */ 5991 public static final int TEXT_BLOCK_LITERAL_BEGIN = 5992 JavaLanguageLexer.TEXT_BLOCK_LITERAL_BEGIN; 5993 5994 /** 5995 * Content of a Java 15 text block. This is a 5996 * sequence of characters, possibly escaped with '\'. Actual line terminators 5997 * are represented by '\n'. 5998 * 5999 * <p>For example:</p> 6000 * <pre> 6001 * String hello = """ 6002 * Hello, world! 6003 * """; 6004 * </pre> 6005 * 6006 * <p>parses as:</p> 6007 * <pre> 6008 * |--VARIABLE_DEF -> VARIABLE_DEF 6009 * | |--MODIFIERS -> MODIFIERS 6010 * | |--TYPE -> TYPE 6011 * | | `--IDENT -> String 6012 * | |--IDENT -> hello 6013 * | `--ASSIGN -> = 6014 * | `--EXPR -> EXPR 6015 * | `--TEXT_BLOCK_LITERAL_BEGIN -> """ 6016 * | |--TEXT_BLOCK_CONTENT -> \n Hello, world!\n 6017 * | `--TEXT_BLOCK_LITERAL_END -> """ 6018 * `--SEMI -> ; 6019 * </pre> 6020 * 6021 * @since 8.36 6022 */ 6023 public static final int TEXT_BLOCK_CONTENT = 6024 JavaLanguageLexer.TEXT_BLOCK_CONTENT; 6025 6026 /** 6027 * End of a Java 15 text block literal, delimited by three 6028 * double quotes. 6029 * 6030 * <p>For example:</p> 6031 * <pre> 6032 * String hello = """ 6033 * Hello, world! 6034 * """; 6035 * </pre> 6036 * 6037 * <p>parses as:</p> 6038 * <pre> 6039 * |--VARIABLE_DEF -> VARIABLE_DEF 6040 * | |--MODIFIERS -> MODIFIERS 6041 * | |--TYPE -> TYPE 6042 * | | `--IDENT -> String 6043 * | |--IDENT -> hello 6044 * | `--ASSIGN -> = 6045 * | `--EXPR -> EXPR 6046 * | `--TEXT_BLOCK_LITERAL_BEGIN -> """ 6047 * | |--TEXT_BLOCK_CONTENT -> \n Hello, world!\n 6048 * | `--TEXT_BLOCK_LITERAL_END -> """ 6049 * `--SEMI -> ; 6050 * </pre> 6051 * 6052 * @since 8.36 6053 */ 6054 public static final int TEXT_BLOCK_LITERAL_END = 6055 JavaLanguageLexer.TEXT_BLOCK_LITERAL_END; 6056 6057 /** 6058 * The {@code yield} keyword. This element appears 6059 * as part of a yield statement. 6060 * 6061 * <p>For example:</p> 6062 * <pre> 6063 * int yield = 0; // not a keyword here 6064 * return switch (mode) { 6065 * case "a", "b": 6066 * yield 1; 6067 * default: 6068 * yield - 1; 6069 * }; 6070 * </pre> 6071 * 6072 * <p>parses as:</p> 6073 * <pre> 6074 * |--VARIABLE_DEF -> VARIABLE_DEF 6075 * | |--MODIFIERS -> MODIFIERS 6076 * | |--TYPE -> TYPE 6077 * | | `--LITERAL_INT -> int 6078 * | |--IDENT -> yield 6079 * | `--ASSIGN -> = 6080 * | `--EXPR -> EXPR 6081 * | `--NUM_INT -> 0 6082 * |--SEMI -> ; 6083 * |--LITERAL_RETURN -> return 6084 * | |--EXPR -> EXPR 6085 * | | `--LITERAL_SWITCH -> switch 6086 * | | |--LPAREN -> ( 6087 * | | |--EXPR -> EXPR 6088 * | | | `--IDENT -> mode 6089 * | | |--RPAREN -> ) 6090 * | | |--LCURLY -> { 6091 * | | |--CASE_GROUP -> CASE_GROUP 6092 * | | | |--LITERAL_CASE -> case 6093 * | | | | |--EXPR -> EXPR 6094 * | | | | | `--STRING_LITERAL -> "a" 6095 * | | | | |--COMMA -> , 6096 * | | | | |--EXPR -> EXPR 6097 * | | | | | `--STRING_LITERAL -> "b" 6098 * | | | | `--COLON -> : 6099 * | | | `--SLIST -> SLIST 6100 * | | | `--LITERAL_YIELD -> yield 6101 * | | | |--EXPR -> EXPR 6102 * | | | | `--NUM_INT -> 1 6103 * | | | `--SEMI -> ; 6104 * | | |--CASE_GROUP -> CASE_GROUP 6105 * | | | |--LITERAL_DEFAULT -> default 6106 * | | | | `--COLON -> : 6107 * | | | `--SLIST -> SLIST 6108 * | | | `--LITERAL_YIELD -> yield 6109 * | | | |--EXPR -> EXPR 6110 * | | | | `--UNARY_MINUS -> - 6111 * | | | | `--NUM_INT -> 1 6112 * | | | `--SEMI -> ; 6113 * | | `--RCURLY -> } 6114 * | `--SEMI -> ; 6115 * </pre> 6116 * 6117 * 6118 * @see #LITERAL_SWITCH 6119 * @see #CASE_GROUP 6120 * @see #SLIST 6121 * @see #SWITCH_RULE 6122 * 6123 * @see <a href="https://docs.oracle.com/javase/specs/jls/se13/preview/switch-expressions.html"> 6124 * Java Language Specification, §14.21</a> 6125 * 6126 * @since 8.36 6127 */ 6128 public static final int LITERAL_YIELD = 6129 JavaLanguageLexer.LITERAL_YIELD; 6130 6131 /** 6132 * Switch Expressions. 6133 * 6134 * <p>For example:</p> 6135 * <pre> 6136 * return switch (day) { 6137 * case SAT, SUN -> "Weekend"; 6138 * default -> "Working day"; 6139 * }; 6140 * </pre> 6141 * 6142 * <p>parses as:</p> 6143 * <pre> 6144 * LITERAL_RETURN -> return 6145 * |--EXPR -> EXPR 6146 * | `--LITERAL_SWITCH -> switch 6147 * | |--LPAREN -> ( 6148 * | |--EXPR -> EXPR 6149 * | | `--IDENT -> day 6150 * | |--RPAREN -> ) 6151 * | |--LCURLY -> { 6152 * | |--SWITCH_RULE -> SWITCH_RULE 6153 * | | |--LITERAL_CASE -> case 6154 * | | | |--EXPR -> EXPR 6155 * | | | | `--IDENT -> SAT 6156 * | | | |--COMMA -> , 6157 * | | | `--EXPR -> EXPR 6158 * | | | `--IDENT -> SUN 6159 * | | |--LAMBDA -> -> 6160 * | | |--EXPR -> EXPR 6161 * | | | `--STRING_LITERAL -> "Weekend" 6162 * | | `--SEMI -> ; 6163 * | |--SWITCH_RULE -> SWITCH_RULE 6164 * | | |--LITERAL_DEFAULT -> default 6165 * | | |--LAMBDA -> -> 6166 * | | |--EXPR -> EXPR 6167 * | | | `--STRING_LITERAL -> "Working day" 6168 * | | `--SEMI -> ; 6169 * | `--RCURLY -> } 6170 * `--SEMI -> ; 6171 * </pre> 6172 * 6173 * @see #LITERAL_CASE 6174 * @see #LITERAL_DEFAULT 6175 * @see #LITERAL_SWITCH 6176 * @see #LITERAL_YIELD 6177 * 6178 * @see <a href="https://docs.oracle.com/javase/specs/jls/se13/preview/switch-expressions.html"> 6179 * Java Language Specification, §14.21</a> 6180 * 6181 * @since 8.36 6182 */ 6183 public static final int SWITCH_RULE = 6184 JavaLanguageLexer.SWITCH_RULE; 6185 6186 /** 6187 * The {@code non-sealed} keyword. This element appears 6188 * as part of a class or interface declaration. 6189 * 6190 * <p>For example:</p> 6191 * <pre> 6192 * non-sealed class Square extends Rectangle { } 6193 * </pre> 6194 * 6195 * <p>parses as:</p> 6196 * <pre> 6197 * CLASS_DEF -> CLASS_DEF 6198 * |--MODIFIERS -> MODIFIERS 6199 * | `--LITERAL_NON_SEALED -> non-sealed 6200 * |--LITERAL_CLASS -> class 6201 * |--IDENT -> Square 6202 * |--EXTENDS_CLAUSE -> extends 6203 * | `--IDENT -> Rectangle 6204 * `--OBJBLOCK -> OBJBLOCK 6205 * |--LCURLY -> { 6206 * `--RCURLY -> } 6207 * </pre> 6208 * 6209 * @see <a href="https://docs.oracle.com/en/java/javase/15/docs/specs/sealed-classes-jls.html"> 6210 * Java Language Specification, §8.1.1.2</a> 6211 * @see #MODIFIERS 6212 * 6213 * @since 8.42 6214 */ 6215 public static final int LITERAL_NON_SEALED = 6216 JavaLanguageLexer.LITERAL_NON_SEALED; 6217 6218 /** 6219 * The {@code sealed} restricted identifier. This element appears 6220 * as part of a class or interface declaration. 6221 * 6222 * <p>For example:</p> 6223 * <pre> 6224 * public sealed class Shape permits Circle, Square, Rectangle { } 6225 * </pre> 6226 * 6227 * <p>parses as:</p> 6228 * <pre> 6229 * CLASS_DEF -> CLASS_DEF 6230 * |--MODIFIERS -> MODIFIERS 6231 * | |--LITERAL_PUBLIC -> public 6232 * | `--LITERAL_SEALED -> sealed 6233 * |--LITERAL_CLASS -> class 6234 * |--IDENT -> Shape 6235 * |--PERMITS_CLAUSE -> permits 6236 * | |--IDENT -> Circle 6237 * | |--COMMA -> , 6238 * | |--IDENT -> Square 6239 * | |--COMMA -> , 6240 * | `--IDENT -> Rectangle 6241 * `--OBJBLOCK -> OBJBLOCK 6242 * |--LCURLY -> { 6243 * `--RCURLY -> } 6244 * </pre> 6245 * 6246 * @see <a href="https://docs.oracle.com/en/java/javase/15/docs/specs/sealed-classes-jls.html"> 6247 * Java Language Specification, §8.1.1.2</a> 6248 * @see #MODIFIERS 6249 * 6250 * @since 8.42 6251 */ 6252 public static final int LITERAL_SEALED = 6253 JavaLanguageLexer.LITERAL_SEALED; 6254 6255 /** 6256 * The {@code permits} restricted identifier. This element appears 6257 * as part of a class or interface declaration. 6258 * 6259 * <p>For example:</p> 6260 * <pre> 6261 * public sealed class Shape permits Circle, Square, Rectangle { } 6262 * </pre> 6263 * 6264 * <p>parses as:</p> 6265 * <pre> 6266 * CLASS_DEF -> CLASS_DEF 6267 * |--MODIFIERS -> MODIFIERS 6268 * | |--LITERAL_PUBLIC -> public 6269 * | `--LITERAL_SEALED -> sealed 6270 * |--LITERAL_CLASS -> class 6271 * |--IDENT -> Shape 6272 * |--PERMITS_CLAUSE -> permits 6273 * | |--IDENT -> Circle 6274 * | |--COMMA -> , 6275 * | |--IDENT -> Square 6276 * | |--COMMA -> , 6277 * | `--IDENT -> Rectangle 6278 * `--OBJBLOCK -> OBJBLOCK 6279 * |--LCURLY -> { 6280 * `--RCURLY -> } 6281 * </pre> 6282 * 6283 * @see <a href="https://docs.oracle.com/en/java/javase/15/docs/specs/sealed-classes-jls.html"> 6284 * Java Language Specification, §9.1.4</a> 6285 * @see #MODIFIERS 6286 * 6287 * @since 8.42 6288 */ 6289 public static final int LITERAL_PERMITS = 6290 JavaLanguageLexer.LITERAL_PERMITS; 6291 6292 /** 6293 * A permits clause. A permits clause's children are a comma separated list of one or 6294 * more identifiers. 6295 * 6296 * <p>For example:</p> 6297 * <pre> 6298 * public sealed class Shape permits Circle, Square, Rectangle { } 6299 * </pre> 6300 * 6301 * <p>parses as:</p> 6302 * <pre> 6303 * CLASS_DEF -> CLASS_DEF 6304 * |--MODIFIERS -> MODIFIERS 6305 * | |--LITERAL_PUBLIC -> public 6306 * | `--LITERAL_SEALED -> sealed 6307 * |--LITERAL_CLASS -> class 6308 * |--IDENT -> Shape 6309 * |--PERMITS_CLAUSE -> permits 6310 * | |--IDENT -> Circle 6311 * | |--COMMA -> , 6312 * | |--IDENT -> Square 6313 * | |--COMMA -> , 6314 * | `--IDENT -> Rectangle 6315 * `--OBJBLOCK -> OBJBLOCK 6316 * |--LCURLY -> { 6317 * `--RCURLY -> } 6318 * </pre> 6319 * 6320 * @see <a href="https://docs.oracle.com/en/java/javase/15/docs/specs/sealed-classes-jls.html"> 6321 * Java Language Specification, §9.1.4</a> 6322 * @see #MODIFIERS 6323 * @see #CLASS_DEF 6324 * @see #INTERFACE_DEF 6325 * @see #COMMA 6326 * @see #IDENT 6327 * 6328 * @since 8.42 6329 */ 6330 public static final int PERMITS_CLAUSE = 6331 JavaLanguageLexer.PERMITS_CLAUSE; 6332 6333 /** 6334 * A pattern definition, excluding simple type pattern (pattern variable) 6335 * definition such as {@code if (o instanceof Integer i){}}. Pattern definitions 6336 * appear as operands of statements and expressions. 6337 * 6338 * <p>For example:</p> 6339 * <pre> 6340 * switch(o) { 6341 * case String s when s.length() > 4: // guarded pattern, `PATTERN_DEF` 6342 * break; 6343 * case String s: // type pattern, no `PATTERN_DEF` 6344 * break; 6345 * } 6346 * </pre> 6347 * 6348 * <p>parses as:</p> 6349 * <pre> 6350 * LITERAL_SWITCH -> switch 6351 * | |--LPAREN -> ( 6352 * | |--EXPR -> EXPR 6353 * | | `--IDENT -> o 6354 * | |--RPAREN -> ) 6355 * | |--LCURLY -> { 6356 * | |--CASE_GROUP -> CASE_GROUP 6357 * | | |--LITERAL_CASE -> case 6358 * | | | |--PATTERN_DEF -> PATTERN_DEF 6359 * | | | | `--LITERAL_WHEN -> when 6360 * | | | | |--PATTERN_VARIABLE_DEF -> PATTERN_VARIABLE_DEF 6361 * | | | | | |--MODIFIERS -> MODIFIERS 6362 * | | | | | |--TYPE -> TYPE 6363 * | | | | | | `--IDENT -> String 6364 * | | | | | `--IDENT -> s 6365 * | | | | `--GT -> > 6366 * | | | | |--METHOD_CALL -> ( 6367 * | | | | | |--DOT -> . 6368 * | | | | | | |--IDENT -> s 6369 * | | | | | | `--IDENT -> length 6370 * | | | | | |--ELIST -> ELIST 6371 * | | | | | `--RPAREN -> ) 6372 * | | | | `--NUM_INT -> 4 6373 * | | | `--COLON -> : 6374 * | | `--SLIST -> SLIST 6375 * | | `--LITERAL_BREAK -> break 6376 * | | `--SEMI -> ; 6377 * | |--CASE_GROUP -> CASE_GROUP 6378 * | | |--LITERAL_CASE -> case 6379 * | | | |--PATTERN_VARIABLE_DEF -> PATTERN_VARIABLE_DEF 6380 * | | | | |--MODIFIERS -> MODIFIERS 6381 * | | | | |--TYPE -> TYPE 6382 * | | | | | `--IDENT -> String 6383 * | | | | `--IDENT -> s 6384 * | | | `--COLON -> : 6385 * | | `--SLIST -> SLIST 6386 * | | `--LITERAL_BREAK -> break 6387 * | | `--SEMI -> ; 6388 * | `--RCURLY -> } 6389 * `--RCURLY -> } 6390 * </pre> 6391 * 6392 * @see <a href="https://docs.oracle.com/javase/specs/jls/se17/html/jls-14.html#jls-14.30"> 6393 * Java Language Specification, §14.30</a> 6394 * @see #LITERAL_SWITCH 6395 * @see #PATTERN_VARIABLE_DEF 6396 * @see #LITERAL_INSTANCEOF 6397 * 6398 * @since 9.3 6399 */ 6400 public static final int PATTERN_DEF = 6401 JavaLanguageLexer.PATTERN_DEF; 6402 6403 /** 6404 * A {@code when} clause. Appears as part of a switch label in a guarded pattern definition. 6405 * 6406 * <p>For example:</p> 6407 * <pre> 6408 * return switch (o) { 6409 * case Integer i when i >= 0 -> i; 6410 * default -> 2; 6411 * }; 6412 * </pre> 6413 * 6414 * <p>parses as:</p> 6415 * <pre> 6416 * LITERAL_RETURN -> return 6417 * `--EXPR -> EXPR 6418 * `--LITERAL_SWITCH -> switch 6419 * |--LPAREN -> ( 6420 * |--EXPR -> EXPR 6421 * | `--IDENT -> o 6422 * |--RPAREN -> ) 6423 * |--LCURLY -> { 6424 * |--SWITCH_RULE -> SWITCH_RULE 6425 * | |--LITERAL_CASE -> case 6426 * | | `--PATTERN_DEF -> PATTERN_DEF 6427 * | | `--LITERAL_WHEN -> when 6428 * | | |--PATTERN_VARIABLE_DEF -> PATTERN_VARIABLE_DEF 6429 * | | | |--MODIFIERS -> MODIFIERS 6430 * | | | |--TYPE -> TYPE 6431 * | | | | `--IDENT -> Integer 6432 * | | | `--IDENT -> i 6433 * | | `--GE -> >= 6434 * | | |--IDENT -> i 6435 * | | `--NUM_INT -> 0 6436 * | |--LAMBDA -> -> 6437 * | |--EXPR -> EXPR 6438 * | | `--IDENT -> i 6439 * | `--SEMI -> ; 6440 * |--SWITCH_RULE -> SWITCH_RULE 6441 * | |--LITERAL_DEFAULT -> default 6442 * | |--LAMBDA -> -> 6443 * | |--EXPR -> EXPR 6444 * | | `--NUM_INT -> 2 6445 * | `--SEMI -> ; 6446 * `--RCURLY -> } 6447 * </pre> 6448 * 6449 * @see <a href="https://docs.oracle.com/javase/specs/jls/se17/html/jls-14.html#jls-14.30"> 6450 * Java Language Specification, §14.30</a> 6451 * @see #LITERAL_SWITCH 6452 * @see #PATTERN_VARIABLE_DEF 6453 * @see #LITERAL_INSTANCEOF 6454 * @see #SWITCH_RULE 6455 * 6456 * @since 10.7.0 6457 */ 6458 public static final int LITERAL_WHEN = 6459 JavaLanguageLexer.LITERAL_WHEN; 6460 6461 /** 6462 * A {@code record} pattern definition. A record pattern consists of a type, 6463 * a (possibly empty) record component pattern list which is used to match against 6464 * the corresponding record components, and an optional identifier. Appears as part of 6465 * an {@code instanceof} expression or a {@code case} label in a switch. 6466 * 6467 * <p>For example:</p> 6468 * <pre> 6469 * record R(Object o){} 6470 * if (o instanceof R(String s) myRecord) {} 6471 * switch (o) { 6472 * case R(String s) myRecord -> {} 6473 * } 6474 * </pre> 6475 * 6476 * <p>parses as:</p> 6477 * <pre> 6478 * |--RECORD_DEF -> RECORD_DEF 6479 * | |--MODIFIERS -> MODIFIERS 6480 * | |--LITERAL_RECORD -> record 6481 * | |--IDENT -> R 6482 * | |--LPAREN -> ( 6483 * | |--RECORD_COMPONENTS -> RECORD_COMPONENTS 6484 * | | `--RECORD_COMPONENT_DEF -> RECORD_COMPONENT_DEF 6485 * | | |--ANNOTATIONS -> ANNOTATIONS 6486 * | | |--TYPE -> TYPE 6487 * | | | `--IDENT -> Object 6488 * | | `--IDENT -> o 6489 * | |--RPAREN -> ) 6490 * | `--OBJBLOCK -> OBJBLOCK 6491 * | |--LCURLY -> { 6492 * | `--RCURLY -> } 6493 * |--LITERAL_IF -> if 6494 * | |--LPAREN -> ( 6495 * | |--EXPR -> EXPR 6496 * | | `--LITERAL_INSTANCEOF -> instanceof 6497 * | | |--IDENT -> o 6498 * | | `--RECORD_PATTERN_DEF -> RECORD_PATTERN_DEF 6499 * | | |--MODIFIERS -> MODIFIERS 6500 * | | |--TYPE -> TYPE 6501 * | | | `--IDENT -> R 6502 * | | |--LPAREN -> ( 6503 * | | |--RECORD_PATTERN_COMPONENTS -> RECORD_PATTERN_COMPONENTS 6504 * | | | `--PATTERN_VARIABLE_DEF -> PATTERN_VARIABLE_DEF 6505 * | | | |--MODIFIERS -> MODIFIERS 6506 * | | | |--TYPE -> TYPE 6507 * | | | | `--IDENT -> String 6508 * | | | `--IDENT -> s 6509 * | | |--RPAREN -> ) 6510 * | | `--IDENT -> myRecord 6511 * | |--RPAREN -> ) 6512 * | `--SLIST -> { 6513 * | `--RCURLY -> } 6514 * |--LITERAL_SWITCH -> switch 6515 * | |--LPAREN -> ( 6516 * | |--EXPR -> EXPR 6517 * | | `--IDENT -> o 6518 * | |--RPAREN -> ) 6519 * | |--LCURLY -> { 6520 * | |--SWITCH_RULE -> SWITCH_RULE 6521 * | | |--LITERAL_CASE -> case 6522 * | | | `--RECORD_PATTERN_DEF -> RECORD_PATTERN_DEF 6523 * | | | |--MODIFIERS -> MODIFIERS 6524 * | | | |--TYPE -> TYPE 6525 * | | | | `--IDENT -> R 6526 * | | | |--LPAREN -> ( 6527 * | | | |--RECORD_PATTERN_COMPONENTS -> RECORD_PATTERN_COMPONENTS 6528 * | | | | `--PATTERN_VARIABLE_DEF -> PATTERN_VARIABLE_DEF 6529 * | | | | |--MODIFIERS -> MODIFIERS 6530 * | | | | |--TYPE -> TYPE 6531 * | | | | | `--IDENT -> String 6532 * | | | | `--IDENT -> s 6533 * | | | |--RPAREN -> ) 6534 * | | | `--IDENT -> myRecord 6535 * | | |--LAMBDA -> -> 6536 * | | `--SLIST -> { 6537 * | | `--RCURLY -> } 6538 * | `--RCURLY -> } 6539 * `--RCURLY -> } 6540 * </pre> 6541 * 6542 * @see <a href="https://openjdk.org/jeps/405">JEP 405: Record Patterns</a> 6543 * @see #LITERAL_WHEN 6544 * @see #PATTERN_VARIABLE_DEF 6545 * @see #LITERAL_INSTANCEOF 6546 * @see #SWITCH_RULE 6547 * 6548 * @since 10.12.0 6549 */ 6550 public static final int RECORD_PATTERN_DEF = 6551 JavaLanguageLexer.RECORD_PATTERN_DEF; 6552 6553 /** 6554 * A (possibly empty) record component pattern list which is used to match against 6555 * the corresponding record components. Appears as part of a record pattern definition. 6556 * 6557 * <p>For example:</p> 6558 * <pre> 6559 * record R(Object o){} 6560 * if (o instanceof R(String myComponent)) {} 6561 * switch (o) { 6562 * case R(String myComponent) when "component".equalsIgnoreCase(myComponent) -> {} 6563 * } 6564 * </pre> 6565 * 6566 * <p>parses as:</p> 6567 * <pre> 6568 * |--RECORD_DEF -> RECORD_DEF 6569 * | |--MODIFIERS -> MODIFIERS 6570 * | |--LITERAL_RECORD -> record 6571 * | |--IDENT -> R 6572 * | |--LPAREN -> ( 6573 * | |--RECORD_COMPONENTS -> RECORD_COMPONENTS 6574 * | | `--RECORD_COMPONENT_DEF -> RECORD_COMPONENT_DEF 6575 * | | |--ANNOTATIONS -> ANNOTATIONS 6576 * | | |--TYPE -> TYPE 6577 * | | | `--IDENT -> Object 6578 * | | `--IDENT -> o 6579 * | |--RPAREN -> ) 6580 * | `--OBJBLOCK -> OBJBLOCK 6581 * | |--LCURLY -> { 6582 * | `--RCURLY -> } 6583 * |--LITERAL_IF -> if 6584 * | |--LPAREN -> ( 6585 * | |--EXPR -> EXPR 6586 * | | `--LITERAL_INSTANCEOF -> instanceof 6587 * | | |--IDENT -> o 6588 * | | `--RECORD_PATTERN_DEF -> RECORD_PATTERN_DEF 6589 * | | |--MODIFIERS -> MODIFIERS 6590 * | | |--TYPE -> TYPE 6591 * | | | `--IDENT -> R 6592 * | | |--LPAREN -> ( 6593 * | | |--RECORD_PATTERN_COMPONENTS -> RECORD_PATTERN_COMPONENTS 6594 * | | | `--PATTERN_VARIABLE_DEF -> PATTERN_VARIABLE_DEF 6595 * | | | |--MODIFIERS -> MODIFIERS 6596 * | | | |--TYPE -> TYPE 6597 * | | | | `--IDENT -> String 6598 * | | | `--IDENT -> myComponent 6599 * | | `--RPAREN -> ) 6600 * | |--RPAREN -> ) 6601 * | `--SLIST -> { 6602 * | `--RCURLY -> } 6603 * |--LITERAL_SWITCH -> switch 6604 * | |--LPAREN -> ( 6605 * | |--EXPR -> EXPR 6606 * | | `--IDENT -> o 6607 * | |--RPAREN -> ) 6608 * | |--LCURLY -> { 6609 * | |--SWITCH_RULE -> SWITCH_RULE 6610 * | | |--LITERAL_CASE -> case 6611 * | | | `--PATTERN_DEF -> PATTERN_DEF 6612 * | | | `--LITERAL_WHEN -> when 6613 * | | | |--RECORD_PATTERN_DEF -> RECORD_PATTERN_DEF 6614 * | | | | |--MODIFIERS -> MODIFIERS 6615 * | | | | |--TYPE -> TYPE 6616 * | | | | | `--IDENT -> R 6617 * | | | | |--LPAREN -> ( 6618 * | | | | |--RECORD_PATTERN_COMPONENTS -> RECORD_PATTERN_COMPONENTS 6619 * | | | | | `--PATTERN_VARIABLE_DEF -> PATTERN_VARIABLE_DEF 6620 * | | | | | |--MODIFIERS -> MODIFIERS 6621 * | | | | | |--TYPE -> TYPE 6622 * | | | | | | `--IDENT -> String 6623 * | | | | | `--IDENT -> myComponent 6624 * | | | | `--RPAREN -> ) 6625 * | | | `--METHOD_CALL -> ( 6626 * | | | |--DOT -> . 6627 * | | | | |--STRING_LITERAL -> "component" 6628 * | | | | `--IDENT -> equalsIgnoreCase 6629 * | | | |--ELIST -> ELIST 6630 * | | | | `--EXPR -> EXPR 6631 * | | | | `--IDENT -> myComponent 6632 * | | | `--RPAREN -> ) 6633 * | | |--LAMBDA -> -> 6634 * | | `--SLIST -> { 6635 * | | `--RCURLY -> } 6636 * | `--RCURLY -> } 6637 * `--RCURLY -> } 6638 * </pre> 6639 * 6640 * @see <a href="https://openjdk.org/jeps/405">JEP 405: Record Patterns</a> 6641 * @see #LITERAL_WHEN 6642 * @see #PATTERN_VARIABLE_DEF 6643 * @see #LITERAL_INSTANCEOF 6644 * @see #SWITCH_RULE 6645 * 6646 * @since 10.12.0 6647 */ 6648 public static final int RECORD_PATTERN_COMPONENTS = 6649 JavaLanguageLexer.RECORD_PATTERN_COMPONENTS; 6650 6651 /** 6652 * An unnamed pattern variable definition. Appears as part of a pattern definition. 6653 * 6654 * <p>For example:</p> 6655 * <pre> 6656 * if (r instanceof R(_)) {} 6657 * </pre> 6658 * 6659 * <p>parses as:</p> 6660 * <pre> 6661 * LITERAL_IF -> if 6662 * |--LPAREN -> ( 6663 * |--EXPR -> EXPR 6664 * | `--LITERAL_INSTANCEOF -> instanceof 6665 * | |--IDENT -> r 6666 * | `--RECORD_PATTERN_DEF -> RECORD_PATTERN_DEF 6667 * | |--MODIFIERS -> MODIFIERS 6668 * | |--TYPE -> TYPE 6669 * | | `--IDENT -> R 6670 * | |--LPAREN -> ( 6671 * | |--RECORD_PATTERN_COMPONENTS -> RECORD_PATTERN_COMPONENTS 6672 * | | `--UNNAMED_PATTERN_DEF -> _ 6673 * | `--RPAREN -> ) 6674 * |--RPAREN -> ) 6675 * `--SLIST -> { 6676 * `--RCURLY -> } 6677 * </pre> 6678 * 6679 * @see #RECORD_PATTERN_COMPONENTS 6680 * @see #RECORD_PATTERN_DEF 6681 * @see #LITERAL_SWITCH 6682 * @see #LITERAL_INSTANCEOF 6683 * @see #SWITCH_RULE 6684 * @see #LITERAL_WHEN 6685 * @see #PATTERN_VARIABLE_DEF 6686 * @see #PATTERN_DEF 6687 * 6688 * @since 10.14.0 6689 */ 6690 public static final int UNNAMED_PATTERN_DEF = 6691 JavaLanguageLexer.UNNAMED_PATTERN_DEF; 6692 6693 /** Prevent instantiation. */ 6694 private TokenTypes() { 6695 } 6696 6697 }