1 (**************************************************************************)
5 (* François Pottier, INRIA Rocquencourt *)
6 (* Yann Régis-Gianas, PPS, Université Paris Diderot *)
8 (* Copyright 2005-2008 Institut National de Recherche en Informatique *)
9 (* et en Automatique. All rights reserved. This file is distributed *)
10 (* under the terms of the Q Public License version 1.0, with the change *)
11 (* described in file LICENSE. *)
13 (**************************************************************************)
15 (* This module parses the command line. *)
17 (* The list of file names that appear on the command line. *)
19 val filenames
: string list
21 (* How to deal with the type of tokens. *)
23 type token_type_mode
=
24 | TokenTypeAndCode
(* produce the definition of the [token] type and code for the parser *)
25 | TokenTypeOnly
(* produce the type definition only *)
26 | CodeOnly
of string (* produce the code only, by relying on an external token type *)
28 val token_type_mode
: token_type_mode
30 (* Whether Pager's algorithm should be used. *)
34 (* Whether conflicts should be explained. *)
38 (* Whether the automaton should be dumped. *)
42 (* Whether the automaton's construction should be explained (very verbose). *)
46 (* Whether the grammar's dependence graph should be dumped. *)
50 (* Whether tracing instructions should be generated. *)
54 (* Whether error recovery should be attempted. This consists
55 in discarding tokens, after the [error] token has been
56 shifted, until a token that can be accepted is found. *)
60 (* Whether one should stop and print the grammar after joining and
61 expanding the grammar. *)
66 | PrintUnitActionsUnitTokens
68 type preprocess_mode
=
69 | PMNormal
(* preprocess and continue *)
70 | PMOnlyPreprocess
of print_mode
(* preprocess, print grammar, stop *)
72 val preprocess_mode
: preprocess_mode
74 (* Whether one should invoke ocamlc in order to infer types for all
79 (* Whether one should inline the non terminal definitions marked
80 with the %inline keyword. *)
84 (* Whether and how one should invoke ocamldep in order to compute and
85 display dependencies. *)
88 | OMNone
(* do not invoke ocamldep *)
89 | OMRaw
(* invoke ocamldep and echo its raw output *)
90 | OMPostprocess
(* invoke ocamldep and postprocess its output *)
92 val depend
: ocamldep_mode
94 (* Whether comments should be printed or discarded. *)
98 (* This undocumented flag suppresses prefixing of identifiers with an
99 unlikely prefix in the generated code. This increases the code's
100 readability, but can cause identifiers in semantic actions to be
105 (* This undocumented flag causes the code to be transformed by
106 [Inline]. It is on by default. *)
108 val code_inlining
: bool
110 (* How [ocamlc] and [ocamldep] should be invoked. *)
115 (* How verbose we should be. *)
117 val logG
: int (* diagnostics on the grammar *)
118 val logA
: int (* diagnostics on the automaton *)
119 val logC
: int (* diagnostics on the generated code *)
121 (* Whether tasks should be timed. *)
125 (* The base name that should be used for the files that we create.
126 This name can contain a path. *)
130 (* The filename of the standard library. *)
132 val stdlib_filename
: string
134 (* Whether Menhir should behave as an interpreter. *)
138 (* Whether the interpreter should build and display concrete syntax trees. *)
140 val interpret_show_cst
: bool
142 (* Whether to use the table-based back-end ([true]) or the code-based
143 back-end ([false]). *)
147 (* Whether to generate a coq description of the grammar and automaton. *)
151 (* Whether the coq description must contain completeness proofs. *)
153 val coq_no_complete
: bool
155 (* Whether the coq backend should ignore types and semantic actions. *)
157 val coq_no_actions
: bool
159 (* Whether unresolved LR(1) conflicts, useless precedence declarations,
160 productions that are never reduced, etc. should be treated as errors. *)