Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
POTTIER Francois
menhir
Commits
5f3f814d
Commit
5f3f814d
authored
Nov 03, 2015
by
POTTIER Francois
Browse files
Also build using menhir --table.
parent
77bfdc1d
Changes
2
Show whitespace changes
Inline
Side-by-side
quicktest/positions/.gitignore
View file @
5f3f814d
_menhir
_ocamlyacc
_menhir
_menhir_table
*.log
quicktest/positions/Makefile
View file @
5f3f814d
...
...
@@ -5,7 +5,7 @@ ifndef MENHIR
MENHIR
:=
$(
shell
../../demos/find-menhir.sh
)
endif
MENHIRFLAGS
:=
--infer
-v
MENHIRFLAGS
:=
--infer
-v
--fixed-exception
OCAMLBUILD
:=
ocamlbuild
-use-ocamlfind
MAIN
:=
calc
...
...
@@ -13,29 +13,43 @@ all:
@
$(OCAMLBUILD)
-build-dir
_ocamlyacc
$(MAIN)
.native
@
$(OCAMLBUILD)
-build-dir
_menhir
-tag
fancy
$(MAIN)
.native
\
-use-menhir
-menhir
"
$(MENHIR)
$(MENHIRFLAGS)
"
@
$(OCAMLBUILD)
-build-dir
_menhir_table
-tag
fancy
$(MAIN)
.native
\
-use-menhir
-menhir
"
$(MENHIR)
$(MENHIRFLAGS)
--table"
-package
menhirLib
clean
:
@
rm
-f
*
~ .
*
~
@
$(OCAMLBUILD)
-build-dir
_ocamlyacc
-clean
@
$(OCAMLBUILD)
-build-dir
_menhir
-clean
@
$(OCAMLBUILD)
-build-dir
_menhir_table
-clean
_ocamlyacc/%.out
:
%.in
_ocamlyacc/
$(MAIN)
.native <
$<
>
$@
_menhir/%.out
:
%.in
_menhir/
$(MAIN)
.native <
$<
>
$@
# We try every input file whose name matches *.in.
# We parse it using each of the three parsers,
# and compare the results pairwise.
test
:
all
@
for
f
in
*
.in
;
do
\
out
=
$
${
f
%*.in
}
.out
;
\
log
=
$
${
f
%*.in
}
.log
;
\
for
target
in
_ocamlyacc _menhir
;
do
\
for
target
in
_ocamlyacc _menhir
_menhir_table
;
do
\
$$
target/
$(MAIN)
.native <
$$
f
>
$$
target/
$$
out
;
\
done
;
\
if
diff _ocamlyacc/
$$
out _menhir/
$$
out
>
$$
log
;
then
\
echo
"OK
$$
f"
;
\
echo
"ocamlyacc versus menhir(code):
$$
f: OK"
;
\
else
\
echo
"ocamlyacc versus menhir(code):
$$
f: FAILURE"
;
\
cat
$$
log
;
\
fi
;
\
if
diff _ocamlyacc/
$$
out _menhir_table/
$$
out
>
$$
log
;
then
\
echo
"ocamlyacc versus menhir(table):
$$
f: OK"
;
\
else
\
echo
"FAILURE
$$
f"
;
\
echo
"ocamlyacc versus menhir(table):
$$
f: FAILURE"
;
\
cat
$$
log
;
\
fi
;
\
if
diff _menhir/
$$
out _menhir_table/
$$
out
>
$$
log
;
then
\
echo
"menhir(code) versus menhir(table):
$$
f: OK"
;
\
else
\
echo
"menhir(code) versus menhir(table):
$$
f: FAILURE"
;
\
cat
$$
log
;
\
fi
;
\
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment