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