1MENHIR(1) General Commands Manual MENHIR(1)
2
3
4
6 menhir - an LR(1) parser generator for OCaml
7
8
10 menhir [options] files
11
13 menhir is an LR(1) parser generator for the OCaml programming language.
14 That is, Menhir compiles LR(1) grammar specifications down to OCaml
15 code. It is mostly compatible with ocamlyacc(1).
16
17
19 -h, --help
20 Show summary of options.
21
22 -b, --base basename
23 Specifies a base name for the output file(s).
24
25 --canonical
26 Construct a canonical Knuth LR(1) automaton.
27
28 --cmly Write the grammar and automaton to basename.cmly.
29
30 --comment
31 Include comments in the generated code.
32
33 --compare-errors file1 --compare-errors file2
34 Compare two .messages files.
35
36 --compile-errors file
37 Compile a .messages file to OCaml code.
38
39 --coq Generate a formally verified parser, in Coq.
40
41 --coq-lib-path path
42 How to qualify references to MenhirLib.
43
44 --coq-lib-no-path
45 Do not qualify references to MenhirLib.
46
47 --coq-no-actions
48 Ignore semantic actions in the Coq output.
49
50 --coq-no-complete
51 Do not generate a proof of completeness.
52
53 --depend
54 Invoke ocamldep and display dependencies.
55
56 --dump Describe the automaton in basename.automaton.
57
58 --echo-errors file
59 Echo the sentences in a .messages file.
60
61 --explain
62 Explain conflicts in basename.conflicts.
63
64 --external-tokens module
65 Import token type definition from module.
66
67 --fixed-exception
68 Declares Error = Parsing.Parse_error.
69
70 --graph
71 Write grammar's dependency graph to basename.dot.
72
73 --infer
74 Invoke ocamlc for ahead of time type inference.
75
76 --infer-protocol-supported
77 Stop with exit code 0.
78
79 --infer-write-query file
80 Write mock .ml file.
81
82 --infer-read-reply file
83 Read inferred .mli file.
84
85 --inspection
86 Generate the inspection API.
87
88 --interpret
89 Interpret the sentences provided on stdin.
90
91 --interpret-show-cst
92 Show a concrete syntax tree upon acceptance.
93
94 --interpret-error
95 Interpret an error sentence provided on stdin.
96
97 --lalr Construct an LALR(1) automaton.
98
99 -la, --log-automaton level
100 Log information about the automaton.
101
102 -lc, --log-code level
103 Log information about the generated code.
104
105 -lg, --log-grammar level
106 Log information about the grammar.
107
108 --list-errors
109 Produce a list of erroneous inputs.
110
111 --no-dollars
112 Disallow the use of $i notation.
113
114 --no-inline
115 Ignore the %inline keyword.
116
117 --no-stdlib
118 Do not load the standard library.
119
120 --ocamlc command
121 Specifies how ocamlc should be invoked.
122
123 --ocamldep command
124 Specifies how ocamldep should be invoked.
125
126 --only-preprocess
127 Print a simplified grammar and exit.
128
129 --only-preprocess-for-ocamlyacc
130 Print grammar in ocamlyacc format and exit.
131
132 --only-preprocess-u
133 Print grammar with unit actions and exit.
134
135 --only-preprocess-uu
136 Print grammar with unit actions and tokens and exit.
137
138 --only-tokens
139 Generate token type definition only, no code.
140
141 --raw-depend
142 Invoke ocamldep and echo its raw output.
143
144 --stdlib directory
145 Specify where the standard library lies.
146
147 --strict
148 Warnings about the grammar are errors.
149
150 --suggest-comp-flags
151 Suggest compilation flags for ocaml{c,opt}.
152
153 --suggest-link-flags-byte
154 Suggest link flags for ocamlc.
155
156 --suggest-link-flags-opt
157 Suggest link flags for ocamlopt.
158
159 --suggest-menhirLib
160 Suggest where MenhirLib was installed in source form.
161
162 --suggest-ocamlfind
163 Deprecated.
164
165 -t, --table
166 Use the table-based back-end.
167
168 --timings
169 Display internal timings.
170
171 --trace
172 Include tracing instructions in the generated code.
173
174 --unused-precedence-levels
175 Do not warn about unused precedence levels.
176
177 --unused-token token
178 Do not warn that token is unused.
179
180 --unused-tokens
181 Do not warn about any unused token.
182
183 --update-errors file
184 Update auto-comments in a .messages file.
185
186 --version
187 Show version number and exit.
188
189 -v Synonymous with --dump --explain.
190
191
192
194 ocaml(1).
195
196
197
199 menhir was written by François Pottier and Yann Régis-Gianas.
200
201 This manual page was originally written by Samuel Mimram <smim‐
202 ram@debian.org> for the Debian project (but may be used by others).
203
204
205
206 July 03, 2018 MENHIR(1)