OS Manuals

/usr/lib/ocaml-4/bin/menhir

LR(1) parser generator for OCaml

From ocaml4-menhir 20230608-r6 (enterprise-packages), captured 2026-11-08 by running menhir --help (exit 0). permalink

Usage: /usr/lib/ocaml-4/bin/menhir <options> <filenames>
  --automaton-graph                 (undocumented)
  --base <basename>                 Specifies a base name for the output file(s)
  --canonical                       Construct a canonical Knuth LR(1) automaton
  --cmly                            Write a .cmly file
  --code                            Use the code back-end (default)
  --code-ancient                    Use the ancient code back-end
  --comment                         Include comments in the generated code
  --compare-errors <filename>       (used twice) Compare two .messages files
  --compile-errors <filename>       Compile a .messages file to OCaml code
  --coq                             Generate a formally verified parser, in Coq
  --coq-lib-path <path>             How to qualify references to MenhirLib
  --coq-lib-no-path                 Do *not* qualify references to MenhirLib
  --coq-no-version-check            Do not generate a version check.
  --coq-no-actions                  Ignore semantic actions in the Coq output
  --coq-no-complete                 Do not generate a proof of completeness
  --depend                          Invoke ocamldep and display dependencies
  --dump                            Write an .automaton file
  --dump-menhirLib <path>           Dump menhirLib.{ml,mli} at <path>
  --dump-resolved                   Write an .automaton.resolved file
  --echo-errors <filename>          Echo the sentences in a .messages file
  --echo-errors-concrete <filename> Echo the sentences in a .messages file
  --error-recovery                  (no longer supported)
  --exn-carries-state               Declares exception Error of int
  --explain                         Explain conflicts in <basename>.conflicts
  --external-tokens <module>        Import token type definition from <module>
  --fixed-exception                 Declares Error = Parsing.Parse_error
  --infer                           Invoke ocamlc to do type inference
  --infer-protocol-supported        Stop with exit code 0
  --infer-write-query <filename>    Write mock .ml file
  --infer-read-reply <filename>     Read inferred .mli file
  --inspection                      Generate the inspection API
  --interpret                       Interpret the sentences provided on stdin
  --interpret-show-cst              Show a concrete syntax tree upon acceptance
  --interpret-error                 Interpret an error sentence
  --lalr                            Construct an LALR(1) automaton
  --list-errors                     Produce a list of erroneous inputs
  --list-errors-algorithm           (undocumented)
  --log-automaton <level>           Log information about the automaton
  --log-code <level>                Log information about the generated code
  --log-grammar <level>             Log information about the grammar
  --merge-errors <filename>         (used twice) Merge two .messages files
  --no-code-inlining                (undocumented)
  --no-dollars                      Disallow $i in semantic actions
  --no-inline                       Ignore the %inline keyword
  --no-pager                        (undocumented)
  --no-prefix                       (undocumented)
  --no-stdlib                       Do not load the standard library
  --ocamlc <command>                Specifies how ocamlc should be invoked
  --ocamldep <command>              Specifies how ocamldep should be invoked
  --only-preprocess                 Print grammar and exit
  --only-preprocess-for-ocamlyacc   Print grammar in ocamlyacc format and exit
  --only-preprocess-u               Print grammar with unit actions and exit
  --only-preprocess-uu              Print grammar with unit actions & tokens
  --only-tokens                     Generate token type definition only, no code
  --random-seed <seed>              Set the random seed
  --random-self-init                Pick a random seed in a system-dependent way
  --random-sentence-length <length> Set the goal length for a random sentence
  --random-sentence <sym>           Generate a random valid sentence
  --random-sentence-concrete <sym>  Generate a random valid sentence
  --raw-depend                      Invoke ocamldep and echo its raw output
  --reference-graph                 Write a dependency graph to a .dot file
  --represent-states                (undocumented)
  --represent-positions             (undocumented)
  --represent-values                (undocumented)
  --represent-everything            (undocumented)
  --require-aliases                 Check that every token has a token alias
  --specialize-token                (undocumented)
  --stacklang-dump                  (undocumented)
  --stacklang-graph                 (undocumented)
  --stacklang-test                  (undocumented)
  --stdlib <directory>              Ignored (deprecated)
  --strategy <strategy>             Choose an error-handling strategy
  --strict                          Warnings about the grammar are errors
  --suggest-comp-flags              Suggest compilation flags for ocaml{c,opt}
  --suggest-link-flags-byte         Suggest link flags for ocamlc
  --suggest-link-flags-opt          Suggest link flags for ocamlopt
  --suggest-menhirLib               Suggest where is MenhirLib
  --suggest-ocamlfind               (deprecated)
  --table                           Use the table back-end
  --timings                         Output internal timings to stderr
  --timings-to <filename>           Output internal timings to <filename>
  --trace                           Generate tracing instructions
  --unused-precedence-levels        Do not warn about unused precedence levels
  --unused-token <token>            Do not warn that <token> is unused
  --unused-tokens                   Do not warn about any unused token
  --update-errors <filename>        Update auto-comments in a .messages file
  --version                         Show version number and exit
  -b <basename>                     Synonymous with --base <basename>
  -lg                               Synonymous with --log-grammar
  -la                               Synonymous with --log-automaton
  -lc                               Synonymous with --log-code
  -O                                (0|1|2) Set optimization level
  -t                                Synonymous with --table
  -v                                Synonymous with --dump --explain
  -help                             Display this list of options
  --help                            Display this list of options
