< prev index next >
src/jdk.jshell/share/classes/jdk/jshell/Snippet.java
Print this page
*** 71,81 ****
* ({@link jdk.jshell.Snippet.SubKind#TYPE_IMPORT_ON_DEMAND_SUBKIND}),
* or a static on-demand type import
* ({@link jdk.jshell.Snippet.SubKind#SINGLE_STATIC_IMPORT_SUBKIND}) --
* use {@link jdk.jshell.Snippet#subKind()} to distinguish.
*
! * @jls 8.3: importDeclaration.
* <P>
* An import declaration is {@linkplain Kind#isPersistent() persistent}.
*/
IMPORT(true),
--- 71,81 ----
* ({@link jdk.jshell.Snippet.SubKind#TYPE_IMPORT_ON_DEMAND_SUBKIND}),
* or a static on-demand type import
* ({@link jdk.jshell.Snippet.SubKind#SINGLE_STATIC_IMPORT_SUBKIND}) --
* use {@link jdk.jshell.Snippet#subKind()} to distinguish.
*
! * @jls 7.5 Import Declarations
* <P>
* An import declaration is {@linkplain Kind#isPersistent() persistent}.
*/
IMPORT(true),
*** 89,109 ****
* {@link jdk.jshell.Snippet.SubKind#INTERFACE_SUBKIND},
* classes {@link jdk.jshell.Snippet.SubKind#CLASS_SUBKIND}, enums, and
* annotation interfaces -- see {@link jdk.jshell.Snippet.SubKind} to
* differentiate.
*
! * @jls 7.6: TypeDeclaration.
* <P>
* A type declaration is {@linkplain Kind#isPersistent() persistent}.
*/
TYPE_DECL(true),
/**
* A method declaration.
* The snippet is an instance of {@link jdk.jshell.MethodSnippet}.
*
! * @jls 8.4: MethodDeclaration.
* <P>
* A method declaration is {@linkplain Kind#isPersistent() persistent}.
*/
METHOD(true),
--- 89,109 ----
* {@link jdk.jshell.Snippet.SubKind#INTERFACE_SUBKIND},
* classes {@link jdk.jshell.Snippet.SubKind#CLASS_SUBKIND}, enums, and
* annotation interfaces -- see {@link jdk.jshell.Snippet.SubKind} to
* differentiate.
*
! * @jls 7.6 Top Level Type Declarations
* <P>
* A type declaration is {@linkplain Kind#isPersistent() persistent}.
*/
TYPE_DECL(true),
/**
* A method declaration.
* The snippet is an instance of {@link jdk.jshell.MethodSnippet}.
*
! * @jls 8.4 Method Declarations
* <P>
* A method declaration is {@linkplain Kind#isPersistent() persistent}.
*/
METHOD(true),
*** 114,124 ****
* <P>
* The variable may be with or without initializer, or be a temporary
* variable representing an expression -- see
* {@link jdk.jshell.Snippet.SubKind}to differentiate.
*
! * @jls 8.3: FieldDeclaration.
* <P>
* A variable declaration is {@linkplain Kind#isPersistent() persistent}.
*/
VAR(true),
--- 114,124 ----
* <P>
* The variable may be with or without initializer, or be a temporary
* variable representing an expression -- see
* {@link jdk.jshell.Snippet.SubKind}to differentiate.
*
! * @jls 8.3 Field Declarations
* <P>
* A variable declaration is {@linkplain Kind#isPersistent() persistent}.
*/
VAR(true),
*** 131,149 ****
* assignment (both of which have natural referencing
* names) -- see {@link jdk.jshell.Snippet.SubKind} to differentiate.
* All other expression forms (operators, method calls, ...) generate a
* scratch variable and so are instead of the VAR Kind.
*
! * @jls 15: Expression.
*/
EXPRESSION(false),
/**
* A statement.
* The snippet is an instance of {@link jdk.jshell.StatementSnippet}.
*
! * @jls 14.5: Statement.
*/
STATEMENT(false),
/**
* A syntactically incorrect input for which the specific
--- 131,149 ----
* assignment (both of which have natural referencing
* names) -- see {@link jdk.jshell.Snippet.SubKind} to differentiate.
* All other expression forms (operators, method calls, ...) generate a
* scratch variable and so are instead of the VAR Kind.
*
! * @jls 15 Expressions
*/
EXPRESSION(false),
/**
* A statement.
* The snippet is an instance of {@link jdk.jshell.StatementSnippet}.
*
! * @jls 14.5 Statements
*/
STATEMENT(false),
/**
* A syntactically incorrect input for which the specific
*** 183,285 ****
public enum SubKind {
/**
* Single-Type-Import Declaration.
* An import declaration of a single type.
! * @jls 7.5.1 SingleTypeImportDeclaration.
*/
SINGLE_TYPE_IMPORT_SUBKIND(Kind.IMPORT),
/**
* Type-Import-on-Demand Declaration.
* A non-static "star" import.
! * @jls 7.5.2. TypeImportOnDemandDeclaration.
*/
TYPE_IMPORT_ON_DEMAND_SUBKIND(Kind.IMPORT),
/**
* Single-Static-Import Declaration.
* An import of a static member.
! * @jls 7.5.3 Single-Static-Import.
*/
SINGLE_STATIC_IMPORT_SUBKIND(Kind.IMPORT),
/**
* Static-Import-on-Demand Declaration.
* A static "star" import of all static members of a named type.
! * @jls 7.5.4. Static-Import-on-Demand Static "star" import.
*/
STATIC_IMPORT_ON_DEMAND_SUBKIND(Kind.IMPORT),
/**
* A class declaration.
* A {@code SubKind} of {@link Kind#TYPE_DECL}.
! * @jls 8.1. NormalClassDeclaration.
*/
CLASS_SUBKIND(Kind.TYPE_DECL),
/**
* An interface declaration.
* A {@code SubKind} of {@link Kind#TYPE_DECL}.
! * @jls 9.1. NormalInterfaceDeclaration.
*/
INTERFACE_SUBKIND(Kind.TYPE_DECL),
/**
* An enum declaration.
* A {@code SubKind} of {@link Kind#TYPE_DECL}.
! * @jls 8.9. EnumDeclaration.
*/
ENUM_SUBKIND(Kind.TYPE_DECL),
/**
* An annotation interface declaration. A {@code SubKind} of
* {@link Kind#TYPE_DECL}.
! * @jls 9.6. AnnotationTypeDeclaration.
*/
ANNOTATION_TYPE_SUBKIND(Kind.TYPE_DECL),
/**
* A method. The only {@code SubKind} for {@link Kind#METHOD}.
! * @jls 8.4. MethodDeclaration.
*/
METHOD_SUBKIND(Kind.METHOD),
/**
* A variable declaration without initializer.
* A {@code SubKind} of {@link Kind#VAR}.
! * @jls 8.3. VariableDeclarator without VariableInitializer in
! * FieldDeclaration.
*/
VAR_DECLARATION_SUBKIND(Kind.VAR, true, true),
/**
* A variable declaration with an initializer expression. A
* {@code SubKind} of {@link Kind#VAR}.
! * @jls 8.3. VariableDeclarator with VariableInitializer in
! * FieldDeclaration.
*/
VAR_DECLARATION_WITH_INITIALIZER_SUBKIND(Kind.VAR, true, true),
/**
* An expression whose value has been stored in a temporary variable. A
* {@code SubKind} of {@link Kind#VAR}.
! * @jls 15. Primary.
*/
TEMP_VAR_EXPRESSION_SUBKIND(Kind.VAR, true, true),
/**
* A simple variable reference expression. A {@code SubKind} of
* {@link Kind#EXPRESSION}.
! * @jls 15.11. Field Access as 3.8. Identifier.
*/
VAR_VALUE_SUBKIND(Kind.EXPRESSION, true, true),
/**
* An assignment expression. A {@code SubKind} of
* {@link Kind#EXPRESSION}.
! * @jls 15.26. Assignment.
*/
ASSIGNMENT_SUBKIND(Kind.EXPRESSION, true, true),
/**
* An expression which has not been wrapped in a temporary variable
--- 183,283 ----
public enum SubKind {
/**
* Single-Type-Import Declaration.
* An import declaration of a single type.
! * @jls 7.5.1 Single-Type-Import Declarations
*/
SINGLE_TYPE_IMPORT_SUBKIND(Kind.IMPORT),
/**
* Type-Import-on-Demand Declaration.
* A non-static "star" import.
! * @jls 7.5.2 Type-Import-on-Demand Declarations
*/
TYPE_IMPORT_ON_DEMAND_SUBKIND(Kind.IMPORT),
/**
* Single-Static-Import Declaration.
* An import of a static member.
! * @jls 7.5.3 Single-Static-Import Declarations
*/
SINGLE_STATIC_IMPORT_SUBKIND(Kind.IMPORT),
/**
* Static-Import-on-Demand Declaration.
* A static "star" import of all static members of a named type.
! * @jls 7.5.4 Static-Import-on-Demand Declarations
*/
STATIC_IMPORT_ON_DEMAND_SUBKIND(Kind.IMPORT),
/**
* A class declaration.
* A {@code SubKind} of {@link Kind#TYPE_DECL}.
! * @jls 8.1 Class Declarations
*/
CLASS_SUBKIND(Kind.TYPE_DECL),
/**
* An interface declaration.
* A {@code SubKind} of {@link Kind#TYPE_DECL}.
! * @jls 9.1 Interface Declarations
*/
INTERFACE_SUBKIND(Kind.TYPE_DECL),
/**
* An enum declaration.
* A {@code SubKind} of {@link Kind#TYPE_DECL}.
! * @jls 8.9 Enum Types
*/
ENUM_SUBKIND(Kind.TYPE_DECL),
/**
* An annotation interface declaration. A {@code SubKind} of
* {@link Kind#TYPE_DECL}.
! * @jls 9.6 Annotation Types
*/
ANNOTATION_TYPE_SUBKIND(Kind.TYPE_DECL),
/**
* A method. The only {@code SubKind} for {@link Kind#METHOD}.
! * @jls 8.4 Method Declarations
*/
METHOD_SUBKIND(Kind.METHOD),
/**
* A variable declaration without initializer.
* A {@code SubKind} of {@link Kind#VAR}.
! * @jls 8.3 Field Declarations
*/
VAR_DECLARATION_SUBKIND(Kind.VAR, true, true),
/**
* A variable declaration with an initializer expression. A
* {@code SubKind} of {@link Kind#VAR}.
! * @jls 8.3 Field Declarations
*/
VAR_DECLARATION_WITH_INITIALIZER_SUBKIND(Kind.VAR, true, true),
/**
* An expression whose value has been stored in a temporary variable. A
* {@code SubKind} of {@link Kind#VAR}.
! * @jls 15 Expressions
*/
TEMP_VAR_EXPRESSION_SUBKIND(Kind.VAR, true, true),
/**
* A simple variable reference expression. A {@code SubKind} of
* {@link Kind#EXPRESSION}.
! * @jls 15.11 Field Access Expressions
*/
VAR_VALUE_SUBKIND(Kind.EXPRESSION, true, true),
/**
* An assignment expression. A {@code SubKind} of
* {@link Kind#EXPRESSION}.
! * @jls 15.26 Assignment Operators
*/
ASSIGNMENT_SUBKIND(Kind.EXPRESSION, true, true),
/**
* An expression which has not been wrapped in a temporary variable
*** 287,297 ****
*/
OTHER_EXPRESSION_SUBKIND(Kind.EXPRESSION, true, true),
/**
* A statement. The only {@code SubKind} for {@link Kind#STATEMENT}.
! * @jls 14.5. Statement.
*/
STATEMENT_SUBKIND(Kind.STATEMENT, true, false),
/**
* An unknown snippet. The only {@code SubKind} for
--- 285,295 ----
*/
OTHER_EXPRESSION_SUBKIND(Kind.EXPRESSION, true, true),
/**
* A statement. The only {@code SubKind} for {@link Kind#STATEMENT}.
! * @jls 14.5 Statements
*/
STATEMENT_SUBKIND(Kind.STATEMENT, true, false),
/**
* An unknown snippet. The only {@code SubKind} for
< prev index next >