Skip to content

Commit

Permalink
refactoring and completing the test set (not done yet!)
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@448 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Feb 9, 2009
1 parent 06e1efc commit 35bef43
Show file tree
Hide file tree
Showing 35 changed files with 316 additions and 271 deletions.
102 changes: 7 additions & 95 deletions topics/transformation/xbgf/tests/Makefile
@@ -1,110 +1,22 @@
log =
redirect = >> $*.log 2>&1
tools = ../../../../shared/tools

build:
@cd ../apps/xbgf; make build

test:
ls -1 *.xbgf | xargs -n1 ./testperform

testfull:
make build
@make add1.quiet
@make add2.quiet
@make chain.quiet
@make define.quiet
@make designate.quiet
@make deyaccify1.quiet
@make deyaccify2.quiet
@make deyaccify3.quiet
@make deyaccify4.quiet
@make deyaccify5.quiet
@make deyaccify6.quiet
@make deyaccify7.quiet
@make deyaccify8.quiet
@make distribute1.quiet
@make eliminate.quiet
@make extract1.quiet
@make extract2.quiet
@make extract3.quiet
@make extract4.quiet
@make factor1.quiet
@make factor2.quiet
@make factor3.quiet
@make factor4.quiet
@make fold1.quiet
@make fold2.quiet
@make fold3.quiet
@make horizontal1.quiet
@make horizontal2.quiet
@make inject.quiet
@make inline.quiet
@make introduce.quiet
@make lassoc1.quiet
@make lassoc2.quiet
@make massage1.quiet
@make massage2.quiet
@make massage3.quiet
@make massage4.quiet
@make massage5.quiet
@make massage6.quiet
@make narrow1.quiet
@make narrow2.quiet
@make narrow3.quiet
@make permute.quiet
@make project.quiet
@make rassoc1.quiet
@make rassoc2.quiet
@make remove.quiet
@make rename1.quiet
@make rename2.quiet
@make rename3.quiet
@make rename4.quiet
@make rename5.quiet
@make replace1.quiet
@make replace2.quiet
@make replace3.quiet
@make replace4.quiet
@make replace5.quiet
@make reroot.quiet
@make abridge.quiet
@make strip1.quiet
@make strip2.quiet
@make strip3.quiet
@make strip4.quiet
@make strip5.quiet
@make unchain.quiet
@make undefine.quiet
@make unfold1.quiet
@make unfold2.quiet
@make unfold3.quiet
@make unfold4.quiet
@make unite.quiet
@make unterminalize.quiet
@make vertical1.quiet
@make vertical2.quiet
@make widen1.quiet
@make widen2.quiet
@make widen3.quiet
@make yaccify1.quiet
@make yaccify2.quiet
ls -1 *.xbgf | xargs -n1 ./testperformfull

rebuild:
make clean
make build
@cd ../apps/xbgf; make rebuild

%.test:
@echo [Test XBGF] $*
@rm -f $*.log
@touch $*.log
@${tools}/checkxml bgf $*.bgf ${log}
@${tools}/checkxml xbgf $*.xbgf ${log}
@${tools}/xbgf $*.xbgf $*.bgf $*.out ${log}
@${tools}/gdt $*.out $*.baseline ${log}
./testperform $*

%.quiet:
@make $*.test log="${redirect}"
@${tools}/showbgf $*.bgf ${redirect}
@${tools}/showxbgf $*.xbgf ${redirect}
@${tools}/showbgf $*.out ${redirect}
./testperformfull $*

clean:
rm -f *.out
Expand Down
20 changes: 20 additions & 0 deletions topics/transformation/xbgf/tests/abstractize.baseline
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>

<bgf:grammar xmlns:bgf="http://planet-sl.org/bgf">
<bgf:production>
<nonterminal>A</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<nonterminal>b</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>c</nonterminal>
</bgf:expression>
<bgf:expression>
<terminal>y</terminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</bgf:grammar>
23 changes: 23 additions & 0 deletions topics/transformation/xbgf/tests/abstractize.bgf
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>

<bgf:grammar xmlns:bgf="http://planet-sl.org/bgf">
<bgf:production>
<nonterminal>A</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<nonterminal>b</nonterminal>
</bgf:expression>
<bgf:expression>
<terminal>x</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>c</nonterminal>
</bgf:expression>
<bgf:expression>
<terminal>y</terminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</bgf:grammar>
Empty file.
30 changes: 30 additions & 0 deletions topics/transformation/xbgf/tests/abstractize.xbgf
@@ -0,0 +1,30 @@
<xbgf:sequence
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">

<xbgf:abstractize>
<bgf:production>
<nonterminal>A</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<nonterminal>b</nonterminal>
</bgf:expression>
<bgf:expression>
<marked>
<bgf:expression>
<terminal>x</terminal>
</bgf:expression>
</marked>
</bgf:expression>
<bgf:expression>
<nonterminal>c</nonterminal>
</bgf:expression>
<bgf:expression>
<terminal>y</terminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:abstractize>
</xbgf:sequence>
40 changes: 25 additions & 15 deletions topics/transformation/xbgf/tests/add2.baseline
@@ -1,17 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>

