Commit 0f9dc265 authored by POTTIER Francois's avatar POTTIER Francois

Saved and published documentation for release 20200612.

parent ec3666a4
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -58,13 +58,13 @@ font-size: 1rem;
}
</style>
<title>Menhir Reference Manual
(version 20200525)
(version 20200612)
</title>
</head>
<body >
<!--HEVEA command line is: hevea -fix manual.tex -->
<!--CUT STYLE article--><!--CUT DEF section 1 --><table class="title"><tr><td style="padding:1ex"><h1 class="titlemain">Menhir Reference Manual<br>
(version 20200525)</h1><h3 class="titlerest">François Pottier and Yann Régis-Gianas<br>
(version 20200612)</h1><h3 class="titlerest">François Pottier and Yann Régis-Gianas<br>
INRIA<br>
<span style="font-family:monospace">{Francois.Pottier, Yann.Regis-Gianas}@inria.fr</span></h3></td></tr>
</table><!--TOC section id="sec1" Contents-->
......@@ -418,7 +418,21 @@ powerful.</p>
copied verbatim at the beginning of the <span style="font-family:monospace">.ml</span> file. It typically contains OCaml <span style="font-family:sans-serif"><span style="font-weight:bold">open</span></span> directives and function definitions for use by the semantic
actions. If a single grammar specification file contains multiple headers,
their order is preserved. However, when two headers originate in distinct
grammar specification files, the order in which they are copied to the <span style="font-family:monospace">.ml</span> file is unspecified.</p>
grammar specification files, the order in which they are copied to the <span style="font-family:monospace">.ml</span> file is unspecified.</p><p>It is important to note that the header is copied by Menhir only to the <span style="font-family:monospace">.ml</span> file, <em>not</em> to the <span style="font-family:monospace">.mli</span> file. Therefore, it should not contain
declarations that affect the meaning of the types that appear in the <span style="font-family:monospace">.mli</span> file. Here are two problems that people commonly run into:
</p><ul class="itemize"><li class="li-itemize">
Placing an <span style="font-family:sans-serif"><span style="font-weight:bold">open</span></span> directive that is required for a <span style="font-family:sans-serif"><span style="font-weight:bold">%type</span></span> declaration
to make sense. For instance, writing <code>open Foo</code> in the header and
declaring <code>%type&lt;t&gt; bar</code>, where the type <code>t</code> is defined in the
module <code>Foo</code>, will not work. You must write <code>%type&lt;Foo.t&gt; bar</code>.
</li><li class="li-itemize">Declaring a module alias that affects a (declared or inferred) type. For
instance, writing <code>module F = Foo</code> in the header and declaring
<code>%type&lt;Foo.t&gt; bar</code> may not work (from
2020/05/25 on). The reason is, OCaml may infer that the symbol <code>bar</code> has
type <code>F.t</code>, and Menhir will rely on this information without realizing
that <code>F</code> is a local name, so in the end, the <span style="font-family:monospace">.mli</span> file contains a
reference to <code>F.t</code> that does not make sense.
</li></ul>
<!--TOC subsubsection id="sec8" Parameters-->
<h4 id="sec8" class="subsubsection">4.1.2  Parameters</h4><!--SEC END --><p>
<a id="sec:parameter"></a></p><p>A declaration of the form:
......
No preview for this file type
www/doc/manual001.png

4.33 KB | W: | H:

www/doc/manual001.png

4.33 KB | W: | H:

www/doc/manual001.png
www/doc/manual001.png
www/doc/manual001.png
www/doc/manual001.png
  • 2-up
  • Swipe
  • Onion skin
www/doc/manual002.png

4.14 KB | W: | H:

www/doc/manual002.png

4.14 KB | W: | H:

www/doc/manual002.png
www/doc/manual002.png
www/doc/manual002.png
www/doc/manual002.png
  • 2-up
  • Swipe
  • Onion skin
www/doc/manual003.png

5.14 KB | W: | H:

www/doc/manual003.png

5.14 KB | W: | H:

www/doc/manual003.png
www/doc/manual003.png
www/doc/manual003.png
www/doc/manual003.png
  • 2-up
  • Swipe
  • Onion skin
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