Skip to content

Kernel.sdf3

pdmosses/sdf/org.metaborg.meta.lang.template/syntax/kernel/Kernel.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
55
56
57
58
59
module 

imports aterms/Aterms 
        symbols/Symbols 
        grammar/Grammars
        constants/StrCon
        priority/Priority
        layout-constraints/Layout-Constraints

context-free syntax

ATermAttribute.Default = <<aterm:ATerm>>
Attribute.Term = <<ATermAttribute>>

.Attrs = <{<list:{Attribute ", "}*>}>
.NoAttrs = <>



//special attributes that should show up in the parse table as attr

Attribute.Deprecated = <deprecated(<StrCon>)> 
Attribute.Constructor = <cons(<StrCon>)> {deprecated("Use 'Sort.Cons' notation instead")}
Attribute = <<QuotedConstructor>> {prefer, deprecated("Use 'Sort.Cons' notation instead") }
QuotedConstructor.Constructor = <<StrCon>>

Attribute.Reject = <reject>
Attribute.Prefer = <prefer> {deprecated("Prefer and avoid are deprecated and will be removed in a future version of SDF3")}
Attribute.Avoid = <avoid> {deprecated("Prefer and avoid are deprecated and will be removed in a future version of SDF3")}

Attribute.Bracket = <bracket>
Attribute.Assoc = <<Associativity>>

Attribute.LayoutConstraint = <layout(<Constraint>)>

Attribute.IgnoreLayout = <ignore-layout>
Attribute.EnforceNewLine = <enforce-newline>
Attribute.LongestMatch = <longest-match>
Attribute.Recover      = <recover>

Attribute.CaseInsensitive = <case-insensitive>
Attribute.Deprecated = <deprecated>  

//new completion attributes
Attribute.Placeholder = <placeholder> 
Attribute.PlaceholderInsertion = <placeholder-insertion> 
Attribute.LiteralCompletion = <literal-completion> 


.Prod = <<Symbols> -\> <result:Symbol> <Attributes>> {deprecated("Use productive form instead")}

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

Grammar.Syntax = <
        syntax 

                <Productions>

                >