Skip to content

Commit

Permalink
intermediate state of Java convergence
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@289 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Sep 18, 2008
1 parent 694f5c4 commit f159b62
Show file tree
Hide file tree
Showing 12 changed files with 1,089 additions and 97 deletions.
2 changes: 1 addition & 1 deletion topics/java/lci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ diff2: test
gdt bgf/jls1app.prepare1.refactorStatements.refactorTypes.structure1.addFeatures1to2.cropFeatures1.bgf bgf/jls2.prepare2.bgf

diff: test
../../../shared/tools/gdt bgf/jls2doc.fixErrors2doc.enhanceModifiers.addFeatures2to3doc.bgf bgf/jls3doc.fixErrors3doc.bgf
../../../shared/tools/gdt bgf/jls2syntax.fixErrors2.prepare2.bgf bgf/jls2doc.fixErrors2doc.deyaccify2doc.inlineStatements2doc.inlineExpressions2doc.refactorDeclarations2doc.breakSemantics2doc.bgf

test:
python ../../convergence/lci/lci.py java.lcf architecture
Expand Down
6 changes: 6 additions & 0 deletions topics/java/lci/java-lci.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,22 @@
<None Include="xbgf\addFeatures1to2doc.xbgf" />
<None Include="xbgf\addFeatures2to3.xbgf" />
<None Include="xbgf\addFeatures2to3doc.xbgf" />
<None Include="xbgf\breakSemantics2doc.xbgf" />
<None Include="xbgf\cropFeatures1.xbgf" />
<None Include="xbgf\deyaccify2doc.xbgf" />
<None Include="xbgf\enhanceModifiers.xbgf" />
<None Include="xbgf\fixErrors1doc.xbgf" />
<None Include="xbgf\fixErrors2.xbgf" />
<None Include="xbgf\fixErrors2doc.xbgf" />
<None Include="xbgf\fixErrors3.xbgf" />
<None Include="xbgf\fixErrors3doc.xbgf" />
<None Include="xbgf\inlineExpressions2doc.xbgf" />
<None Include="xbgf\inlineStatements2doc.xbgf" />
<None Include="xbgf\preferLALR.xbgf" />
<None Include="xbgf\prepare1.xbgf" />
<None Include="xbgf\prepare2.xbgf" />
<None Include="xbgf\prepare3.xbgf" />
<None Include="xbgf\refactorDeclarations2doc.xbgf" />
<None Include="xbgf\refactorStatements.xbgf" />
<None Include="xbgf\refactorTypes.xbgf" />
<None Include="xbgf\restructure1doc.xbgf" />
Expand Down
25 changes: 13 additions & 12 deletions topics/java/lci/java.lcf
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,13 @@
<expand>slps</expand>/shared/tools
</expansion>
</shortcut>
<shortcut>
<name>wrappers</name>
<expansion>
<expand>slps</expand>/shared/wrappers
</expansion>
</shortcut>

<tool>
<!--tool>
<name>validation</name>
<grammar>
<expand>tools</expand>/checkxml bgf
</grammar>
</tool>
</tool-->
<tool>
<name>comparison</name>
<grammar>
Expand Down Expand Up @@ -92,7 +86,7 @@
</grammar>
</source>

<target>
<!--target>
<name>one</name>
<branch>
<input>jls1syntax</input>
Expand All @@ -102,20 +96,27 @@
<input>jls1doc</input>
<perform>preferLALR</perform>
</branch>
</target>
</target-->

<target>
<name>two</name>
<branch>
<input>jls2syntax</input>
<perform>fixErrors2</perform>
<perform>prepare2</perform>
</branch>
<branch>
<input>jls2doc</input>
<perform>fixErrors2doc</perform>
<perform>deyaccify2doc</perform>
<perform>inlineStatements2doc</perform>
<perform>inlineExpressions2doc</perform>
<perform>refactorDeclarations2doc</perform>
<perform>breakSemantics2doc</perform>
</branch>
</target>

<target>
<!--target>
<name>three</name>
<branch>
<input>jls3syntax</input>
Expand Down Expand Up @@ -192,6 +193,6 @@
<branch>
<input>jls3syntax</input>
</branch>
</target>
</target-->

</lcf:configuration>
63 changes: 63 additions & 0 deletions topics/java/lci/xbgf/breakSemantics2doc.xbgf
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<xbgf:sequence
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">

<!--
NOT semantic-preserving in any way.

- Fail: MethodBody.
- [], n(Block)
vs.
- [], ;([n(Block), t((;))])
-->
<xbgf:vertical>
<nonterminal>MethodBody</nonterminal>
</xbgf:vertical>
<xbgf:remove>
<bgf:production>
<nonterminal>MethodBody</nonterminal>
<bgf:expression>
<terminal>;</terminal>
</bgf:expression>
</bgf:production>
</xbgf:remove>

