(ocamllex
  (modules lexer)
)

(menhir
  (modules parser)
  (flags -la 2 -O 2)
)

(executable
  (name calc)
)

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

(rule
  (alias test)
  (action (diff calc.exp calc.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))
)
