Modules.sdf3
pdmosses/sdf/org.metaborg.meta.lang.template/syntax/modules/Modules.sdf3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
module
imports kernel/Kernel
renaming/Renaming
symbols/Symbols
lexical syntax
//letters:[A-Za-z0-9\_\-]+ -> ModuleWord {cons("word")}
.Word = [A-Za-z0-9\_\-]+
.Leaf = ModuleWord
//sep:"/" basename:ModuleId -> ModuleId {cons("root")}
.Root = "/" ModuleId
//dirname:ModuleWord sep:"/" basename:ModuleId -> ModuleId {cons("path")}
.Path = ModuleWord "/" ModuleId
context-free syntax
//Definition = <<list:Module*>>
.Module = <
module <ModuleName>
<list:ImpSection*>
<Sections>>
//Section.Exports = <exports <Grammar>>
//Section.Hiddens = <hiddens <Grammar>>
Sections = <<{Section "\n"}*>>
Section.SDFSection = <<Grammar>>
.Unparameterized = <<ModuleId>>
.Parameterized = <<ModuleId> [<params:Symbols>]>
// Attribute.Id = <id (<ModuleName>) >
ImpSection.Imports = <
imports
<list:Imports>>
//Grammar.ImpSection = <<ImpSection>> IGNORED PRODUCTION
Imports = <<list:{Import "\n\t"}*>>
Import.Module = <<ModuleName>>
//Import.RenamedModule = <<ModuleName> <Renamings>> IGNORED PRODUCTION
//Import = <(<Import>)> {bracket}
lexical restrictions
ModuleWord -/- [A-Za-z0-9\_\-]
ModuleId -/- [\/]
|