Skip to content

Commit

Permalink
the original JLS convergence study, for the sake of archiving
Browse files Browse the repository at this point in the history
  • Loading branch information
grammarware committed May 17, 2012
1 parent b3c0576 commit c641b99
Show file tree
Hide file tree
Showing 77 changed files with 28,357 additions and 4 deletions.
12 changes: 8 additions & 4 deletions topics/convergence/exbgf/java/README.txt
@@ -1,6 +1,10 @@
The current version of the Java Language Specification grammar convergence case study heavily employs EXBGF.
In order to view the old JLS case study with XBGF (published at SCAM'09 and in SQJ), check out revision 1170.
The version of the Java Language Specification grammar convergence case study
that is found in this directory, heavily employs EXBGF.

EXBGF is Extended XBGF, it is a vertical DSL defined on top of XBGF that allows to specify grammar transformation steps in bigger and cleaner steps, thus boosting the productivity of a grammar engineer.
In order to view the old JLS case study with pure XBGF, go to ../../exbgf/java/

-- VVZ, http://grammarware.net
EXBGF is Extended XBGF, it is a vertical DSL defined on top of XBGF that allows
to specify grammar transformation steps in bigger and cleaner steps, thus
boosting the productivity of a grammar engineer.

-- VVZ, http://grammarware.net
3 changes: 3 additions & 0 deletions topics/convergence/xbgf/java/.gitignore
@@ -0,0 +1,3 @@
TMP-res
architecture_*
*.log
28 changes: 28 additions & 0 deletions topics/convergence/xbgf/java/Makefile
@@ -0,0 +1,28 @@
tools = ../../../../shared/tools
validator = ${tools}/validate

build:

test:
${tools}/lci java.lcf architecture

check:
${validator} lcf java.lcf
ls -1 xbgf/*.xbgf | xargs -n1 ${validator} xbgf
ls -1 bgf/*.bgf | xargs -n1 ${validator} bgf

debug:
${tools}/bgf2bnf snapshot/impl1.bgf 1.bnf
${tools}/bgf2bnf snapshot/impl2.bgf 2.bnf
${tools}/bgf2bnf snapshot/impl3.bgf 3.bnf
${tools}/bgf2bnf snapshot/read1.bgf q.bnf
${tools}/bgf2bnf snapshot/read2.bgf w.bnf
${tools}/bgf2bnf snapshot/read3.bgf e.bnf

clean:
rm -f *~
rm -f bgf/*
rm -rf bin obj
rm -f *.user *.suo
rm -f architecture*
rm -f java.log
9 changes: 9 additions & 0 deletions topics/convergence/xbgf/java/README.txt
@@ -0,0 +1,9 @@
The version of the Java Language Specification grammar convergence case study
that is found in this directory, is based on pure XBGF.
This is the way it was done originally and published
at SCAM'09, CoRR abs/1107.4661 and SQJ 19(2)

To find the same files at the old Sourceforge repository of SLPS, check out revision 1170.
To find the same case study replicated in Extended XBGF, go to ../../exbgf/java/

-- VVZ, http://grammarware.net
1 change: 1 addition & 0 deletions topics/convergence/xbgf/java/bgf/.gitignore
@@ -0,0 +1 @@
*.bgf
289 changes: 289 additions & 0 deletions topics/convergence/xbgf/java/java.lcf
@@ -0,0 +1,289 @@
<?xml version="1.0" encoding="utf-8"?>
<lcf:configuration xmlns:lcf="http://planet-sl.org/lcf">
<shortcut>
<name>grammars</name>
<expansion>../../../grammars</expansion>
</shortcut>
<shortcut>
<name>tools</name>
<expansion>
../../../../shared/tools
</expansion>
</shortcut>
<tools>
<transformer>
<grammar><expand>tools</expand>/xbgf</grammar>
</transformer>
<comparator>
<grammar><expand>tools</expand>/gdt</grammar>
</comparator>
<!--
<validator>
<grammar><expand>tools</expand>/validate bgf</grammar>
</validator>
-->
</tools>
<source>
<name>impl1</name>
<grammar>
<extraction><expand>tools</expand>/html2bgf <expand>grammars</expand>/java-1/jls-impl/syntax.kw <expand>grammars</expand>/java-1/jls-impl/src.htm
</extraction>
</grammar>
</source>
<source>
<name>read1</name>
<grammar>
<extraction><expand>tools</expand>/html2bgf <expand>grammars</expand>/java-1/jls-read/collect.kw <expand>grammars</expand>/java-1/jls-read/src.htm
</extraction>
</grammar>
</source>
<source>
<name>impl2</name>
<grammar>
<extraction><expand>tools</expand>/html2bgf <expand>grammars</expand>/java-2/jls-impl/src.htm
</extraction>
</grammar>
</source>
<source>
<name>read2</name>
<grammar>
<extraction><expand>tools</expand>/html2bgf <expand>grammars</expand>/java-2/jls-read/collect.kw <expand>grammars</expand>/java-2/jls-read/src.htm
</extraction>
</grammar>
</source>
<source>
<name>impl3</name>
<grammar>
<extraction><expand>tools</expand>/html2bgf <expand>grammars</expand>/java-5/jls-impl/src.htm
</extraction>
</grammar>
</source>
<source>
<name>read3</name>
<grammar>
<extraction><expand>tools</expand>/html2bgf <expand>grammars</expand>/java-5/jls-read/collect.kw <expand>grammars</expand>/java-5/jls-read/src.htm
</extraction>
</grammar>
</source>
<target>
<name>jls1</name>
<branch>
<input>impl1</input>
<preparation>
<perform>correct-impl1</perform>
</preparation>
<nominal-matching>
<perform>rename-impl1</perform>
</nominal-matching>
<structural-matching>
<perform>refactor-impl1</perform>
</structural-matching>
</branch>
<branch>
<input>read1</input>
<preparation>
<perform>correct-read1</perform>
</preparation>
<nominal-matching>
<perform>rename-read1</perform>
</nominal-matching>
<structural-matching>
<perform>generalizeModifiers-read1</perform>
<perform>generalizeNames-read1</perform>
<perform>refactor-read1</perform>
</structural-matching>
</branch>
</target>
<target>
<name>jls2</name>
<branch>
<input>impl2</input>
<preparation>
<perform>correct-impl2</perform>
</preparation>
<structural-matching>
<perform>refactor-impl2</perform>
</structural-matching>
<relaxation>
<perform>generalizeLabels</perform>
<perform>generalizeBlock</perform>
</relaxation>
</branch>
<branch>
<input>read2</input>
<preparation>
<perform>recover-read2</perform>
<perform>correct-read2</perform>
</preparation>
<nominal-matching>
<perform>rename-read2</perform>
</nominal-matching>
<structural-matching>
<perform>deyaccifyModifiers-read2</perform>
<perform>generalizeModifiers-read2</perform>
<!-- should be moved to relaxation!!! -->
<perform>generalizeNames</perform>
<perform>deyaccifyStatements</perform>
<perform>refactorTypes-read2</perform>
<perform>refactorExpressions</perform>
<perform>inlineStatements</perform>
<perform>generalizeStatements</perform>
<perform>editExpressions-read2</perform>
<perform>eliminate-read2</perform>
<perform>refactorClasses-read2</perform>
<perform>refactorInterfaces-read2</perform>
<perform>refactorDeclarations-read2</perform>
<perform>refactorMinorMismatches</perform>
</structural-matching>
<relaxation>
<perform>edit-read2</perform>
</relaxation>
</branch>
</target>
<target>
<name>jls3</name>
<branch>
<input>impl3</input>
<preparation>
<perform>recover-impl3</perform>
<perform>correct-impl3</perform>
</preparation>
<nominal-matching>
<perform>extract-impl3</perform>
</nominal-matching>
<structural-matching>
<perform>refactor-impl3</perform>
</structural-matching>
<relaxation>
<perform>generalizeLabels</perform>
<perform>generalizeBlock</perform>
<perform>generalize-impl3</perform>
</relaxation>
</branch>
<branch>
<input>read3</input>
<preparation>
<perform>recover-read3</perform>
<perform>correct-read3</perform>
</preparation>
<nominal-matching>
<perform>rename-read3</perform>
</nominal-matching>
<structural-matching>
<perform>deyaccifyStatements</perform>
<perform>inlineForStatement</perform>
<perform>inlineStatements</perform>
<perform>refactorStatements-read3</perform>
<perform>refactorClasses-read3</perform>
<perform>refactorEnums</perform>
</structural-matching>
<relaxation>
<perform>generalizeModifiers-read3</perform>
<perform>relaxClasses-read3</perform>
<perform>generalizeNames</perform>
<perform>refactorTypes-read3</perform>
<perform>generalizeStatements</perform>
<perform>refactorInterfaces-read3</perform>
<perform>refactorDeclarations-read3</perform>
<perform>relaxExpressions-read3</perform>
<perform>editExpressions-read3</perform>
<perform>edit-read3</perform>
</relaxation>
</branch>
</target>
<target>
<name>jls12</name>
<branch>
<input>jls1</input>
<nominal-matching>
<perform>rename-jls1</perform>
</nominal-matching>
<structural-matching>
<perform>refactorStatements-jls1</perform>
<perform>generalizeStatements</perform>
<perform>refactorTypes-jls1</perform>
<perform>editDeclarations</perform>
<perform>refactorExpressions</perform>
<perform>refactorMinorMismatches</perform>
</structural-matching>
<relaxation>
<perform>editExpressions-jls1</perform>
</relaxation>
<extension>
<perform>extend-jls1</perform>
</extension>
</branch>
<branch>
<input>jls2</input>
</branch>
</target>
<target>
<name>jls123</name>
<branch>
<input>jls12</input>
<nominal-matching>
<perform>rename-jls12</perform>
</nominal-matching>
<extension>
<perform>extendDeclarations</perform>
<perform>extendWithAnnotations</perform>
<perform>extendClassDeclarations</perform>
<perform>extendInterfaceDeclarations</perform>
<perform>extendWithTypeArguments</perform>
<perform>extendExpressions</perform>
<perform>extendStatements</perform>
</extension>
</branch>
<branch>
<input>jls3</input>
</branch>
</target>
<target>
<name>read12</name>
<branch>
<input>read1</input>
<preparation>
<perform>correct-read1</perform>
</preparation>
<structural-matching>
<perform>edit-read1</perform>
</structural-matching>
<extension>
<perform>extend-read1</perform>
</extension>
</branch>
<branch>
<input>read2</input>
<preparation>
<perform>recover-read2</perform>
<perform>correct-read2</perform>
</preparation>
<structural-matching>
<perform>refactorPackageNames</perform>
</structural-matching>
</branch>
</target>
<target>
<name>read123</name>
<branch>
<input>read12</input>
<nominal-matching>
<perform>rename-read12</perform>
</nominal-matching>
<extension>
<perform>extendModifiers</perform>
<perform>extend-read12</perform>
</extension>
</branch>
<branch>
<input>read3</input>
<preparation>
<perform>recover-read3</perform>
<perform>correct-read3</perform>
</preparation>
<structural-matching>
<perform>refactorPackageNames</perform>
</structural-matching>
</branch>
</target>
</lcf:configuration>
1 change: 1 addition & 0 deletions topics/convergence/xbgf/java/snapshot/.gitignore
@@ -0,0 +1 @@
*.bgf
14 changes: 14 additions & 0 deletions topics/convergence/xbgf/java/xbgf/correct-impl1.xbgf
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<xbgf:sequence
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">

<!-- in the extracted version root is undefined -->
<xbgf:reroot>
<root>CompilationUnit</root>
</xbgf:reroot>

<!-- not used in other versions -->
<xbgf:eliminate><nonterminal>Goal</nonterminal></xbgf:eliminate>

</xbgf:sequence>

0 comments on commit c641b99

Please sign in to comment.