Permalink
Browse files

enforcing the naming convention; Ecore test set baselines are stored …

…in BGF and not in BNF now

git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@905 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information...
grammarware committed Dec 12, 2010
1 parent c24c3bc commit 1ed736c4179099ab2cce336224b2e310e8c8396b
View
@@ -11,9 +11,9 @@ if [ ! -r $1 ]; then
exit 1
elif [ $# -eq 2 ]; then
rm -f $2
xsltproc ${SLPS}/shared/xsl/ecore2bgf.xslt $1 > $2
xsltproc ${SLPS}/topics/extraction/ecore/ecore2bgf.xslt $1 > $2
elif [ $# -eq 1 ]; then
xsltproc ${SLPS}/shared/xsl/ecore2bgf.xslt $1 > ${LOCAL}/`basename $1 .ecore`.bgf
xsltproc ${SLPS}/topics/extraction/ecore/ecore2bgf.xslt $1 > ${LOCAL}/`basename $1 .ecore`.bgf
else
echo "This tool extracts a BGF grammar from an Ecore model"
echo "Usage: ecore2bgf <ecore-model> [<output-grammar>]"
@@ -7,10 +7,8 @@ test:
make clean
../../../shared/tools/ecore2bgf ${source1} ${target1}.bgf
../../../shared/tools/ecore2bgf ${source2} ${target2}.bgf
../../../shared/tools/bgf2bnf ${target1}.bgf ${target1}.out
../../../shared/tools/bgf2bnf ${target2}.bgf ${target2}.out
diff ${target1}.out ${target1}.baseline
diff ${target2}.out ${target2}.baseline
../../../shared/tools/gdt ${target1}.bgf ${target1}.baseline
../../../shared/tools/gdt ${target2}.bgf ${target2}.baseline
clean:
rm -f *.bgf *.out
rm -f *.bgf *~
File renamed without changes.
@@ -0,0 +1,251 @@
<?xml version="1.0" encoding="UTF-8"?>
<bgf:grammar xmlns:bgf="http://planet-sl.org/bgf">
<bgf:production>
<nonterminal>Program</nonterminal>
<bgf:expression>
<plus>
<bgf:expression>
<selectable>
<selector>function</selector>
<bgf:expression>
<nonterminal>Function</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
</plus>
</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>
<plus>
<bgf:expression>
<selectable>
<selector>argument</selector>
<bgf:expression>
<nonterminal>Argument</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
</plus>
</bgf:expression>
<bgf:expression>
<selectable>
<selector>definition</selector>
<bgf:expression>
<nonterminal>Exp</nonterminal>
</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>Exp</nonterminal>
<bgf:expression>
<choice>
<bgf:expression>
<nonterminal>LiteralExp</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>ArgumentExp</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>IfThenElseExp</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>ApplyExp</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>BinaryExp</nonterminal>
</bgf:expression>
</choice>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>LiteralExp</nonterminal>
<bgf:expression>
<selectable>
<selector>value</selector>
<bgf:expression>
<value>int</value>
</bgf:expression>
</selectable>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>ArgumentExp</nonterminal>
<bgf:expression>
<selectable>
<selector>argument</selector>
<bgf:expression>
<nonterminal>Argument</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>IfThenElseExp</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<selectable>
<selector>if</selector>
<bgf:expression>
<nonterminal>Exp</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
<bgf:expression>
<selectable>
<selector>then</selector>
<bgf:expression>
<nonterminal>Exp</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
<bgf:expression>
<selectable>
<selector>else</selector>
<bgf:expression>
<nonterminal>Exp</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>ApplyExp</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<selectable>
<selector>function</selector>
<bgf:expression>
<nonterminal>Function</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
<bgf:expression>
<plus>
<bgf:expression>
<selectable>
<selector>argument</selector>
<bgf:expression>
<nonterminal>Exp</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
</plus>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>BinaryExp</nonterminal>
<bgf:expression>
<choice>
<bgf:expression>
<nonterminal>PlusExp</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>MinusExp</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>EqualExp</nonterminal>
</bgf:expression>
</choice>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>PlusExp</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<selectable>
<selector>left</selector>
<bgf:expression>
<nonterminal>Exp</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
<bgf:expression>
<selectable>
<selector>right</selector>
<bgf:expression>
<nonterminal>Exp</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>MinusExp</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<selectable>
<selector>left</selector>
<bgf:expression>
<nonterminal>Exp</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
<bgf:expression>
<selectable>
<selector>right</selector>
<bgf:expression>
<nonterminal>Exp</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>EqualExp</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<selectable>
<selector>left</selector>
<bgf:expression>
<nonterminal>Exp</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
<bgf:expression>
<selectable>
<selector>right</selector>
<bgf:expression>
<nonterminal>Exp</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</bgf:grammar>
Oops, something went wrong.

0 comments on commit 1ed736c

Please sign in to comment.