<xns1:grammar xmlns:xns1="http://planet-sl.org/bgf">
<xns1:production>
<bgf:grammar xmlns:bgf="http://planet-sl.org/bgf">
<bgf:production>
<nonterminal>expr</nonterminal>
<xns1:expression>
<choice>
<xns1:expression>
<nonterminal>int</nonterminal>
</xns1:expression>
<xns1:expression>
<nonterminal>id</nonterminal>
</xns1:expression>
</choice>
</xns1:expression>
</xns1:production>
</xns1:grammar>
<bgf:expression>
<sequence>
<bgf:expression>
<optional>
<bgf:expression>
<choice>
<bgf:expression>
<terminal>+</terminal>
</bgf:expression>
<bgf:expression>
<terminal>-</terminal>
</bgf:expression>
</choice>
</bgf:expression>
</optional>
</bgf:expression>
<bgf:expression>
<nonterminal>int</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</bgf:grammar>
16 changes: 14 additions & 2 deletions topics/transformation/xbgf/tests/add2.bgf
@@ -1,8 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<bgf:grammar xmlns:bgf="http://planet-sl.org/bgf">
<bgf:production>
<nonterminal>expr</nonterminal>
<bgf:expression>
<nonterminal>int</nonterminal>
<sequence>
<bgf:expression>
<optional>
<bgf:expression>
<terminal>-</terminal>
</bgf:expression>
</optional>
</bgf:expression>
<bgf:expression>
<nonterminal>int</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</bgf:grammar>
</bgf:grammar>
37 changes: 28 additions & 9 deletions topics/transformation/xbgf/tests/add2.xbgf
Expand Up @@ -2,14 +2,33 @@
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">
<xbgf:add>
<bgf:expression>
<nonterminal>id</nonterminal>
</bgf:expression>
<bgf:expression>
<nonterminal>int</nonterminal>
</bgf:expression>
<in>
<bgf:production>
<nonterminal>expr</nonterminal>
</in>
<bgf:expression>
<sequence>
<bgf:expression>
<optional>
<bgf:expression>
<choice>
<bgf:expression>
<marked>
<bgf:expression>
<terminal>+</terminal>
</bgf:expression>
</marked>
</bgf:expression>
<bgf:expression>
<terminal>-</terminal>
</bgf:expression>
</choice>
</bgf:expression>
</optional>
</bgf:expression>
<bgf:expression>
<nonterminal>int</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:add>
</xbgf:sequence>
</xbgf:sequence>
Expand Up @@ -5,19 +5,17 @@
<label>constant</label>
<nonterminal>expr</nonterminal>
<bgf:expression>
<selectable>
<selector>value</selector>
<bgf:expression>
<nonterminal>int</nonterminal>
</bgf:expression>
</selectable>
<nonterminal>int</nonterminal>
</bgf:expression>
</bgf:production>
<bgf:production>
<label>binary</label>
<nonterminal>expr</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<terminal>(</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>expr</nonterminal>
</bgf:expression>
Expand All @@ -32,6 +30,9 @@
<bgf:expression>
<nonterminal>expr</nonterminal>
</bgf:expression>
<bgf:expression>
<terminal>)</terminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
Expand All @@ -54,10 +55,4 @@
</sequence>
</bgf:expression>
</bgf:production>
<bgf:production>
<nonterminal>nonexpr</nonterminal>
<bgf:expression>
<terminal>test</terminal>
</bgf:expression>
</bgf:production>
</bgf:grammar>
Expand Up @@ -58,4 +58,4 @@
</sequence>
</bgf:expression>
</bgf:production>
</bgf:grammar>
</bgf:grammar>
13 changes: 13 additions & 0 deletions topics/transformation/xbgf/tests/anonymize.xbgf
@@ -0,0 +1,13 @@
<xbgf:sequence
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">
<xbgf:anonymize>
<bgf:production>
<label>constant</label>
<nonterminal>expr</nonterminal>
<bgf:expression>
<nonterminal>int</nonterminal>
</bgf:expression>
</bgf:production>
</xbgf:anonymize>
</xbgf:sequence>
File renamed without changes.
20 changes: 20 additions & 0 deletions topics/transformation/xbgf/tests/remove2.baseline
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<bgf:grammar xmlns:bgf="http://planet-sl.org/bgf">
<bgf:production>
<nonterminal>expr</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<optional>
<bgf:expression>
<terminal>-</terminal>
</bgf:expression>
</optional>
</bgf:expression>
<bgf:expression>
<nonterminal>int</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</bgf:grammar>

0 comments on commit 35bef43

Please sign in to comment.