Skip to content

Priority.sdf3

pdmosses/sdf/org.metaborg.meta.lang.template/syntax/priority/Priority.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
module 

imports kernel/Kernel constants/NatCon TemplateLang

context-free syntax

.Left = <left>
.Right = <right>
.NonAssoc = <non-assoc>
.Assoc = <assoc>
.NonNested = <non-nested>



ArgumentIndicator.Default = <\<<arguments:{NatCon ","}+>\>>
.WithArguments = <<Group> <ArgumentIndicator>> {non-assoc}
.NonTransitive = <<Group>.> {non-assoc}

.SimpleGroup = <<PriorityProduction>>
.ProdsGroup = <{<PriorityProductions>}>
.AssocGroup = <
        {<Associativity>: 
                <PriorityProductions>}> 


 = <<SdfProduction>>
 = <<Production>>
 = <<list:{PriorityProduction "\n"}*>>


Priority.Chain = <<list:{Group " > "}+>>
//"left":Group Associativity "right":Group             -> Priority  {cons("assoc")}
Priority.Assoc = <<Group> <Associativity> <Group>>

 = <<list:{Priority ",\n"}*>>
Grammar.Priorities = <
        priorities 

                <Priorities>

                >