Options (94)
OptionDescriptionSource
--automaton-graph(undocumented)help
--base basenameSpecifies a base name for the output file(s)help
--canonicalConstruct a canonical Knuth LR(1) automaton.help + man
--cmlyWrite the grammar and automaton to basename.cmly.help + man
--codeUse the code back-end (default)help
--code-ancientUse the ancient code back-endhelp
--commentInclude comments in the generated code.help + man
--compare-errors filename(used twice) Compare two .messages fileshelp
--compile-errors filenameCompile a .messages file to OCaml codehelp
--coqGenerate a formally verified parser, in Coq.help + man
--coq-lib-path pathHow to qualify references to MenhirLibhelp
--coq-lib-no-pathDo *not* qualify references to MenhirLibhelp + man
--coq-no-version-checkDo not generate a version check.help
--coq-no-actionsIgnore semantic actions in the Coq output.help + man
--coq-no-completeDo not generate a proof of completeness.help + man
--dependInvoke ocamldep and display dependencies.help + man
--dumpDescribe the automaton in the file basename.automaton.help + man
--dump-menhirLib pathDump menhirLib.{ml,mli} at <path>help
--dump-resolvedDescribe the automaton, after conflict resolution, in the file basename.automaton.resolved.help + man
--echo-errors filenameEcho the sentences in a .messages filehelp
--error-recovery(no longer supported)help
--exn-carries-stateDeclares exception Error of inthelp + man
--explainExplain conflicts in <basename>.conflictshelp + man
--external-tokens moduleImport token type definition from <module>help
--fixed-exceptionDeclares Error = Parsing.Parse_error.help + man
--inferInvoke ocamlc to do type inference.help + man
--infer-protocol-supportedStop with exit code 0.help + man
--infer-write-query filenameWrite mock .ml filehelp
--infer-read-reply filenameRead inferred .mli filehelp
--inspectionGenerate the inspection API.help + man
--interpretInterpret the sentences provided on stdin.help + man
--interpret-show-cstShow a concrete syntax tree upon acceptance.help + man
--interpret-errorInterpret an error sentence provided on stdin.help + man
--lalrConstruct an LALR(1) automaton.help + man
--list-errorsProduce a list of erroneous inputs.help + man
--list-errors-algorithm(undocumented)help
--log-automaton levelLog information about the automatonhelp
--log-code levelLog information about the generated codehelp
--log-grammar levelLog information about the grammarhelp
--merge-errors filename(used twice) Merge two .messages fileshelp
--no-code-inlining(undocumented)help
--no-dollarsDisallow the use of $i notation.help + man
--no-inlineIgnore the %inline keyword.help + man
--no-pager(undocumented)help
--no-prefix(undocumented)help
--no-stdlibDo not load the standard library.help + man
--ocamlc commandSpecifies how ocamlc should be invokedhelp
--ocamldep commandSpecifies how ocamldep should be invokedhelp
--only-preprocessPrint a simplified grammar and exit.help + man
--only-preprocess-for-ocamlyaccPrint grammar in ocamlyacc format and exit.help + man
--only-preprocess-uPrint grammar with unit actions and exit.help + man
--only-preprocess-uuPrint grammar with unit actions and tokens and exit.help + man
--only-tokensGenerate token type definition only, no code.help + man
--random-seed seedSet the random seedhelp
--random-self-initAutomatically set the seed used by the random sentence generator.help + man
--random-sentence symGenerate a random valid sentencehelp
--random-sentence-concrete symGenerate a random valid sentencehelp
--raw-dependInvoke ocamldep and echo its raw output.help + man
--reference-graphWrite a dependency graph to a .dot filehelp
--represent-states(undocumented)help
--represent-positions(undocumented)help
--represent-values(undocumented)help
--represent-everything(undocumented)help
--require-aliasesCheck that every terminal symbol has a token alias.help + man
--specialize-token(undocumented)help
--stacklang-dump(undocumented)help
--stacklang-graph(undocumented)help
--stacklang-test(undocumented)help
--stdlib directoryIgnored (deprecated)help
--strategy strategyChoose an error-handling strategyhelp
--strictWarnings about the grammar are errors.help + man
--suggest-comp-flagsSuggest compilation flags for ocaml{c,opt}.help + man
--suggest-link-flags-byteSuggest link flags for ocamlc.help + man
--suggest-link-flags-optSuggest link flags for ocamlopt.help + man
--suggest-menhirLibSuggest where MenhirLib was installed in source form.help + man
--suggest-ocamlfind(deprecated)help
--tableUse the table back-endhelp
--timingsOutput internal timings to stderrhelp + man
--timings-to filenameOutput internal timings to <filename>help
--traceInclude tracing instructions in the generated code.help + man
--unused-precedence-levelsDo not warn about unused precedence levels.help + man
--unused-token tokenDo not warn that <token> is unusedhelp
--unused-tokensDo not warn about any unused token.help + man
--update-errors filenameUpdate auto-comments in a .messages filehelp
--versionShow version number and exit.help + man
-b basenameSpecifies a base name for the output file(s).help + man
-lgLog information about the grammar.help + man
-laLog information about the automaton.help + man
-lcLog information about the generated code.help + man
-O(0|1|2) Set optimization levelhelp
-tUse the table-based back-end.help + man
-vSynonymous with --dump --explain.help + man
-helpDisplay this list of optionshelp
--help, -hDisplay this list of optionshelp + man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.