Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.puppycrawl.tools.checkstyle.api
Class TokenTypes  view TokenTypes download TokenTypes.java

java.lang.Object
  extended bycom.puppycrawl.tools.checkstyle.api.TokenTypes

public final class TokenTypes
extends java.lang.Object

Contains the constants for all the tokens contained in the Abstract Syntax Tree.

Implementation detail: This class has been introduced to break the circular dependency between packages.

Version:
1.0

Field Summary
static int ABSTRACT
          The abstract keyword.
static int ARRAY_DECLARATOR
          An array declaration.
static int ARRAY_INIT
          An array initialization.
static int ASSIGN
          The = (assignment) operator.
static int BAND
          The & (bitwise AND) operator.
static int BAND_ASSIGN
          The &= (bitwise AND assignment) operator.
static int BNOT
          The ~ (bitwise complement) operator.
static int BOR
          The | (bitwise OR) operator.
static int BOR_ASSIGN
          The |= (bitwise OR assignment) operator.
static int BSR
          The >>> (unsigned shift right) operator.
static int BSR_ASSIGN
          The >>>= (unsigned right shift assignment) operator.
static int BXOR
          The ^ (bitwise exclusive OR) operator.
static int BXOR_ASSIGN
          The ^= (bitwise exclusive OR assignment) operator.
static int CASE_GROUP
          A group of case clauses.
static int CHAR_LITERAL
          A character literal.
static int CLASS_DEF
          A class declaration.
static int COLON
          The : (colon) operator.
static int COMMA
          The , (comma) operator.
static int CTOR_CALL
          A constructor call.
static int CTOR_DEF
          A constructor declaration.
static int DEC
          The -- (prefix decrement) operator.
static int DIV
          The / (division) operator.
static int DIV_ASSIGN
          The /= (division assignment) operator.
static int DOT
          The . (dot) operator.
static int ELIST
          An expression list.
static int EMPTY_STAT
          The empty statement.
static int EOF
          The end of file token.
static int EQUAL
          The == (equal) operator.
static int EXPR
          An expression.
static int EXTENDS_CLAUSE
          An extends clause.
static int FINAL
          The final keyword.
static int FOR_CONDITION
          A for loop condition.
static int FOR_INIT
          A for loop initializer.
static int FOR_ITERATOR
          A for loop iterator.
static int GE
          The >= (greater than or equal) operator.
static int GT
          The > (greater than) operator.
static int IDENT
          An identifier.
static int IMPLEMENTS_CLAUSE
          An implements clause.
static int IMPORT
          An import declaration.
static int INC
          The ++ (prefix increment) operator.
static int INDEX_OP
          The array index operator.
static int INSTANCE_INIT
          An instance initializer.
static int INTERFACE_DEF
          An interface declaration.
static int LABELED_STAT
          A labeled statement.
static int LAND
          The && (conditional AND) operator.
static int LCURLY
          A left (curly) brace ({).
static int LE
          The <= (less than or equal) operator.
static int LITERAL_ASSERT
          The assert keyword.
static int LITERAL_BOOLEAN
          The boolean keyword.
static int LITERAL_BREAK
          The break keyword.
static int LITERAL_BYTE
          The byte keyword.
static int LITERAL_CASE
          The case keyword.
static int LITERAL_CATCH
          The catch keyword.
static int LITERAL_CHAR
          The char keyword.
static int LITERAL_CLASS
          The class keyword.
static int LITERAL_CONTINUE
          The continue keyword.
static int LITERAL_DEFAULT
          The default keyword.
static int LITERAL_DO
          The do keyword.
static int LITERAL_DOUBLE
          The double keyword.
static int LITERAL_ELSE
          The else keyword.
static int LITERAL_FALSE
          The false keyword.
static int LITERAL_FINALLY
          The finally keyword.
static int LITERAL_FLOAT
          The float keyword.
static int LITERAL_FOR
          The for keyword.
static int LITERAL_IF
          The if keyword.
static int LITERAL_INSTANCEOF
          The instanceof operator.
static int LITERAL_INT
          The int keyword.
static int LITERAL_LONG
          The long keyword.
static int LITERAL_NATIVE
          The native keyword.
static int LITERAL_NEW
          The new keyword.
static int LITERAL_NULL
          The null keyword.
static int LITERAL_PRIVATE
          The private keyword.
static int LITERAL_PROTECTED
          The protected keyword.
static int LITERAL_PUBLIC
          The public keyword.
static int LITERAL_RETURN
          The return keyword.
static int LITERAL_SHORT
          The short keyword.
static int LITERAL_STATIC
          The static keyword.
static int LITERAL_SUPER
          The super keyword.
static int LITERAL_SWITCH
          The switch keyword.
static int LITERAL_SYNCHRONIZED
          The synchronized keyword.
static int LITERAL_THIS
          The this keyword.
static int LITERAL_THROW
          The throw keyword.
static int LITERAL_THROWS
          The throws keyword.
static int LITERAL_TRANSIENT
          The transient keyword.
static int LITERAL_TRUE
          The true keyword.
static int LITERAL_TRY
          The try keyword.
static int LITERAL_VOID
          The void keyword.
static int LITERAL_VOLATILE
          The volatile keyword.
static int LITERAL_WHILE
          The while keyword.
static int LNOT
          The ! (logical complement) operator.
static int LOR
          The || (conditional OR) operator.
static int LPAREN
          A left parenthesis (().
static int LT
          The < (less than) operator.
static int METHOD_CALL
          A method call.
static int METHOD_DEF
          A method declaration.
static int MINUS
          The - (subtraction) operator.
static int MINUS_ASSIGN
          The -= (subtraction assignment) operator.
static int MOD
          The % (remainder) operator.
static int MOD_ASSIGN
          The %= (remainder assignment) operator.
static int MODIFIERS
          Modifiers for type, method, and field declarations.
static int NOT_EQUAL
          The != (not equal) operator.
static int NUM_DOUBLE
          A double precision floating point literal.
static int NUM_FLOAT
          A single precision floating point literal.
static int NUM_INT
          An integer literal.
static int NUM_LONG
          A long integer literal.
static int OBJBLOCK
          An object block.
static int PACKAGE_DEF
          The package declaration.
static int PARAMETER_DEF
          A parameter declaration.
static int PARAMETERS
          A list of parameters to a method or constructor.
static int PLUS
          The + (addition) operator.
static int PLUS_ASSIGN
          The += (addition assignment) operator.
static int POST_DEC
          The -- (postfix decrement) operator.
static int POST_INC
          The ++ (postfix increment) operator.
static int QUESTION
          The ? (conditional) operator.
static int RCURLY
          A right (curly) brace (}).
static int RPAREN
          A right parenthesis ()).
