1
(**************************************************************************)
5
(* Fran�ois Pottier and Yann R�gis-Gianas, INRIA Rocquencourt *)
7
(* Copyright 2005 Institut National de Recherche en Informatique et *)
8
(* en Automatique. All rights reserved. This file is distributed *)
9
(* under the terms of the Q Public License version 1.0, with the *)
10
(* change described in file LICENSE. *)
12
(**************************************************************************)
14
(* This module parses the command line. *)
16
(* The list of file names that appear on the command line. *)
18
val filenames: string list
20
(* How to deal with the type of tokens. *)
22
type token_type_mode =
23
| TokenTypeAndCode (* produce the definition of the [token] type and code for the parser *)
24
| TokenTypeOnly (* produce the type definition only *)
25
| CodeOnly of string (* produce the code only, by relying on an external token type *)
27
val token_type_mode: token_type_mode
29
(* Whether Pager's algorithm should be used. *)
33
(* Whether conflicts should be explained. *)
37
(* Whether the automaton should be dumped. *)
41
(* Whether the grammar's dependence graph should be dumped. *)
45
(* Whether tracing instructions should be generated. *)
49
(* Whether error recovery should be attempted. This consists
50
in discarding tokens, after the [error] token has been
51
shifted, until a token that can be accepted is found. *)
55
(* Whether one should stop after joining and expanding the
58
val preprocess_only: bool
60
(* Whether one should invoke ocamlc in order to infer types for all
65
(* Whether one should inline the non terminal definitions marked
66
with the %inline keyword. *)
70
(* Whether and how one should invoke ocamldep in order to compute and
71
display dependencies. *)
74
| OMNone (* do not invoke ocamldep *)
75
| OMRaw (* invoke ocamldep and echo its raw output *)
76
| OMPostprocess (* invoke ocamldep and postprocess its output *)
78
val depend: ocamldep_mode
80
(* Whether comments should be printed or discarded. *)
84
(* This undocumented flag suppresses prefixing of identifiers with an
85
unlikely prefix in the generated code. This increases the code's
86
readability, but can cause identifiers in semantic actions to be
91
(* This undocumented flag causes the code to be transformed by
92
[Inline]. It is on by default. *)
94
val code_inlining: bool
96
(* How [ocamlc] and [ocamldep] should be invoked. *)
101
(* How verbose we should be. *)
103
val logG: int (* diagnostics on the grammar *)
104
val logA: int (* diagnostics on the automaton *)
105
val logC: int (* diagnostics on the generated code *)
107
(* Whether tasks should be timed. *)
111
(* The base name that should be used for the files that we create.
112
This name can contain a path. *)
116
(* The filename of the standard library. *)
118
val stdlib_filename : string