hoaparse: fix parsing of LBTT with non 0-based states

* src/hoaparse/hoaparse.yy: Here.
* src/tgbatest/lbttparse.test: Add test cases.
* src/tgbatest/hoaparse.test: Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2015-02-02 18:48:33 +01:00
parent 08fbe27136
commit d7dc584992
3 changed files with 102 additions and 19 deletions

View file

@ -84,6 +84,7 @@ State: 1 {0}
-1
EOF
diff='different state numbers have been used'
expecterr input <<EOF
input:8.5: state number is larger than state count...
input:2.1-9: ... declared here.
@ -91,10 +92,7 @@ input:9.8: state number is larger than state count...
input:2.1-9: ... declared here.
input:10.5: state number is larger than state count...
input:2.1-9: ... declared here.
input:13.1: state number is larger than state count...
input:12.1: ... declared here.
input:18.1: state number is larger than state count...
input:12.1: ... declared here.
input:12.1-19.2: 2 states have been declared, but 3 $diff
EOF
cat >input <<EOF

View file

@ -100,6 +100,48 @@ cat >input <<EOF
-1 4 0 1 -1 4 ! p1
-1 5 0 1 -1 5 t
-1
/* this one show that state numbers do not always start from 0 */
1 1t
1 1
1 -1 !p0
1 0 -1 p0
-1
/* This is the output of 'lbt' on the formula 'U p0 p1', but with
states 1 and 2 changed to 100 and 200 */
4 1
0 1 -1
100 p0
200 p1
-1
100 0 -1
100 p0
200 p1
-1
200 0 0 -1
3 t
-1
3 0 0 -1
3 t
-1
/* This is the output of 'lbt' on the formula 'U p0 p1', but with
states 0 and 2 changed to 100 and 200. This make sure the renaming
also applies to the initial state.
*/
4 1
100 1 -1
1 p0
200 p1
-1
1 0 -1
1 p0
200 p1
-1
200 0 0 -1
3 t
-1
3 0 0 -1
3 t
-1
EOF
run 0 ../../bin/autfilt --stats '%s %t %e %a' input > output
@ -108,6 +150,9 @@ cat >expected<<EOF
4 16 6 1
1 0 0 3
6 20 9 1
1 2 2 1
4 16 6 1
4 16 6 1
EOF
diff output expected