Project

General

Profile

Download (1.6 KB) Statistics
| Branch: | Tag: | Revision:
1
(menhir
2
 (modules parser_lustre)
3
 (flags --explain))
4

    
5
;; The use of [--external-tokens Parser] is required for the two parsers
6
;; to share a single [token] type. This makes them usable with the same
7
;; lexer.
8
(menhir
9
 (modules parser_lustre)
10
 (merge_into parser_lustre_table)
11
 (flags --table --external-tokens Parser_lustre))
12

    
13
(ocamllex lexerLustreSpec lexer_lustre)
14

    
15
;; -----------------------------------------------------------------------------
16

    
17
;; This section deals with the .messages file.
18

    
19
;; The following rule generates "parser_lustre_messages.ml" based on the source file
20
;; "parser_lustre.messages". It requires the completeness check to have been
21
;; performed first. (If desired, this check could be disabled.)
22

    
23
(rule
24
 (deps parser_lustre.check)
25
 (action (with-stdout-to parser_lustre_messages.ml
26
          (run menhir
27
               %{dep:parser_lustre.mly}
28
               --compile-errors %{dep:parser_lustre.messages}))))
29

    
30
;; This rule generates a file "parser_lustre.auto.messages" that contains a
31
;; list of all error states. It is used by the completeness check.
32

    
33
(rule
34
 (with-stdout-to parser_lustre.auto.messages
35
  (run menhir %{dep:parser_lustre.mly} --list-errors)))
36

    
37
;; This rule implements the completeness check. It checks that every error
38
;; state listed in the auto-generated file "parserMessages.auto.messages"
39
;; is also listed in the file "parserMessages.messages" that is maintained
40
;; by the programmer.
41

    
42
(rule
43
 (with-stdout-to parser_lustre.check
44
  (run menhir
45
       %{dep:parser_lustre.mly}
46
       --compare-errors %{dep:parser_lustre.auto.messages}
47
       --compare-errors %{dep:parser_lustre.messages})))
(1-1/8)