Skip to content

Commit

Permalink
keeping up with XBGF changes
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@280 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Sep 15, 2008
1 parent 516d201 commit 4119208
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 41 deletions.
2 changes: 1 addition & 1 deletion topics/extraction/html2bgf/getpre.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def processSection(text,tagN,cx,p):
subsections=content[1].split('<h'+`tagN+1`+'>')
for pre in subsections[0].split('<pre>')[1:]:
if max:
print 'Matched <pre> in',content[0].split()[0]
#print 'Matched <pre> in',content[0].split()[0]
p.write(pre.split('</pre>')[0].replace('<br>','').replace('&#32;',' '))
p.write('\n<hr>\n')
max -= 1
Expand Down
23 changes: 21 additions & 2 deletions topics/java/lci/xbgf/addFeatures1to2doc.xbgf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,25 @@
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">

<!--
<!--
- Fail: ConstantDeclaration.
- [], ,([?(n(ConstantModifiers)), n(Type), n(VariableDeclarator)])
vs.
- [], ,([?(n(ConstantModifiers)), n(Type), n(VariableDeclarators)])
-->
<xbgf:replace>
<bgf:expression>
<nonterminal>VariableDeclarator</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>VariableDeclarators</nonterminal>
</bgf:expression>
<in>
<nonterminal>ConstantDeclaration</nonterminal>
</in>
</xbgf:replace>

<!--
- Fail: FieldAccess.
- [], ;([,([n(Primary), t(.), n(Identifier)]), ,([t(super), t(.), n(Identifier)])])
vs.
Expand Down Expand Up @@ -102,7 +120,6 @@
</bgf:expression>
</bgf:production>
</xbgf:add>
<xbgf:horizontal>ClassBodyDeclaration</xbgf:horizontal>
<xbgf:define>
<bgf:production>
<nonterminal>InstanceInitializer</nonterminal>
Expand All @@ -111,6 +128,8 @@
</bgf:expression>
</bgf:production>
</xbgf:define>
<xbgf:horizontal>ClassBodyDeclaration</xbgf:horizontal>

<!--
- Fail: ClassMemberDeclaration.
- [], ;([n(FieldDeclaration), n(MethodDeclaration)])
Expand Down
28 changes: 28 additions & 0 deletions topics/java/lci/xbgf/addFeatures2to3doc.xbgf
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,15 @@
</bgf:production>
</xbgf:add>
<xbgf:horizontal>MethodInvocation</xbgf:horizontal>
<xbgf:strip>
<selector>target2</selector>
</xbgf:strip>
<xbgf:strip>
<selector>target3</selector>
</xbgf:strip>
<xbgf:strip>
<selector>target4</selector>
</xbgf:strip>

<!--
- Fail: FormalParameterList.
Expand Down Expand Up @@ -1398,6 +1407,9 @@
</bgf:production>
</xbgf:inject>
<xbgf:horizontal>PrimaryNoNewArray</xbgf:horizontal>
<xbgf:strip>
<selector>target</selector>
</xbgf:strip>

<!--
- Fail: ConstantDeclaration.
Expand Down Expand Up @@ -1930,6 +1942,16 @@
</bgf:production>
</xbgf:define>
<xbgf:horizontal>ExplicitConstructorInvocation</xbgf:horizontal>
<xbgf:strip>
<selector>target1</selector>
</xbgf:strip>
<xbgf:strip>
<selector>target2</selector>
</xbgf:strip>
<xbgf:strip>
<selector>target3</selector>
</xbgf:strip>


<!--
- Fail: ClassInstanceCreationExpression.
Expand Down Expand Up @@ -2275,6 +2297,12 @@
</bgf:production>
</xbgf:inject>
<xbgf:horizontal>ArrayCreationExpression</xbgf:horizontal>
<xbgf:strip>
<selector>target1</selector>
</xbgf:strip>
<xbgf:strip>
<selector>target2</selector>
</xbgf:strip>

<!-- last bits -->

