Closed mingodad closed 2 years ago
And here is the EBNF for java.g
:
Goal ::= '++' CompilationUnit
Goal ::= '--' MethodBody
Goal ::= '>>' StaticInitializer
Goal ::= '>>' Initializer
Goal ::= '>>>' Header1 Modifiersopt
Goal ::= '!' Header2 Modifiersopt
Goal ::= '*' BlockStatements
Goal ::= '*' CatchHeader
Goal ::= '&&' FieldDeclaration
Goal ::= '||' ImportDeclaration
Goal ::= '?' PackageDeclaration
Goal ::= '+' TypeDeclaration
Goal ::= '/' GenericMethodDeclaration
Goal ::= '&' ClassBodyDeclarations
Goal ::= '%' Expression
Goal ::= '%' ArrayInitializer
Goal ::= '~' BlockStatementsopt
Goal ::= '{' BlockStatementopt
Goal ::= '||' MemberValue
Goal ::= '?' AnnotationTypeMemberDeclaration
Goal ::= '->' ParenthesizedLambdaParameterList
Goal ::= '(' ParenthesizedCastNameAndBounds
Goal ::= '<' ReferenceExpressionTypeArgumentsAndTrunk
Goal ::= '@' TypeAnnotations
Goal ::= '->' YieldStatement
Goal ::= '->' SwitchLabelCaseLhs
Goal ::= 'RestrictedIdentifiersealed' Modifiersopt
Goal ::= 'RestrictedIdentifierpermits' PermittedSubclasses
Literal ::= /*->*/ 'IntegerLiteral'
Literal ::= /*->*/ 'LongLiteral'
Literal ::= /*->*/ 'FloatingPointLiteral'
Literal ::= /*->*/ 'DoubleLiteral'
Literal ::= /*->*/ 'CharacterLiteral'
Literal ::= /*->*/ 'StringLiteral'
Literal ::= /*->*/ 'TextBlock'
Literal ::= /*->*/ 'null'
Literal ::= /*->*/ BooleanLiteral
BooleanLiteral ::= /*->*/ 'true'
BooleanLiteral ::= /*->*/ 'false'
Type ::= PrimitiveType
Type ::= /*->*/ ReferenceType
PrimitiveType ::= /*->*/ TypeAnnotationsopt NumericType
NumericType ::= /*->*/ IntegralType
NumericType ::= /*->*/ FloatingPointType
PrimitiveType ::= /*->*/ TypeAnnotationsopt 'boolean'
PrimitiveType ::= /*->*/ TypeAnnotationsopt 'void'
IntegralType ::= /*->*/ 'byte'
IntegralType ::= /*->*/ 'short'
IntegralType ::= /*->*/ 'int'
IntegralType ::= /*->*/ 'long'
IntegralType ::= /*->*/ 'char'
FloatingPointType ::= /*->*/ 'float'
FloatingPointType ::= /*->*/ 'double'
ReferenceType ::= ClassOrInterfaceType
ReferenceType ::= /*->*/ ArrayType
ClassOrInterfaceType ::= /*->*/ ClassOrInterface
ClassOrInterfaceType ::= /*->*/ GenericType
ClassOrInterface ::= Name
ClassOrInterface ::= GenericType '.' Name
GenericType ::= ClassOrInterface TypeArguments
GenericType ::= ClassOrInterface '<' '>'
ArrayTypeWithTypeArgumentsName ::= GenericType '.' Name
ArrayType ::= PrimitiveType Dims
ArrayType ::= Name Dims
ArrayType ::= ArrayTypeWithTypeArgumentsName Dims
ArrayType ::= GenericType Dims
ClassType ::= /*->*/ ClassOrInterfaceType
Name ::= SimpleName
Name ::= /*->*/ TypeAnnotations SimpleName
Name ::= /*->*/ QualifiedName
SimpleName ::= /*->*/ 'Identifier'
UnannotatableName ::= /*->*/ SimpleName
UnannotatableName ::= UnannotatableName '.' SimpleName
QualifiedName ::= Name '.' SimpleName
QualifiedName ::= Name '.' TypeAnnotations SimpleName
TypeAnnotationsopt ::= //$Empty
TypeAnnotationsopt ::= /*->*/ TypeAnnotations
TypeAnnotations ::= TypeAnnotations0
TypeAnnotations0 ::= /*->*/ TypeAnnotation
TypeAnnotations0 ::= TypeAnnotations0 TypeAnnotation
TypeAnnotation ::= NormalTypeAnnotation
TypeAnnotation ::= MarkerTypeAnnotation
TypeAnnotation ::= SingleMemberTypeAnnotation
TypeAnnotationName ::= '@308' UnannotatableName
NormalTypeAnnotation ::= TypeAnnotationName '(' MemberValuePairsopt ')'
MarkerTypeAnnotation ::= TypeAnnotationName
SingleMemberTypeAnnotation ::= TypeAnnotationName '(' SingleMemberAnnotationMemberValue ')'
RejectTypeAnnotations ::= //$Empty
PushZeroTypeAnnotations ::= //$Empty
VariableDeclaratorIdOrThis ::= 'this'
VariableDeclaratorIdOrThis ::= UnannotatableName '.' 'this'
VariableDeclaratorIdOrThis ::= VariableDeclaratorId
CompilationUnit ::= EnterCompilationUnit InternalCompilationUnit
InternalCompilationUnit ::= PackageDeclaration
InternalCompilationUnit ::= PackageDeclaration ImportDeclarations ReduceImports
InternalCompilationUnit ::= PackageDeclaration ImportDeclarations ReduceImports TypeDeclarations
InternalCompilationUnit ::= PackageDeclaration TypeDeclarations
InternalCompilationUnit ::= ImportDeclarations ReduceImports
InternalCompilationUnit ::= TypeDeclarations
InternalCompilationUnit ::= ImportDeclarations ReduceImports TypeDeclarations
InternalCompilationUnit ::= //$Empty
InternalCompilationUnit ::= ImportDeclarations ReduceImports ModuleDeclaration
InternalCompilationUnit ::= ModuleDeclaration
ModuleDeclaration ::= ModuleHeader ModuleBody
ModuleHeader ::= Modifiersopt ModuleModifieropt 'module' UnannotatableName
ModuleModifieropt ::= //$Empty
ModuleModifieropt ::= ModuleModifier
ModuleModifier ::= /*->*/ 'open'
ModuleBody ::= '{' ModuleStatementsOpt '}'
ModuleStatementsOpt ::= //$Empty
ModuleStatementsOpt ::= /*->*/ ModuleStatements
ModuleStatements ::= ModuleStatement
ModuleStatements ::= ModuleStatements ModuleStatement
ModuleStatement ::= RequiresStatement
ModuleStatement ::= ExportsStatement
ModuleStatement ::= OpensStatement
ModuleStatement ::= UsesStatement
ModuleStatement ::= ProvidesStatement
RequiresStatement ::= SingleRequiresModuleName ';'
SingleRequiresModuleName ::= 'requires' RequiresModifiersopt UnannotatableName
RequiresModifiersopt ::= RequiresModifiers
RequiresModifiersopt ::= //$Empty
RequiresModifiers ::= /*->*/ RequiresModifier
RequiresModifiers ::= RequiresModifiers RequiresModifier
RequiresModifier ::= /*->*/ 'transitive'
RequiresModifier ::= /*->*/ 'static'
ExportsStatement ::= ExportsHeader TargetModuleListopt ';'
ExportsHeader ::= 'exports' SinglePkgName
TargetModuleListopt ::= //$Empty
TargetModuleListopt ::= 'to' TargetModuleNameList
TargetModuleName ::= UnannotatableName
TargetModuleNameList ::= /*->*/ TargetModuleName
TargetModuleNameList ::= TargetModuleNameList ',' TargetModuleName
SinglePkgName ::= UnannotatableName
OpensStatement ::= OpensHeader TargetModuleListopt ';'
OpensHeader ::= 'opens' SinglePkgName
UsesStatement ::= UsesHeader ';'
UsesHeader ::= 'uses' Name
ProvidesStatement ::= ProvidesInterface WithClause ';'
ProvidesInterface ::= 'provides' Name
ServiceImplName ::= Name
ServiceImplNameList ::= /*->*/ ServiceImplName
ServiceImplNameList ::= ServiceImplNameList ',' ServiceImplName
WithClause ::= 'with' ServiceImplNameList
ReduceImports ::= //$Empty
EnterCompilationUnit ::= //$Empty
Header ::= /*->*/ ImportDeclaration
Header ::= /*->*/ PackageDeclaration
Header ::= /*->*/ ClassHeader
Header ::= /*->*/ InterfaceHeader
Header ::= /*->*/ EnumHeader
Header ::= /*->*/ RecordHeaderPart
Header ::= /*->*/ AnnotationTypeDeclarationHeader
Header ::= /*->*/ StaticInitializer
Header ::= /*->*/ RecoveryMethodHeader
Header ::= /*->*/ FieldDeclaration
Header ::= /*->*/ AllocationHeader
Header ::= /*->*/ ArrayCreationHeader
Header ::= /*->*/ ModuleHeader
Header ::= /*->*/ RequiresStatement
Header ::= /*->*/ ExportsStatement
Header ::= /*->*/ UsesStatement
Header ::= /*->*/ ProvidesStatement
Header ::= /*->*/ OpensStatement
Header1 ::= /*->*/ Header
Header1 ::= /*->*/ ConstructorHeader
Header2 ::= /*->*/ Header
Header2 ::= /*->*/ EnumConstantHeader
CatchHeader ::= 'catch' '(' CatchFormalParameter ')' '{'
ImportDeclarations ::= /*->*/ ImportDeclaration
ImportDeclarations ::= ImportDeclarations ImportDeclaration
TypeDeclarations ::= /*->*/ TypeDeclaration
TypeDeclarations ::= TypeDeclarations TypeDeclaration
PackageDeclaration ::= PackageDeclarationName ';'
PackageDeclarationName ::= Modifiers 'package' PushRealModifiers Name RejectTypeAnnotations
PackageDeclarationName ::= PackageComment 'package' Name RejectTypeAnnotations
PackageComment ::= //$Empty
ImportDeclaration ::= /*->*/ SingleTypeImportDeclaration
ImportDeclaration ::= /*->*/ TypeImportOnDemandDeclaration
ImportDeclaration ::= /*->*/ SingleStaticImportDeclaration
ImportDeclaration ::= /*->*/ StaticImportOnDemandDeclaration
SingleTypeImportDeclaration ::= SingleTypeImportDeclarationName ';'
SingleTypeImportDeclarationName ::= 'import' Name RejectTypeAnnotations
TypeImportOnDemandDeclaration ::= TypeImportOnDemandDeclarationName ';'
TypeImportOnDemandDeclarationName ::= 'import' Name '.' RejectTypeAnnotations '*'
TypeDeclaration ::= /*->*/ ClassDeclaration
TypeDeclaration ::= /*->*/ InterfaceDeclaration
TypeDeclaration ::= ';'
TypeDeclaration ::= /*->*/ EnumDeclaration
TypeDeclaration ::= /*->*/ AnnotationTypeDeclaration
TypeDeclaration ::= /*->*/ RecordDeclaration
Modifiers ::= /*->*/ Modifier
Modifiers ::= Modifiers Modifier
Modifier ::= /*->*/ 'public'
Modifier ::= /*->*/ 'protected'
Modifier ::= /*->*/ 'private'
Modifier ::= /*->*/ 'static'
Modifier ::= /*->*/ 'abstract'
Modifier ::= /*->*/ 'final'
Modifier ::= /*->*/ 'native'
Modifier ::= /*->*/ 'non-sealed'
Modifier ::= /*->*/ 'RestrictedIdentifiersealed'
Modifier ::= /*->*/ 'synchronized'
Modifier ::= /*->*/ 'transient'
Modifier ::= /*->*/ 'volatile'
Modifier ::= /*->*/ 'strictfp'
Modifier ::= Annotation
ClassDeclaration ::= ClassHeader ClassBody
ClassHeader ::= ClassHeaderName ClassHeaderExtendsopt ClassHeaderImplementsopt ClassHeaderPermittedSubclassesopt
ClassHeaderName ::= ClassHeaderName1 TypeParameters
ClassHeaderName ::= /*->*/ ClassHeaderName1
ClassHeaderName1 ::= Modifiersopt 'class' 'Identifier'
ClassHeaderExtends ::= 'extends' ClassType
ClassHeaderImplements ::= 'implements' InterfaceTypeList
InterfaceTypeList ::= /*->*/ InterfaceType
InterfaceTypeList ::= InterfaceTypeList ',' InterfaceType
InterfaceType ::= ClassOrInterfaceType
ClassBody ::= '{' ClassBodyDeclarationsopt '}'
ClassBodyDeclarations ::= ClassBodyDeclaration
ClassBodyDeclarations ::= ClassBodyDeclarations ClassBodyDeclaration
ClassBodyDeclaration ::= /*->*/ ClassMemberDeclaration
ClassBodyDeclaration ::= /*->*/ StaticInitializer
ClassBodyDeclaration ::= /*->*/ ConstructorDeclaration
ClassBodyDeclaration ::= Diet NestedMethod CreateInitializer Block
Diet ::= //$Empty
Initializer ::= Diet NestedMethod CreateInitializer Block
CreateInitializer ::= //$Empty
ClassMemberDeclaration ::= /*->*/ FieldDeclaration
ClassMemberDeclaration ::= /*->*/ MethodDeclaration
ClassMemberDeclaration ::= /*->*/ ClassDeclaration
ClassMemberDeclaration ::= /*->*/ InterfaceDeclaration
ClassMemberDeclaration ::= /*->*/ EnumDeclaration
ClassMemberDeclaration ::= /*->*/ AnnotationTypeDeclaration
ClassMemberDeclaration ::= /*->*/ RecordDeclaration
ClassMemberDeclaration ::= ';'
GenericMethodDeclaration ::= /*->*/ MethodDeclaration
GenericMethodDeclaration ::= /*->*/ ConstructorDeclaration
FieldDeclaration ::= Modifiersopt Type VariableDeclarators ';'
VariableDeclarators ::= /*->*/ VariableDeclarator
VariableDeclarators ::= VariableDeclarators ',' VariableDeclarator
VariableDeclarator ::= VariableDeclaratorId EnterVariable ExitVariableWithoutInitialization
VariableDeclarator ::= VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization
EnterVariable ::= //$Empty
ExitVariableWithInitialization ::= //$Empty
ExitVariableWithoutInitialization ::= //$Empty
ForceNoDiet ::= //$Empty
RestoreDiet ::= //$Empty
VariableDeclaratorId ::= 'Identifier' Dimsopt
VariableInitializer ::= /*->*/ Expression
VariableInitializer ::= /*->*/ ArrayInitializer
MethodDeclaration ::= /*->*/ AbstractMethodDeclaration
MethodDeclaration ::= MethodHeader MethodBody
MethodDeclaration ::= DefaultMethodHeader MethodBody
AbstractMethodDeclaration ::= MethodHeader ';'
MethodHeader ::= MethodHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderExtendedDims MethodHeaderThrowsClauseopt
DefaultMethodHeader ::= DefaultMethodHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderExtendedDims MethodHeaderThrowsClauseopt
MethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
MethodHeaderName ::= Modifiersopt Type 'Identifier' '('
DefaultMethodHeaderName ::= ModifiersWithDefault TypeParameters Type 'Identifier' '('
DefaultMethodHeaderName ::= ModifiersWithDefault Type 'Identifier' '('
ModifiersWithDefault ::= Modifiersopt 'default' Modifiersopt
MethodHeaderRightParen ::= ')'
MethodHeaderExtendedDims ::= Dimsopt
MethodHeaderThrowsClause ::= 'throws' ClassTypeList
ConstructorHeader ::= ConstructorHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderThrowsClauseopt
ConstructorHeaderName ::= Modifiersopt TypeParameters 'Identifier' '('
ConstructorHeaderName ::= Modifiersopt 'Identifier' '('
FormalParameterList ::= /*->*/ FormalParameter
FormalParameterList ::= FormalParameterList ',' FormalParameter
FormalParameter ::= Modifiersopt Type VariableDeclaratorIdOrThis
FormalParameter ::= Modifiersopt Type PushZeroTypeAnnotations '...' VariableDeclaratorIdOrThis
FormalParameter ::= Modifiersopt Type '@308...' TypeAnnotations '...' VariableDeclaratorIdOrThis
CatchFormalParameter ::= Modifiersopt CatchType VariableDeclaratorId
CatchType ::= UnionType
UnionType ::= Type
UnionType ::= UnionType '|' Type
ClassTypeList ::= /*->*/ ClassTypeElt
ClassTypeList ::= ClassTypeList ',' ClassTypeElt
ClassTypeElt ::= ClassType
MethodBody ::= NestedMethod '{' BlockStatementsopt '}'
NestedMethod ::= //$Empty
StaticInitializer ::= StaticOnly Block
StaticOnly ::= 'static'
ConstructorDeclaration ::= ConstructorHeader MethodBody
ConstructorDeclaration ::= ConstructorHeader ';'
ExplicitConstructorInvocation ::= 'this' '(' ArgumentListopt ')' ';'
ExplicitConstructorInvocation ::= OnlyTypeArguments 'this' '(' ArgumentListopt ')' ';'
ExplicitConstructorInvocation ::= 'super' '(' ArgumentListopt ')' ';'
ExplicitConstructorInvocation ::= OnlyTypeArguments 'super' '(' ArgumentListopt ')' ';'
ExplicitConstructorInvocation ::= Primary '.' 'super' '(' ArgumentListopt ')' ';'
ExplicitConstructorInvocation ::= Primary '.' OnlyTypeArguments 'super' '(' ArgumentListopt ')' ';'
ExplicitConstructorInvocation ::= Name '.' 'super' '(' ArgumentListopt ')' ';'
ExplicitConstructorInvocation ::= Name '.' OnlyTypeArguments 'super' '(' ArgumentListopt ')' ';'
ExplicitConstructorInvocation ::= Primary '.' 'this' '(' ArgumentListopt ')' ';'
ExplicitConstructorInvocation ::= Primary '.' OnlyTypeArguments 'this' '(' ArgumentListopt ')' ';'
ExplicitConstructorInvocation ::= Name '.' 'this' '(' ArgumentListopt ')' ';'
ExplicitConstructorInvocation ::= Name '.' OnlyTypeArguments 'this' '(' ArgumentListopt ')' ';'
InterfaceDeclaration ::= InterfaceHeader InterfaceBody
InterfaceHeader ::= InterfaceHeaderName InterfaceHeaderExtendsopt InterfaceHeaderPermittedSubClassesAndSubInterfacesopt
InterfaceHeaderName ::= InterfaceHeaderName1 TypeParameters
InterfaceHeaderName ::= /*->*/ InterfaceHeaderName1
InterfaceHeaderName1 ::= Modifiersopt 'interface' 'Identifier'
InterfaceHeaderExtends ::= 'extends' InterfaceTypeList
InterfaceBody ::= '{' InterfaceMemberDeclarationsopt '}'
InterfaceMemberDeclarations ::= /*->*/ InterfaceMemberDeclaration
InterfaceMemberDeclarations ::= InterfaceMemberDeclarations InterfaceMemberDeclaration
InterfaceMemberDeclaration ::= ';'
InterfaceMemberDeclaration ::= /*->*/ ConstantDeclaration
InterfaceMemberDeclaration ::= DefaultMethodHeader MethodBody
InterfaceMemberDeclaration ::= MethodHeader MethodBody
InterfaceMemberDeclaration ::= DefaultMethodHeader ';'
InvalidConstructorDeclaration ::= ConstructorHeader MethodBody
InvalidConstructorDeclaration ::= ConstructorHeader ';'
InvalidInitializer ::= /*->*/ StaticInitializer
InvalidInitializer ::= /*->*/ Initializer
InterfaceMemberDeclaration ::= /*->*/ AbstractMethodDeclaration
InterfaceMemberDeclaration ::= /*->*/ InvalidConstructorDeclaration
InterfaceMemberDeclaration ::= /*->*/ InvalidInitializer
InterfaceMemberDeclaration ::= /*->*/ ClassDeclaration
InterfaceMemberDeclaration ::= /*->*/ InterfaceDeclaration
InterfaceMemberDeclaration ::= /*->*/ EnumDeclaration
InterfaceMemberDeclaration ::= /*->*/ AnnotationTypeDeclaration
InterfaceMemberDeclaration ::= /*->*/ RecordDeclaration
RecordDeclaration ::= RecordHeaderPart RecordBody
RecordHeaderPart ::= RecordHeaderName RecordHeader ClassHeaderImplementsopt
RecordHeaderName ::= RecordHeaderName1 TypeParameters
RecordHeaderName ::= /*->*/ RecordHeaderName1
RecordHeaderName1 ::= Modifiersopt 'RestrictedIdentifierrecord' 'Identifier'
RecordComponentHeaderRightParen ::= ')'
RecordHeader ::= '(' RecordComponentsopt RecordComponentHeaderRightParen
RecordComponentsopt ::= //$Empty
RecordComponentsopt ::= /*->*/ RecordComponents
RecordComponents ::= /*->*/ RecordComponent
RecordComponents ::= RecordComponents ',' RecordComponent
RecordComponent ::= /*->*/ VariableArityRecordComponent
RecordComponent ::= Modifiersopt Type VariableDeclaratorId
VariableArityRecordComponent ::= Modifiersopt Type PushZeroTypeAnnotations '...' VariableDeclaratorId
VariableArityRecordComponent ::= Modifiersopt Type '@308...' TypeAnnotations '...' VariableDeclaratorId
RecordBody ::= '{' RecordBodyDeclarationopt '}'
RecordBodyDeclarationopt ::= //$Empty
RecordBodyDeclarationopt ::= /*->*/ RecordBodyDeclarations
RecordBodyDeclarations ::= RecordBodyDeclaration
RecordBodyDeclarations ::= RecordBodyDeclarations RecordBodyDeclaration
RecordBodyDeclaration ::= ClassBodyDeclaration
RecordBodyDeclaration ::= CompactConstructorDeclaration
CompactConstructorDeclaration ::= CompactConstructorHeader MethodBody
CompactConstructorHeader ::= CompactConstructorHeaderName MethodHeaderThrowsClauseopt
CompactConstructorHeaderName ::= Modifiersopt 'Identifier'
CompactConstructorHeaderName ::= Modifiersopt TypeParameters 'Identifier'
InstanceofExpression ::= /*->*/ RelationalExpression
InstanceofExpression ::= InstanceofExpression InstanceofRHS
InstanceofRHS ::= /*->*/ InstanceofClassic
InstanceofRHS ::= /*->*/ InstanceofPattern
InstanceofClassic ::= 'instanceof' Modifiersopt Type
InstanceofPattern ::= InstanceofClassic 'Identifier'
ConstantDeclaration ::= /*->*/ FieldDeclaration
PushLeftBrace ::= //$Empty
ArrayInitializer ::= '{' PushLeftBrace opt_comma '}'
ArrayInitializer ::= '{' PushLeftBrace VariableInitializers '}'
ArrayInitializer ::= '{' PushLeftBrace VariableInitializers ',' '}'
VariableInitializers ::= VariableInitializer
VariableInitializers ::= VariableInitializers ',' VariableInitializer
Block ::= OpenBlock '{' BlockStatementsopt '}'
OpenBlock ::= //$Empty
BlockStatements ::= BlockStatement
BlockStatements ::= BlockStatements BlockStatement
BlockStatementopt ::= BlockStatementopt0
BlockStatementopt0 ::= /*->*/ //$Empty
BlockStatementopt0 ::= /*->*/ BlockStatement
BlockStatement ::= /*->*/ LocalVariableDeclarationStatement
BlockStatement ::= /*->*/ Statement
BlockStatement ::= /*->*/ ClassDeclaration
BlockStatement ::= /*->*/ RecordDeclaration
BlockStatement ::= InterfaceDeclaration
BlockStatement ::= AnnotationTypeDeclaration
BlockStatement ::= EnumDeclaration
LocalVariableDeclarationStatement ::= LocalVariableDeclaration ';'
LocalVariableDeclaration ::= Type PushModifiers VariableDeclarators
LocalVariableDeclaration ::= Modifiers Type PushRealModifiers VariableDeclarators
PushModifiers ::= //$Empty
PushModifiersForHeader ::= //$Empty
PushRealModifiers ::= //$Empty
Statement ::= /*->*/ StatementWithoutTrailingSubstatement
Statement ::= /*->*/ LabeledStatement
Statement ::= /*->*/ IfThenStatement
Statement ::= /*->*/ IfThenElseStatement
Statement ::= /*->*/ WhileStatement
Statement ::= /*->*/ ForStatement
Statement ::= /*->*/ EnhancedForStatement
StatementNoShortIf ::= /*->*/ StatementWithoutTrailingSubstatement
StatementNoShortIf ::= /*->*/ LabeledStatementNoShortIf
StatementNoShortIf ::= /*->*/ IfThenElseStatementNoShortIf
StatementNoShortIf ::= /*->*/ WhileStatementNoShortIf
StatementNoShortIf ::= /*->*/ ForStatementNoShortIf
StatementNoShortIf ::= /*->*/ EnhancedForStatementNoShortIf
StatementWithoutTrailingSubstatement ::= /*->*/ AssertStatement
StatementWithoutTrailingSubstatement ::= /*->*/ Block
StatementWithoutTrailingSubstatement ::= /*->*/ EmptyStatement
StatementWithoutTrailingSubstatement ::= /*->*/ ExpressionStatement
StatementWithoutTrailingSubstatement ::= /*->*/ SwitchStatement
StatementWithoutTrailingSubstatement ::= /*->*/ DoStatement
StatementWithoutTrailingSubstatement ::= /*->*/ BreakStatement
StatementWithoutTrailingSubstatement ::= /*->*/ ContinueStatement
StatementWithoutTrailingSubstatement ::= /*->*/ ReturnStatement
StatementWithoutTrailingSubstatement ::= /*->*/ SynchronizedStatement
StatementWithoutTrailingSubstatement ::= /*->*/ ThrowStatement
StatementWithoutTrailingSubstatement ::= /*->*/ TryStatement
StatementWithoutTrailingSubstatement ::= /*->*/ TryStatementWithResources
StatementWithoutTrailingSubstatement ::= /*->*/ YieldStatement
EmptyStatement ::= ';'
LabeledStatement ::= Label ':' Statement
LabeledStatementNoShortIf ::= Label ':' StatementNoShortIf
Label ::= 'Identifier'
ExpressionStatement ::= StatementExpression ';'
ExpressionStatement ::= ExplicitConstructorInvocation
StatementExpression ::= Assignment
StatementExpression ::= PreIncrementExpression
StatementExpression ::= PreDecrementExpression
StatementExpression ::= PostIncrementExpression
StatementExpression ::= PostDecrementExpression
StatementExpression ::= MethodInvocation
StatementExpression ::= ClassInstanceCreationExpression
IfThenStatement ::= 'if' '(' Expression ')' Statement
IfThenElseStatement ::= 'if' '(' Expression ')' StatementNoShortIf 'else' Statement
IfThenElseStatementNoShortIf ::= 'if' '(' Expression ')' StatementNoShortIf 'else' StatementNoShortIf
SwitchStatement ::= 'switch' '(' Expression ')' OpenBlock SwitchBlock
SwitchBlock ::= '{' '}'
SwitchBlock ::= '{' SwitchBlockStatements '}'
SwitchBlock ::= '{' SwitchLabels '}'
SwitchBlock ::= '{' SwitchBlockStatements SwitchLabels '}'
SwitchBlockStatements ::= /*->*/ SwitchBlockStatement
SwitchBlockStatements ::= SwitchBlockStatements SwitchBlockStatement
SwitchBlockStatement ::= /*->*/ SwitchLabeledRule
SwitchBlockStatement ::= SwitchLabels BlockStatements
SwitchLabels ::= /*->*/ SwitchLabel
SwitchLabels ::= SwitchLabels SwitchLabel
SwitchLabel ::= SwitchLabelCaseLhs ':'
SwitchLabel ::= 'default' ':'
UnaryExpressionNotPlusMinus ::= /*->*/ SwitchExpression
UnaryExpressionNotPlusMinus_NotName ::= /*->*/ SwitchExpression
SwitchExpression ::= 'switch' '(' Expression ')' OpenBlock SwitchBlock
SwitchLabeledRule ::= SwitchLabeledExpression
SwitchLabeledRule ::= SwitchLabeledBlock
SwitchLabeledRule ::= SwitchLabeledThrowStatement
SwitchLabeledExpression ::= SwitchLabelExpr Expression ';'
SwitchLabeledBlock ::= SwitchLabelExpr Block
SwitchLabeledThrowStatement ::= SwitchLabelExpr ThrowExpression ';'
SwitchLabelExpr ::= 'default' '->'
SwitchLabelExpr ::= SwitchLabelCaseLhs 'BeginCaseExpr' '->'
SwitchLabelCaseLhs ::= 'case' ConstantExpressions
YieldStatement ::= 'RestrictedIdentifierYield' Expression ';'
WhileStatement ::= 'while' '(' Expression ')' Statement
WhileStatementNoShortIf ::= 'while' '(' Expression ')' StatementNoShortIf
DoStatement ::= 'do' Statement 'while' '(' Expression ')' ';'
ForStatement ::= 'for' '(' ForInitopt ';' Expressionopt ';' ForUpdateopt ')' Statement
ForStatementNoShortIf ::= 'for' '(' ForInitopt ';' Expressionopt ';' ForUpdateopt ')' StatementNoShortIf
ForInit ::= StatementExpressionList
ForInit ::= /*->*/ LocalVariableDeclaration
ForUpdate ::= /*->*/ StatementExpressionList
StatementExpressionList ::= /*->*/ StatementExpression
StatementExpressionList ::= StatementExpressionList ',' StatementExpression
AssertStatement ::= 'assert' Expression ';'
AssertStatement ::= 'assert' Expression ':' Expression ';'
BreakStatement ::= 'break' ';'
BreakStatement ::= 'break' 'Identifier' ';'
ContinueStatement ::= 'continue' ';'
ContinueStatement ::= 'continue' 'Identifier' ';'
ReturnStatement ::= 'return' Expressionopt ';'
ThrowStatement ::= 'throw' Expression ';'
ThrowExpression ::= 'throw' Expression
SynchronizedStatement ::= OnlySynchronized '(' Expression ')' Block
OnlySynchronized ::= 'synchronized'
TryStatement ::= 'try' TryBlock Catches
TryStatement ::= 'try' TryBlock Catchesopt Finally
TryStatementWithResources ::= 'try' ResourceSpecification TryBlock Catchesopt
TryStatementWithResources ::= 'try' ResourceSpecification TryBlock Catchesopt Finally
ResourceSpecification ::= '(' Resources opt_semi ')'
opt_semi ::= //$Empty
opt_semi ::= ';'
Resources ::= Resource
Resources ::= Resources TrailingSemiColon Resource
TrailingSemiColon ::= ';'
Resource ::= Type PushModifiers VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization
Resource ::= Modifiers Type PushRealModifiers VariableDeclaratorId EnterVariable '=' ForceNoDiet VariableInitializer RestoreDiet ExitVariableWithInitialization
Resource ::= Name
Resource ::= FieldAccess
TryBlock ::= Block ExitTryBlock
ExitTryBlock ::= //$Empty
Catches ::= /*->*/ CatchClause
Catches ::= Catches CatchClause
CatchClause ::= 'catch' '(' CatchFormalParameter ')' Block
Finally ::= 'finally' Block
PushLPAREN ::= '('
PushRPAREN ::= ')'
Primary ::= /*->*/ PrimaryNoNewArray
Primary ::= /*->*/ ArrayCreationWithArrayInitializer
Primary ::= /*->*/ ArrayCreationWithoutArrayInitializer
PrimaryNoNewArray ::= /*->*/ Literal
PrimaryNoNewArray ::= 'this'
PrimaryNoNewArray ::= PushLPAREN Expression_NotName PushRPAREN
PrimaryNoNewArray ::= PushLPAREN Name PushRPAREN
PrimaryNoNewArray ::= /*->*/ ClassInstanceCreationExpression
PrimaryNoNewArray ::= /*->*/ FieldAccess
PrimaryNoNewArray ::= Name '.' 'this'
QualifiedSuperReceiver ::= Name '.' 'super'
PrimaryNoNewArray ::= Name '.' 'class'
PrimaryNoNewArray ::= Name Dims '.' 'class'
PrimaryNoNewArray ::= PrimitiveType Dims '.' 'class'
PrimaryNoNewArray ::= PrimitiveType '.' 'class'
PrimaryNoNewArray ::= /*->*/ MethodInvocation
PrimaryNoNewArray ::= /*->*/ ArrayAccess
PrimaryNoNewArray ::= /*->*/ LambdaExpression
PrimaryNoNewArray ::= /*->*/ ReferenceExpression
ReferenceExpressionTypeArgumentsAndTrunk ::= ReferenceExpressionTypeArgumentsAndTrunk0
ReferenceExpressionTypeArgumentsAndTrunk0 ::= OnlyTypeArguments Dimsopt
ReferenceExpressionTypeArgumentsAndTrunk0 ::= OnlyTypeArguments '.' ClassOrInterfaceType Dimsopt
ReferenceExpression ::= PrimitiveType Dims '::' NonWildTypeArgumentsopt IdentifierOrNew
ReferenceExpression ::= Name Dimsopt '::' NonWildTypeArgumentsopt IdentifierOrNew
ReferenceExpression ::= Name 'BeginTypeArguments' ReferenceExpressionTypeArgumentsAndTrunk '::' NonWildTypeArgumentsopt IdentifierOrNew
ReferenceExpression ::= Primary '::' NonWildTypeArgumentsopt 'Identifier'
ReferenceExpression ::= QualifiedSuperReceiver '::' NonWildTypeArgumentsopt 'Identifier'
ReferenceExpression ::= 'super' '::' NonWildTypeArgumentsopt 'Identifier'
NonWildTypeArgumentsopt ::= //$Empty
NonWildTypeArgumentsopt ::= /*->*/ OnlyTypeArguments
IdentifierOrNew ::= 'Identifier'
IdentifierOrNew ::= 'new'
LambdaExpression ::= LambdaParameters '->' LambdaBody
NestedLambda ::= //$Empty
LambdaParameters ::= 'Identifier' NestedLambda
LambdaParameters ::= /*->*/ 'BeginLambda' NestedLambda LambdaParameterList
ParenthesizedLambdaParameterList ::= LambdaParameterList
LambdaParameterList ::= /*->*/ PushLPAREN FormalParameterListopt PushRPAREN
LambdaParameterList ::= /*->*/ PushLPAREN TypeElidedFormalParameterList PushRPAREN
TypeElidedFormalParameterList ::= /*->*/ TypeElidedFormalParameter
TypeElidedFormalParameterList ::= TypeElidedFormalParameterList ',' TypeElidedFormalParameter
TypeElidedFormalParameter ::= Modifiersopt 'Identifier'
LambdaBody ::= /*->*/ ElidedLeftBraceAndReturn Expression 'ElidedSemicolonAndRightBrace'
LambdaBody ::= /*->*/ Block
ElidedLeftBraceAndReturn ::= //$Empty
AllocationHeader ::= 'new' ClassType '(' ArgumentListopt ')'
ClassInstanceCreationExpression ::= 'new' OnlyTypeArguments ClassType EnterInstanceCreationArgumentList '(' ArgumentListopt ')' UnqualifiedClassBodyopt
ClassInstanceCreationExpression ::= 'new' ClassType EnterInstanceCreationArgumentList '(' ArgumentListopt ')' UnqualifiedClassBodyopt
ClassInstanceCreationExpression ::= Primary '.' 'new' OnlyTypeArguments ClassType EnterInstanceCreationArgumentList '(' ArgumentListopt ')' QualifiedClassBodyopt
ClassInstanceCreationExpression ::= Primary '.' 'new' ClassType EnterInstanceCreationArgumentList '(' ArgumentListopt ')' QualifiedClassBodyopt
ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName ClassType EnterInstanceCreationArgumentList '(' ArgumentListopt ')' QualifiedClassBodyopt
ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName OnlyTypeArguments ClassType EnterInstanceCreationArgumentList '(' ArgumentListopt ')' QualifiedClassBodyopt
EnterInstanceCreationArgumentList ::= //$Empty
ClassInstanceCreationExpressionName ::= Name '.' 'new'
UnqualifiedClassBodyopt ::= //$Empty
UnqualifiedClassBodyopt ::= UnqualifiedEnterAnonymousClassBody ClassBody
UnqualifiedEnterAnonymousClassBody ::= //$Empty
QualifiedClassBodyopt ::= //$Empty
QualifiedClassBodyopt ::= QualifiedEnterAnonymousClassBody ClassBody
QualifiedEnterAnonymousClassBody ::= //$Empty
ArgumentList ::= Expression
ArgumentList ::= ArgumentList ',' Expression
ArrayCreationHeader ::= 'new' PrimitiveType DimWithOrWithOutExprs
ArrayCreationHeader ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs
ArrayCreationWithoutArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs
ArrayCreationWithArrayInitializer ::= 'new' PrimitiveType DimWithOrWithOutExprs ArrayInitializer
ArrayCreationWithoutArrayInitializer ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs
ArrayCreationWithArrayInitializer ::= 'new' ClassOrInterfaceType DimWithOrWithOutExprs ArrayInitializer
DimWithOrWithOutExprs ::= DimWithOrWithOutExpr
DimWithOrWithOutExprs ::= DimWithOrWithOutExprs DimWithOrWithOutExpr
DimWithOrWithOutExpr ::= TypeAnnotationsopt '[' Expression ']'
DimWithOrWithOutExpr ::= TypeAnnotationsopt '[' ']'
Dims ::= DimsLoop
DimsLoop ::= /*->*/ OneDimLoop
DimsLoop ::= DimsLoop OneDimLoop
OneDimLoop ::= '[' ']'
OneDimLoop ::= TypeAnnotations '[' ']'
FieldAccess ::= Primary '.' 'Identifier'
FieldAccess ::= 'super' '.' 'Identifier'
FieldAccess ::= QualifiedSuperReceiver '.' 'Identifier'
MethodInvocation ::= Name '(' ArgumentListopt ')'
MethodInvocation ::= Name '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
MethodInvocation ::= Primary '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
MethodInvocation ::= Primary '.' 'Identifier' '(' ArgumentListopt ')'
MethodInvocation ::= QualifiedSuperReceiver '.' 'Identifier' '(' ArgumentListopt ')'
MethodInvocation ::= QualifiedSuperReceiver '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
MethodInvocation ::= 'super' '.' OnlyTypeArguments 'Identifier' '(' ArgumentListopt ')'
MethodInvocation ::= 'super' '.' 'Identifier' '(' ArgumentListopt ')'
ArrayAccess ::= Name '[' Expression ']'
ArrayAccess ::= PrimaryNoNewArray '[' Expression ']'
ArrayAccess ::= ArrayCreationWithArrayInitializer '[' Expression ']'
PostfixExpression ::= /*->*/ Primary
PostfixExpression ::= Name
PostfixExpression ::= /*->*/ PostIncrementExpression
PostfixExpression ::= /*->*/ PostDecrementExpression
PostIncrementExpression ::= PostfixExpression '++'
PostDecrementExpression ::= PostfixExpression '--'
PushPosition ::= //$Empty
UnaryExpression ::= /*->*/ PreIncrementExpression
UnaryExpression ::= /*->*/ PreDecrementExpression
UnaryExpression ::= '+' PushPosition UnaryExpression
UnaryExpression ::= '-' PushPosition UnaryExpression
UnaryExpression ::= /*->*/ UnaryExpressionNotPlusMinus
PreIncrementExpression ::= '++' PushPosition UnaryExpression
PreDecrementExpression ::= '--' PushPosition UnaryExpression
UnaryExpressionNotPlusMinus ::= /*->*/ PostfixExpression
UnaryExpressionNotPlusMinus ::= '~' PushPosition UnaryExpression
UnaryExpressionNotPlusMinus ::= '!' PushPosition UnaryExpression
UnaryExpressionNotPlusMinus ::= /*->*/ CastExpression
CastExpression ::= PushLPAREN PrimitiveType Dimsopt AdditionalBoundsListOpt PushRPAREN InsideCastExpression UnaryExpression
CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression Dimsopt AdditionalBoundsListOpt PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
CastExpression ::= PushLPAREN Name OnlyTypeArgumentsForCastExpression '.' ClassOrInterfaceType Dimsopt AdditionalBoundsListOpt PushRPAREN InsideCastExpressionWithQualifiedGenerics UnaryExpressionNotPlusMinus
CastExpression ::= PushLPAREN Name PushRPAREN InsideCastExpressionLL1 UnaryExpressionNotPlusMinus
CastExpression ::= 'BeginIntersectionCast' PushLPAREN CastNameAndBounds PushRPAREN InsideCastExpressionLL1WithBounds UnaryExpressionNotPlusMinus
CastExpression ::= PushLPAREN Name Dims AdditionalBoundsListOpt PushRPAREN InsideCastExpression UnaryExpressionNotPlusMinus
AdditionalBoundsListOpt ::= //$Empty
AdditionalBoundsListOpt ::= /*->*/ AdditionalBoundList
ParenthesizedCastNameAndBounds ::= '(' CastNameAndBounds ')'
CastNameAndBounds ::= /*->*/ Name AdditionalBoundList
OnlyTypeArgumentsForCastExpression ::= OnlyTypeArguments
InsideCastExpression ::= //$Empty
InsideCastExpressionLL1 ::= //$Empty
InsideCastExpressionLL1WithBounds ::= //$Empty
InsideCastExpressionWithQualifiedGenerics ::= //$Empty
MultiplicativeExpression ::= /*->*/ UnaryExpression
MultiplicativeExpression ::= MultiplicativeExpression '*' UnaryExpression
MultiplicativeExpression ::= MultiplicativeExpression '/' UnaryExpression
MultiplicativeExpression ::= MultiplicativeExpression '%' UnaryExpression
AdditiveExpression ::= /*->*/ MultiplicativeExpression
AdditiveExpression ::= AdditiveExpression '+' MultiplicativeExpression
AdditiveExpression ::= AdditiveExpression '-' MultiplicativeExpression
ShiftExpression ::= /*->*/ AdditiveExpression
ShiftExpression ::= ShiftExpression '<<' AdditiveExpression
ShiftExpression ::= ShiftExpression '>>' AdditiveExpression
ShiftExpression ::= ShiftExpression '>>>' AdditiveExpression
RelationalExpression ::= /*->*/ ShiftExpression
RelationalExpression ::= RelationalExpression '<' ShiftExpression
RelationalExpression ::= RelationalExpression '>' ShiftExpression
RelationalExpression ::= RelationalExpression '<=' ShiftExpression
RelationalExpression ::= RelationalExpression '>=' ShiftExpression
EqualityExpression ::= /*->*/ InstanceofExpression
EqualityExpression ::= EqualityExpression '==' InstanceofExpression
EqualityExpression ::= EqualityExpression '!=' InstanceofExpression
AndExpression ::= /*->*/ EqualityExpression
AndExpression ::= AndExpression '&' EqualityExpression
ExclusiveOrExpression ::= /*->*/ AndExpression
ExclusiveOrExpression ::= ExclusiveOrExpression '^' AndExpression
InclusiveOrExpression ::= /*->*/ ExclusiveOrExpression
InclusiveOrExpression ::= InclusiveOrExpression '|' ExclusiveOrExpression
ConditionalAndExpression ::= /*->*/ InclusiveOrExpression
ConditionalAndExpression ::= ConditionalAndExpression '&&' InclusiveOrExpression
ConditionalOrExpression ::= /*->*/ ConditionalAndExpression
ConditionalOrExpression ::= ConditionalOrExpression '||' ConditionalAndExpression
ConditionalExpression ::= /*->*/ ConditionalOrExpression
ConditionalExpression ::= ConditionalOrExpression '?' Expression ':' ConditionalExpression
AssignmentExpression ::= /*->*/ ConditionalExpression
AssignmentExpression ::= /*->*/ Assignment
Assignment ::= PostfixExpression AssignmentOperator AssignmentExpression
InvalidArrayInitializerAssignement ::= PostfixExpression AssignmentOperator ArrayInitializer
Assignment ::= InvalidArrayInitializerAssignement
AssignmentOperator ::= '='
AssignmentOperator ::= '*='
AssignmentOperator ::= '/='
AssignmentOperator ::= '%='
AssignmentOperator ::= '+='
AssignmentOperator ::= '-='
AssignmentOperator ::= '<<='
AssignmentOperator ::= '>>='
AssignmentOperator ::= '>>>='
AssignmentOperator ::= '&='
AssignmentOperator ::= '^='
AssignmentOperator ::= '|='
Expression ::= AssignmentExpression
ClassHeaderExtendsopt ::= //$Empty
ClassHeaderExtendsopt ::= /*->*/ ClassHeaderExtends
Expressionopt ::= //$Empty
Expressionopt ::= /*->*/ Expression
ConstantExpressions ::= /*->*/ ConstantExpression
ConstantExpressions ::= ConstantExpressions ',' ConstantExpression
ConstantExpression ::= /*->*/ Expression
opt_comma ::= /*->*/ //$Empty
opt_comma ::= /*->*/ ','
ClassBodyDeclarationsopt ::= //$Empty
ClassBodyDeclarationsopt ::= NestedType ClassBodyDeclarations
Modifiersopt ::= //$Empty
Modifiersopt ::= Modifiers
BlockStatementsopt ::= //$Empty
BlockStatementsopt ::= /*->*/ BlockStatements
Dimsopt ::= //$Empty
Dimsopt ::= /*->*/ Dims
ArgumentListopt ::= //$Empty
ArgumentListopt ::= /*->*/ ArgumentList
MethodHeaderThrowsClauseopt ::= //$Empty
MethodHeaderThrowsClauseopt ::= /*->*/ MethodHeaderThrowsClause
FormalParameterListopt ::= //$Empty
FormalParameterListopt ::= /*->*/ FormalParameterList
ClassHeaderImplementsopt ::= //$Empty
ClassHeaderImplementsopt ::= /*->*/ ClassHeaderImplements
ClassHeaderPermittedSubclassesopt ::= //$Empty
ClassHeaderPermittedSubclassesopt ::= /*->*/ ClassHeaderPermittedSubclasses
PermittedSubclasses ::= ClassTypeList
ClassHeaderPermittedSubclasses ::= 'RestrictedIdentifierpermits' ClassTypeList
InterfaceHeaderPermittedSubClassesAndSubInterfacesopt ::= //$Empty
InterfaceHeaderPermittedSubClassesAndSubInterfacesopt ::= /*->*/ InterfaceHeaderPermittedSubClassesAndSubInterfaces
InterfaceHeaderPermittedSubClassesAndSubInterfaces ::= 'RestrictedIdentifierpermits' ClassTypeList
InterfaceMemberDeclarationsopt ::= //$Empty
InterfaceMemberDeclarationsopt ::= NestedType InterfaceMemberDeclarations
NestedType ::= //$Empty
ForInitopt ::= //$Empty
ForInitopt ::= /*->*/ ForInit
ForUpdateopt ::= //$Empty
ForUpdateopt ::= /*->*/ ForUpdate
InterfaceHeaderExtendsopt ::= //$Empty
InterfaceHeaderExtendsopt ::= /*->*/ InterfaceHeaderExtends
Catchesopt ::= //$Empty
Catchesopt ::= /*->*/ Catches
EnumDeclaration ::= EnumHeader EnumBody
EnumHeader ::= EnumHeaderName ClassHeaderImplementsopt
EnumHeaderName ::= Modifiersopt 'enum' 'Identifier'
EnumHeaderName ::= Modifiersopt 'enum' 'Identifier' TypeParameters
EnumBody ::= '{' EnumBodyDeclarationsopt '}'
EnumBody ::= '{' ',' EnumBodyDeclarationsopt '}'
EnumBody ::= '{' EnumConstants ',' EnumBodyDeclarationsopt '}'
EnumBody ::= '{' EnumConstants EnumBodyDeclarationsopt '}'
EnumConstants ::= /*->*/ EnumConstant
EnumConstants ::= EnumConstants ',' EnumConstant
EnumConstantHeaderName ::= Modifiersopt 'Identifier'
EnumConstantHeader ::= EnumConstantHeaderName ForceNoDiet Argumentsopt RestoreDiet
EnumConstant ::= EnumConstantHeader ForceNoDiet ClassBody RestoreDiet
EnumConstant ::= EnumConstantHeader
Arguments ::= '(' ArgumentListopt ')'
Argumentsopt ::= //$Empty
Argumentsopt ::= /*->*/ Arguments
EnumDeclarations ::= ';' ClassBodyDeclarationsopt
EnumBodyDeclarationsopt ::= //$Empty
EnumBodyDeclarationsopt ::= /*->*/ EnumDeclarations
EnhancedForStatement ::= EnhancedForStatementHeader Statement
EnhancedForStatementNoShortIf ::= EnhancedForStatementHeader StatementNoShortIf
EnhancedForStatementHeaderInit ::= 'for' '(' Type PushModifiers 'Identifier' Dimsopt
EnhancedForStatementHeaderInit ::= 'for' '(' Modifiers Type PushRealModifiers 'Identifier' Dimsopt
EnhancedForStatementHeader ::= EnhancedForStatementHeaderInit ':' Expression ')'
SingleStaticImportDeclaration ::= SingleStaticImportDeclarationName ';'
SingleStaticImportDeclarationName ::= 'import' 'static' Name RejectTypeAnnotations
StaticImportOnDemandDeclaration ::= StaticImportOnDemandDeclarationName ';'
StaticImportOnDemandDeclarationName ::= 'import' 'static' Name '.' RejectTypeAnnotations '*'
TypeArguments ::= '<' TypeArgumentList1
OnlyTypeArguments ::= '<' TypeArgumentList1
TypeArgumentList1 ::= /*->*/ TypeArgument1
TypeArgumentList1 ::= TypeArgumentList ',' TypeArgument1
TypeArgumentList ::= /*->*/ TypeArgument
TypeArgumentList ::= TypeArgumentList ',' TypeArgument
TypeArgument ::= ReferenceType
TypeArgument ::= /*->*/ Wildcard
TypeArgument1 ::= /*->*/ ReferenceType1
TypeArgument1 ::= /*->*/ Wildcard1
ReferenceType1 ::= ReferenceType '>'
ReferenceType1 ::= ClassOrInterface '<' TypeArgumentList2
TypeArgumentList2 ::= /*->*/ TypeArgument2
TypeArgumentList2 ::= TypeArgumentList ',' TypeArgument2
TypeArgument2 ::= /*->*/ ReferenceType2
TypeArgument2 ::= /*->*/ Wildcard2
ReferenceType2 ::= ReferenceType '>>'
ReferenceType2 ::= ClassOrInterface '<' TypeArgumentList3
TypeArgumentList3 ::= /*->*/ TypeArgument3
TypeArgumentList3 ::= TypeArgumentList ',' TypeArgument3
TypeArgument3 ::= /*->*/ ReferenceType3
TypeArgument3 ::= /*->*/ Wildcard3
ReferenceType3 ::= ReferenceType '>>>'
Wildcard ::= TypeAnnotationsopt '?'
Wildcard ::= TypeAnnotationsopt '?' WildcardBounds
WildcardBounds ::= 'extends' ReferenceType
WildcardBounds ::= 'super' ReferenceType
Wildcard1 ::= TypeAnnotationsopt '?' '>'
Wildcard1 ::= TypeAnnotationsopt '?' WildcardBounds1
WildcardBounds1 ::= 'extends' ReferenceType1
WildcardBounds1 ::= 'super' ReferenceType1
Wildcard2 ::= TypeAnnotationsopt '?' '>>'
Wildcard2 ::= TypeAnnotationsopt '?' WildcardBounds2
WildcardBounds2 ::= 'extends' ReferenceType2
WildcardBounds2 ::= 'super' ReferenceType2
Wildcard3 ::= TypeAnnotationsopt '?' '>>>'
Wildcard3 ::= TypeAnnotationsopt '?' WildcardBounds3
WildcardBounds3 ::= 'extends' ReferenceType3
WildcardBounds3 ::= 'super' ReferenceType3
TypeParameterHeader ::= TypeAnnotationsopt 'Identifier'
TypeParameters ::= '<' TypeParameterList1
TypeParameterList ::= /*->*/ TypeParameter
TypeParameterList ::= TypeParameterList ',' TypeParameter
TypeParameter ::= /*->*/ TypeParameterHeader
TypeParameter ::= TypeParameterHeader 'extends' ReferenceType
TypeParameter ::= TypeParameterHeader 'extends' ReferenceType AdditionalBoundList
AdditionalBoundList ::= /*->*/ AdditionalBound
AdditionalBoundList ::= AdditionalBoundList AdditionalBound
AdditionalBound ::= '&' ReferenceType
TypeParameterList1 ::= /*->*/ TypeParameter1
TypeParameterList1 ::= TypeParameterList ',' TypeParameter1
TypeParameter1 ::= TypeParameterHeader '>'
TypeParameter1 ::= TypeParameterHeader 'extends' ReferenceType1
TypeParameter1 ::= TypeParameterHeader 'extends' ReferenceType AdditionalBoundList1
AdditionalBoundList1 ::= /*->*/ AdditionalBound1
AdditionalBoundList1 ::= AdditionalBoundList AdditionalBound1
AdditionalBound1 ::= '&' ReferenceType1
PostfixExpression_NotName ::= /*->*/ Primary
PostfixExpression_NotName ::= /*->*/ PostIncrementExpression
PostfixExpression_NotName ::= /*->*/ PostDecrementExpression
UnaryExpression_NotName ::= /*->*/ PreIncrementExpression
UnaryExpression_NotName ::= /*->*/ PreDecrementExpression
UnaryExpression_NotName ::= '+' PushPosition UnaryExpression
UnaryExpression_NotName ::= '-' PushPosition UnaryExpression
UnaryExpression_NotName ::= /*->*/ UnaryExpressionNotPlusMinus_NotName
UnaryExpressionNotPlusMinus_NotName ::= /*->*/ PostfixExpression_NotName
UnaryExpressionNotPlusMinus_NotName ::= '~' PushPosition UnaryExpression
UnaryExpressionNotPlusMinus_NotName ::= '!' PushPosition UnaryExpression
UnaryExpressionNotPlusMinus_NotName ::= /*->*/ CastExpression
MultiplicativeExpression_NotName ::= /*->*/ UnaryExpression_NotName
MultiplicativeExpression_NotName ::= MultiplicativeExpression_NotName '*' UnaryExpression
MultiplicativeExpression_NotName ::= Name '*' UnaryExpression
MultiplicativeExpression_NotName ::= MultiplicativeExpression_NotName '/' UnaryExpression
MultiplicativeExpression_NotName ::= Name '/' UnaryExpression
MultiplicativeExpression_NotName ::= MultiplicativeExpression_NotName '%' UnaryExpression
MultiplicativeExpression_NotName ::= Name '%' UnaryExpression
AdditiveExpression_NotName ::= /*->*/ MultiplicativeExpression_NotName
AdditiveExpression_NotName ::= AdditiveExpression_NotName '+' MultiplicativeExpression
AdditiveExpression_NotName ::= Name '+' MultiplicativeExpression
AdditiveExpression_NotName ::= AdditiveExpression_NotName '-' MultiplicativeExpression
AdditiveExpression_NotName ::= Name '-' MultiplicativeExpression
ShiftExpression_NotName ::= /*->*/ AdditiveExpression_NotName
ShiftExpression_NotName ::= ShiftExpression_NotName '<<' AdditiveExpression
ShiftExpression_NotName ::= Name '<<' AdditiveExpression
ShiftExpression_NotName ::= ShiftExpression_NotName '>>' AdditiveExpression
ShiftExpression_NotName ::= Name '>>' AdditiveExpression
ShiftExpression_NotName ::= ShiftExpression_NotName '>>>' AdditiveExpression
ShiftExpression_NotName ::= Name '>>>' AdditiveExpression
RelationalExpression_NotName ::= /*->*/ ShiftExpression_NotName
RelationalExpression_NotName ::= ShiftExpression_NotName '<' ShiftExpression
RelationalExpression_NotName ::= Name '<' ShiftExpression
RelationalExpression_NotName ::= ShiftExpression_NotName '>' ShiftExpression
RelationalExpression_NotName ::= Name '>' ShiftExpression
RelationalExpression_NotName ::= RelationalExpression_NotName '<=' ShiftExpression
RelationalExpression_NotName ::= Name '<=' ShiftExpression
RelationalExpression_NotName ::= RelationalExpression_NotName '>=' ShiftExpression
RelationalExpression_NotName ::= Name '>=' ShiftExpression
InstanceofExpression_NotName ::= /*->*/ RelationalExpression_NotName
InstanceofExpression_NotName ::= Name InstanceofRHS
InstanceofExpression_NotName ::= InstanceofExpression_NotName InstanceofRHS
EqualityExpression_NotName ::= /*->*/ InstanceofExpression_NotName
EqualityExpression_NotName ::= EqualityExpression_NotName '==' InstanceofExpression
EqualityExpression_NotName ::= Name '==' InstanceofExpression
EqualityExpression_NotName ::= EqualityExpression_NotName '!=' InstanceofExpression
EqualityExpression_NotName ::= Name '!=' InstanceofExpression
AndExpression_NotName ::= /*->*/ EqualityExpression_NotName
AndExpression_NotName ::= AndExpression_NotName '&' EqualityExpression
AndExpression_NotName ::= Name '&' EqualityExpression
ExclusiveOrExpression_NotName ::= /*->*/ AndExpression_NotName
ExclusiveOrExpression_NotName ::= ExclusiveOrExpression_NotName '^' AndExpression
ExclusiveOrExpression_NotName ::= Name '^' AndExpression
InclusiveOrExpression_NotName ::= /*->*/ ExclusiveOrExpression_NotName
InclusiveOrExpression_NotName ::= InclusiveOrExpression_NotName '|' ExclusiveOrExpression
InclusiveOrExpression_NotName ::= Name '|' ExclusiveOrExpression
ConditionalAndExpression_NotName ::= /*->*/ InclusiveOrExpression_NotName
ConditionalAndExpression_NotName ::= ConditionalAndExpression_NotName '&&' InclusiveOrExpression
ConditionalAndExpression_NotName ::= Name '&&' InclusiveOrExpression
ConditionalOrExpression_NotName ::= /*->*/ ConditionalAndExpression_NotName
ConditionalOrExpression_NotName ::= ConditionalOrExpression_NotName '||' ConditionalAndExpression
ConditionalOrExpression_NotName ::= Name '||' ConditionalAndExpression
ConditionalExpression_NotName ::= /*->*/ ConditionalOrExpression_NotName
ConditionalExpression_NotName ::= ConditionalOrExpression_NotName '?' Expression ':' ConditionalExpression
ConditionalExpression_NotName ::= Name '?' Expression ':' ConditionalExpression
AssignmentExpression_NotName ::= /*->*/ ConditionalExpression_NotName
AssignmentExpression_NotName ::= /*->*/ Assignment
Expression_NotName ::= /*->*/ AssignmentExpression_NotName
AnnotationTypeDeclarationHeaderName ::= Modifiers '@' PushRealModifiers 'interface' 'Identifier'
AnnotationTypeDeclarationHeaderName ::= Modifiers '@' PushRealModifiers 'interface' 'Identifier' TypeParameters
AnnotationTypeDeclarationHeaderName ::= '@' PushModifiersForHeader 'interface' 'Identifier' TypeParameters
AnnotationTypeDeclarationHeaderName ::= '@' PushModifiersForHeader 'interface' 'Identifier'
AnnotationTypeDeclarationHeader ::= AnnotationTypeDeclarationHeaderName ClassHeaderExtendsopt ClassHeaderImplementsopt
AnnotationTypeDeclaration ::= AnnotationTypeDeclarationHeader AnnotationTypeBody
AnnotationTypeBody ::= '{' AnnotationTypeMemberDeclarationsopt '}'
AnnotationTypeMemberDeclarationsopt ::= //$Empty
AnnotationTypeMemberDeclarationsopt ::= NestedType AnnotationTypeMemberDeclarations
AnnotationTypeMemberDeclarations ::= /*->*/ AnnotationTypeMemberDeclaration
AnnotationTypeMemberDeclarations ::= AnnotationTypeMemberDeclarations AnnotationTypeMemberDeclaration
AnnotationMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
AnnotationMethodHeaderName ::= Modifiersopt Type 'Identifier' '('
AnnotationMethodHeaderDefaultValueopt ::= //$Empty
AnnotationMethodHeaderDefaultValueopt ::= DefaultValue
AnnotationMethodHeader ::= AnnotationMethodHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderExtendedDims AnnotationMethodHeaderDefaultValueopt
AnnotationTypeMemberDeclaration ::= AnnotationMethodHeader ';'
AnnotationTypeMemberDeclaration ::= /*->*/ ConstantDeclaration
AnnotationTypeMemberDeclaration ::= /*->*/ ConstructorDeclaration
AnnotationTypeMemberDeclaration ::= /*->*/ TypeDeclaration
DefaultValue ::= 'default' MemberValue
Annotation ::= /*->*/ NormalAnnotation
Annotation ::= /*->*/ MarkerAnnotation
Annotation ::= /*->*/ SingleMemberAnnotation
AnnotationName ::= '@' UnannotatableName
NormalAnnotation ::= AnnotationName '(' MemberValuePairsopt ')'
MemberValuePairsopt ::= //$Empty
MemberValuePairsopt ::= /*->*/ MemberValuePairs
MemberValuePairs ::= /*->*/ MemberValuePair
MemberValuePairs ::= MemberValuePairs ',' MemberValuePair
MemberValuePair ::= SimpleName '=' EnterMemberValue MemberValue ExitMemberValue
EnterMemberValue ::= //$Empty
ExitMemberValue ::= //$Empty
MemberValue ::= /*->*/ ConditionalExpression_NotName
MemberValue ::= Name
MemberValue ::= /*->*/ Annotation
MemberValue ::= /*->*/ MemberValueArrayInitializer
MemberValueArrayInitializer ::= EnterMemberValueArrayInitializer '{' PushLeftBrace MemberValues ',' '}'
MemberValueArrayInitializer ::= EnterMemberValueArrayInitializer '{' PushLeftBrace MemberValues '}'
MemberValueArrayInitializer ::= EnterMemberValueArrayInitializer '{' PushLeftBrace ',' '}'
MemberValueArrayInitializer ::= EnterMemberValueArrayInitializer '{' PushLeftBrace '}'
EnterMemberValueArrayInitializer ::= //$Empty
MemberValues ::= /*->*/ MemberValue
MemberValues ::= MemberValues ',' MemberValue
MarkerAnnotation ::= AnnotationName
SingleMemberAnnotationMemberValue ::= MemberValue
SingleMemberAnnotation ::= AnnotationName '(' SingleMemberAnnotationMemberValue ')'
RecoveryMethodHeaderName ::= Modifiersopt TypeParameters Type 'Identifier' '('
RecoveryMethodHeaderName ::= Modifiersopt Type 'Identifier' '('
RecoveryMethodHeaderName ::= ModifiersWithDefault TypeParameters Type 'Identifier' '('
RecoveryMethodHeaderName ::= ModifiersWithDefault Type 'Identifier' '('
RecoveryMethodHeader ::= RecoveryMethodHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderExtendedDims AnnotationMethodHeaderDefaultValueopt
RecoveryMethodHeader ::= RecoveryMethodHeaderName FormalParameterListopt MethodHeaderRightParen MethodHeaderExtendedDims MethodHeaderThrowsClause
It's great and useful feature. I love it.
I had implement generate railroad diagram feature on vscode-extension for lpg2 before , but no on LPG2 .Terminal and non-terminal railroad graph for LPG grammars
Can you finish the code which about this feature .
I need some help understanding the usage of ->
, ->?
, ::=?
and also it seems that LPG2 accepts non alpha characters in identifiers like:
rules_segment ::= RULES_KEY {action_segment}
...
{action_segment} ::= %Empty
{action_segment} ::= {action_segment} action_segment
That makes it trick, probably need a string transformation like I did manually {action_segment}
-> action_segment_list
.
I could not find a document describing the LPG2 syntax and it's usage (mainly the mentioned ->
, ->?
and '::=?`).
There is any document that describes it ?
It has little document left.in these place. https://github.com/impulse-org/imp.lpg.ide/tree/master/html
https://github.com/A-LPG/LPG2/tree/main/lpg-generator-templates-2.1.00/docs
produces ::= '::=' produces ::= '::=?' produces ::= '->' produces ::= '->?'
i think they are all means produces.no different to us
I've looked a bit further on this and I decided that LPG2 it's not for me I'll have it as a reference for a LALR(k) parser but I doubt I'll use it due to lack of documentation.
Any way the code that generate the EBNF is on the first message.
I've looked a bit further on this and I decided that LPG2 it's not for me I'll have it as a reference for a LALR(k) parser but I doubt I'll use it due to lack of documentation.
Any way the code that generate the EBNF is on the first message.
That's fine. Than you for you code. About documentation . I will try to write some in future. It's a excellent tool but after Philiphe Charles, Robert M. Fuhrer left IBM,. No one maintain it any more.
Based on the code from
void Grammar::DisplayInput(void)
I built so far this initial EBNF grammar (after some small manual changes) that can be used on https://www.bottlecaps.de/rr/ui to get a railroad diagram (https://en.wikipedia.org/wiki/Syntax_diagram).I think that it's a useful option to have on LPG2.
Copy and paste the EBNF shown bellow on https://www.bottlecaps.de/rr/ui in the TAB Edit Grammar then switch to the TAB View Diagram.
Initial code to generate EBNF understood by https://www.bottlecaps.de/rr/ui: