Permalink
Browse files

naming convention; proper grammar diffing for tests instead of pretty…

…-printing and text diffing

git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@902 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information...
grammarware committed Dec 10, 2010
1 parent 0276b47 commit 08c3f774dc0b4912e97c10f716e23c881b28c6fc
View
@@ -18,10 +18,10 @@ elif [ ! -r $1 ]; then
exit 1
else
# Build extractor if needed
cd ${LOCAL2}/../topics/extraction/antlr2bgf
cd ${LOCAL2}/../topics/extraction/antlr
make
cd ${LOCAL1}
rm -f $2
python ${LOCAL2}/../topics/extraction/antlr2bgf/antlrstrip.py ${LOCAL3}/`basename $1` $1.stripped
java -cp ${CLASSPATH}:${LOCAL2}/../download/antlrworks-1.1.7.jar:${LOCAL2}/../topics/extraction/antlr2bgf slps.antlr2bgf.Tool $1.stripped $2
python ${LOCAL2}/../topics/extraction/antlr/antlrstrip.py ${LOCAL3}/`basename $1` $1.stripped
java -cp ${CLASSPATH}:${LOCAL2}/../download/antlrworks-1.1.7.jar:${LOCAL2}/../topics/extraction/antlr slps.antlr2bgf.Tool $1.stripped $2
fi
@@ -9,8 +9,7 @@ build:
test:
make clean-tests
../../../shared/tools/antlr2bgf ${source} ${target}.bgf
../../../shared/tools/bgf2bnf ${target}.bgf ${target}.out
diff ${target}.out ${target}.baseline
../../../shared/tools/gdt ${target}.bgf ${target}.baseline
clean:
make clean-tests
@@ -0,0 +1,167 @@
<?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>
<nonterminal>function</nonterminal>
</bgf:expression>
</plus>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>function</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<nonterminal>ID</nonterminal>
</bgf:expression>
<bgf:expression>
<plus>
<bgf:expression>
<nonterminal>ID</nonterminal>
</bgf:expression>
</plus>
</bgf:expression>
<bgf:expression>
<terminal>=</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>expr</nonterminal>
</bgf:expression>
<bgf:expression>
<plus>
<bgf:expression>
<nonterminal>NEWLINE</nonterminal>
</bgf:expression>
</plus>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>expr</nonterminal>
<bgf:expression>
<choice>
<bgf:expression>
<nonterminal>binary</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>apply</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>ifThenElse</nonterminal>
</bgf:expression>
</choice>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>binary</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<nonterminal>atom</nonterminal>
</bgf:expression>
<bgf:expression>
<star>
<bgf:expression>
<sequence>
<bgf:expression>
<nonterminal>ops</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>atom</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</star>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>apply</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<nonterminal>ID</nonterminal>
</bgf:expression>
<bgf:expression>
<plus>
<bgf:expression>
<nonterminal>atom</nonterminal>
</bgf:expression>
</plus>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>ifThenElse</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<terminal>if</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>expr</nonterminal>
</bgf:expression>
<bgf:expression>
<terminal>then</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>expr</nonterminal>
</bgf:expression>
<bgf:expression>
<terminal>else</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>expr</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>atom</nonterminal>
<bgf:expression>
<choice>
<bgf:expression>
<nonterminal>ID</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>INT</nonterminal>
</bgf:expression>
<bgf:expression>
<sequence>
<bgf:expression>
<terminal>(</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>expr</nonterminal>
</bgf:expression>
<bgf:expression>
<terminal>)</terminal>
</bgf:expression>
</sequence>
</bgf:expression>
</choice>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>ops</nonterminal>
<bgf:expression>
<choice>
<bgf:expression>
<terminal>==</terminal>
</bgf:expression>
<bgf:expression>
<terminal>+</terminal>
</bgf:expression>
<bgf:expression>
<terminal>-</terminal>
</bgf:expression>
</choice>
</bgf:expression>
</bgf:production>
</bgf:grammar>

This file was deleted.

Oops, something went wrong.

0 comments on commit 08c3f77

Please sign in to comment.