Work around MinGW mangling of "host:/path"
[msysgit/historical-msysgit.git] / mingw / info / gdb / M2-Operators.html
blobafd0f3e6fe0641c67f3e53a8932ae2c76bc7bb2f
1 <html lang="en">
2 <head>
3 <title>Debugging with GDB</title>
4 <meta http-equiv="Content-Type" content="text/html">
5 <meta name="description" content="Debugging with GDB">
6 <meta name="generator" content="makeinfo 4.3">
7 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home">
8 </head>
9 <body>
10 <div class="node">
11 <p>
12 Node:<a name="M2%20Operators">M2 Operators</a>,
13 Next:<a rel="next" accesskey="n" href="Built-In-Func-Proc.html#Built-In%20Func%2fProc">Built-In Func/Proc</a>,
14 Up:<a rel="up" accesskey="u" href="Modula-2.html#Modula-2">Modula-2</a>
15 <hr><br>
16 </div>
18 <h5 class="subsubsection">Operators</h5>
20 <p>Operators must be defined on values of specific types. For instance,
21 <code>+</code> is defined on numbers, but not on structures. Operators are
22 often defined on groups of types. For the purposes of Modula-2, the
23 following definitions hold:
25 <ul>
27 <li><em>Integral types</em> consist of <code>INTEGER</code>, <code>CARDINAL</code>, and
28 their subranges.
30 <li><em>Character types</em> consist of <code>CHAR</code> and its subranges.
32 <li><em>Floating-point types</em> consist of <code>REAL</code>.
34 <li><em>Pointer types</em> consist of anything declared as <code>POINTER TO
35 </code><var>type</var><code></code>.
37 <li><em>Scalar types</em> consist of all of the above.
39 <li><em>Set types</em> consist of <code>SET</code> and <code>BITSET</code> types.
41 <li><em>Boolean types</em> consist of <code>BOOLEAN</code>.
42 </ul>
44 <p>The following operators are supported, and appear in order of
45 increasing precedence:
47 <dl>
48 <dt><code>,</code>
49 <dd>Function argument or array index separator.
51 <br><dt><code>:=</code>
52 <dd>Assignment. The value of <var>var</var> <code>:=</code> <var>value</var> is
53 <var>value</var>.
55 <br><dt><code>&lt;</code>, <code>&gt;</code>
56 <dd>Less than, greater than on integral, floating-point, or enumerated
57 types.
59 <br><dt><code>&lt;=</code>, <code>&gt;=</code>
60 <dd>Less than or equal to, greater than or equal to
61 on integral, floating-point and enumerated types, or set inclusion on
62 set types. Same precedence as <code>&lt;</code>.
64 <br><dt><code>=</code>, <code>&lt;&gt;</code>, <code>#</code>
65 <dd>Equality and two ways of expressing inequality, valid on scalar types.
66 Same precedence as <code>&lt;</code>. In GDB scripts, only <code>&lt;&gt;</code> is
67 available for inequality, since <code>#</code> conflicts with the script
68 comment character.
70 <br><dt><code>IN</code>
71 <dd>Set membership. Defined on set types and the types of their members.
72 Same precedence as <code>&lt;</code>.
74 <br><dt><code>OR</code>
75 <dd>Boolean disjunction. Defined on boolean types.
77 <br><dt><code>AND</code>, <code>&amp;</code>
78 <dd>Boolean conjunction. Defined on boolean types.
80 <br><dt><code>@</code>
81 <dd>The GDB "artificial array" operator (see <a href="Expressions.html#Expressions">Expressions</a>).
83 <br><dt><code>+</code>, <code>-</code>
84 <dd>Addition and subtraction on integral and floating-point types, or union
85 and difference on set types.
87 <br><dt><code>*</code>
88 <dd>Multiplication on integral and floating-point types, or set intersection
89 on set types.
91 <br><dt><code>/</code>
92 <dd>Division on floating-point types, or symmetric set difference on set
93 types. Same precedence as <code>*</code>.
95 <br><dt><code>DIV</code>, <code>MOD</code>
96 <dd>Integer division and remainder. Defined on integral types. Same
97 precedence as <code>*</code>.
99 <br><dt><code>-</code>
100 <dd>Negative. Defined on <code>INTEGER</code> and <code>REAL</code> data.
102 <br><dt><code>^</code>
103 <dd>Pointer dereferencing. Defined on pointer types.
105 <br><dt><code>NOT</code>
106 <dd>Boolean negation. Defined on boolean types. Same precedence as
107 <code>^</code>.
109 <br><dt><code>.</code>
110 <dd><code>RECORD</code> field selector. Defined on <code>RECORD</code> data. Same
111 precedence as <code>^</code>.
113 <br><dt><code>[]</code>
114 <dd>Array indexing. Defined on <code>ARRAY</code> data. Same precedence as <code>^</code>.
116 <br><dt><code>()</code>
117 <dd>Procedure argument list. Defined on <code>PROCEDURE</code> objects. Same precedence
118 as <code>^</code>.
120 <br><dt><code>::</code>, <code>.</code>
121 <dd>GDB and Modula-2 scope operators.
122 </dl>
124 <blockquote>
125 <em>Warning:</em> Sets and their operations are not yet supported, so GDB
126 treats the use of the operator <code>IN</code>, or the use of operators
127 <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, <code>=</code>, , <code>&lt;&gt;</code>, <code>#</code>,
128 <code>&lt;=</code>, and <code>&gt;=</code> on sets as an error.
129 </blockquote>
131 </body></html>