summaryrefslogtreecommitdiff
path: root/api_docgen/Ocaml_operators.mld
blob: a7a35e6d9816e2b6076ee6e43b1605290df4d0d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{0 Precedence level and associativity of operators}

The following table lists the precedence level of all operator classes
from the highest to the lowest precedence. A few other syntactic constructions
are also listed as references.

{%latex:
%
% Note: the tables below should be kept in sync with the one in
% manual/src/refman/expr.etex .
%
\begin{tabular}{cc}
\hline
Operator class                                       & Associativity \\
\hline
$!\ldots$ $\tilde{}\ldots$                                    &  --   \\
$.\cdots()$ $.\cdots[]$ $.\cdots$\textbraceleft\textbraceright&  --   \\
\#\ldots                                                      & left  \\
function application                                          & left  \\
- -.                                                          &  --   \\
$**\ldots$ lsl lsr asr                                        & right \\
$*\ldots$ /\ldots \%\ldots  mod land lor lxor                 & left  \\
+\ldots -\ldots                                               & left  \\
::                                                            & right \\
@\ldots \textasciicircum\ldots                                & right \\
=\ldots <\ldots >\ldots |\ldots \&\ldots \$\ldots !=          & left  \\
\& \&\&                                                       & right \\
or ||                                                         & right \\
,                                                             &  --   \\
<- :=                                                         & right \\
if                                                            &  --   \\
;                                                             & right \\
\hline
\end{tabular}
%}

{%html:
<table align=center border=1>
<thead><tr><th>Operator class</th><th>Associativity </th></tr></thead>
<tr><td><code class=code>!&#X2026 ~&#X2026</code>     </td><td>&#X2013</td></tr>
<tr><td><code class=code>.&#X2026() .&#X2026[] .&#X2026{} </code>
                                                      </td><td>&#X2013</td></tr>
<tr><td><code class=code>#&#X2026</code>              </td><td> left </td></tr>
<tr><td><code class=code>function application</code>  </td><td> left </td></tr>
<tr><td><code class=code>- -.</code>                  </td><td>&#X2013</td></tr>
<tr><td><code class=code>**&#X2026 lsl lsr asr </code></td><td> right </td></tr>
<tr><td><code class=code>*&#X2026  /&#X2026 %&#X2026 mod land lor lxor</code>
                                                      </td><td> left  </td></tr>
<tr><td><code class=code>+&#X2026 -&#X2026</code>     </td><td> left  </td></tr>
<tr><td><code class=code>::</code>                    </td><td> right </td></tr>
<tr><td><code class=code>@&#X2026 ^&#X2026            </td><td> right </td></tr>
<tr><td><code class=code>=&#X2026 &lt;&#X2026
>&#X2026 |&#X2026 &amp;&#X2026 $&#X2026 !=</code>     </td><td> left  </td></tr>
<tr><td><code class=code>&amp; &amp;&amp;</code>      </td><td> right </td></tr>
<tr><td><code class=code>or || </code>                </td><td> right </td></tr>
<tr><td><code class=code>,</code>                     </td><td>&#X2013</td></tr>
<tr><td><code class=code><- :=</code>                 </td><td> right </td></tr>
<tr><td><code class=code>if</code>                    </td><td>&#X2013</td></tr>
<tr><td><code class=code>;</code>                     </td><td> right </td></tr>
</table>
%}

{%man:
.IP Associativity
Operator class
.IP -
!.. ~..
.IP -
\&.() .[] .{}
.IP left
#..
.IP left
function application
.IP -
- -.
.IP right
**.. lsl lsr asr
.IP left
*..  /.. %.. mod land lor lxor
.IP left
+.. -..
.IP right
::
.IP right
@.. ^..
.IP left
=.. <.. >.. |.. &.. $.. !=
.IP right
& &&
.IP right
or ||
.IP -
,
.IP right
<- :=
.IP -
if
.IP right
;
%}