Skip to content

Commit

Permalink
enforcing naming convention; deleting obsolete directories ; adding a…
Browse files Browse the repository at this point in the history
… test case to the set

git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@906 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Dec 12, 2010
1 parent 1ed736c commit bff9b3c
Show file tree
Hide file tree
Showing 12 changed files with 481 additions and 83 deletions.
4 changes: 2 additions & 2 deletions shared/tools/java2bgf
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ else
cd $1
LOCAL3=${PWD}
# Build extractor if needed
cd ${LOCAL2}/../topics/extraction/java2bgf/slps/java2bgf
cd ${LOCAL2}/../topics/extraction/java/slps/java2bgf
javac *.java
cd ${LOCAL1}
rm -f $3
java -cp ${CLASSPATH}:${LOCAL2}/../topics/extraction/java2bgf:${LOCAL3} slps.java2bgf.Tool $*
java -cp ${CLASSPATH}:${LOCAL2}/../topics/extraction/java:${LOCAL3} slps.java2bgf.Tool $*
fi
27 changes: 12 additions & 15 deletions topics/extraction/Makefile
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
build:
cd antlr2bgf; make build
cd asfix2btf; make build
cd dcg2bgf; make build
cd antlr; make build
cd asfix; make build
cd dcg; make build
cd java2bgf; make build
cd ldf2bgf; make build
cd ldf2pdf; make build
cd sdf2bgf; make build
cd xml2btf; make build
cd xsd2bgf; make build
cd xsd2ldf; make build
cd xsd; make build

test:
cd antlr2bgf; make test
cd asfix2btf; make test
cd dcg2bgf; make test
cd antlr; make test
cd asfix; make test
cd dcg; make test
cd java2bgf; make test
cd ldf2bgf; make test
cd ldf2pdf; make test
cd sdf2bgf; make test
cd xml2btf; make test
cd xsd2bgf; make test
cd xsd2ldf; make test
cd xsd; make test

clean:
cd antlr2bgf; make clean
cd asfix2btf; make clean
cd dcg2bgf; make clean
cd antlr; make clean
cd asfix; make clean
cd dcg; make clean
cd java2bgf; make clean
cd ldf2bgf; make clean
cd ldf2pdf; make clean
cd sdf2bgf; make clean
cd xml2btf; make clean
cd xsd2bgf; make clean
cd xsd2ldf; make clean
cd xsd; make clean
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions topics/extraction/java/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
build:
cd slps/java2bgf; javac *.java

test:
./testperform ../../fl/java1 types
./testperform ../../fl/java3 fl

clean:
rm -f *~ tests/*.bgf slps/java2bgf/*.class
File renamed without changes.
6 changes: 6 additions & 0 deletions topics/extraction/java/testperform
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

echo [Test Case] $1 $2
../../../shared/tools/java2bgf $1 $2 `basename $1`.bgf || exit -1
../../../shared/tools/validate bgf `basename $1`.bgf || exit -1
../../../shared/tools/gdt `basename $1`.bgf tests/`basename $1`.baseline || exit -1
223 changes: 223 additions & 0 deletions topics/extraction/java/tests/java1.baseline
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
<?xml version="1.0" encoding="UTF-8"?>
<bgf:grammar xmlns:bgf="http://planet-sl.org/bgf">
<bgf:production>
<nonterminal>Apply</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<selectable>
<selector>name</selector>
<bgf:expression>
<value>string</value>
</bgf:expression>
</selectable>
</bgf:expression>
<bgf:expression>
<selectable>
<selector>args</selector>
<bgf:expression>
<star>
<bgf:expression>
<any/>
</bgf:expression>
</star>
</bgf:expression>
</selectable>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>Argument</nonterminal>
<bgf:expression>
<selectable>
<selector>name</selector>
<bgf:expression>
<value>string</value>
</bgf:expression>
</selectable>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>Binary</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<selectable>
<selector>ops</selector>
<bgf:expression>
<nonterminal>Ops</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
<bgf:expression>
<selectable>
<selector>left</selector>
<bgf:expression>
<nonterminal>Expr</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
<bgf:expression>
<selectable>
<selector>right</selector>
<bgf:expression>
<nonterminal>Expr</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>Expr</nonterminal>
<bgf:expression>
<choice>
<bgf:expression>
<nonterminal>Apply</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>Argument</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>Binary</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>IfThenElse</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>Literal</nonterminal>
</bgf:expression>
</choice>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>Function</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<selectable>
<selector>name</selector>
<bgf:expression>
<value>string</value>
</bgf:expression>
</selectable>
</bgf:expression>
<bgf:expression>
<selectable>
<selector>args</selector>
<bgf:expression>
<star>
<bgf:expression>
<any/>
</bgf:expression>
</star>
</bgf:expression>
</selectable>
</bgf:expression>
<bgf:expression>
<selectable>
<selector>rhs</selector>
<bgf:expression>
<nonterminal>Expr</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>IfThenElse</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<selectable>
<selector>ifExpr</selector>
<bgf:expression>
<nonterminal>Expr</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
<bgf:expression>
<selectable>
<selector>thenExpr</selector>
<bgf:expression>
<nonterminal>Expr</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
<bgf:expression>
<selectable>
<selector>elseExpr</selector>
<bgf:expression>
<nonterminal>Expr</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>Literal</nonterminal>
<bgf:expression>
<selectable>
<selector>info</selector>
<bgf:expression>
<value>int</value>
</bgf:expression>
</selectable>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>Ops</nonterminal>
<bgf:expression>
<choice>
<bgf:expression>
<selectable>
<selector>Equal</selector>
<bgf:expression>
<epsilon/>
</bgf:expression>
</selectable>
</bgf:expression>
<bgf:expression>
<selectable>
<selector>Plus</selector>
<bgf:expression>
<epsilon/>
</bgf:expression>
</selectable>
</bgf:expression>
<bgf:expression>
<selectable>
<selector>Minus</selector>
<bgf:expression>
<epsilon/>
</bgf:expression>
</selectable>
</bgf:expression>
</choice>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>Program</nonterminal>
<bgf:expression>
<selectable>
<selector>functions</selector>
<bgf:expression>
<star>
<bgf:expression>
<any/>
</bgf:expression>
</star>
</bgf:expression>
</selectable>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>Visitor</nonterminal>
<bgf:expression>
<empty/>
</bgf:expression>
</bgf:production>
</bgf:grammar>
Loading

0 comments on commit bff9b3c

Please sign in to comment.