;; ------------------------------------------------------------------------------
;; The following declarations are used to build this demo.

(ocamllex
  (modules lexer)
)

(menhir
  (modules parser)
  (flags --table --unparsing)
)

;; When --table is used, menhirLib must be linked.
;; When --unparsing is used, menhirCST must be linked.
(executable
  (name calc)
  (libraries menhirLib menhirCST vendored_pprint)
)

;; ------------------------------------------------------------------------------
;; The following declarations are used to test this demo.

;; test00

(rule
  (with-stdout-to test00.out
  (with-stdin-from test00.in
    (run ./calc.exe)
  ))
)

(rule
  (alias test)
  (action (diff test00.exp test00.out))
)

;; test01

(rule
  (with-stdout-to test01.out
  (with-stdin-from test01.in
    (run ./calc.exe)
  ))
)

(rule
  (alias test)
  (action (diff test01.exp test01.out))
)

;; test02

(rule
  (with-stdout-to test02.out
  (with-stdin-from test02.in
    (run ./calc.exe)
  ))
)

(rule
  (alias test)
  (action (diff test02.exp test02.out))
)

;; ------------------------------------------------------------------------------
;; The following declarations are not part of the demo.
;; They are used to test Menhir itself.
;; Any change in the code generated by Menhir's code back-end is detected here.

(rule
  (alias test)
  (action (diff parser.ml.exp parser.ml))
)

(rule
  (alias test)
  (action (diff parser.mli.exp parser.mli))
)
