|
コンパイラ
構文解析
Module
0
1
| Module:
ModuleDecl ModuleDef
ModuleDecl ExternalModuleDecls ModuleDef
|
ModuleDecl
0
1
2
3
| ModuleDecl:
"module" ModulePath ";"
ModulePath:
Identfier "." IdentPath
|
IdentPath
0
1
| IdentPath:
IdentPath "." Identifier
Identifier
|
SymbolPath , SymbolName
0
1
2
3
| SymbolPath:
IdentPath
SymbolName:
Identifier
|
ExternalModuleDecls
0
1
2
3
4
5
6
7
8
9
10
11
12
| ExternalModuleDecls:
ExternalModuleDecl
ExternalModuleDecl ExternalModuleDecls
ExternalModuleDecl:
ImportExternalModule
UsingExternalModule
ImportExternalModule:
"import" ModulePath ";"
UsingExternalModule
"using" ModulePath ";"
|
ModuleDef
0
1
2
| ModuleDef:
StaticTypeDef
# ただしModuleNameと同じ必要がある
|
StaticTypeDef
0
1
2
3
4
5
6
| StaticTypeDef:
ClassDef
EnumDef
InterfaceDef
PodDef
StructDef
TypedefDef
UtilityDef
|
StaticSymbolDef
0
1
| StaticSymbolDef:
StaticTypeDef
AliasDef
|
AliasDef
0
1
2
| AliasDef:
'alias' IdentPath Identifier ';'
# ここのIdentPathはStaticSymbolDefなモノに限定
|
ClassDef
EnumDef
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| EnumDef:
'enum' EnumAssignValueDef ';'
'enum' EnumNoAssignValueDef ';'
'enum' '{' EnumValueDefs '}' ';'
EnumValueDef:
EnumAssignValueDef
EnumNoAssignValueDef
EnumAssignValueDef:
SymbolName '=' Expression
EnumNoAssignValueDef:
SymbolName
EnumValueDefs:
EnumValueDef
EnumValueDef ','
EnumValueDef ',' EnumValueDefs
|
InterfaceDef
PodDef
StructDef
TypedefDef
0
1
2
| TypedefDef:
'typedef' IdentPath Identifier ';'
# ここのIdentPathはStaticTypeDefなものに限定
|
UtilityDef
|