static int SEMI
          The statement terminator (;).
static int SL
          The << (shift left) operator.
static int SL_ASSIGN
          The <<= (left shift assignment) operator.
static int SLIST
          A list of statements.
static int SR
          The >> (signed shift right) operator.
static int SR_ASSIGN
          The >>= (signed right shift assignment) operator.
static int STAR
          The * (multiplication or wildcard) operator.
static int STAR_ASSIGN
          The *= (multiplication assignment) operator.
static int STATIC_INIT
          A static initialization block.
static int STRICTFP
          The strictfp keyword.
static int STRING_LITERAL
          A string literal.
static int SUPER_CTOR_CALL
          A super constructor call.
private static java.util.Map TOKEN_NAME_TO_VALUE
          maps from a token name to value
private static java.lang.String[] TOKEN_VALUE_TO_NAME
          maps from a token value to name
static int TYPE
          A type.
static int TYPECAST
          A type-cast.
static int UNARY_MINUS
          The + (unary plus) operator.
static int UNARY_PLUS
          The - (unary minus) operator.
static int VARIABLE_DEF
          A field or local variable declaration.
 
Constructor Summary
private TokenTypes()
          prevent instantiation
 
Method Summary
static int getTokenId(java.lang.String aName)
          Returns the ID of a token for a given name.
static java.lang.String getTokenName(int aID)
          Returns the name of a token for a given ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EOF

public static final int EOF
The end of file token. This is the root node for the source file. It's children are an optional package definition, zero or more import statements, and one or more class or interface definitions.

See Also:
PACKAGE_DEF 55 , IMPORT 55 , CLASS_DEF 55 , INTERFACE_DEF 55

MODIFIERS

public static final int MODIFIERS
Modifiers for type, method, and field declarations. The modifiers element is always present even though it may have no children.

See Also:
Java Language Specification, Chapter 8, LITERAL_PUBLIC 55 , LITERAL_PROTECTED 55 , LITERAL_PRIVATE 55 , ABSTRACT 55 , LITERAL_STATIC 55 , FINAL 55 , LITERAL_TRANSIENT 55 , LITERAL_VOLATILE 55 , LITERAL_SYNCHRONIZED 55 , LITERAL_NATIVE 55 , STRICTFP 55

OBJBLOCK

public static final int OBJBLOCK
An object block. These are children of class and interface declarations. Also, object blocks are children of the new keyword when defining anonymous inner classes.

See Also:
LCURLY 55 , INSTANCE_INIT 55 , STATIC_INIT 55 , CLASS_DEF 55 , CTOR_DEF 55 , METHOD_DEF 55 , VARIABLE_DEF 55 , RCURLY 55 , INTERFACE_DEF 55 , LITERAL_NEW 55

SLIST

public static final int SLIST
A list of statements.

See Also:
RCURLY 55 , EXPR 55 , LABELED_STAT 55 , LITERAL_THROWS 55 , LITERAL_RETURN 55 , SEMI 55 , METHOD_DEF 55 , CTOR_DEF 55 , LITERAL_FOR 55 , LITERAL_WHILE 55 , LITERAL_IF 55 , LITERAL_ELSE 55 , CASE_GROUP 55

CTOR_DEF

public static final int CTOR_DEF
A constructor declaration.

For example:

 public SpecialEntry(int value, String text)
 {
   this.value = value;
   this.text = text;
 }
 

