Skip to content

Commit

Permalink
more convergence
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@260 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Sep 12, 2008
1 parent 72f95d1 commit 7e6bdb1
Show file tree
Hide file tree
Showing 8 changed files with 229 additions and 12 deletions.
2 changes: 1 addition & 1 deletion topics/java/lci/Makefile
Expand Up @@ -3,7 +3,7 @@ validator = ../../../shared/tools/checkxml
build:

diff: test
gdt bgf/jls1.prepare1.refactorStatements.structure1.addFeatures1to2.bgf bgf/jls2.prepare2.bgf
gdt bgf/jls1app.prepare1.refactorStatements.refactorTypes.structure1.addFeatures1to2.cropFeatures1.bgf bgf/jls2.prepare2.bgf

test:
python ../../convergence/lci/lci.py java.lcf architecture
Expand Down
5 changes: 5 additions & 0 deletions topics/java/lci/java-lci.csproj
Expand Up @@ -58,10 +58,15 @@
<Link>xbgf.xsd</Link>
</None>
<None Include="java.lcf" />
<None Include="xbgf\addFeatures1to2.xbgf" />
<None Include="xbgf\addFeatures2to3.xbgf" />
<None Include="xbgf\cropFeatures1.xbgf" />
<None Include="xbgf\preferLALR.xbgf" />
<None Include="xbgf\prepare1.xbgf" />
<None Include="xbgf\prepare2.xbgf" />
<None Include="xbgf\prepare3.xbgf" />
<None Include="xbgf\refactorStatements.xbgf" />
<None Include="xbgf\refactorTypes.xbgf" />
<None Include="xbgf\structure1.xbgf" />
</ItemGroup>
</Project>
6 changes: 4 additions & 2 deletions topics/java/lci/java.lcf
Expand Up @@ -102,14 +102,16 @@
<perform>preferLALR</perform>
</branch>
</target>

<target>
<name>onetwo</name>
<branch>
<input>one</input>
<perform>refactorStatements</perform>
<perform>refactorTypes</perform>
<perform>structure1</perform>
<perform>addFeatures1to2</perform>
<perform>cropFeatures1</perform>
</branch>
<branch>
<input>jls2</input>
Expand All @@ -132,4 +134,4 @@
</branch>
</target>

</lcf:configuration>
</lcf:configuration>
13 changes: 13 additions & 0 deletions topics/java/lci/xbgf/cropFeatures1.xbgf
@@ -0,0 +1,13 @@
<xbgf:sequence
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">
<xbgf:vertical>
<nonterminal>MethodBody</nonterminal>
</xbgf:vertical>
<xbgf:remove>
<bgf:production>
<nonterminal>MethodBody</nonterminal>
<bgf:expression><terminal>;</terminal></bgf:expression>
</bgf:production>
</xbgf:remove>
</xbgf:sequence>
69 changes: 69 additions & 0 deletions topics/java/lci/xbgf/preferLALR.xbgf
@@ -0,0 +1,69 @@
<xbgf:sequence
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">
<xbgf:reroot>
<root>CompilationUnit</root>
</xbgf:reroot>
<xbgf:vertical>
<nonterminal>Type</nonterminal>
</xbgf:vertical>
<xbgf:vertical>
<nonterminal>Primary</nonterminal>
</xbgf:vertical>
<xbgf:vertical>
<nonterminal>Statement</nonterminal>
</xbgf:vertical>
<xbgf:rename>
<nonterminal>
<from>AmbiguousName</from>
<to>Name</to>
</nonterminal>
</xbgf:rename>

<xbgf:unite>
<add>MethodName</add>
<to>Name</to>
</xbgf:unite>
<xbgf:unite>
<add>TypeName</add>
<to>Name</to>
</xbgf:unite>
<xbgf:unite>
<add>PackageName</add>
<to>Name</to>
</xbgf:unite>
<xbgf:unite>
<add>ExpressionName</add>
<to>Name</to>
</xbgf:unite>
<!--xbgf:restrict>
<bgf:production>
<nonterminal>Name</nonterminal>
<bgf:expression>
<choice>
<bgf:expression>
<nonterminal>Identifier</nonterminal>
</bgf:expression>
<bgf:expression>
<sequence>
<bgf:expression>
<nonterminal>Name</nonterminal>
</bgf:expression>
<bgf:expression>
<terminal>.</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>Identifier</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</choice>
</bgf:expression>
</bgf:production>
</xbgf:restrict-->
<!--xbgf:add>
<bgf:production>
<nonterminal></nonterminal>
</bgf:production>
</xbgf:add-->
</xbgf:sequence>
3 changes: 3 additions & 0 deletions topics/java/lci/xbgf/prepare2.xbgf
Expand Up @@ -32,6 +32,9 @@
<xbgf:vertical>
<nonterminal>InterfaceMemberDecl</nonterminal>
</xbgf:vertical>
<xbgf:vertical>
<nonterminal>BasicType</nonterminal>
</xbgf:vertical>

<xbgf:define>
<bgf:production>
Expand Down
45 changes: 36 additions & 9 deletions topics/java/lci/xbgf/refactorStatements.xbgf
Expand Up @@ -54,7 +54,14 @@
</bgf:expression>
</bgf:production>
</xbgf:define>
<xbgf:prune>IfThenStatement</xbgf:prune>
<xbgf:remove>
<bgf:production>
<nonterminal>Statement</nonterminal>
<bgf:expression>
<nonterminal>IfThenStatement</nonterminal>
</bgf:expression>
</bgf:production>
</xbgf:remove>
<xbgf:inline>IfThenElseStatement</xbgf:inline>

<xbgf:inline>ForStatement</xbgf:inline>
Expand All @@ -63,17 +70,33 @@
<xbgf:vertical>
<nonterminal>StatementWithoutTrailingSubstatement</nonterminal>
</xbgf:vertical>
<xbgf:unite>
<xbgf:unite>
<add>StatementWithoutTrailingSubstatement</add>
<to>Statement</to>
</xbgf:unite>
<xbgf:remove>
<bgf:production>
<nonterminal>Statement</nonterminal>
<bgf:expression>
<nonterminal>Statement</nonterminal>
</bgf:expression>
</bgf:production>
</xbgf:remove>
<xbgf:vertical>
<nonterminal>TryStatement</nonterminal>
</xbgf:vertical>
<xbgf:unite>
<add>TryStatement</add>
<to>Statement</to>
</xbgf:unite>
<xbgf:remove>
<bgf:production>
<nonterminal>Statement</nonterminal>
<bgf:expression>
<nonterminal>Statement</nonterminal>
</bgf:expression>
</bgf:production>
</xbgf:remove>
<xbgf:inline>Finally</xbgf:inline>
<!--xbgf:fold>
<bgf:production>
Expand Down Expand Up @@ -158,18 +181,22 @@
</bgf:production>
</xbgf:define>

<!--xbgf:lassoc>
<xbgf:undefine>StatementExpressionList</xbgf:undefine>
<xbgf:define>
<bgf:production>
<nonterminal>SwitchBlockStatementGroups</nonterminal>
<nonterminal>StatementExpressionList</nonterminal>
<bgf:expression>
<star>
<sequence>
<bgf:expression>
<nonterminal>SwitchBlockStatementGroup</nonterminal>
<nonterminal>StatementExpression</nonterminal>
</bgf:expression>
</star>
<bgf:expression>
<nonterminal>MoreStatementExpressions</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:lassoc-->

</xbgf:define>
<xbgf:inline>StatementExpressionList</xbgf:inline>
<!--...-->
</xbgf:sequence>
98 changes: 98 additions & 0 deletions topics/java/lci/xbgf/refactorTypes.xbgf
@@ -0,0 +1,98 @@
<xbgf:sequence
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">

<xbgf:vertical>
<nonterminal>PrimitiveType</nonterminal>
</xbgf:vertical>
<xbgf:remove>
<bgf:production>
<nonterminal>PrimitiveType</nonterminal>
<bgf:expression>
<nonterminal>NumericType</nonterminal>
</bgf:expression>
</bgf:production>
</xbgf:remove>
<xbgf:eliminate>NumericType</xbgf:eliminate>
<xbgf:vertical>
<nonterminal>IntegralType</nonterminal>
</xbgf:vertical>
<xbgf:unite>
<add>IntegralType</add>
<to>PrimitiveType</to>
</xbgf:unite>
<xbgf:vertical>
<nonterminal>FloatingPointType</nonterminal>
</xbgf:vertical>
<xbgf:unite>
<add>FloatingPointType</add>
<to>PrimitiveType</to>
</xbgf:unite>
<xbgf:rename>
<nonterminal>
<from>PrimitiveType</from>
<to>BasicType</to>
</nonterminal>
</xbgf:rename>

<xbgf:undefine>ReferenceType</xbgf:undefine>
<xbgf:unite>
<add>ReferenceType</add>
<to>Type</to>
</xbgf:unite>
<xbgf:undefine>ClassType</xbgf:undefine>
<xbgf:unite>
<add>ClassType</add>
<to>Type</to>
</xbgf:unite><xbgf:eliminate>ArrayType</xbgf:eliminate>
<xbgf:remove>
<bgf:production>
<nonterminal>Type</nonterminal>
<bgf:expression>
<nonterminal>Type</nonterminal>
</bgf:expression>
</bgf:production>
</xbgf:remove>
<xbgf:add>
<bgf:production>
<nonterminal>Type</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<nonterminal>Identifier</nonterminal>
</bgf:expression>
<bgf:expression>
<star>
<bgf:expression>
<sequence>
<bgf:expression>
<terminal>.</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>Identifier</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</star>
</bgf:expression>
<bgf:expression>
<nonterminal>BracketsOpt</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:add>

<xbgf:rename>
<nonterminal>
<from>ClassTypeList</from>
<to>TypeList</to>
</nonterminal>
</xbgf:rename>
<xbgf:undefine>InterfaceTypeList</xbgf:undefine>
<xbgf:unite>
<add>InterfaceTypeList</add>
<to>TypeList</to>
</xbgf:unite>
<!--...-->
</xbgf:sequence>

0 comments on commit 7e6bdb1

Please sign in to comment.