/
refactor-impl3.xbgf
130 lines (125 loc) · 3.64 KB
/
refactor-impl3.xbgf
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?xml version="1.0" encoding="utf-8"?>
<xbgf:sequence
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">
<!--
- Fail: Annotations.
- [], ,([n(Annotation), ?(n(Annotations))])
vs.
- [], ;([n(Annotation), ,([n(Annotations), n(Annotation)])])
-->
<xbgf:massage>
<bgf:expression>
<optional>
<bgf:expression>
<nonterminal>Annotations</nonterminal>
</bgf:expression>
</optional>
</bgf:expression>
<bgf:expression>
<choice>
<bgf:expression>
<nonterminal>Annotations</nonterminal>
</bgf:expression>
<bgf:expression>
<epsilon/>
</bgf:expression>
</choice>
</bgf:expression>
<in>
<nonterminal>Annotations</nonterminal>
</in>
</xbgf:massage>
<xbgf:distribute>
<nonterminal>Annotations</nonterminal>
</xbgf:distribute>
<xbgf:atomic>
<xbgf:vertical>
<nonterminal>Annotations</nonterminal>
</xbgf:vertical>
<xbgf:deyaccify>Annotations</xbgf:deyaccify>
</xbgf:atomic>
<!--
- Fail: Catches.
- [], ,([n(CatchClause), *(n(CatchClause))])
vs.
- [], +n(CatchClause)
-->
<xbgf:massage>
<bgf:expression>
<sequence>
<bgf:expression>
<nonterminal>CatchClause</nonterminal>
</bgf:expression>
<bgf:expression>
<star>
<bgf:expression>
<nonterminal>CatchClause</nonterminal>
</bgf:expression>
</star>
</bgf:expression>
</sequence>
</bgf:expression>
<bgf:expression>
<plus>
<bgf:expression>
<nonterminal>CatchClause</nonterminal>
</bgf:expression>
</plus>
</bgf:expression>
</xbgf:massage>
<!--
','([n('Primary'), *(n('Selector')), *(n('PostfixOp'))])
vs
;([n('Primary'), n('QualifiedIdentifier'), ','([n('PostfixExpression'), n('PostfixOp')])])
-->
<!-- CORRECTION -->
<!-- REVISE -->
<xbgf:replace>
<bgf:expression>
<sequence>
<bgf:expression>
<nonterminal>Primary</nonterminal>
</bgf:expression>
<bgf:expression>
<star>
<bgf:expression>
<nonterminal>Selector</nonterminal>
</bgf:expression>
</star>
</bgf:expression>
</sequence>
</bgf:expression>
<bgf:expression>
<choice>
<bgf:expression>
<nonterminal>Primary</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>QualifiedIdentifier</nonterminal>
</bgf:expression>
</choice>
</bgf:expression>
</xbgf:replace>
<xbgf:eliminate>Selector</xbgf:eliminate>
<!-- we don't need minimised lookahead here -->
<xbgf:horizontal>InterfaceMemberDecl</xbgf:horizontal>
<xbgf:inline>InterfaceMemberDecl</xbgf:inline>
<xbgf:inline>InterfaceMethodOrFieldDecl</xbgf:inline>
<xbgf:horizontal>InterfaceMethodOrFieldRest</xbgf:horizontal>
<xbgf:inline>InterfaceMethodOrFieldRest</xbgf:inline>
<xbgf:inline>InterfaceGenericMethodDecl</xbgf:inline>
<xbgf:inline>InterfaceMethodDeclaratorRest</xbgf:inline>
<xbgf:inline>VoidInterfaceMethodDeclaratorRest</xbgf:inline>
<xbgf:atomic>
<xbgf:inline>ConstantDeclaratorsRest</xbgf:inline>
<xbgf:inline>FormalParameters</xbgf:inline>
</xbgf:atomic>
<xbgf:distribute>
<nonterminal>InterfaceBodyDeclaration</nonterminal>
</xbgf:distribute>
<!--remove when done-->
<xbgf:vertical>
<nonterminal>InterfaceBodyDeclaration</nonterminal>
</xbgf:vertical>
</xbgf:sequence>