parses as:

 +--CTOR_DEF
     |
     +--MODIFIERS
         |
         +--LITERAL_PUBLIC (public)
     +--IDENT (SpecialEntry)
     +--LPAREN (()
     +--PARAMETERS
         |
         +--PARAMETER_DEF
             |
             +--MODIFIERS
             +--TYPE
                 |
                 +--LITERAL_INT (int)
             +--IDENT (value)
         +--COMMA (,)
         +--PARAMETER_DEF
             |
             +--MODIFIERS
             +--TYPE
                 |
                 +--IDENT (String)
             +--IDENT (text)
     +--RPAREN ())
     +--SLIST ({)
         |
         +--EXPR
             |
             +--ASSIGN (=)
                 |
                 +--DOT (.)
                     |
                     +--LITERAL_THIS (this)
                     +--IDENT (value)
                 +--IDENT (value)
         +--SEMI (;)
         +--EXPR
             |
             +--ASSIGN (=)
                 |
                 +--DOT (.)
                     |
                     +--LITERAL_THIS (this)
                     +--IDENT (text)
                 +--IDENT (text)
         +--SEMI (;)
         +--RCURLY (})
 

See Also:
OBJBLOCK 55 , CLASS_DEF 55

METHOD_DEF

public static final int METHOD_DEF
A method declaration. The children are modifiers, return type, method name, parameter list, an optional throws list, and statement list. The statement list is omitted if the method declaration appears in an interface declaration. Method declarations may appear inside object blocks of class declarations, interface declarations, or anonymous inner-class declarations.

For example:

  public static int square(int x)
  {
    return x*x;
  }
 

parses as:

 +--METHOD_DEF
     |
     +--MODIFIERS
         |
         +--LITERAL_PUBLIC (public)
         +--LITERAL_STATIC (static)
     +--TYPE
         |
         +--LITERAL_INT (int)
     +--IDENT (square)
     +--PARAMETERS
         |
         +--PARAMETER_DEF
             |
             +--MODIFIERS
             +--TYPE
                 |
                 +--LITERAL_INT (int)
             +--IDENT (x)
     +--SLIST ({)
         |
         +--LITERAL_RETURN (return)
             |
             +--EXPR
                 |
                 +--STAR (*)
                     |
                     +--IDENT (x)
                     +--IDENT (x)
             +--SEMI (;)
         +--RCURLY (})
 

See Also:
MODIFIERS 55 , TYPE 55 , IDENT 55 , PARAMETERS 55 , LITERAL_THROWS 55 , SLIST 55 , OBJBLOCK 55

VARIABLE_DEF

public static final int VARIABLE_DEF
A field or local variable declaration. The children are modifiers, type, the identifier name, and an optional assignment statement.

See Also:
MODIFIERS 55 , TYPE 55 , IDENT 55 , ASSIGN 55

INSTANCE_INIT

public static final int INSTANCE_INIT
An instance initializer. Zero or more instance initializers may appear in class definitions. This token will be a child of the object block in either a normal or anonymous inner class.

See Also:
Java Language Specification§8.6, SLIST 55 , OBJBLOCK 55

STATIC_INIT

public static final int STATIC_INIT
A static initialization block. Zero or more static initializers may be children of the object block of a class declaration (interfaces cannot have static initializers). The first and only child is a statement list.

See Also:
Java Language Specification, §8.7, SLIST 55 , OBJBLOCK 55

TYPE

public static final int TYPE
A type. This is either a return type of a method or a type of a variable or field. The first child of this element is the actual type. This may be a primitive type, an identifier, a dot which is the root of a fully qualified type, or an array of any of these.

See Also:
VARIABLE_DEF 55 , METHOD_DEF 55 , PARAMETER_DEF 55 , IDENT 55 , DOT 55 , LITERAL_VOID 55 , LITERAL_BOOLEAN 55 , LITERAL_BYTE 55 , LITERAL_CHAR 55 , LITERAL_SHORT 55 , LITERAL_INT 55 , LITERAL_FLOAT 55 , LITERAL_LONG 55 , LITERAL_DOUBLE 55 , ARRAY_DECLARATOR 55

CLASS_DEF

public static final int CLASS_DEF
A class declaration.

For example:

 public class MyClass
   implements Serializable
 {
 }
 

parses as:

 +--CLASS_DEF
     |
     +--MODIFIERS
         |
         +--LITERAL_PUBLIC (public)
     +--IDENT (MyClass)
     +--EXTENDS_CLAUSE
     +--IMPLEMENTS_CLAUSE
         |
         +--IDENT (Serializable)
     +--OBJBLOCK
         |
         +--LCURLY ({)
         +--RCURLY (})
 

See Also:
Java Language Specification, Chapter 8, MODIFIERS 55 , IDENT 55 , EXTENDS_CLAUSE 55 , IMPLEMENTS_CLAUSE 55 , OBJBLOCK 55 , LITERAL_NEW 55

INTERFACE_DEF

public static final int INTERFACE_DEF
An interface declaration.

For example:

   public interface MyInterface
   {
   }

 

parses as:

 +--INTERFACE_DEF
     |
     +--MODIFIERS
         |
         +--LITERAL_PUBLIC (public)
     +--IDENT (MyInterface)
     +--EXTENDS_CLAUSE
     +--OBJBLOCK
         |
         +--LCURLY ({)
         +--RCURLY (})
 

See Also:
Java Language Specification, Chapter 9, MODIFIERS 55 , IDENT 55 , EXTENDS_CLAUSE 55 , OBJBLOCK 55

PACKAGE_DEF

public static final int PACKAGE_DEF
The package declaration. This is optional, but if it is included, then there is only one package declaration per source file and it must be the first non-comment in the file.