Expand Down
4 changes: 3 additions & 1 deletion topics/java/lci/xbgf/cropFeatures1.xbgf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
<xbgf:remove>
<bgf:production>
<nonterminal>MethodBody</nonterminal>
<bgf:expression><terminal>;</terminal></bgf:expression>
<bgf:expression>
<terminal>;</terminal>
</bgf:expression>
</bgf:production>
</xbgf:remove>
</xbgf:sequence>
5 changes: 4 additions & 1 deletion topics/java/lci/xbgf/enhanceModifiers.xbgf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@
</bgf:production>
</xbgf:permute>
<xbgf:horizontal>ConstantModifiers</xbgf:horizontal>

<xbgf:strip>
<selector>target</selector>
</xbgf:strip>

<!--
- Fail: FieldModifier.
- [], ;([t(public), t(protected), t(private), t(static), t(final), t(transient), t((volatile))])
Expand Down
50 changes: 15 additions & 35 deletions topics/java/lci/xbgf/fixErrors1doc.xbgf
Original file line number Diff line number Diff line change
Expand Up @@ -35,48 +35,28 @@
<xbgf:horizontal>ConstantModifiers</xbgf:horizontal>

<!--
The authors fix an old problem here.
Fixed by "substitute" in XBGF.
The authors fix an old problem here. (fixed partially

- Fail: ConstantDeclaration.
- [], ,([n(ConstantModifiers), n(Type), n(VariableDeclarator)])
vs.
- [], ,([?(n(ConstantModifiers)), n(Type), n(VariableDeclarators)])
-->
<xbgf:project>
<bgf:production>
<nonterminal>ConstantDeclaration</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<nonterminal>Type</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:project>
<xbgf:inject>
<bgf:production>
<xbgf:widen>
<bgf:expression>
<nonterminal>ConstantModifiers</nonterminal>
</bgf:expression>
<bgf:expression>
<optional>
<bgf:expression>
<nonterminal>ConstantModifiers</nonterminal>
</bgf:expression>
</optional>
</bgf:expression>
<in>
<nonterminal>ConstantDeclaration</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<optional>
<bgf:expression>
<nonterminal>ConstantModifiers</nonterminal>
</bgf:expression>
</optional>
</bgf:expression>
<bgf:expression>
<nonterminal>Type</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>VariableDeclarators</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:inject>
</in>
</xbgf:widen>

<!-- Wrong markup makes the extractor enforce line continuation

Expand Down
11 changes: 10 additions & 1 deletion topics/java/lci/xbgf/preferLALR.xbgf
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@
</bgf:expression>
</bgf:production>
</xbgf:chain>
<!-- horizontal also kills the temporary label -->
<xbgf:horizontal>Name</xbgf:horizontal>
<xbgf:strip>
<selector>idtoname</selector>
</xbgf:strip>

<xbgf:undefine>ClassOrInterfaceType</xbgf:undefine>
<xbgf:undefine>InterfaceType</xbgf:undefine>
Expand Down Expand Up @@ -298,6 +300,9 @@
</bgf:production>
</xbgf:inject>
<xbgf:horizontal>ArrayCreationExpression</xbgf:horizontal>
<xbgf:strip>
<selector>target</selector>
</xbgf:strip>
<!-- end local rename aka substitute-->

<xbgf:vertical>
Expand Down Expand Up @@ -368,6 +373,10 @@
</bgf:production>
</xbgf:inject>
<!-- end local rename aka substitute-->
<xbgf:strip>
<label>target</label>
</xbgf:strip>

<xbgf:add>
<bgf:production>
<nonterminal>CastExpression</nonterminal>
Expand Down
3 changes: 3 additions & 0 deletions topics/java/lci/xbgf/restructure1doc.xbgf
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
</bgf:production>
</xbgf:inject>
<xbgf:horizontal>TypeName</xbgf:horizontal>
<xbgf:strip>
<selector>target</selector>
</xbgf:strip>

<!--
Resolve brutally. Is there a better way?
Expand Down

0 comments on commit 4119208

Please sign in to comment.