<!--
- Fail: InterfaceDeclaration.
- [], ,([t(interface), n(Identifier), ?(,([t(extends), n(TypeList)])), n(InterfaceBody)])
vs.
- [], ,([?(n(InterfaceModifiers)), n(Identifier), ?(,([t(extends), n(TypeList)])), n(InterfaceBody)])
-->
<xbgf:project>
<bgf:production>
<nonterminal>InterfaceDeclaration</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<terminal>interface</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>Identifier</nonterminal>
</bgf:expression>
<bgf:expression>
<optional>
<bgf:expression>
<sequence>
<bgf:expression>
<terminal>extends</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>TypeList</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</optional>
</bgf:expression>
<bgf:expression>
<nonterminal>InterfaceBody</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:project>
</xbgf:sequence>
68 changes: 68 additions & 0 deletions topics/java/lci/xbgf/deyaccify2doc.xbgf
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<xbgf:sequence
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">
<!--
- Fail: SwitchBlockStatementGroups.
- [], *(n(SwitchBlockStatementGroup))
vs.
- [], ;([n(SwitchBlockStatementGroup), ,([n(SwitchBlockStatementGroups), n(SwitchBlockStatementGroup)])])
-->
<xbgf:deyaccify>SwitchBlockStatementGroups</xbgf:deyaccify>
<xbgf:extract>
<bgf:production>
<nonterminal>SwitchBlockStatementGroupsOptPlus</nonterminal>
<bgf:expression>
<optional>
<bgf:expression>
<nonterminal>SwitchBlockStatementGroups</nonterminal>
</bgf:expression>
</optional>
</bgf:expression>
</bgf:production>
</xbgf:extract>
<xbgf:inline>SwitchBlockStatementGroups</xbgf:inline>
<xbgf:rename>
<nonterminal>
<from>SwitchBlockStatementGroupsOptPlus</from>
<to>SwitchBlockStatementGroups</to>
</nonterminal>
</xbgf:rename>
<!-- replace by massage later -->
<xbgf:massage>
<bgf:expression>
<optional>
<bgf:expression>
<plus>
<bgf:expression>
<nonterminal>SwitchBlockStatementGroup</nonterminal>
</bgf:expression>
</plus>
</bgf:expression>
</optional>
</bgf:expression>
<bgf:expression>
<star>
<bgf:expression>
<nonterminal>SwitchBlockStatementGroup</nonterminal>
</bgf:expression>
</star>
</bgf:expression>
</xbgf:massage>

<!--
- Fail: Catches.
- [], ,([n(CatchClause), *(n(CatchClause))])
vs.
- [], ;([n(CatchClause), ,([n(Catches), n(CatchClause)])])
-->
<xbgf:deyaccify>Catches</xbgf:deyaccify>

<!--
- Fail: BlockStatements.
- [], *(n(BlockStatement))
vs.
- [], ;([n(BlockStatement), ,([n(BlockStatements), n(BlockStatement)])])
-->
<xbgf:deyaccify>BlockStatements</xbgf:deyaccify>

</xbgf:sequence>
100 changes: 100 additions & 0 deletions topics/java/lci/xbgf/fixErrors2.xbgf
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<xbgf:sequence
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">
<!-- let's complete some of the statements with a trailing semicolon-->
<xbgf:vertical>
<nonterminal>Statement</nonterminal>
</xbgf:vertical>
<xbgf:designate>
<bgf:production>
<label>ContinueStatement</label>
<nonterminal>Statement</nonterminal> <bgf:expression>
<sequence>
<bgf:expression>
<terminal>continue</terminal>
</bgf:expression>
<bgf:expression>
<optional>
<bgf:expression>
<nonterminal>Identifier</nonterminal>
</bgf:expression>
</optional>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:designate>
<xbgf:inject>
<bgf:production>
<label>ContinueStatement</label>
<nonterminal>Statement</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<terminal>continue</terminal>
</bgf:expression>
<bgf:expression>
<optional>
<bgf:expression>
<nonterminal>Identifier</nonterminal>
</bgf:expression>
</optional>
</bgf:expression>
<bgf:expression>
<terminal>;</terminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:inject>
<xbgf:strip>
<label>ContinueStatement</label>
</xbgf:strip>
<xbgf:designate>
<bgf:production>
<label>BreakStatement</label>
<nonterminal>Statement</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<terminal>break</terminal>
</bgf:expression>
<bgf:expression>
<optional>
<bgf:expression>
<nonterminal>Identifier</nonterminal>
</bgf:expression>
</optional>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:designate>
<xbgf:inject>
<bgf:production>
<label>BreakStatement</label>
<nonterminal>Statement</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<terminal>break</terminal>
</bgf:expression>
<bgf:expression>
<optional>
<bgf:expression>
<nonterminal>Identifier</nonterminal>
</bgf:expression>
</optional>
</bgf:expression>
<bgf:expression>
<terminal>;</terminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:inject>
<xbgf:strip>
<label>BreakStatement</label>
</xbgf:strip>

</xbgf:sequence>
Loading

0 comments on commit f159b62

Please sign in to comment.