For example:

   package com.puppycrawl.tools.checkstyle.api;
 

parses as:

 +--PACKAGE_DEF (package)
     |
     +--DOT (.)
         |
         +--DOT (.)
             |
             +--DOT (.)
                 |
                 +--DOT (.)
                     |
                     +--IDENT (com)
                     +--IDENT (puppycrawl)
                 +--IDENT (tools)
             +--IDENT (checkstyle)
         +--IDENT (api)
     +--SEMI (;)
 

See Also:
Java Language Specification §7.4, DOT 55 , IDENT 55 , SEMI 55 , FullIdent

ARRAY_DECLARATOR

public static final int ARRAY_DECLARATOR
An array declaration.

If the array declaration represents a type, then the type of the array elements is the first child. Multidimensional arrays may be regarded as arrays of arrays. In other words, the first child of the array declaration is another array declaration.

For example:

   int[] x;
 

parses as:

 +--VARIABLE_DEF
     |
     +--MODIFIERS
     +--TYPE
         |
         +--ARRAY_DECLARATOR ([)
             |
             +--LITERAL_INT (int)
     +--IDENT (x)
 +--SEMI (;)
 

The array declaration may also represent an inline array definition. In this case, the first child will be either an expression specifying the length of the array or an array initialization block.

See Also:
Java Language Specification Chapter 10, TYPE 55 , ARRAY_INIT 55

EXTENDS_CLAUSE

public static final int EXTENDS_CLAUSE
An extends clause. This appear as part of class and interface definitions. This element appears even if the extends keyword is not explicitly used. The child is an optional identifier.

For example:

 

parses as:

 +--EXTENDS_CLAUSE
     |
     +--DOT (.)
         |
         +--DOT (.)
             |
             +--IDENT (java)
             +--IDENT (util)
         +--IDENT (LinkedList)
 

See Also:
IDENT 55 , DOT 55 , CLASS_DEF 55 , INTERFACE_DEF 55 , FullIdent

IMPLEMENTS_CLAUSE

public static final int IMPLEMENTS_CLAUSE
An implements clause. This always appears in a class declaration, even if there are no implemented interfaces. The children are a comma separated list of zero or more identifiers.

For example:

 implements Serializable, Comparable
 

parses as:

 +--IMPLEMENTS_CLAUSE
     |
     +--IDENT (Serializable)
     +--COMMA (,)
     +--IDENT (Comparable)
 

See Also:
IDENT 55 , DOT 55 , COMMA 55 , CLASS_DEF 55

PARAMETERS

public static final int PARAMETERS
A list of parameters to a method or constructor. The children are zero or more parameter declarations separated by commas.

For example

 int start, int end
 

parses as:

 +--PARAMETERS
     |
     +--PARAMETER_DEF
         |
         +--MODIFIERS
         +--TYPE
             |
             +--LITERAL_INT (int)
         +--IDENT (start)
     +--COMMA (,)
     +--PARAMETER_DEF
         |
         +--MODIFIERS
         +--TYPE
             |
             +--LITERAL_INT (int)
         +--IDENT (end)
 

See Also:
PARAMETER_DEF 55 , COMMA 55 , METHOD_DEF 55 , CTOR_DEF 55

PARAMETER_DEF

public static final int PARAMETER_DEF
A parameter declaration.

See Also:
MODIFIERS 55 , TYPE 55 , IDENT 55 , PARAMETERS 55

LABELED_STAT

public static final int LABELED_STAT
A labeled statement.

For example:

 outside: ;
 

parses as:

 +--LABELED_STAT (:)
     |
     +--IDENT (outside)
     +--EMPTY_STAT (;)
 

See Also:
Java Language Specification, §14.7, SLIST 55

TYPECAST

public static final int TYPECAST
A type-cast.

For example:

 (String)it.next()
 

parses as:

 +--TYPECAST (()
     |
     +--TYPE
         |
         +--IDENT (String)
     +--RPAREN ())
     +--METHOD_CALL (()
         |
         +--DOT (.)
             |
             +--IDENT (it)
             +--IDENT (next)
         +--ELIST
         +--RPAREN ())
 

See Also:
Java Language Specification, §15.16, EXPR 55 , TYPE 55 , RPAREN 55

INDEX_OP

public static final int INDEX_OP
The array index operator.

For example:

 ar[2] = 5;
 

parses as:

 +--EXPR
     |
     +--ASSIGN (=)
         |
         +--INDEX_OP ([)
             |
             +--IDENT (ar)
             +--EXPR
                 |
                 +--NUM_INT (2)
         +--NUM_INT (5)
 +--SEMI (;)
 

See Also:
EXPR 55

POST_INC

public static final int POST_INC
The ++ (postfix increment) operator.

See Also:
Java Language Specification, §15.14.1, EXPR 55 , INC 55

POST_DEC

public static final int POST_DEC
The -- (postfix decrement) operator.

See Also:
Java Language Specification, §15.14.2, EXPR 55 , DEC 55

METHOD_CALL

public static final int METHOD_CALL
A method call.

For example:

 Math.random()
 

parses as:

 +--METHOD_CALL (()
     |
     +--DOT (.)
         |
         +--IDENT (Math)
         +--IDENT (random)
     +--ELIST
     +--RPAREN ())
 

See Also:
IDENT 55 , DOT 55 , ELIST 55 , RPAREN 55 , FullIdent

EXPR

public static final int EXPR
An expression. Operators with lower precedence appear at a higher level in the tree than operators with higher precedence. Parentheses are siblings to the operator they enclose.

For example:

 x = 4 + 3 * 5 + (30 + 26) / 4 + 5 % 4 + (1<<3);
 

parses as:

 +--EXPR
     |
     +--ASSIGN (=)
         |
         +--IDENT (x)
         +--PLUS (+)
             |
             +--PLUS (+)
                 |
                 +--PLUS (+)
                     |
                     +--PLUS (+)
                         |
                         +--NUM_INT (4)
                         +--STAR (*)
                             |
                             +--NUM_INT (3)
                             +--NUM_INT (5)
                     +--DIV (/)
                         |
                         +--LPAREN (()
                         +--PLUS (+)
                             |
                             +--NUM_INT (30)
                             +--NUM_INT (26)
                         +--RPAREN ())
                         +--NUM_INT (4)
                 +--MOD (%)
                     |
                     +--NUM_INT (5)
                     +--NUM_INT (4)
             +--LPAREN (()
             +--SL (<<)
                 |
                 +--NUM_INT (1)
                 +--NUM_INT (3)
             +--RPAREN ())
 +--SEMI (;)
 

See Also:
ELIST 55 , ASSIGN 55 , LPAREN 55 , RPAREN 55

ARRAY_INIT

public static final int ARRAY_INIT
An array initialization. This may occur as part of an array declaration or inline with new.

For example:

   int[] y =
     {
       1,
       2,
     };
 

parses as:

 +--VARIABLE_DEF
     |
     +--MODIFIERS
     +--TYPE
         |
         +--ARRAY_DECLARATOR ([)
             |
             +--LITERAL_INT (int)
     +--IDENT (y)
     +--ASSIGN (=)
         |
         +--ARRAY_INIT ({)
             |
             +--EXPR
                 |
                 +--NUM_INT (1)
             +--COMMA (,)
             +--EXPR
                 |
                 +--NUM_INT (2)
             +--COMMA (,)
             +--RCURLY (})
 +--SEMI (;)
 

Also consider:

   int[] z = new int[]
     {
       1,
       2,
     };
 

which parses as:

 +--VARIABLE_DEF
     |
     +--MODIFIERS
     +--TYPE
         |
         +--ARRAY_DECLARATOR ([)
             |
             +--LITERAL_INT (int)
     +--IDENT (z)
     +--ASSIGN (=)
         |
         +--EXPR
             |
             +--LITERAL_NEW (new)
                 |
                 +--LITERAL_INT (int)
                 +--ARRAY_DECLARATOR ([)
                 +--ARRAY_INIT ({)
                     |
                     +--EXPR
                         |
                         +--NUM_INT (1)
                     +--COMMA (,)
                     +--EXPR
                         |
                         +--NUM_INT (2)
                     +--COMMA (,)
                     +--RCURLY (})
 

See Also:
ARRAY_DECLARATOR 55 , TYPE 55 , LITERAL_NEW 55 , COMMA 55

IMPORT

public static final int IMPORT
An import declaration. Import declarations are option, but must appear after the package declaration and before the type declaration.

For example:

   import java.io.IOException;
 

parses as:

 +--IMPORT (import)
     |
     +--DOT (.)
         |
         +--DOT (.)
             |
             +--IDENT (java)
             +--IDENT (io)
         +--IDENT (IOException)
     +--SEMI (;)
 

See Also:
Java Language Specification §7.5, DOT 55 , IDENT 55 , STAR 55 , SEMI 55 , FullIdent

UNARY_MINUS

public static final int UNARY_MINUS
The + (unary plus) operator.

See Also:
Java Language Specification, §15.15.3, EXPR 55

UNARY_PLUS

public static final int UNARY_PLUS
The - (unary minus) operator.

See Also:
Java Language Specification, §15.15.4, EXPR 55

CASE_GROUP

public static final int CASE_GROUP
A group of case clauses. Case clauses with no associated statements are grouped together into a case group. The last child is a statement list containing the statements to execute upon a match.

For example:

 case 0:
 case 1:
 case 2:
   x = 3;
   break;
 

parses as:

 +--CASE_GROUP
     |
     +--LITERAL_CASE (case)
         |
         +--EXPR
             |
             +--NUM_INT (0)
     +--LITERAL_CASE (case)
         |
         +--EXPR
             |
             +--NUM_INT (1)
     +--LITERAL_CASE (case)
         |
         +--EXPR
             |
             +--NUM_INT (2)
     +--SLIST
         |
         +--EXPR
             |
             +--ASSIGN (=)
                 |
                 +--IDENT (x)
                 +--NUM_INT (3)
         +--SEMI (;)
         +--LITERAL_BREAK (break)
             |
             +--SEMI (;)
 

See Also:
LITERAL_CASE 55 , LITERAL_DEFAULT 55 , LITERAL_SWITCH 55

ELIST

public static final int ELIST
An expression list. The children are a comma separated list of expressions.

See Also:
LITERAL_NEW 55 , FOR_INIT 55 , FOR_ITERATOR 55 , EXPR 55 , METHOD_CALL 55 , CTOR_CALL 55 , SUPER_CTOR_CALL 55

FOR_INIT

public static final int FOR_INIT
A for loop initializer. This is a child of LITERAL_FOR. The children of this element may be a comma separated list of variable declarations, an expression list, or empty.

See Also:
VARIABLE_DEF 55 , ELIST 55 , LITERAL_FOR 55

FOR_CONDITION

public static final int FOR_CONDITION
A for loop condition. This is a child of LITERAL_FOR. The child of this element is an optional expression.

See Also:
EXPR 55 , LITERAL_FOR 55

FOR_ITERATOR

public static final int FOR_ITERATOR
A for loop iterator. This is a child of LITERAL_FOR. The child of this element is an optional expression list.

See Also:
ELIST 55 , LITERAL_FOR 55

EMPTY_STAT

public static final int EMPTY_STAT
The empty statement. This goes in place of an SLIST for a for or while loop body.

See Also:
Java Language Specification, §14.6, LITERAL_FOR 55 , LITERAL_WHILE 55

FINAL

public static final int FINAL
The final keyword.

See Also:
MODIFIERS 55

ABSTRACT

public static final int ABSTRACT
The abstract keyword.

See Also:
MODIFIERS 55

STRICTFP

public static final int STRICTFP
The strictfp keyword.

See Also:
MODIFIERS 55

SUPER_CTOR_CALL

public static final int SUPER_CTOR_CALL
A super constructor call.

See Also:
ELIST 55 , RPAREN 55 , SEMI 55 , CTOR_CALL 55

CTOR_CALL

public static final int CTOR_CALL
A constructor call.

For example:

 this(1);
 

parses as:

 +--CTOR_CALL (()
     |
     +--ELIST
         |
         +--EXPR
             |
             +--NUM_INT (1)
     +--RPAREN ())
     +--SEMI (;)
 

See Also:
ELIST 55 , RPAREN 55 , SEMI 55 , SUPER_CTOR_CALL 55

SEMI

public static final int SEMI
The statement terminator (;). Depending on the context, this make occur as a sibling, a child, or not at all.

See Also:
PACKAGE_DEF 55 , IMPORT 55 , SLIST 55 , ARRAY_INIT 55 , LITERAL_FOR 55

LITERAL_VOID

public static final int LITERAL_VOID
The void keyword.

See Also:
TYPE 55

LITERAL_BOOLEAN

public static final int LITERAL_BOOLEAN
The boolean keyword.

See Also:
TYPE 55

LITERAL_BYTE

public static final int LITERAL_BYTE
The byte keyword.

See Also:
TYPE 55

LITERAL_CHAR

public static final int LITERAL_CHAR
The char keyword.

See Also:
TYPE 55

LITERAL_SHORT

public static final int LITERAL_SHORT
The short keyword.

See Also:
TYPE 55

LITERAL_INT

public static final int LITERAL_INT
The int keyword.

See Also:
TYPE 55

LITERAL_FLOAT

public static final int LITERAL_FLOAT
The float keyword.

See Also:
TYPE 55

LITERAL_LONG

public static final int LITERAL_LONG
The long keyword.

See Also:
TYPE 55

LITERAL_DOUBLE

public static final int LITERAL_DOUBLE
The double keyword.

See Also:
TYPE 55

IDENT

public static final int IDENT
An identifier. These can be names of types, subpackages, fields, methods, parameters, and local variables.


DOT

public static final int DOT
The . (dot) operator.

See Also:
FullIdent

STAR

public static final int STAR
The * (multiplication or wildcard) operator.

See Also:
Java Language Specification, §7.5.2, Java Language Specification, §15.17.1, EXPR 55 , IMPORT 55

LITERAL_PRIVATE

public static final int LITERAL_PRIVATE
The private keyword.

See Also:
MODIFIERS 55

LITERAL_PUBLIC

public static final int LITERAL_PUBLIC
The public keyword.

See Also:
MODIFIERS 55

LITERAL_PROTECTED

public static final int LITERAL_PROTECTED
The protected keyword.

See Also:
MODIFIERS 55

LITERAL_STATIC

public static final int LITERAL_STATIC
The static keyword.

See Also:
MODIFIERS 55

LITERAL_TRANSIENT

public static final int LITERAL_TRANSIENT
The transient keyword.

See Also:
MODIFIERS 55

LITERAL_NATIVE

public static final int LITERAL_NATIVE
The native keyword.

See Also:
MODIFIERS 55

LITERAL_SYNCHRONIZED

public static final int LITERAL_SYNCHRONIZED
The synchronized keyword. This may be used as a modifier of a method or in the definition of a synchronized block.

For example:

 synchronized(this)
 {
   x++;
 }
 

parses as:

 +--LITERAL_SYNCHRONIZED (synchronized)
     |
     +--LPAREN (()
     +--EXPR
         |
         +--LITERAL_THIS (this)
     +--RPAREN ())
     +--SLIST ({)
         |
         +--EXPR
             |
             +--POST_INC (++)
                 |
                 +--IDENT (x)
         +--SEMI (;)
         +--RCURLY (})
 +--RCURLY (})
 

See Also:
MODIFIERS 55 , LPAREN 55 , EXPR 55 , RPAREN 55 , SLIST 55 , RCURLY 55

LITERAL_VOLATILE

public static final int LITERAL_VOLATILE
The volatile keyword.

See Also:
MODIFIERS 55

LITERAL_CLASS

public static final int LITERAL_CLASS
The class keyword. This element does not appear as part of a class declaration, but only inline to reference a class object.

For example:

 int.class
 

parses as:

 +--EXPR
     |
     +--DOT (.)
         |
         +--LITERAL_INT (int)
         +--LITERAL_CLASS (class)
 

See Also:
DOT 55 , IDENT 55 , CLASS_DEF 55 , FullIdent

LCURLY

public static final int LCURLY
A left (curly) brace ({).

See Also:
OBJBLOCK 55 , ARRAY_INIT 55 , SLIST 55

RCURLY

public static final int RCURLY
A right (curly) brace (}).

See Also:
OBJBLOCK 55 , ARRAY_INIT 55 , SLIST 55

COMMA

public static final int COMMA
The , (comma) operator.

See Also:
ARRAY_INIT 55 , FOR_INIT 55 , FOR_ITERATOR 55 , LITERAL_THROWS 55 , IMPLEMENTS_CLAUSE 55

LPAREN

public static final int LPAREN
A left parenthesis (().

See Also:
LITERAL_FOR 55 , LITERAL_NEW 55 , EXPR 55 , LITERAL_SWITCH 55 , LITERAL_CATCH 55

RPAREN

public static final int RPAREN
A right parenthesis ()).

See Also:
LITERAL_FOR 55 , LITERAL_NEW 55 , METHOD_CALL 55 , TYPECAST 55 , EXPR 55 , LITERAL_SWITCH 55 , LITERAL_CATCH 55

LITERAL_THIS

public static final int LITERAL_THIS
The this keyword.

See Also:
EXPR 55 , CTOR_CALL 55

LITERAL_SUPER

public static final int LITERAL_SUPER
The super keyword.

See Also:
EXPR 55 , SUPER_CTOR_CALL 55

ASSIGN

public static final int ASSIGN
The = (assignment) operator.

See Also:
Java Language Specification, §15.26.1, EXPR 55

LITERAL_THROWS

public static final int LITERAL_THROWS
The throws keyword. The children are a number of one or more identifiers separated by commas.

See Also:
Java Language Specification, §8.4.4, IDENT 55 , DOT 55 , COMMA 55 , METHOD_DEF 55 , CTOR_DEF 55 , FullIdent

COLON

public static final int COLON
The : (colon) operator. This will appear as part of the conditional operator (? :).

See Also:
QUESTION 55 , LABELED_STAT 55 , CASE_GROUP 55

LITERAL_IF

public static final int LITERAL_IF
The if keyword.

For example:

 if(optimistic)
 {
   message = "half full";
 }
 else
 {
   message = "half empty";
 }
 

parses as:

 +--LITERAL_IF (if)
     |
     +--LPAREN (()
     +--EXPR
         |
         +--IDENT (optimistic)
     +--RPAREN ())
     +--SLIST ({)
         |
         +--EXPR
             |
             +--ASSIGN (=)
                 |
                 +--IDENT (message)
                 +--STRING_LITERAL ("half full")
         +--SEMI (;)
         +--RCURLY (})
     +--LITERAL_ELSE (else)
         |
         +--SLIST ({)
             |
             +--EXPR
                 |
                 +--ASSIGN (=)
                     |
                     +--IDENT (message)
                     +--STRING_LITERAL ("half empty")
             +--SEMI (;)
             +--RCURLY (})
 

See Also:
LPAREN 55 , EXPR 55 , RPAREN 55 , SLIST 55 , EMPTY_STAT 55 , LITERAL_ELSE 55

LITERAL_FOR

public static final int LITERAL_FOR
The for keyword. The children are (, an initializer, a condition, an iterator, a ) and either a statement list, a single expression, or an empty statement.

For example:

 for(int i = 0, n = myArray.length; i < n; i++)
 {
 }
 

parses as:

 +--LITERAL_FOR (for)
     |
     +--LPAREN (()
     +--FOR_INIT
         |
         +--VARIABLE_DEF
             |
             +--MODIFIERS
             +--TYPE
                 |
                 +--LITERAL_INT (int)
             +--IDENT (i)
             +--ASSIGN (=)
                 |
                 +--EXPR
                     |
                     +--NUM_INT (0)
         +--COMMA (,)
         +--VARIABLE_DEF
             |
             +--MODIFIERS
             +--TYPE
                 |
                 +--LITERAL_INT (int)
             +--IDENT (n)
             +--ASSIGN (=)
                 |
                 +--EXPR
                     |
                     +--DOT (.)
                         |
                         +--IDENT (myArray)
                         +--IDENT (length)
     +--SEMI (;)
     +--FOR_CONDITION
         |
         +--EXPR
             |
             +--LT (<)
                 |
                 +--IDENT (i)
                 +--IDENT (n)
     +--SEMI (;)
     +--FOR_ITERATOR
         |
         +--ELIST
             |
             +--EXPR
                 |
                 +--POST_INC (++)
                     |
                     +--IDENT (i)
     +--RPAREN ())
     +--SLIST ({)
         |
         +--RCURLY (})
 

See Also:
LPAREN 55 , FOR_INIT 55 , SEMI 55 , FOR_CONDITION 55 , FOR_ITERATOR 55 , RPAREN 55 , SLIST 55 , EMPTY_STAT 55 , EXPR 55

LITERAL_WHILE

public static final int LITERAL_WHILE
The while keyword.

For example:

 while(line != null)
 {
   process(line);
   line = in.readLine();
 }
 

parses as:

 +--LITERAL_WHILE (while)
     |
     +--LPAREN (()
     +--EXPR
         |
         +--NOT_EQUAL (!=)
             |
             +--IDENT (line)
             +--LITERAL_NULL (null)
     +--RPAREN ())
     +--SLIST ({)
         |
         +--EXPR
             |
             +--METHOD_CALL (()
                 |
                 +--IDENT (process)
                 +--ELIST
                     |
                     +--EXPR
                         |
                         +--IDENT (line)
                 +--RPAREN ())
         +--SEMI (;)
         +--EXPR
             |
             +--ASSIGN (=)
                 |
                 +--IDENT (line)
                 +--METHOD_CALL (()
                     |
                     +--DOT (.)
                         |
                         +--IDENT (in)
                         +--IDENT (readLine)
                     +--ELIST
                     +--RPAREN ())
         +--SEMI (;)
         +--RCURLY (})
 


LITERAL_DO

public static final int LITERAL_DO
The do keyword. Note the the while token does not appear as part of the do-while construct.

For example:

 do
 {
   x = rand.nextInt(10);
 }
 while(x < 5);
 

parses as:

 +--LITERAL_DO (do)
     |
     +--SLIST ({)
         |
         +--EXPR
             |
             +--ASSIGN (=)
                 |
                 +--IDENT (x)
                 +--METHOD_CALL (()
                     |
                     +--DOT (.)
                         |
                         +--IDENT (rand)
                         +--IDENT (nextInt)
                     +--ELIST
                         |
                         +--EXPR
                             |
                             +--NUM_INT (10)
                     +--RPAREN ())
         +--SEMI (;)
         +--RCURLY (})
     +--LPAREN (()
     +--EXPR
         |
         +--LT (<)
             |
             +--IDENT (x)
             +--NUM_INT (5)
     +--RPAREN ())
     +--SEMI (;)
 

See Also:
SLIST 55 , EXPR 55 , EMPTY_STAT 55 , LPAREN 55 , RPAREN 55 , SEMI 55

LITERAL_BREAK

public static final int LITERAL_BREAK
The break keyword. The first child is an optional identifier and the last child is a semicolon.

See Also:
IDENT 55 , SEMI 55 , SLIST 55

LITERAL_CONTINUE

public static final int LITERAL_CONTINUE
The continue keyword. The first child is an optional identifier and the last child is a semicolon.

See Also:
IDENT 55 , SEMI 55 , SLIST 55

LITERAL_RETURN

public static final int LITERAL_RETURN
The return keyword. The first child is an optional expression for the return value. The last child is a semi colon.

See Also:
EXPR 55 , SEMI 55 , SLIST 55

LITERAL_SWITCH

public static final int LITERAL_SWITCH
The switch keyword.

For example:

 switch(type)
 {
   case 0:
     background = Color.blue;
     break;
   case 1:
     background = Color.red;
     break;
   default:
     background = Color.green;
     break;
 }
 

parses as:

 +--LITERAL_SWITCH (switch)
     |
     +--LPAREN (()
     +--EXPR
         |
         +--IDENT (type)
     +--RPAREN ())
     +--LCURLY ({)
     +--CASE_GROUP
         |
         +--LITERAL_CASE (case)
             |
             +--EXPR
                 |
                 +--NUM_INT (0)
         +--SLIST
             |
             +--EXPR
                 |
                 +--ASSIGN (=)
                     |
                     +--IDENT (background)
                     +--DOT (.)
                         |
                         +--IDENT (Color)
                         +--IDENT (blue)
             +--SEMI (;)
             +--LITERAL_BREAK (break)
                 |
                 +--SEMI (;)
     +--CASE_GROUP
         |
         +--LITERAL_CASE (case)
             |
             +--EXPR
                 |
                 +--NUM_INT (1)
         +--SLIST
             |
             +--EXPR
                 |
                 +--ASSIGN (=)
                     |
                     +--IDENT (background)
                     +--DOT (.)
                         |
                         +--IDENT (Color)
                         +--IDENT (red)
             +--SEMI (;)
             +--LITERAL_BREAK (break)
                 |
                 +--SEMI (;)
     +--CASE_GROUP
         |
         +--LITERAL_DEFAULT (default)
         +--SLIST
             |
             +--EXPR
                 |
                 +--ASSIGN (=)
                     |
                     +--IDENT (background)
                     +--DOT (.)
                         |
                         +--IDENT (Color)
                         +--IDENT (green)
             +--SEMI (;)
             +--LITERAL_BREAK (break)
                 |
                 +--SEMI (;)
     +--RCURLY (})
 

See Also:
Java Language Specification, §14.10, LPAREN 55 , EXPR 55 , RPAREN 55 , LCURLY 55 , CASE_GROUP 55 , RCURLY 55 , SLIST 55

LITERAL_THROW

public static final int LITERAL_THROW
The throw keyword. The first child is an expression that evaluates to a Throwable instance.

See Also: