Une nouvelle version du portail de gestion des comptes externes sera mise en production lundi 09 août. Elle permettra d'allonger la validité d'un compte externe jusqu'à 3 ans. Pour plus de détails sur cette version consulter : https://doc-si.inria.fr/x/FCeS

Commit 6adfc5b7 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Add $MENHIR_STDLIB.

parent 231025f9
2017/01/01:
Add $MENHIR_STDLIB as a way of controlling where Menhir looks for the file
standard.mly. This environment variable overrides the installation-time
default setting, and is itself overridden by the --stdlib command line
switch. (Requested by Jonathan Protzenko.)
2017/01/01: 2017/01/01:
Makefile fix: filter out '\r' in the output of menhir --suggest-ocamlfind, Makefile fix: filter out '\r' in the output of menhir --suggest-ocamlfind,
so that the Makefile works when Menhir is compiled as a Windows executable. so that the Makefile works when Menhir is compiled as a Windows executable.
......
...@@ -239,9 +239,8 @@ channel. When \nt{level} is 2, the \emph{nullable}, \emph{FIRST}, and ...@@ -239,9 +239,8 @@ channel. When \nt{level} is 2, the \emph{nullable}, \emph{FIRST}, and
grammar specification to be ignored. This is especially useful in order grammar specification to be ignored. This is especially useful in order
to understand whether these keywords help solve any conflicts. to understand whether these keywords help solve any conflicts.
\docswitch{\onostdlib} This switch causes the standard library \emph{not} \docswitch{\onostdlib} This switch instructs Menhir to \emph{not} use
to be implicitly joined with the grammar specifications whose names are its standard library (\sref{sec:library}).
explicitly provided on the command line.
\docswitch{\oocamlc \nt{command}} This switch controls how \ocamlc is \docswitch{\oocamlc \nt{command}} This switch controls how \ocamlc is
invoked (when \oinfer is used). It allows setting both the name of invoked (when \oinfer is used). It allows setting both the name of
...@@ -275,6 +274,11 @@ postprocessing. ...@@ -275,6 +274,11 @@ postprocessing.
An end user who uses \ocamlbuild does not need to mention this switch: An end user who uses \ocamlbuild does not need to mention this switch:
\ocamlbuild uses it automatically. \ocamlbuild uses it automatically.
\docswitch{\ostdlib \nt{directory}} This switch controls the directory where
the standard library (\sref{sec:library}) is found. It takes precedence over
both the installation-time directory and the directory that may be specified
via the environment variable \verb+$MENHIR_STDLIB+.
\docswitch{\ostrict} This switch causes several warnings about the grammar \docswitch{\ostrict} This switch causes several warnings about the grammar
and about the automaton to be considered errors. This includes warnings about and about the automaton to be considered errors. This includes warnings about
useless precedence declarations, non-terminal symbols that produce the empty useless precedence declarations, non-terminal symbols that produce the empty
...@@ -322,11 +326,6 @@ query menhirLib}. ...@@ -322,11 +326,6 @@ query menhirLib}.
value (i.e., either \texttt{true} or \texttt{false}), which indicates whether value (i.e., either \texttt{true} or \texttt{false}), which indicates whether
\menhirlib was installed via \ocamlfind. \menhirlib was installed via \ocamlfind.
\docswitch{\ostdlib \nt{directory}} This switch controls the directory
where the standard library is found. It allows overriding the default
directory that is set at installation time. The trailing \texttt{/} character
is optional.
\docswitch{\otable} This switch causes \menhir to use its table-based \docswitch{\otable} This switch causes \menhir to use its table-based
back-end, as opposed to its (default) code-based back-end. When \otable is back-end, as opposed to its (default) code-based back-end. When \otable is
used, \menhir produces significantly more compact and somewhat slower parsers. used, \menhir produces significantly more compact and somewhat slower parsers.
...@@ -1137,6 +1136,18 @@ causes \nt{plist}(\nt{X}) to recognize a list of \nt{X}'s, where the empty ...@@ -1137,6 +1136,18 @@ causes \nt{plist}(\nt{X}) to recognize a list of \nt{X}'s, where the empty
list is represented by the empty string, and a non-empty list is delimited list is represented by the empty string, and a non-empty list is delimited
with parentheses and comma-separated. with parentheses and comma-separated.
The standard library is stored in a file named \texttt{standard.mly}, which is
installed at the same time as Menhir. By default, Menhir attempts to find this
file in the directory where this file was installed. This can be overridden by
setting the environment variable
\verb+$MENHIR_STDLIB+. If defined, this variable should contain the path of
the directory where \texttt{standard.mly} is stored. (This path may
end with a \texttt{/} character.) This can be overridden also via the
command line switch \ostdlib.
%
The command line switch \onostdlib instructs Menhir to \emph{not} load the
standard library.
% --------------------------------------------------------------------------------------------------------------------- % ---------------------------------------------------------------------------------------------------------------------
\section{Conflicts} \section{Conflicts}
......
...@@ -124,9 +124,20 @@ let filenames = ...@@ -124,9 +124,20 @@ let filenames =
let no_stdlib = let no_stdlib =
ref false ref false
(* By default, [stdlib_path] is [Installation.libdir], that is, the directory
that was specified when Menhir was compiled. This is overridden by the
environment variable $MENHIR_STDLIB, if it is defined, and by the --stdlib
command line option, if present. *)
let stdlib_path = let stdlib_path =
ref Installation.libdir ref Installation.libdir
let () =
try
stdlib_path := Sys.getenv "MENHIR_STDLIB"
with Not_found ->
()
let insert name = let insert name =
filenames := StringSet.add name !filenames filenames := StringSet.add name !filenames
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment