* HACKING, Makefile.am, configure.ac, m4/gccwarn.m4,

src/Makefile.am, src/ltlast/Makefile.am, src/ltlast/allnodes.hh,
src/ltlast/atomic_prop.cc, src/ltlast/atomic_prop.hh,
src/ltlast/binop.cc, src/ltlast/binop.hh, src/ltlast/constant.cc,
src/ltlast/constant.hh, src/ltlast/formulae.hh,
src/ltlast/multop.cc, src/ltlast/multop.hh, src/ltlast/predecl.hh,
src/ltlast/unop.cc, src/ltlast/unop.hh, src/ltlast/visitor.hh,
src/ltlparse/Makefile.am, src/ltlparse/ltlparse.yy,
src/ltlparse/ltlscan.ll, src/ltlparse/parsedecl.hh,
src/ltlparse/public.hh, src/ltlvisit/Makefile.am,
src/ltlvisit/dotty.cc, src/ltlvisit/dotty.hh,
src/ltlvisit/dump.cc, src/ltlvisit/dump.hh,
src/ltlvisit/rewrite.cc, src/ltlvisit/rewrite.hh,
src/ltltest/Makefile.am, src/ltltest/defs.in, src/ltltest/readltl.cc,
src/ltltest/parse.test, src/ltltest/parseerr.test,
src/misc/Makefile.am, src/misc/const_sel.hh: New files.
This commit is contained in:
Alexandre Duret-Lutz 2003-04-15 10:55:16 +00:00
parent ababb9ff93
commit f0a8d0aeb3
46 changed files with 1818 additions and 0 deletions

47
src/ltltest/parseerr.test Executable file
View file

@ -0,0 +1,47 @@
#! /bin/sh
# Check error recovery in parsing. This also check how the
# resulting tree looks like.
. ./defs || exit 1
check()
{
if ./ltl2text "$1" >stdout; then
echo "ltl2text unexpectedly parsed '$1' successfully"
rm -f stdout
exit 1
else
if test -n "$2"; then
echo "$2" >expect
else
: >expect
fi
if cmp stdout expect; then
:
else
echo "'$1' parsed as"
cat stdout
echo "instead of"
cat expect
rm -f stdout expect
exit 1
fi
fi
}
# Empty or unparsable strings
check '' ''
check '+' ''
check 'a U' ''
check 'a U b V c R' ''
# leading and trailing garbage are skipped
check '/2/3/4/5 a + b /6/7/8/' 'multop(Or, AP(a), AP(b))'
check 'a U b c' 'binop(U, AP(a), AP(b))'
# Recovery inside parentheses
check 'a U (b c) U e R (f g <=> h)' \
'binop(R, binop(U, binop(U, AP(a), AP(b)), AP(e)), AP(f))'
check 'a U ((c) U e) R (<=> f g)' \
'binop(R, binop(U, AP(a), binop(U, AP(c), AP(e))), constant(0))'