Skip to content

Commit

Permalink
JLS case study in consistent state
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@455 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Feb 9, 2009
1 parent 81a3094 commit 3e022b4
Show file tree
Hide file tree
Showing 18 changed files with 1,081 additions and 579 deletions.
48 changes: 38 additions & 10 deletions topics/java/lci/xbgf/correct-app2.xbgf
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,19 @@
</optional>
</bgf:expression>
<bgf:expression>
<terminal>;</terminal>
<marked>
<bgf:expression>
<terminal>;</terminal>
</bgf:expression>
</marked>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:inject>
<xbgf:strip>
<xbgf:unlabel>
<label>ContinueStatement</label>
</xbgf:strip>
</xbgf:unlabel>

<!-- ISSUE CORRECT SPECERROR
Same for BreakStatement -->
Expand Down Expand Up @@ -130,15 +134,19 @@
</optional>
</bgf:expression>
<bgf:expression>
<terminal>;</terminal>
<marked>
<bgf:expression>
<terminal>;</terminal>
</bgf:expression>
</marked>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:inject>
<xbgf:strip>
<xbgf:unlabel>
<label>BreakStatement</label>
</xbgf:strip>
</xbgf:unlabel>

<!-- ISSUE CORRECT SPECERROR
Expression is referenced as Expr:
Expand All @@ -164,8 +172,7 @@
vs.
- [], ,([n(FormalParameters), n(BracketsOpt), ?(,([t(throws), n(QualifiedIdentifierList)])), t((;))])
-->
<!-- GENERALITY -->
<xbgf:inject>
<xbgf:appear>
<bgf:production>
<nonterminal>VoidInterfaceMethodDeclaratorRest</nonterminal>
<bgf:expression>
Expand All @@ -174,7 +181,22 @@
<nonterminal>FormalParameters</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>BracketsOpt</nonterminal>
<marked>
<bgf:expression>
<star>
<bgf:expression>
<sequence>
<bgf:expression>
<terminal>[</terminal>
</bgf:expression>
<bgf:expression>
<terminal>]</terminal>
</bgf:expression>
</sequence>
</bgf:expression>
</star>
</bgf:expression>
</marked>
</bgf:expression>
<bgf:expression>
<optional>
Expand All @@ -196,7 +218,13 @@
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:inject>
</xbgf:appear>
<xbgf:fold>
<nonterminal>BracketsOpt</nonterminal>
<in>
<nonterminal>VoidInterfaceMethodDeclaratorRest</nonterminal>
</in>
</xbgf:fold>

<!-- ISSUE CORRECT SPECERROR
undefined non-terminals -->
Expand Down
145 changes: 114 additions & 31 deletions topics/java/lci/xbgf/editDeclarations.xbgf
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,22 @@
<nonterminal>ExtendsInterfaces</nonterminal>
</in>
</xbgf:fold>
<!-- TODO -->
<!-- BREFACTOR -->
<xbgf:project>
<xbgf:disappear>
<bgf:production>
<nonterminal>InterfaceDeclaration</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<marked>
<bgf:expression>
<optional>
<bgf:expression>
<nonterminal>Modifiers</nonterminal>
</bgf:expression>
</optional>
</bgf:expression>
</marked>
</bgf:expression>
<bgf:expression>
<terminal>interface</terminal>
</bgf:expression>
Expand All @@ -98,20 +107,31 @@
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:project>
</xbgf:disappear>
<xbgf:inline>ExtendsInterfaces</xbgf:inline>
<!-- BREFACTOR

<!--
- Fail: ClassDeclaration.
- [], ,([?(n(Modifiers)), t(class), n(Identifier), ?(n(Super)), ?(n(Interfaces)), n(ClassBody)])
vs.
- [], ,([t(class), n(Identifier), ?(,([t(extends), n(Type)])), ?(,([t(implements), n(TypeList)])), n(ClassBody)])
-->
<xbgf:project>
<xbgf:disappear>
<bgf:production>
<nonterminal>ClassDeclaration</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<marked>
<bgf:expression>
<optional>
<bgf:expression>
<nonterminal>Modifiers</nonterminal>
</bgf:expression>
</optional>
</bgf:expression>
</marked>
</bgf:expression>
<bgf:expression>
<terminal>class</terminal>
</bgf:expression>
Expand All @@ -138,7 +158,7 @@
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:project>
</xbgf:disappear>
<xbgf:inline>Super</xbgf:inline>
<xbgf:inline>Interfaces</xbgf:inline>

Expand Down Expand Up @@ -171,14 +191,21 @@
<xbgf:vertical>
<nonterminal>TypeDeclaration</nonterminal>
</xbgf:vertical>
<!-- BREFACTOR -->
<xbgf:inject>
<xbgf:appear>
<bgf:production>
<nonterminal>ClassOrInterfaceDeclaration</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<nonterminal>ModifiersOpt</nonterminal>
<marked>
<bgf:expression>
<optional>
<bgf:expression>
<nonterminal>Modifiers</nonterminal>
</bgf:expression>
</optional>
</bgf:expression>
</marked>
</bgf:expression>
<bgf:expression>
<choice>
Expand All @@ -193,26 +220,29 @@
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:inject>
</xbgf:appear>

