trustme.sh 745 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
#!/bin/sh

# This script re-generates the reference files used by test.sh for comparison.
# One should call it only when one trusts that Menhir is currently working!

. ./config.sh

# Make sure Menhir and MenhirLib are up-to-date.
./build.sh

# Build the parser with the code back-end and run it.
12
echo "Building (code)..."
13 14
make clean >/dev/null
make MENHIR="$MENHIR --trace" >/dev/null
15 16
for f in *.real.in ; do
  b=${f%.in}
17
  echo "($b) Reconstructing reference output and trace..."
18 19
  ./calc < $f > $b.ref.out 2> $b.ref.err
done
20 21 22 23 24 25

# Run the reference interpreter.
echo "Running the reference interpreter..."
echo "INT PLUS INT TIMES INT PLUS INT EOL" | $MENHIR --trace --interpret parser.mly > interpret-ref.out 2> interpret-ref.err

echo "Done."