dune 2.62 KB
Newer Older
1 2
;; -*-lisp-*-

3 4 5
(ocamllex data_lexer term_lexer)

(menhir
6
 (flags (--explain --table))
7
 (modules term_parser_test))
8 9 10

(menhir
 (merge_into data_parser)
11
 (flags (--explain --table --strict))
12
 (modules file_parser sig_parser lex_parser term_type_parser bound_term_parser))
13

14 15 16 17 18 19
;; Rule to generate the messages ml file
(rule
 (targets messages.ml)
 (mode promote)
 (deps
  (alias update)
20
  (alias check_all_messages)
21
  (:message_file data_parser.messages)
22
  (:parsers file_parser.mly lex_parser.mly sig_parser.mly term_type_parser.mly bound_term_parser.mly)
23 24
  )
 (action
25
  (with-stdout-to messages.ml (run menhir --base data_parser --compile-errors %{message_file} %{parsers})))
26 27 28 29 30
 )

;; Rule to generate the automatic message file
(rule
 (targets data_parser.messages.automatic)
31
 (deps (:parsers file_parser.mly lex_parser.mly sig_parser.mly term_type_parser.mly bound_term_parser.mly))
32
 (action
33
  (with-stdout-to data_parser.messages.automatic (run menhir --base data_parser --list-errors %{parsers})))
34 35
 )

POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
36 37
;; Rule to generate the message file by updating previously existing
;; message file
38 39
(rule
 (targets data_parser.messages.new)
40
 (deps (:parsers file_parser.mly lex_parser.mly sig_parser.mly term_type_parser.mly bound_term_parser.mly))
41
 (action (with-stdout-to data_parser.messages.new (run menhir --base data_parser --update-errors data_parser.messages %{parsers}))
42 43 44
  )
 )

POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
45 46
;; alias to check whether automatic new messages have been generated
;; after updating the grammar
47 48
(alias
 (name update)
49
 (enabled_if (= %{profile} dev))
50 51 52
 (action (diff data_parser.messages data_parser.messages.new))
 )

POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
53 54 55
;; alias to check that all the messages in data_parser.messages
;; containts all the error listed in data_parser.messages.automatic
;; which is complete (generated by --list-errors)
56
(alias
57
 (name check_all_messages)
58 59 60
 (deps
  data_parser.messages.automatic
  data_parser.messages
61
  (:parsers file_parser.mly lex_parser.mly sig_parser.mly term_type_parser.mly bound_term_parser.mly)
62
  )
63
 (action (run menhir --base data_parser --compare-errors data_parser.messages.automatic --compare-errors data_parser.messages %{parsers}))
64 65
 )

66 67 68 69
;; This stanza declares the Grammar library
(library
 (name grammars)
  (flags (:standard -w -58))
70
  (modules (:standard \ acgc interactive term_test entry))
71 72
  (libraries
   menhirLib
73 74 75 76 77 78 79 80 81 82 83 84
   logic
   acgData
   )
  )

;; This declares the acgc executable implemented by acgc.ml
(executable
 (name acgc)
 (public_name acgc)
 (package acgtk)
 (modules acgc)
 (libraries
85 86
  logs
  fmt.tty
87 88
  cmdliner
  
89 90 91 92 93
  logic
  acgData
  grammars
  ))

94 95 96 97 98 99 100 101 102 103
(test
 (name term_test)
 (modules term_test)
 (libraries
  menhirLib
  utilsLib
  grammars)
 )


104 105

(documentation (package acgtkLib))