Created
September 15, 2017 09:02
-
-
Save kmizu/bb3fe4bf3589f84f2dbcdd21ddab6a94 to your computer and use it in GitHub Desktop.
プログラミング言語の構文の複雑さについて考える 〜Java vs. Scala〜 ref: http://qiita.com/kmizu/items/62db9d44f929055fbfc7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
‘try’ (‘{’ Block ‘}’ | Expr) [‘catch’ ‘{’ CaseClauses ‘}’] [‘finally’ Expr] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TryStatement: | |
try Block Catches | |
| try Block [Catches] Finally | |
| TryWithResourcesStatement; | |
Catches: | |
CatchClause {CatchClause}; | |
CatchClause: | |
catch ( CatchFormalParameter ) Block; | |
CatchFormalParameter: | |
{VariableModifier} CatchType VariableDeclaratorId; | |
CatchType: | |
UnannClassType {| ClassType}; | |
Finally: | |
finally Block; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ClassDef ::= id [TypeParamClause] {ConstrAnnotation} | |
[AccessModifier] | |
ClassParamClauses ClassTemplateOpt | |
TraitDef ::= id [TypeParamClause] TraitTemplateOpt | |
ObjectDef ::= id ClassTemplateOpt | |
ClassTemplateOpt ::= ‘extends’ ClassTemplate | [[‘extends’] TemplateBody] | |
TraitTemplateOpt ::= ‘extends’ TraitTemplate | [[‘extends’] TemplateBody] | |
ClassTemplate ::= [EarlyDefs] ClassParents [TemplateBody] | |
TraitTemplate ::= [EarlyDefs] TraitParents [TemplateBody] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TypeDeclaration: | |
ClassDeclaration | |
| InterfaceDeclaration; | |
ClassDeclaration: | |
NormalClassDeclaration | |
| EnumDeclaration; | |
NormalClassDeclaration: | |
{ClassModifier} class Identifier [TypeParameters] [Superclass] | |
[Superinterfaces] ClassBody; | |
EnumDeclaration: | |
{ClassModifier} enum Identifier [Superinterfaces] EnumBody; | |
InterfaceDeclaration: | |
AnnotationTypeDeclaration | |
| NormalInterfaceDeclaration; | |
NormalInterfaceDeclaration: | |
{InterfaceModifier} interface Identifier [TypeParameters] | |
[ExtendsInterfaces] InterfaceBody; | |
InterfaceBody: { {InterfaceMemberDeclaration} }; | |
InterfaceMemberDeclaration: | |
ConstantDeclaration | |
| InterfaceMethodDeclaration | |
| ClassDeclaration | |
| InterfaceDeclaration; | |
ClassBody: { {ClassBodyDeclaration} }; | |
ClassBodyDeclaration: | |
ClassMemberDeclaration | |
| InstanceInitializer | |
| StaticInitializer | |
| ConstructorDeclaration; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment