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