/
correct-read2.exbgf
111 lines (108 loc) · 3.17 KB
/
correct-read2.exbgf
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
<?xml version="1.0" encoding="UTF-8"?>
<exbgf:sequence xmlns:bgf="http://planet-sl.org/bgf" xmlns:xbgf="http://planet-sl.org/xbgf" xmlns:exbgf="http://planet-sl.org/exbgf">
<!-- in the extracted version root is undefined -->
<xbgf:reroot>
<root>CompilationUnit</root>
</xbgf:reroot>
<!-- ISSUE CORRECT SPECERROR
This is an error (typo) in JLS2.
- Fail: ConstantModifiers.
- [], ;([n(ConstantModifier), ,([n(ConstantModifiers), n(ConstantModifier)])])
vs.
- [], ;([n(ConstantModifier), ,([n(ConstantModifiers), n(ConstantModifer)])])
-->
<!-- INITCORR -->
<xbgf:unite>
<add>ConstantModifer</add>
<to>ConstantModifier</to>
</xbgf:unite>
<!-- ISSUE CORRECT SPECERROR
Another typo of JLS2 -->
<!-- INITCORR -->
<xbgf:unite>
<add>Identifer</add>
<to>Identifier</to>
</xbgf:unite>
<!-- ISSUE CORRECT SPECERROR
Left forgotten and undefined -->
<!-- GENERALITY -->
<!-- INITCORR -->
<exbgf:defineH>
<bgf:production>
<nonterminal>ClassName</nonterminal>
<bgf:expression>
<choice>
<bgf:expression>
<nonterminal>Identifier</nonterminal>
</bgf:expression>
<bgf:expression>
<sequence>
<bgf:expression>
<nonterminal>AmbiguousName</nonterminal>
</bgf:expression>
<bgf:expression>
<terminal>.</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>Identifier</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</choice>
</bgf:expression>
</bgf:production>
</exbgf:defineH>
<!-- ISSUE CORRECT SPECERROR
- Fail: ConstructorDeclarator.
- [], ,([n(Identifier), t((), ?(n(FormalParameterList)), t())])
vs.
- [], ,([n(SimpleTypeName), t((), ?(n(FormalParameterList)), t())])
SimpleTypeName is not defined formally in the JLS2
-->
<!-- CORRECTION -->
<xbgf:unite>
<add>SimpleTypeName</add>
<to>Identifier</to>
</xbgf:unite>
<!-- ISSUE CORRECT SPECERROR
The productions were "repeated for convenience", but repeated incorrectly, which led to this ugly thing:
p([], 'CastExpression',
;([','([t('('), n('PrimitiveType'), t(')'), n('UnaryExpression')]),
','([t('('), n('ReferenceType'), t(')'), n('UnaryExpressionNotPlusMinus')]),
','([t('('), n('PrimitiveType'), ?(n('Dims')), t(')'), n('UnaryExpression')])])),
-->
<exbgf:atomicV>
<context>CastExpression</context>
<exbgf:factor-out>
<start>
<bgf:expression>
<terminal>(</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>PrimitiveType</nonterminal>
</bgf:expression>
</start>
<optional>
<bgf:expression>
<optional>
<bgf:expression>
<nonterminal>Dims</nonterminal>
</bgf:expression>
</optional>
</bgf:expression>
</optional>
<tail>
<bgf:expression>
<terminal>)</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>UnaryExpression</nonterminal>
</bgf:expression>
</tail>
</exbgf:factor-out>
<exbgf:massage-double>
<optional/>
<nonterminal>Dims</nonterminal>
</exbgf:massage-double>
</exbgf:atomicV>
</exbgf:sequence>