;; -----------------------------------------------------------------------------

;; We copy most files from a neighbor directory.

(copy_files# ../calc-unparsing/{PPrint,AST,Eval,lexer,CST2String,CST2Document,calc}.ml)
(copy_files# ../calc-unparsing/Document.{ml,mli})

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

(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))
)
