Skip to content

Commit

Permalink
more statistics for XBGF
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@328 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Oct 7, 2008
1 parent aadfca2 commit 029322c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions shared/tools/xbgflc
Expand Up @@ -21,4 +21,6 @@ else
xpath $1 `cat ${SLPS}/topics/presentation/metrics/transformations.xpath` 2> /dev/null
/bin/echo -n "Total issues solved: "
cat $1 | grep -c "<\!--"
/bin/echo "XBGF commands statistics:"
galax-run ${SLPS}/topics/presentation/metrics/perxbgfcommand.xq -serialize wf -doc xsd=${SLPS}/shared/xsd/xbgf.xsd -doc xbgf=$1 -language dxq | grep -v "glx:result"
fi
11 changes: 11 additions & 0 deletions topics/presentation/metrics/Makefile
@@ -0,0 +1,11 @@
all:
make clean
make test

build:

test:
find ../../transformation/xbgf/tests/ -name "*.xbgf" | xargs -I {} -n1 galax-run perxbgfcommand.xq -serialize wf -doc xsd=../../../shared/xsd/xbgf.xsd -doc xbgf={} -language dxq | grep -v "glx:result"

clean:
rm -f *.bnf
19 changes: 19 additions & 0 deletions topics/presentation/metrics/perxbgfcommand.xq
@@ -0,0 +1,19 @@
declare default element namespace "xsd";
declare variable $xsd external;
declare variable $xbgf external;

declare function local:report($name,$nodes)
{
let $counter := count($nodes)
return
if ($counter != 0)
then ("
",data($name),data($counter))
else ""
};

let $schema := $xsd/*
for $command in $schema/*/@name
return
local:report($command,$xbgf/*[local-name()='sequence']/*[local-name()=$command]),"
"

0 comments on commit 029322c

Please sign in to comment.