<!-- ISSUE EXTEND
- Fail: FormalParameter.
- [], ,([n(Type), n(VariableDeclaratorId)])
vs.
- [], ,([?(t(final)), n(Type), n(VariableDeclaratorId)])
-->
<!-- GENERALITY -->
<xbgf:inject>
<xbgf:appear>
<bgf:production>
<nonterminal>FormalParameter</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<optional>
<marked>
<bgf:expression>
<terminal>final</terminal>
<optional>
<bgf:expression>
<terminal>final</terminal>
</bgf:expression>
</optional>
</bgf:expression>
</optional>
</marked>
</bgf:expression>
<bgf:expression>
<nonterminal>Type</nonterminal>
Expand All @@ -223,8 +253,8 @@
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:inject>
</xbgf:appear>

<!--
- Fail: SwitchBlockStatementGroup.
- [], ,([n(SwitchLabels), n(BlockStatements)])
Expand All @@ -234,7 +264,7 @@
p([], 'SwitchLabels', ;([n('SwitchLabel'), ','([n('SwitchLabels'), n('SwitchLabel')])])),
-->
<xbgf:deyaccify>SwitchLabels</xbgf:deyaccify>

<!--
- Fail: ImportDeclaration.
- [], ;([n(SingleTypeImportDeclaration), n(TypeImportOnDemandDeclaration)])
Expand Down Expand Up @@ -358,7 +388,7 @@
-->
<xbgf:deyaccify>VariableInitializers</xbgf:deyaccify>
<xbgf:inline>VariableInitializers</xbgf:inline>

<!--
- Fail: ClassBody.
- [], ,([t({), ?(n(ClassBodyDeclarations)), t(})])
Expand Down Expand Up @@ -387,7 +417,7 @@
</star>
</bgf:expression>
</xbgf:massage>

<!--
- Fail: InterfaceBody.
- [], ,([t({), ?(n(InterfaceMemberDeclarations)), t(})])
Expand Down Expand Up @@ -422,7 +452,7 @@
<to>InterfaceBodyDeclaration</to>
</nonterminal>
</xbgf:rename>

<!--
- Fail: CompilationUnit.
- [], ,([?(n(PackageDeclaration)), ?(n(ImportDeclarations)), ?(n(TypeDeclarations))])
Expand Down Expand Up @@ -527,7 +557,7 @@
</star>
</bgf:expression>
</xbgf:massage>

<!--
- Fail: InterfaceBodyDeclaration.
- [], ;([,([n(ModifiersOpt), n(Type), n(VariableDeclarators), t((;))]),
Expand Down Expand Up @@ -743,7 +773,7 @@
</bgf:expression>
</bgf:production>
</xbgf:add>

<!--
- Fail: InterfaceMemberDecl.
- [], ;([,([n(Type), n(VariableDeclarators), t((;))]),
Expand All @@ -762,7 +792,7 @@
</xbgf:unfold>
<xbgf:deyaccify>MethodDeclarator</xbgf:deyaccify>
<xbgf:inline>MethodDeclarator</xbgf:inline>

<!--
- Fail: InterfaceMemberDecl.
- [], ;([,([n(Type), n(VariableDeclarator), *(,([t((,)), n(VariableDeclarator)])), t((;))]),
Expand Down Expand Up @@ -1093,7 +1123,7 @@
<nonterminal>InterfaceMemberDecl</nonterminal>
</in>
</xbgf:extract>

<!-- ISSUE EXTEND
- Fail: InterfaceMemberDecl.
- [], ;([n(InterfaceMethodOrFieldDecl), ,([t(void), n(Identifier), n(VoidInterfaceMethodDeclaratorRest)])])
Expand Down Expand Up @@ -1149,7 +1179,7 @@
<nonterminal>VoidInterfaceMethodDeclaratorRest</nonterminal>
</in>
</xbgf:fold>

<!-- ISSUE CORRECT
Fixing brutally

Expand Down Expand Up @@ -1608,7 +1638,53 @@
</bgf:expression>
</bgf:production>
</xbgf:designate>
<!-- BREFACTOR -->
<xbgf:disappear>
<bgf:production>
<label>target</label>
<nonterminal>ClassBodyDeclaration</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<nonterminal>ModifiersOpt</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>Type</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>Identifier</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>VariableDeclaratorRest</nonterminal>
</bgf:expression>
<bgf:expression>
<marked>
<bgf:expression>
<star>
<bgf:expression>
<sequence>
<bgf:expression>
<terminal>,</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>Identifier</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>VariableDeclaratorRest</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</star>
</bgf:expression>
</marked>
</bgf:expression>
<bgf:expression>
<terminal>;</terminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:disappear>
<!-- REVISE -->
<xbgf:project>
<bgf:production>
<label>target</label>
Expand All @@ -1627,13 +1703,20 @@
<bgf:expression>
<nonterminal>VariableDeclaratorRest</nonterminal>
</bgf:expression>
<bgf:expression>
<marked>
<bgf:expression>
<terminal>;</terminal>
</bgf:expression>
</marked>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:project>
<xbgf:strip>
<xbgf:unlabel>
<label>target</label>
</xbgf:strip>
</xbgf:unlabel>

<!--
- [], ,([n(ModifiersOpt), n(Type), n(Identifier), n(MethodDeclaratorRest)])
Expand Down
Loading

0 comments on commit 3e022b4

Please sign in to comment.