gains.sh 1.76 KB
Newer Older
1 2
#!/bin/bash

Sylvain Schmitz's avatar
Sylvain Schmitz committed
3
echo '\begin{tabular}{lrrrr}'
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
echo '\toprule'
#echo '& \multicolumn{3}{c}{basic} & \multicolumn{3}{c}{advanced}\\'
echo '& basic & $\pi\mathbin\triangle\pi$ & $\last()$ & $\texttt{id}()$\\'
echo '\midrule'
# which XPath fragments to take into account
fragments=( `grep 'file=' ../../relaxng/fragments-full.xml | sed 's/.*file=\"\([\.a-zA-Z0-9\-]*.rnc\).*/\1/g'` )
names=( `grep 'nametex=' ../../relaxng/fragments-full.xml | sed 's/.*nametex=\"\([^\"]*\)\"/\1/g'` )

for ((f=0; f<${#fragments[@]}; ++f))
do
    fname=${names[f]}
    full=${fragments[f]}
    orig=$(echo $full | sed s/[a-z]*.rnc/orig.rnc/)
    basic=$(echo $full | sed s/[a-z]*.rnc/basic.rnc/)
    join=$(echo $full | sed s/[a-z]*.rnc/join.rnc/)
    last=$(echo $full | sed s/[a-z]*.rnc/last.rnc/)
    id=$(echo $full | sed s/[a-z]*.rnc/id.rnc/)
    
    printf "\\\\textsf{$fname} & "
    #printf '\multicolumn{3}{c}{'

    # basic
26
    ./diffs.sh $orig $basic `grep 'type="\(xslt\|xquery\)"' ../tex/benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'`
27 28 29 30 31 32 33
    #printf '} & '
    printf ' & '

    # join
    if [ -f ../../relaxng/$join ]
    then
        printf "+"
34
        ./diffs.sh $basic $join `grep 'type="\(xslt\|xquery\)"' ../tex/benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'`
35 36 37 38 39 40 41
    fi
    printf ' & '

    # last
    if [ -f ../../relaxng/$last ]
    then
        printf "+"
42
        ./diffs.sh $basic $last `grep 'type="\(xslt\|xquery\)"' ../tex/benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'`
43 44 45 46 47 48 49
    fi
    printf ' & '

    # id
    if [ -f ../../relaxng/$id ]
    then
        printf "+"
50
        ./diffs.sh $basic $id `grep 'type="\(xslt\|xquery\)"' ../tex/benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'`
51 52 53 54 55
    fi
    echo '\\'
done
echo '\bottomrule'
echo '\end{tabular}'