この章では、第4章、第6-10章、第14章および第15章に示されている構文文法と、第3章の字句文法の重要な部分を、第2.4項の表記を使用して繰り返します。
§3 (Lexical Structure)からのプロダクション
permits、record、sealed、var、またはyieldではない識別子
yieldではなく識別子
§4 (Types、 Values、 and Variables)からのプロダクション
boolean
byte short int long char
float double
extends TypeVariable extends ClassOrInterfaceType {AdditionalBound}
< TypeArgumentList >
? [WildcardBounds]
extends ReferenceType super ReferenceType
§6 (名前)からのプロダクション
§7 (Packages and Modules)からのプロダクション
package Identifier {. 識別子} ;
import タイプ名 ;
import PackageOrTypeName . * ;
import static TypeName . * ;
open] module Identifier {. 識別子} { {ModuleDirective} }
requires {RequiresModifier} ModuleName ; exports PackageName [to ModuleName {, ModuleName}] ; opens PackageName [to ModuleName {, ModuleName}] ; uses TypeName ; provides TypeName with TypeName {, TypeName} ;
transitive static
§8 (Classes)のプロダクション
public protected private abstract static final sealed non-sealed strictfp
extends ClassType
implements InterfaceTypeList
{ {ClassBodyDeclaration} }
public protected private static final transient volatile
_
boolean
public protected private abstract static final synchronized native strictfp
void
( [ReceiverParameter ,] [FormalParameterList] ) [Dims]
.] this
final
throws ExceptionTypeList
;
static ブロック
public protected private
{ [BlockStatements] ConstructorInvocation [BlockStatements] } { [BlockStatements] }
this ( [ArgumentList] ) ; super ( [ArgumentList] ) ; . [TypeArguments] super ( [ArgumentList] ) ; . [TypeArguments] super ( [ArgumentList] ) ;
{ [EnumConstantList] [,] [EnumBodyDeclarations] }
( [ArgumentList] )] [ClassBody]
( [RecordComponentList] )
{ {RecordBodyDeclaration} }
§9 (Interfaces)からのプロダクション
interface TypeIdentifier [TypeParameters] [InterfaceExtends] [InterfacePermits] InterfaceBody
public protected private abstract static sealed non-sealed strictfp
extends InterfaceTypeList
public static final
public private abstract default static strictfp
@ interface TypeIdentifier AnnotationInterfaceBody
public abstract
defaultElementValue
@ TypeName ( [ElementValuePairList] )
{ [ElementValueList] [,] }
@ タイプ名
@ TypeName ( ElementValue )
§14 (Blocks、 Statements、 and Patterns)からの作品
{ [BlockStatements] }
var
;
if ( 式 ) StatementNoShortIf else 文
if ( 式 ) StatementNoShortIf else StatementNoShortIf
switch ( 式 ) SwitchBlock
{ SwitchRule {SwitchRule} } { {SwitchBlockStatementGroup} {SwitchLabel :} }
-> 式 ; -> ブロック -> ThrowStatement
case CaseConstant {, CaseConstant} case null [, default] case CasePattern {, CasePattern} [Guard] default
when 式
while ( 式 ) StatementNoShortIf
for ( [ForInit] ; [Expression] ; [ForUpdate] ) Statement
for ( [ForInit] ; [Expression] ; [ForUpdate] ) StatementNoShortIf
for ( LocalVariableDeclaration : 式 ) 文
for ( LocalVariableDeclaration : 式 ) StatementNoShortIf
break [識別子] ;
yield 式 ;
continue [識別子] ;
return [式] ;
throw 式 ;
catch ( CatchFormalParameter ) ブロック
finally ブロック
try ResourceSpecification Block [Catches] [Finally]
( ResourceList [;] )
_
§15 (Expressions)からのプロダクション
[ ]} . class [ ]} . class boolean {[ ]} . class void . class
new [TypeArguments] ClassOrInterfaceTypeToInstantiate ( [ArgumentList] ) [ClassBody]
new PrimitiveType DimExprs [Dims] new ClassOrInterfaceType DimExprs [Dims]
[ 式 ]
( [ArgumentList] ) . [TypeArguments] Identifier ( [ArgumentList] ) . [TypeArguments] Identifier ( [ArgumentList] ) . [TypeArguments] Identifier ( [ArgumentList] ) super . [TypeArguments] Identifier ( [ArgumentList] ) . super . [TypeArguments] Identifier ( [ArgumentList] )
:: [TypeArguments] 識別子 :: [TypeArguments] 識別子 :: [TypeArguments] 識別子 super :: [TypeArguments] 識別子 . super :: [TypeArguments] 識別子 :: [TypeArguments] new :: new
var
_
=*=/=%=+=-=<<=>>=>>>=&=^=|=
|| ConditionalAndExpression
instanceofReferenceTypeinstanceofパターン
switch ( 式 ) SwitchBlock